server

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WorkerEtcdPrefix is the prefix in etcd that we use to store worker information.
	WorkerEtcdPrefix = "workers"
)

Variables

This section is empty.

Functions

func Cancel

func Cancel(ctx context.Context, pipelineInfo *pps.PipelineInfo, etcdClient *etcd.Client,
	etcdPrefix string, workerGrpcPort uint16, jobID string, dataFilter []string) (retErr error)

Cancel cancels a set of datums running on workers. Pass empty strings for project & pipeline names and a zero version to cancel ALL workers.

func Status

func Status(ctx context.Context, pipelineInfo *pps.PipelineInfo, etcdClient *etcd.Client, etcdPrefix string, workerGrpcPort uint16) ([]*pps.WorkerStatus, error)

Status returns the statuses of workers referenced by pipelineRcName. Pass "" for projectName & pipelineName and zero for pipelineVersion to get all clients for all workers.

Types

type APIServer

type APIServer struct {
	workerapi.UnsafeWorkerServer
	// contains filtered or unexported fields
}

APIServer implements the worker API

func NewAPIServer

func NewAPIServer(driver driver.Driver, workerInterface WorkerInterface, workerName string) *APIServer

NewAPIServer creates an APIServer for a given pipeline

func (*APIServer) Cancel

Cancel cancels the currently running datum

func (*APIServer) NextDatum

func (*APIServer) Status

func (a *APIServer) Status(ctx context.Context, _ *emptypb.Empty) (*pps.WorkerStatus, error)

Status returns the status of the current worker task.

type Client

type Client struct {
	workerapi.WorkerClient
	debug.DebugClient
	// contains filtered or unexported fields
}

Client combines the WorkerAPI and the DebugAPI into a single client.

func NewClient

func NewClient(address string) (Client, error)

NewClient returns a worker client for the worker at the IP address passed in.

func (*Client) Close

func (c *Client) Close() error

type WorkerInterface

type WorkerInterface interface {
	GetStatus() (*pps.WorkerStatus, error)
	Cancel(jobID string, datumFilter []string) bool
	NextDatum(context.Context, error) ([]string, error)
}

WorkerInterface is an interface for getting or canceling the currently-running task in the worker process.

Jump to

Keyboard shortcuts

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