allocator

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidMgr

type BidMgr interface {
	Alloc(ctx context.Context, count uint64) (bidRange []BidRange, err error)
}

BidMgr Assume the task of assigning bid segments

func NewBidMgr

func NewBidMgr(ctx context.Context, cfg BlobConfig, clusterMgr clustermgr.APIProxy) (BidMgr, error)

type BidRange

type BidRange struct {
	StartBid proto.BlobID
	EndBid   proto.BlobID
}

type BlobConfig

type BlobConfig struct {
	BidAllocNums uint64 `json:"bid_alloc_nums"`
}

type ModeInfo

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

type VolConfig

type VolConfig struct {
	ClusterID             proto.ClusterID `json:"cluster_id"`
	Idc                   string          `json:"idc"`
	Host                  string          `json:"host"`
	RetainIntervalS       int64           `json:"retain_interval_s"`
	DefaultAllocVolsNum   int             `json:"default_alloc_vols_num"`
	InitVolumeNum         int             `json:"init_volume_num"`
	TotalThresholdRatio   float64         `json:"total_threshold_ratio"`
	MetricReportIntervalS int             `json:"metric_report_interval_s"`
	VolumeReserveSize     int             `json:"-"`
}

type VolumeMgr

type VolumeMgr interface {
	// Alloc the required volumes to access module
	Alloc(ctx context.Context, args *proxy.AllocVolsArgs) (allocVols []proxy.AllocRet, err error)
	// List the volumes in the allocator
	List(ctx context.Context, codeMode codemode.CodeMode) (vids []proto.Vid, volumes []clustermgr.AllocVolumeInfo, err error)
	Close()
}

func NewVolumeMgr

func NewVolumeMgr(ctx context.Context, blobCfg BlobConfig, volCfg VolConfig, clusterMgr clustermgr.APIProxy) (VolumeMgr, error)

Jump to

Keyboard shortcuts

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