gfspvgmgr

package
v0.2.4-alpha.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFreezingPeriodForSP = 10 * time.Minute
	ReleaseSPJobInterval       = 1 * time.Minute
)
View Source
const (
	VirtualGroupManagerSpace            = "VirtualGroupManager"
	RefreshMetaInterval                 = 2 * time.Second
	MaxStorageUsageRatio                = 0.95
	DefaultInitialGVGStakingStorageSize = uint64(8) * 1024 * 1024 * 1024 * 1024 // 8TB per GVG, chain side DefaultMaxStoreSizePerFamily is 64 TB
)

Variables

View Source
var (
	ErrFailedPickVGF = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540001,
		"failed to pick virtual group family, need creating global virtual group")
	ErrFailedPickGVG = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540002,
		"failed to pick global virtual group, need staking more storage size")
	ErrStaledMetadata = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540003,
		"metadata is staled, need forcing refresh metadata")
	ErrFailedPickDestSP = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540004,
		"failed to pick dest sp")
)

Functions

func NewVirtualGroupManager

func NewVirtualGroupManager(selfOperatorAddress string, chainClient consensus.Consensus) (vgmgr.VirtualGroupManager, error)

NewVirtualGroupManager returns a virtual group manager interface.

Types

type FreeStorageSizeWeightPicker

type FreeStorageSizeWeightPicker struct {
	// contains filtered or unexported fields
}

FreeStorageSizeWeightPicker is used to pick index by storage usage, The more free storage usage, the greater the probability of being picked.

type FreezeSPPool added in v0.2.4

type FreezeSPPool struct {
	sync.Map
}

func NewFreezeSPPool added in v0.2.4

func NewFreezeSPPool() *FreezeSPPool

func (*FreezeSPPool) FreezeSPAndGVGs added in v0.2.4

func (s *FreezeSPPool) FreezeSPAndGVGs(spID uint32, joinedGVGs []*virtual_types.GlobalVirtualGroup)

FreezeSPAndGVGs puts a Secondary SP and its joined Global virtual groups into the Freeze Pool.

func (*FreezeSPPool) GetFreezeGVGsInFamily added in v0.2.4

func (s *FreezeSPPool) GetFreezeGVGsInFamily(familyID uint32) vgmgr.IDSet

func (*FreezeSPPool) GetFreezeSPIDs added in v0.2.4

func (s *FreezeSPPool) GetFreezeSPIDs() vgmgr.IDSet

func (*FreezeSPPool) ReleaseSP added in v0.2.4

func (s *FreezeSPPool) ReleaseSP()

type SPStats added in v0.2.4

type SPStats struct {
	JoinedGVGs  []*virtual_types.GlobalVirtualGroup
	FreezeUntil int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL