gfspvgmgr

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFreezingPeriodForSP = 5 * time.Minute
	ReleaseSPJobInterval       = 1 * time.Minute
)
View Source
const (
	VirtualGroupManagerSpace            = "VirtualGroupManager"
	RefreshMetaInterval                 = 5 * time.Second
	MaxStorageUsageRatio                = 0.95
	DefaultInitialGVGStakingStorageSize = uint64(2) * 1024 * 1024 * 1024 * 1024 // 2TB 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 to create global virtual group")
	ErrFailedPickGVG = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540002,
		"failed to pick global virtual group, need to stake more storage size")
	ErrStaledMetadata = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540003,
		"metadata is staled, need to force refresh metadata")
	ErrFailedPickDestSP = gfsperrors.Register(VirtualGroupManagerSpace, http.StatusInternalServerError, 540004,
		"failed to pick dest sp")
)

Functions

func NewIDSetFromList added in v1.0.4

func NewIDSetFromList(list []uint32) vgmgr.IDSet

func NewVirtualGroupManager

func NewVirtualGroupManager(selfOperatorAddress string, chainClient consensus.Consensus, gfspClient gfspclient.GfSpClientAPI, enableHealthyChecker bool) (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) ReleaseAllSP added in v1.0.4

func (s *FreezeSPPool) ReleaseAllSP()

func (*FreezeSPPool) ReleaseSP added in v0.2.4

func (s *FreezeSPPool) ReleaseSP()

type HealthChecker added in v1.1.0

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

func NewHealthChecker added in v1.1.0

func NewHealthChecker(chainClient consensus.Consensus) *HealthChecker

func (*HealthChecker) Start added in v1.1.0

func (checker *HealthChecker) Start()

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