evaluator

package
v2.0.0-alpha-2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, evaluator Evaluator)

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
}

func Get

func Get(name string) Evaluator

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) IsBadNode

func (ef *Factory) IsBadNode(peer *supervisor.Peer) bool

func (*Factory) NeedAdjustParent

func (ef *Factory) NeedAdjustParent(peer *supervisor.Peer) bool

func (*Factory) Register

func (ef *Factory) Register(name string, evaluator Evaluator)

func (*Factory) RegisterGetEvaluatorFunc

func (ef *Factory) RegisterGetEvaluatorFunc(priority int, fun getEvaluatorFunc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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