Documentation
¶
Index ¶
- type Cluster
- type Labels
- type MemoGroupStore
- type MemoMessageQueue
- func (queue *MemoMessageQueue) Close() error
- func (queue *MemoMessageQueue) NewScheduleQueue(nodeID string) *MemoScheduleQueue
- func (queue *MemoMessageQueue) PushNodeTransaction(ctx context.Context, transaction Transaction) error
- func (queue *MemoMessageQueue) WaitMessages(ctx context.Context) ([]NodeMessage, error)
- type MemoScheduleQueue
- type Node
- type NodeAgent
- func (manager *NodeAgent) AddUnits(ctx context.Context, units ...Unit) error
- func (manager *NodeAgent) GetCurrentNode(ctx context.Context) (Node, error)
- func (manager *NodeAgent) GetCurrentSchedule(ctx context.Context) (expect *UnitSet, err error)
- func (manager *NodeAgent) RemoveUnits(ctx context.Context, keys []string) error
- func (manager *NodeAgent) SendCurrentInfo(ctx context.Context) error
- func (manager *NodeAgent) SetLeaveCluster(ctx context.Context) error
- func (manager *NodeAgent) SetLiveInfo(ctx context.Context, available float64) error
- func (manager *NodeAgent) WaitSchedule(ctx context.Context) (expect *UnitSet, err error)
- type NodeEvent
- type NodeEventQueue
- type NodeGroup
- type NodeGroupStore
- type NodeMessage
- type NodeMessageQueue
- type NodeObserver
- type NodeSchedule
- type NodeScheduleEvent
- type NotificationAcceptor
- type ScheduleEventQueue
- type ScheduleTrigger
- type Scheduler
- type SchedulerFunc
- type Transaction
- type Unit
- type UnitSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func New ¶
func New( nodeStore NodeGroupStore, nodeNotifyQueue NodeMessageQueue, schedulers Scheduler, records record.Factory) *Cluster
type Labels ¶
type Labels textproto.MIMEHeader
type MemoGroupStore ¶
type MemoGroupStore struct {
// contains filtered or unexported fields
}
func (*MemoGroupStore) ReadNodeGroup ¶
func (store *MemoGroupStore) ReadNodeGroup(ctx context.Context) (*NodeGroup, error)
type MemoMessageQueue ¶
type MemoMessageQueue struct {
// contains filtered or unexported fields
}
func NewMemoMessageQueue ¶
func NewMemoMessageQueue() *MemoMessageQueue
func (*MemoMessageQueue) Close ¶
func (queue *MemoMessageQueue) Close() error
func (*MemoMessageQueue) NewScheduleQueue ¶
func (queue *MemoMessageQueue) NewScheduleQueue(nodeID string) *MemoScheduleQueue
func (*MemoMessageQueue) PushNodeTransaction ¶
func (queue *MemoMessageQueue) PushNodeTransaction(ctx context.Context, transaction Transaction) error
func (*MemoMessageQueue) WaitMessages ¶
func (queue *MemoMessageQueue) WaitMessages(ctx context.Context) ([]NodeMessage, error)
type MemoScheduleQueue ¶
type MemoScheduleQueue struct {
// contains filtered or unexported fields
}
func (*MemoScheduleQueue) Ack ¶
func (queue *MemoScheduleQueue) Ack(ctx context.Context, node Node) error
func (*MemoScheduleQueue) Close ¶
func (queue *MemoScheduleQueue) Close() error
func (*MemoScheduleQueue) WaitEvent ¶
func (queue *MemoScheduleQueue) WaitEvent(ctx context.Context) (*NodeScheduleEvent, error)
type NodeAgent ¶
type NodeAgent struct {
// contains filtered or unexported fields
}
func NewNodeAgent ¶
func NewNodeAgent(store Node, eventStream ScheduleEventQueue) *NodeAgent
func (*NodeAgent) GetCurrentNode ¶
func (*NodeAgent) GetCurrentSchedule ¶
func (*NodeAgent) RemoveUnits ¶
func (*NodeAgent) SendCurrentInfo ¶
func (*NodeAgent) SetLeaveCluster ¶
func (*NodeAgent) SetLiveInfo ¶
type NodeEventQueue ¶
type NodeEventQueue struct {
// contains filtered or unexported fields
}
func (*NodeEventQueue) Peek ¶
func (q *NodeEventQueue) Peek(ctx context.Context) (*NodeEvent, error)
func (*NodeEventQueue) Reset ¶
func (q *NodeEventQueue) Reset()
type NodeGroup ¶
type NodeGroup struct {
// contains filtered or unexported fields
}
func NewNodeGroup ¶
func (*NodeGroup) UpdateNode ¶
type NodeGroupStore ¶
type NodeMessage ¶
type NodeMessageQueue ¶
type NodeMessageQueue interface { WaitMessages(ctx context.Context) ([]NodeMessage, error) PushNodeTransaction(ctx context.Context, transaction Transaction) error Close() error }
type NodeObserver ¶
type NodeObserver struct {
// contains filtered or unexported fields
}
func (*NodeObserver) GetEventQueue ¶
func (observer *NodeObserver) GetEventQueue(ctx context.Context) *NodeEventQueue
func (*NodeObserver) GetNodeGroup ¶
func (observer *NodeObserver) GetNodeGroup(ctx context.Context) (*NodeGroup, error)
type NodeSchedule ¶
type NodeScheduleEvent ¶
type NodeScheduleEvent struct { Schedule NodeSchedule Seq int64 }
type NotificationAcceptor ¶
type NotificationAcceptor interface { Accept(ctx context.Context, notification NodeMessage) error WaitScheduleTask(ctx context.Context) ([]NodeSchedule, error) }
type ScheduleEventQueue ¶
type ScheduleTrigger ¶
type ScheduleTrigger interface {
WaitSchedulerTrigger(ctx context.Context) ([]NodeSchedule, error)
}
type Scheduler ¶
type Scheduler interface {
StartSchedule(ctx context.Context, observer *NodeObserver) (ScheduleTrigger, error)
}
type SchedulerFunc ¶
type SchedulerFunc func(ctx context.Context) ([]NodeSchedule, error)
func (SchedulerFunc) WaitSchedulerTrigger ¶
func (f SchedulerFunc) WaitSchedulerTrigger(ctx context.Context) ([]NodeSchedule, error)
type Transaction ¶
type Transaction struct { Seq int64 Schedules []NodeSchedule }
type UnitSet ¶
type UnitSet struct {
// contains filtered or unexported fields
}
func NewUnitSet ¶
func NewUnitSet() *UnitSet
Click to show internal directories.
Click to hide internal directories.