worker

package
v1.4.0-RC3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 23 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:

ProcessRequest
ProcessResponse

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashDatum added in v1.4.8

func HashDatum(data []*pfs.FileInfo, options *Options) (string, error)

HashDatum computes and returns the hash of a datum + pipeline.

func RegisterWorkerServer

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

Types

type APIServer

type APIServer struct {
	sync.Mutex
	protorpclog.Logger
	// contains filtered or unexported fields
}

APIServer implements the worker API

func NewAPIServer added in v1.5.0

func NewAPIServer(pachClient *client.APIClient, options *Options) *APIServer

NewAPIServer creates an APIServer for a given pipeline

func (*APIServer) Process

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

Process processes a datum.

type Input

type Input struct {
	Name string
	Lazy bool
}

Input is a generic input object that can either be a pipeline input or a job input. It only defines the attributes that the worker cares about.

type Options

type Options struct {
	Transform *pps.Transform
	Inputs    []*Input
}

Options are the options used to initialize a worker.

type ProcessRequest

type ProcessRequest struct {
	// The datum to process
	Data []*pfs.FileInfo `protobuf:"bytes,1,rep,name=data" json:"data,omitempty"`
}

func (*ProcessRequest) Descriptor

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

func (*ProcessRequest) GetData

func (m *ProcessRequest) GetData() []*pfs.FileInfo

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"`
	Log string   `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
}

ProcessResponse contains either a tag, if the processing was successful, or a log that's the combination of stdout+stderr, if the processing was unsuccessful. TODO: allow for capturing logs even if processing was successful.

func (*ProcessResponse) Descriptor

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

func (*ProcessResponse) GetLog

func (m *ProcessResponse) GetLog() string

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

func NewWorkerClient

func NewWorkerClient(cc *grpc.ClientConn) WorkerClient

type WorkerServer

type WorkerServer interface {
	Process(context.Context, *ProcessRequest) (*ProcessResponse, error)
}

Jump to

Keyboard shortcuts

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