Documentation ¶
Index ¶
- func Register(name string, evaluator Evaluator)
- type Evaluator
- type Factory
- func (ef *Factory) Evaluate(dst *supervisor.Peer, src *supervisor.Peer) float64
- func (ef *Factory) IsBadNode(peer *supervisor.Peer) bool
- func (ef *Factory) NeedAdjustParent(peer *supervisor.Peer) bool
- func (ef *Factory) Register(name string, evaluator Evaluator)
- func (ef *Factory) RegisterGetEvaluatorFunc(priority int, fun getEvaluatorFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Evaluator ¶
type Evaluator interface { // Evaluate todo Normalization Evaluate(parent *supervisor.Peer, child *supervisor.Peer) float64 // NeedAdjustParent determine whether the peer needs a new parent node NeedAdjustParent(peer *supervisor.Peer) bool // IsBadNode determine if peer is a failed node IsBadNode(peer *supervisor.Peer) bool }
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewEvaluatorFactory ¶
func NewEvaluatorFactory(cfg *config.SchedulerConfig) *Factory
func (*Factory) Evaluate ¶
func (ef *Factory) Evaluate(dst *supervisor.Peer, src *supervisor.Peer) float64
func (*Factory) NeedAdjustParent ¶
func (ef *Factory) NeedAdjustParent(peer *supervisor.Peer) bool
func (*Factory) RegisterGetEvaluatorFunc ¶
Click to show internal directories.
Click to hide internal directories.