Documentation ¶
Index ¶
- type KeySpanNumberScheduler
- func (t *KeySpanNumberScheduler) AlignCapture(captureIDs map[model.CaptureID]struct{})
- func (t *KeySpanNumberScheduler) CalRebalanceOperates(targetSkewness float64) (skewness float64, moveKeySpanJobs map[model.KeySpanID]*model.MoveKeySpanJob)
- func (t *KeySpanNumberScheduler) DistributeKeySpans(keyspanIDs map[model.KeySpanID]model.Ts) map[model.CaptureID]map[model.KeySpanID]*model.KeySpanOperation
- func (t *KeySpanNumberScheduler) ResetWorkloads(captureID model.CaptureID, workloads model.TaskWorkload)
- func (t *KeySpanNumberScheduler) Skewness() float64
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeySpanNumberScheduler ¶
type KeySpanNumberScheduler struct {
// contains filtered or unexported fields
}
KeySpanNumberScheduler provides a feature that scheduling by the keyspan number
func (*KeySpanNumberScheduler) AlignCapture ¶
func (t *KeySpanNumberScheduler) AlignCapture(captureIDs map[model.CaptureID]struct{})
AlignCapture implements the Scheduler interface
func (*KeySpanNumberScheduler) CalRebalanceOperates ¶
func (t *KeySpanNumberScheduler) CalRebalanceOperates(targetSkewness float64) ( skewness float64, moveKeySpanJobs map[model.KeySpanID]*model.MoveKeySpanJob, )
CalRebalanceOperates implements the Scheduler interface
func (*KeySpanNumberScheduler) DistributeKeySpans ¶
func (t *KeySpanNumberScheduler) DistributeKeySpans(keyspanIDs map[model.KeySpanID]model.Ts) map[model.CaptureID]map[model.KeySpanID]*model.KeySpanOperation
DistributeKeySpans implements the Scheduler interface
func (*KeySpanNumberScheduler) ResetWorkloads ¶
func (t *KeySpanNumberScheduler) ResetWorkloads(captureID model.CaptureID, workloads model.TaskWorkload)
ResetWorkloads implements the Scheduler interface
func (*KeySpanNumberScheduler) Skewness ¶
func (t *KeySpanNumberScheduler) Skewness() float64
Skewness implements the Scheduler interface
type Scheduler ¶
type Scheduler interface { // ResetWorkloads resets the workloads info of the capture ResetWorkloads(captureID model.CaptureID, workloads model.TaskWorkload) // AlignCapture makes sure that the workloads of the capture is matched with the specified captureIDs AlignCapture(captureIDs map[model.CaptureID]struct{}) // Skewness returns the skewness Skewness() float64 // CalRebalanceOperates calculates the rebalance operates // returns * the skewness after rebalance // * the move jobs need by rebalance CalRebalanceOperates(targetSkewness float64) ( skewness float64, moveKeySpanJobs map[model.KeySpanID]*model.MoveKeySpanJob) // DistributeKeySpans distributes the new keyspans to the captures // returns the operations of the new keyspans DistributeKeySpans(keyspanIDs map[model.KeySpanID]model.Ts) map[model.CaptureID]map[model.KeySpanID]*model.KeySpanOperation }
Scheduler is an abstraction for anything that provide the schedule keyspan feature
Click to show internal directories.
Click to hide internal directories.