Documentation ¶
Index ¶
- Constants
- Variables
- type BoltDB
- func (taskBolt *BoltDB) Close()
- func (taskBolt *BoltDB) DeleteNode(ctx context.Context, node *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
- func (taskBolt *BoltDB) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
- func (taskBolt *BoltDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)
- func (taskBolt *BoltDB) Init() error
- func (taskBolt *BoltDB) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
- func (taskBolt *BoltDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
- func (taskBolt *BoltDB) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)
- func (taskBolt *BoltDB) ReadQueue(n int) []*tes.Task
- func (taskBolt *BoltDB) WriteEvent(ctx context.Context, req *events.Event) error
Constants ¶
const ( Unknown = tes.State_UNKNOWN Queued = tes.State_QUEUED Running = tes.State_RUNNING Paused = tes.State_PAUSED Complete = tes.State_COMPLETE ExecutorError = tes.State_EXECUTOR_ERROR SystemError = tes.State_SYSTEM_ERROR Canceled = tes.State_CANCELED Initializing = tes.State_INITIALIZING )
State variables for convenience
Variables ¶
var ExecutorLogs = []byte("executor-logs")
ExecutorLogs maps (task ID + executor index) -> tes.ExecutorLog struct
var ExecutorStderr = []byte("executor-stderr")
ExecutorStderr maps (task ID + executor index) -> tes.ExecutorLog.Stderr string
var ExecutorStdout = []byte("executor-stdout")
ExecutorStdout maps (task ID + executor index) -> tes.ExecutorLog.Stdout string
var Nodes = []byte("nodes")
Nodes maps: node ID -> pbs.Node struct
var SysLogs = []byte("system-logs")
SysLogs defeines the name of a bucket with maps task ID -> tes.TaskLog.SystemLogs
var TaskBucket = []byte("tasks")
TaskBucket defines the name of a bucket which maps task ID -> tes.Task struct
var TaskState = []byte("tasks-state")
TaskState maps: task ID -> state string
var TasksLog = []byte("tasks-log")
TasksLog defines the name of a bucket which maps task ID -> tes.TaskLog struct
var TasksQueued = []byte("tasks-queued")
TasksQueued defines the name of a bucket which maps task ID -> nil
Functions ¶
This section is empty.
Types ¶
type BoltDB ¶
type BoltDB struct { scheduler.UnimplementedSchedulerServiceServer // contains filtered or unexported fields }
BoltDB provides handlers for gRPC endpoints. Data is stored/retrieved from the BoltDB key-value database.
func NewBoltDB ¶
NewBoltDB returns a new instance of BoltDB, accessing the database at the given path, and including the given ServerConfig.
func (*BoltDB) DeleteNode ¶
func (taskBolt *BoltDB) DeleteNode(ctx context.Context, node *scheduler.Node) (*scheduler.DeleteNodeResponse, error)
DeleteNode deletes the given node. Currently, the node's version field is not checked.
func (*BoltDB) GetNode ¶
func (taskBolt *BoltDB) GetNode(ctx context.Context, req *scheduler.GetNodeRequest) (*scheduler.Node, error)
GetNode gets a node
func (*BoltDB) ListNodes ¶
func (taskBolt *BoltDB) ListNodes(ctx context.Context, req *scheduler.ListNodesRequest) (*scheduler.ListNodesResponse, error)
ListNodes is an API endpoint that returns a list of nodes.
func (*BoltDB) ListTasks ¶
func (taskBolt *BoltDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
ListTasks returns a list of taskIDs
func (*BoltDB) PutNode ¶
func (taskBolt *BoltDB) PutNode(ctx context.Context, node *scheduler.Node) (*scheduler.PutNodeResponse, error)
PutNode put a node object into the database.
For optimisic locking, if the node already exists and node.Version doesn't match the version in the database, an error is returned.