worker

package
v1.4.8-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package worker is a generated protocol buffer package.

It is generated from these files:

server/pkg/worker/worker_service.proto

It has these top-level messages:

Input
ProcessRequest
ProcessResponse
CancelRequest
CancelResponse

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashDatum added in v1.4.8

func HashDatum(pipelineInfo *pps.PipelineInfo, jobInfo *pps.JobInfo, data []*Input) (string, error)

HashDatum computes and returns the hash of datum + pipeline, with a pipeline-specific prefix.

func MatchDatum added in v1.4.4

func MatchDatum(filter []string, data []*pps.Datum) bool

MatchDatum checks if a datum matches a filter. To match each string in filter must correspond match at least 1 datum's Path or Hash. Order of filter and data is irrelevant.

func RegisterWorkerServer

func RegisterWorkerServer(s *grpc.Server, srv WorkerServer)

Types

type APIServer

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

APIServer implements the worker API

func NewJobAPIServer

func NewJobAPIServer(pachClient *client.APIClient, jobInfo *pps.JobInfo, workerName string) *APIServer

NewJobAPIServer creates an APIServer for a given pipeline

func NewPipelineAPIServer

func NewPipelineAPIServer(pachClient *client.APIClient, pipelineInfo *pps.PipelineInfo, workerName string) *APIServer

NewPipelineAPIServer creates an APIServer for a given pipeline

func (*APIServer) Cancel added in v1.4.4

func (a *APIServer) Cancel(ctx context.Context, request *CancelRequest) (*CancelResponse, error)

Cancel cancels the currently running datum

func (*APIServer) Process

func (a *APIServer) Process(ctx context.Context, req *ProcessRequest) (resp *ProcessResponse, retErr error)

Process processes a datum.

func (*APIServer) Status added in v1.4.4

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

Status returns the status of the current worker.

type CancelRequest added in v1.4.4

type CancelRequest struct {
	JobID       string   `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	DataFilters []string `protobuf:"bytes,1,rep,name=data_filters,json=dataFilters" json:"data_filters,omitempty"`
}

func (*CancelRequest) Descriptor added in v1.4.4

func (*CancelRequest) Descriptor() ([]byte, []int)

func (*CancelRequest) GetDataFilters added in v1.4.4

func (m *CancelRequest) GetDataFilters() []string

func (*CancelRequest) GetJobID added in v1.4.4

func (m *CancelRequest) GetJobID() string

func (*CancelRequest) ProtoMessage added in v1.4.4

func (*CancelRequest) ProtoMessage()

func (*CancelRequest) Reset added in v1.4.4

func (m *CancelRequest) Reset()

func (*CancelRequest) String added in v1.4.4

func (m *CancelRequest) String() string

type CancelResponse added in v1.4.4

type CancelResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

func (*CancelResponse) Descriptor added in v1.4.4

func (*CancelResponse) Descriptor() ([]byte, []int)

func (*CancelResponse) GetSuccess added in v1.4.4

func (m *CancelResponse) GetSuccess() bool

func (*CancelResponse) ProtoMessage added in v1.4.4

func (*CancelResponse) ProtoMessage()

func (*CancelResponse) Reset added in v1.4.4

func (m *CancelResponse) Reset()

func (*CancelResponse) String added in v1.4.4

func (m *CancelResponse) String() string

type Input

type Input struct {
	FileInfo     *pfs.FileInfo `protobuf:"bytes,1,opt,name=file_info,json=fileInfo" json:"file_info,omitempty"`
	ParentCommit *pfs.Commit   `protobuf:"bytes,5,opt,name=parent_commit,json=parentCommit" json:"parent_commit,omitempty"`
	Name         string        `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Lazy         bool          `protobuf:"varint,3,opt,name=lazy,proto3" json:"lazy,omitempty"`
	Branch       string        `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"`
}

func (*Input) Descriptor added in v1.4.6

func (*Input) Descriptor() ([]byte, []int)

func (*Input) GetBranch added in v1.4.8

func (m *Input) GetBranch() string

func (*Input) GetFileInfo added in v1.4.6

func (m *Input) GetFileInfo() *pfs.FileInfo

func (*Input) GetLazy added in v1.4.6

func (m *Input) GetLazy() bool

func (*Input) GetName added in v1.4.6

func (m *Input) GetName() string

func (*Input) GetParentCommit added in v1.4.8

func (m *Input) GetParentCommit() *pfs.Commit

func (*Input) ProtoMessage added in v1.4.6

func (*Input) ProtoMessage()

func (*Input) Reset added in v1.4.6

func (m *Input) Reset()

func (*Input) String added in v1.4.6

func (m *Input) String() string

type ProcessRequest

type ProcessRequest struct {
	// ID of the job for which we're processing 'data'. This is attached to logs
	// generated while processing 'data', so that they can be searched.
	JobID string `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	// The datum to process
	Data []*Input `protobuf:"bytes,1,rep,name=data" json:"data,omitempty"`
	// The tag corresponding to the previous parent's run of this datum, used for
	// incremental jobs, may be nil.
	ParentOutput *pfs.Tag `protobuf:"bytes,3,opt,name=parent_output,json=parentOutput" json:"parent_output,omitempty"`
}

func (*ProcessRequest) Descriptor

func (*ProcessRequest) Descriptor() ([]byte, []int)

func (*ProcessRequest) GetData

func (m *ProcessRequest) GetData() []*Input

func (*ProcessRequest) GetJobID

func (m *ProcessRequest) GetJobID() string

func (*ProcessRequest) GetParentOutput added in v1.4.8

func (m *ProcessRequest) GetParentOutput() *pfs.Tag

func (*ProcessRequest) ProtoMessage

func (*ProcessRequest) ProtoMessage()

func (*ProcessRequest) Reset

func (m *ProcessRequest) Reset()

func (*ProcessRequest) String

func (m *ProcessRequest) String() string

type ProcessResponse

type ProcessResponse struct {
	Tag *pfs.Tag `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"`
	// If true, the user program has errored
	Failed bool `protobuf:"varint,2,opt,name=failed,proto3" json:"failed,omitempty"`
}

ProcessResponse contains a tag, only if the processing was successful.

func (*ProcessResponse) Descriptor

func (*ProcessResponse) Descriptor() ([]byte, []int)

func (*ProcessResponse) GetFailed added in v1.4.2

func (m *ProcessResponse) GetFailed() bool

func (*ProcessResponse) GetTag

func (m *ProcessResponse) GetTag() *pfs.Tag

func (*ProcessResponse) ProtoMessage

func (*ProcessResponse) ProtoMessage()

func (*ProcessResponse) Reset

func (m *ProcessResponse) Reset()

func (*ProcessResponse) String

func (m *ProcessResponse) String() string

type WorkerClient

type WorkerClient interface {
	Process(ctx context.Context, in *ProcessRequest, opts ...grpc.CallOption) (*ProcessResponse, error)
	Status(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*pps.WorkerStatus, error)
	Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error)
}

func NewWorkerClient

func NewWorkerClient(cc *grpc.ClientConn) WorkerClient

Jump to

Keyboard shortcuts

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