Versions in this module Expand all Collapse all v0 v0.1.0 Mar 12, 2021 Changes in this version + const DefaultCacheSize + const DispatchFromCreate + const DispatchFromHeartBeat + const DispatchFromNotifierQueue + var ContainerBalanceBaseTime float64 = 60 + var PriorityWeight = []float64 + var PushOperatorTickInterval = 500 * time.Millisecond + func ApplyOperator(mc *mockcluster.Cluster, op *operator.Operator) + func ApplyOperatorStep(resource *core.CachedResource, op *operator.Operator) *core.CachedResource + func DecodeConfig(data []byte, v interface{}) error + func EncodeConfig(v interface{}) ([]byte, error) + func FindSchedulerTypeByName(name string) string + func NewTotalOpInfluence(operators []*operator.Operator, cluster opt.Cluster) operator.OpInfluence + func RegisterScheduler(typ string, createFn CreateSchedulerFunc) + func RegisterSliceDecoderBuilder(typ string, builder ConfigSliceDecoderBuilder) + type Bucket struct + type CheckerController struct + func NewCheckerController(ctx context.Context, cluster opt.Cluster, ruleManager *placement.RuleManager, ...) *CheckerController + func (c *CheckerController) AddWaitingResource(res *core.CachedResource) + func (c *CheckerController) CheckResource(res *core.CachedResource) []*operator.Operator + func (c *CheckerController) GetMergeChecker() *checker.MergeChecker + func (c *CheckerController) GetWaitingResources() []*cache.Item + func (c *CheckerController) RemoveWaitingResource(id uint64) + type ConfigDecoder func(v interface{}) error + func ConfigJSONDecoder(data []byte) ConfigDecoder + func ConfigSliceDecoder(name string, args []string) ConfigDecoder + type ConfigSliceDecoderBuilder func([]string) ConfigDecoder + type CreateSchedulerFunc func(opController *OperatorController, storage storage.Storage, dec ConfigDecoder) (Scheduler, error) + type OperatorController struct + func NewOperatorController(ctx context.Context, cluster opt.Cluster, hbStreams *hbstream.HeartbeatStreams) *OperatorController + func (oc *OperatorController) AddOperator(ops ...*operator.Operator) bool + func (oc *OperatorController) AddWaitingOperator(ops ...*operator.Operator) int + func (oc *OperatorController) CollectContainerLimitMetrics() + func (oc *OperatorController) Ctx() context.Context + func (oc *OperatorController) Dispatch(res *core.CachedResource, source string) + func (oc *OperatorController) ExceedContainerLimit(ops ...*operator.Operator) bool + func (oc *OperatorController) GetCluster() opt.Cluster + func (oc *OperatorController) GetHistory(start time.Time) []operator.OpHistory + func (oc *OperatorController) GetLeaderSchedulePolicy() core.SchedulePolicy + func (oc *OperatorController) GetOpInfluence(cluster opt.Cluster) operator.OpInfluence + func (oc *OperatorController) GetOperator(resID uint64) *operator.Operator + func (oc *OperatorController) GetOperatorStatus(id uint64) *OperatorWithStatus + func (oc *OperatorController) GetOperators() []*operator.Operator + func (oc *OperatorController) GetWaitingOperators() []*operator.Operator + func (oc *OperatorController) OperatorCount(mask operator.OpKind) uint64 + func (oc *OperatorController) PromoteWaitingOperator() + func (oc *OperatorController) PruneHistory() + func (oc *OperatorController) PushOperators() + func (oc *OperatorController) RemoveOperator(op *operator.Operator, extra string) bool + func (oc *OperatorController) SendScheduleCommand(res *core.CachedResource, step operator.OpStep, source string) + func (oc *OperatorController) SetOperator(op *operator.Operator) + type OperatorRecords struct + func NewOperatorRecords(ctx context.Context) *OperatorRecords + func (o *OperatorRecords) Get(id uint64) *OperatorWithStatus + func (o *OperatorRecords) Put(op *operator.Operator) + type OperatorWithStatus struct + Op *operator.Operator + Status metapb.OperatorStatus + func NewOperatorWithStatus(op *operator.Operator) *OperatorWithStatus + func (o *OperatorWithStatus) MarshalJSON() ([]byte, error) + type PluginInterface struct + func NewPluginInterface() *PluginInterface + func (p *PluginInterface) GetFunction(path string, funcName string) (plugin.Symbol, error) + type RandBuckets struct + func NewRandBuckets() *RandBuckets + func (b *RandBuckets) GetOperator() []*operator.Operator + func (b *RandBuckets) ListOperator() []*operator.Operator + func (b *RandBuckets) PutOperator(op *operator.Operator) + type RangeCluster struct + func GenRangeCluster(cluster opt.Cluster, startKey, endKey []byte) *RangeCluster + func (r *RangeCluster) GetAverageResourceSize() int64 + func (r *RangeCluster) GetContainer(id uint64) *core.CachedContainer + func (r *RangeCluster) GetContainers() []*core.CachedContainer + func (r *RangeCluster) GetFollowerContainers(res *core.CachedResource) []*core.CachedContainer + func (r *RangeCluster) GetLeaderContainer(res *core.CachedResource) *core.CachedContainer + func (r *RangeCluster) GetResourceContainers(res *core.CachedResource) []*core.CachedContainer + func (r *RangeCluster) GetTolerantSizeRatio() float64 + func (r *RangeCluster) RandFollowerResource(containerID uint64, ranges []core.KeyRange, opts ...core.ResourceOption) *core.CachedResource + func (r *RangeCluster) RandLeaderResource(containerID uint64, ranges []core.KeyRange, opts ...core.ResourceOption) *core.CachedResource + func (r *RangeCluster) SetTolerantSizeRatio(ratio float64) + type ResourceScatterer struct + func NewResourceScatterer(ctx context.Context, cluster opt.Cluster) *ResourceScatterer + func (r *ResourceScatterer) Scatter(res *core.CachedResource, group string) (*operator.Operator, error) + func (r *ResourceScatterer) ScatterResources(resources map[uint64]*core.CachedResource, failures map[uint64]error, ...) ([]*operator.Operator, error) + func (r *ResourceScatterer) ScatterResourcesByID(resourceIDs []uint64, group string, retryLimit int) ([]*operator.Operator, map[uint64]error, error) + func (r *ResourceScatterer) ScatterResourcesByRange(startKey, endKey []byte, group string, retryLimit int) ([]*operator.Operator, map[uint64]error, error) + type ResourceSplitter struct + func NewResourceSplitter(cluster opt.Cluster, handler SplitResourcesHandler) *ResourceSplitter + func (r *ResourceSplitter) SplitResources(ctx context.Context, splitKeys [][]byte, retryLimit int) (int, []uint64) + type Scheduler interface + Cleanup func(cluster opt.Cluster) + EncodeConfig func() ([]byte, error) + GetMinInterval func() time.Duration + GetName func() string + GetNextInterval func(interval time.Duration) time.Duration + GetType func() string + IsScheduleAllowed func(cluster opt.Cluster) bool + Prepare func(cluster opt.Cluster) error + Schedule func(cluster opt.Cluster) []*operator.Operator + func CreateScheduler(typ string, opController *OperatorController, storage storage.Storage, ...) (Scheduler, error) + type SplitResourcesHandler interface + ScanResourcesByKeyRange func(groupKeys *resourceGroupKeys, results *splitKeyResults) + SplitResourceByKeys func(res *core.CachedResource, splitKeys [][]byte) error + func NewSplitResourcesHandler(cluster opt.Cluster, oc *OperatorController) SplitResourcesHandler + type WaitingOperator interface + GetOperator func() []*operator.Operator + ListOperator func() []*operator.Operator + PutOperator func(op *operator.Operator) + type WaitingOperatorStatus struct + func NewWaitingOperatorStatus() *WaitingOperatorStatus