manager

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocElement

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

type GridElement

type GridElement struct {
	ID uint64
	sync.RWMutex
	// contains filtered or unexported fields
}

type LimitFactor

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

func (*LimitFactor) CheckGrid

func (factor *LimitFactor) CheckGrid()

func (*LimitFactor) GetWaitTotalSize

func (factor *LimitFactor) GetWaitTotalSize() (waitSize uint64)

func (*LimitFactor) SetLimit

func (factor *LimitFactor) SetLimit(limitVal uint64, bufferVal uint64)

func (*LimitFactor) TryReleaseWaitList

func (factor *LimitFactor) TryReleaseWaitList()

clean wait list if limit be enlrarged by master no lock need for parallel,caller own the lock and will release it

type LimitManager

type LimitManager struct {
	ID uint64

	WrapperUpdate UploadFlowInfoFunc
	ReqPeriod     uint32
	HitTriggerCnt uint8

	Version *proto.VersionInfo
	// contains filtered or unexported fields
}

func NewLimitManager

func NewLimitManager(client wrapper.SimpleClientInfo) *LimitManager

func (*LimitManager) CalcNeedByPow

func (limitManager *LimitManager) CalcNeedByPow(limitFactor *LimitFactor, used uint64) (need uint64)

func (*LimitManager) GetFlowInfo

func (limitManager *LimitManager) GetFlowInfo() (*proto.ClientReportLimitInfo, bool)

func (*LimitManager) ReadAlloc

func (limitManager *LimitManager) ReadAlloc(ctx context.Context, size int)

func (*LimitManager) ScheduleCheckGrid

func (limitManager *LimitManager) ScheduleCheckGrid()

func (*LimitManager) SetClientID

func (limitManager *LimitManager) SetClientID(id uint64) (err error)

func (*LimitManager) SetClientLimit

func (limitManager *LimitManager) SetClientLimit(limit *proto.LimitRsp2Client)

func (*LimitManager) UpdateFlowInfo

func (limitManager *LimitManager) UpdateFlowInfo(limit *proto.LimitRsp2Client)

func (*LimitManager) WaitN

func (limitManager *LimitManager) WaitN(ctx context.Context, lim *LimitFactor, n int) (err error)

WaitN blocks until alloc success

func (*LimitManager) WriteAlloc

func (limitManager *LimitManager) WriteAlloc(ctx context.Context, size int)

type UploadFlowInfoFunc

type UploadFlowInfoFunc func(clientInfo wrapper.SimpleClientInfo) (bWork bool, err error)

Jump to

Keyboard shortcuts

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