Documentation
¶
Index ¶
- type MongoDB
- func (db *MongoDB) ClaimExecution(ctx context.Context, taskID string, owner *events.ExecutionOwner) (bool, error)
- func (db *MongoDB) Close()
- func (db *MongoDB) DeleteNode(ctx context.Context, req *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
- func (db *MongoDB) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
- func (db *MongoDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)
- func (db *MongoDB) Init() error
- func (db *MongoDB) ListNodeCandidates(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
- func (db *MongoDB) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
- func (db *MongoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
- func (db *MongoDB) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)
- func (db *MongoDB) ReadQueue(n int, after *tes.Task) []*tes.Task
- func (db *MongoDB) SetNodeState(ctx context.Context, observed *scheduler.Node) (*scheduler.Node, error)
- func (db *MongoDB) TaskStateCounts(ctx context.Context) (map[string]int32, error)
- func (db *MongoDB) TryAssign(ctx context.Context, task *tes.Task, candidate *scheduler.Node) (string, error)
- func (db *MongoDB) WriteEvent(ctx context.Context, req *events.Event) error
- type TaskOwner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct {
scheduler.UnimplementedSchedulerServiceServer
// contains filtered or unexported fields
}
MongoDB provides an MongoDB database server backend.
func (*MongoDB) ClaimExecution ¶
func (db *MongoDB) ClaimExecution(ctx context.Context, taskID string, owner *events.ExecutionOwner) (bool, error)
ClaimExecution atomically admits one worker for a queued or initializing task.
func (*MongoDB) DeleteNode ¶
func (db *MongoDB) DeleteNode(ctx context.Context, req *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
DeleteNode deletes a node
func (*MongoDB) GetNode ¶
func (db *MongoDB) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
GetNode gets a node
func (*MongoDB) ListNodeCandidates ¶
func (db *MongoDB) ListNodeCandidates(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
ListNodeCandidates returns scheduling data without expanding each node's active task IDs.
func (*MongoDB) ListNodes ¶
func (db *MongoDB) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
ListNodes is an API endpoint that returns a list of nodes.
func (*MongoDB) ListTasks ¶
func (db *MongoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
ListTasks returns a list of taskIDs
func (*MongoDB) PutNode ¶
func (db *MongoDB) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)
PutNode is an RPC endpoint that is used by nodes to send heartbeats and status updates, such as completed tasks. The server responds with updated information for the node, such as canceled tasks.
func (*MongoDB) ReadQueue ¶
ReadQueue returns a slice of queued Tasks. Up to "n" tasks are returned.
func (*MongoDB) SetNodeState ¶
func (*MongoDB) TaskStateCounts ¶
TaskStateCounts returns the number of tasks in each state.