Documentation ¶
Index ¶
- Constants
- Variables
- type BoltDB
- func (taskBolt *BoltDB) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)
- func (taskBolt *BoltDB) CreateEvent(ctx context.Context, req *events.Event) (*events.CreateEventResponse, error)
- func (taskBolt *BoltDB) CreateTask(ctx context.Context, task *tes.Task) (*tes.CreateTaskResponse, error)
- func (taskBolt *BoltDB) DeleteNode(ctx context.Context, node *pbs.Node) error
- func (taskBolt *BoltDB) GetNode(ctx context.Context, req *pbs.GetNodeRequest) (*pbs.Node, error)
- func (taskBolt *BoltDB) GetServiceInfo(ctx context.Context, info *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)
- func (taskBolt *BoltDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)
- func (taskBolt *BoltDB) Init(ctx context.Context) error
- func (taskBolt *BoltDB) ListNodes(ctx context.Context, req *pbs.ListNodesRequest) (*pbs.ListNodesResponse, error)
- func (taskBolt *BoltDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
- func (taskBolt *BoltDB) PutNode(ctx context.Context, node *pbs.Node) (*pbs.PutNodeResponse, error)
- func (taskBolt *BoltDB) QueueTask(task *tes.Task) error
- func (taskBolt *BoltDB) ReadQueue(n int) []*tes.Task
- func (taskBolt *BoltDB) WithComputeBackend(backend compute.Backend)
- func (taskBolt *BoltDB) Write(req *events.Event) error
- func (taskBolt *BoltDB) WriteContext(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 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 {
// 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) CancelTask ¶
func (taskBolt *BoltDB) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)
CancelTask cancels a task
func (*BoltDB) CreateEvent ¶
func (taskBolt *BoltDB) CreateEvent(ctx context.Context, req *events.Event) (*events.CreateEventResponse, error)
CreateEvent creates an event for the server to handle.
func (*BoltDB) CreateTask ¶
func (taskBolt *BoltDB) CreateTask(ctx context.Context, task *tes.Task) (*tes.CreateTaskResponse, error)
CreateTask provides an HTTP/gRPC endpoint for creating a task. This is part of the TES implementation.
func (*BoltDB) DeleteNode ¶
DeleteNode deletes the given node. Currently, the node's version field is not checked.
func (*BoltDB) GetServiceInfo ¶
func (taskBolt *BoltDB) GetServiceInfo(ctx context.Context, info *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)
GetServiceInfo provides an endpoint for Funnel clients to get information about this server.
func (*BoltDB) ListNodes ¶
func (taskBolt *BoltDB) ListNodes(ctx context.Context, req *pbs.ListNodesRequest) (*pbs.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 ¶
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.
func (*BoltDB) WithComputeBackend ¶
WithComputeBackend configures the BoltDB instance to use the given compute.Backend. The compute backend is responsible for dispatching tasks to schedulers / compute resources with its Submit method.