Documentation ¶
Index ¶
- Constants
- func Cancel(ctx context.Context, pipelineInfo *pps.PipelineInfo, etcdClient *etcd.Client, ...) (retErr error)
- func Status(ctx context.Context, pipelineInfo *pps.PipelineInfo, etcdClient *etcd.Client, ...) ([]*pps.WorkerStatus, error)
- type APIServer
- func (a *APIServer) Cancel(ctx context.Context, request *workerapi.CancelRequest) (*workerapi.CancelResponse, error)
- func (a *APIServer) NextDatum(ctx context.Context, request *workerapi.NextDatumRequest) (*workerapi.NextDatumResponse, error)
- func (a *APIServer) Status(ctx context.Context, _ *emptypb.Empty) (*pps.WorkerStatus, error)
- type Client
- type WorkerInterface
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 ¶
func (a *APIServer) Cancel(ctx context.Context, request *workerapi.CancelRequest) (*workerapi.CancelResponse, error)
Cancel cancels the currently running datum
func (*APIServer) NextDatum ¶
func (a *APIServer) NextDatum(ctx context.Context, request *workerapi.NextDatumRequest) (*workerapi.NextDatumResponse, error)
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.
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.
Click to show internal directories.
Click to hide internal directories.