Documentation ¶
Index ¶
- type MongoDB
- 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) 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) []*tes.Task
- func (db *MongoDB) TaskStateCounts(ctx context.Context) (map[string]int32, error)
- func (db *MongoDB) WriteEvent(ctx context.Context, req *events.Event) error
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 NewMongoDB ¶
NewMongoDB returns a new MongoDB instance.
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) 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) TaskStateCounts ¶
TaskStateCounts returns the number of tasks in each state.
Click to show internal directories.
Click to hide internal directories.