zscheduler

package
v0.0.0-...-031d970 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PreSlotsManager

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

PreSlotsManager will manage pre dispatch and sync to

func NewPreSlotsManager

func NewPreSlotsManager(conn *zk.Conn) (PreSlotsManager, error)

NewPreSlotsManager will sync old data first

func (*PreSlotsManager) Commit

func (psm *PreSlotsManager) Commit(begin uint32, end uint32, serviceName string) error

Commit will free segment

func (*PreSlotsManager) PreDispatch

func (psm *PreSlotsManager) PreDispatch() (uint32, uint32, string, error)

PreDispatch will block new segment

type Scheduler

type Scheduler interface {
	Schedule(registerName string, serviceName string) error
	Listen(string) error
	GetIdles() []interface{}
	GetIdle() interface{}
}

Scheduler is a standard interface for zeus cammand

type SimpleScheduler

type SimpleScheduler struct {
	ServiceHost *zroute.ServiceHost

	YurtPool mapset.Set
	// contains filtered or unexported fields
}

SimpleScheduler is a simple algo for schedule idle yurt

func NewSimpleScheduler

func NewSimpleScheduler(ctx context.Context, wg *sync.WaitGroup, conn *zk.Conn, minRequest int, ServiceHost *zroute.ServiceHost, sc *zslot.SlotCluster, segChannel chan zroute.Segment, psm *PreSlotsManager) (SimpleScheduler, error)

NewSimpleScheduler is a help function for new SimpleScheduler

func (*SimpleScheduler) GetIdle

func (ss *SimpleScheduler) GetIdle() interface{}

func (*SimpleScheduler) GetIdles

func (ss *SimpleScheduler) GetIdles() []interface{}

func (*SimpleScheduler) Listen

func (ss *SimpleScheduler) Listen(path string) error

Listen will start a routine to ChildrenW now we just let idle into YurtPool

func (*SimpleScheduler) Schedule

func (ss *SimpleScheduler) Schedule(registerNode string, serviceName string) error

Schedule will dispatch yurt

Jump to

Keyboard shortcuts

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