Documentation
¶
Index ¶
- type Postgres
- func (db *Postgres) ClaimExecution(ctx context.Context, taskID string, owner *events.ExecutionOwner) (bool, error)
- func (db *Postgres) Close()
- func (db *Postgres) DeleteNode(ctx context.Context, req *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
- func (db *Postgres) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
- func (db *Postgres) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)
- func (db *Postgres) Init() error
- func (db *Postgres) ListNodeCandidates(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
- func (db *Postgres) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
- func (db *Postgres) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
- func (db *Postgres) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)
- func (db *Postgres) ReadQueue(n int, after *tes.Task) []*tes.Task
- func (db *Postgres) SetNodeState(ctx context.Context, observed *scheduler.Node) (*scheduler.Node, error)
- func (db *Postgres) TryAssign(ctx context.Context, task *tes.Task, candidate *scheduler.Node) (string, error)
- func (db *Postgres) WriteEvent(ctx context.Context, req *events.Event) error
- type TaskCore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct {
scheduler.UnimplementedSchedulerServiceServer
// contains filtered or unexported fields
}
Postgres provides a PostgreSQL database server backend.
func (*Postgres) ClaimExecution ¶
func (db *Postgres) ClaimExecution(ctx context.Context, taskID string, owner *events.ExecutionOwner) (bool, error)
ClaimExecution atomically admits one worker for a queued or initializing task.
func (*Postgres) DeleteNode ¶
func (db *Postgres) DeleteNode(ctx context.Context, req *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
DeleteNode deletes a node
func (*Postgres) GetNode ¶
func (db *Postgres) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
GetNode gets a node
func (*Postgres) ListNodeCandidates ¶
func (db *Postgres) ListNodeCandidates(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
ListNodeCandidates returns scheduling data without expanding each node's active task IDs.
func (*Postgres) ListNodes ¶
func (db *Postgres) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
ListNodes is an API endpoint that returns a list of nodes.
func (*Postgres) ListTasks ¶
func (db *Postgres) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
ListTasks returns a list of tasks.
func (*Postgres) PutNode ¶
func (db *Postgres) 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.
func (*Postgres) ReadQueue ¶
ReadQueue returns a slice of queued Tasks. Up to "n" tasks are returned.
func (*Postgres) SetNodeState ¶
func (*Postgres) TryAssign ¶
func (db *Postgres) TryAssign(ctx context.Context, task *tes.Task, candidate *scheduler.Node) (string, error)
TryAssign atomically claims a queued task for candidate and reserves its resources in the candidate node. It leaves the task state unchanged; state and event propagation remain the responsibility of the event writer.