dynamodb

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDB

type DynamoDB struct {
	// contains filtered or unexported fields
}

DynamoDB provides handlers for gRPC endpoints Data is stored/retrieved from the Amazon DynamoDB NoSQL database.

func NewDynamoDB

func NewDynamoDB(conf config.DynamoDB) (*DynamoDB, error)

NewDynamoDB returns a new instance of DynamoDB, accessing the database at the given url, and including the given ServerConfig.

func (*DynamoDB) CancelTask

func (db *DynamoDB) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)

CancelTask cancels a task

func (*DynamoDB) Close

func (db *DynamoDB) Close() error

Close closes the writer.

func (*DynamoDB) CreateEvent

func (db *DynamoDB) CreateEvent(ctx context.Context, req *events.Event) (*events.CreateEventResponse, error)

CreateEvent creates an event for the server to handle.

func (*DynamoDB) CreateTask

func (db *DynamoDB) 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 (*DynamoDB) DeleteNode

func (db *DynamoDB) DeleteNode(ctx context.Context, req *pbs.Node) error

DeleteNode deletes a node

func (*DynamoDB) GetNode

func (db *DynamoDB) GetNode(ctx context.Context, req *pbs.GetNodeRequest) (*pbs.Node, error)

GetNode gets a node

func (*DynamoDB) GetServiceInfo

func (db *DynamoDB) GetServiceInfo(ctx context.Context, info *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)

GetServiceInfo provides an endpoint for Funnel clients to get information about this server.

func (*DynamoDB) GetTask

func (db *DynamoDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)

GetTask gets a task, which describes a running task

func (*DynamoDB) Init

func (db *DynamoDB) Init(ctx context.Context) error

Init creates tables in DynamoDB. If these tables already exist, a Debug level log is produced.

func (*DynamoDB) ListNodes

func (db *DynamoDB) ListNodes(ctx context.Context, req *pbs.ListNodesRequest) (*pbs.ListNodesResponse, error)

ListNodes is an API endpoint that returns a list of nodes.

func (*DynamoDB) ListTasks

func (db *DynamoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)

ListTasks returns a list of taskIDs

func (*DynamoDB) PutNode

func (db *DynamoDB) PutNode(ctx context.Context, req *pbs.Node) (*pbs.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 (*DynamoDB) QueueTask

func (db *DynamoDB) QueueTask(task *tes.Task) error

QueueTask adds a task to the scheduler queue.

func (*DynamoDB) ReadQueue

func (db *DynamoDB) ReadQueue(n int) []*tes.Task

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

func (*DynamoDB) WithComputeBackend

func (db *DynamoDB) WithComputeBackend(backend compute.Backend)

WithComputeBackend configures the DynamoDB instance to use the given compute.Backend. The compute backend is responsible for dispatching tasks to schedulers / compute resources with its Submit method.

func (*DynamoDB) Write

func (db *DynamoDB) 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 (*DynamoDB) WriteContext

func (db *DynamoDB) WriteContext(ctx context.Context, e *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