boltdb

package
v0.0.0-...-5db00e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var ExecutorLogs = []byte("executor-logs")

ExecutorLogs maps (task ID + executor index) -> tes.ExecutorLog struct

View Source
var ExecutorStderr = []byte("executor-stderr")

ExecutorStderr maps (task ID + executor index) -> tes.ExecutorLog.Stderr string

View Source
var ExecutorStdout = []byte("executor-stdout")

ExecutorStdout maps (task ID + executor index) -> tes.ExecutorLog.Stdout string

View Source
var Nodes = []byte("nodes")

Nodes maps: node ID -> pbs.Node struct

View Source
var TaskBucket = []byte("tasks")

TaskBucket defines the name of a bucket which maps task ID -> tes.Task struct

View Source
var TaskState = []byte("tasks-state")

TaskState maps: task ID -> state string

View Source
var TasksLog = []byte("tasks-log")

TasksLog defines the name of a bucket which maps task ID -> tes.TaskLog struct

View Source
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

func NewBoltDB(conf config.Config) (*BoltDB, error)

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

func (taskBolt *BoltDB) DeleteNode(ctx context.Context, node *pbs.Node) 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 *pbs.GetNodeRequest) (*pbs.Node, error)

GetNode gets a node

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) GetTask

func (taskBolt *BoltDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)

GetTask gets a task, which describes a running task

func (*BoltDB) Init

func (taskBolt *BoltDB) Init(ctx context.Context) error

Init creates the required BoltDB buckets

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

func (taskBolt *BoltDB) PutNode(ctx context.Context, node *pbs.Node) (*pbs.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.

func (*BoltDB) QueueTask

func (taskBolt *BoltDB) QueueTask(task *tes.Task) error

QueueTask adds a task to the scheduler queue.

func (*BoltDB) ReadQueue

func (taskBolt *BoltDB) ReadQueue(n int) []*tes.Task

ReadQueue returns a slice of queued Tasks. Up to "n" tasks are returned.

func (*BoltDB) WithComputeBackend

func (taskBolt *BoltDB) WithComputeBackend(backend compute.Backend)

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.

func (*BoltDB) Write

func (taskBolt *BoltDB) Write(req *events.Event) error

Write writes task events to the database, updating the task record they are related to. System log events are ignored.

func (*BoltDB) WriteContext

func (taskBolt *BoltDB) WriteContext(ctx context.Context, req *events.Event) error

WriteContext is Write, but with context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL