worker

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

README

To update the protocol buffer definitions, run this from one directory above:

protoc -I worker worker/payload.proto --go_out=plugins=grpc:worker

Documentation

Overview

Package worker is a generated protocol buffer package.

It is generated from these files:

payload.proto

It has these top-level messages:

Payload

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(workerList []string)

func GetOrAssignUidsOverNetwork

func GetOrAssignUidsOverNetwork(ctx context.Context, xidToUid *map[string]uint64) (rerr error)

func Init

func Init(ps, uStore *store.Store, idx, numInst uint64)

func MutateOverNetwork

func MutateOverNetwork(ctx context.Context,
	edges []x.DirectedEdge) (left []x.DirectedEdge, rerr error)

func NewQuery

func NewQuery(attr string, uids []uint64) []byte

func ProcessTaskOverNetwork

func ProcessTaskOverNetwork(ctx context.Context, qu []byte) (result []byte, rerr error)

func RegisterWorkerServer

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

Types

type Mutations

type Mutations struct {
	Set []x.DirectedEdge
	Del []x.DirectedEdge
}

func (*Mutations) Decode

func (m *Mutations) Decode(data []byte) error

func (*Mutations) Encode

func (m *Mutations) Encode() (data []byte, rerr error)

type Payload

type Payload struct {
	Data []byte `protobuf:"bytes,1,opt,name=Data,json=data,proto3" json:"Data,omitempty"`
}

func (*Payload) Descriptor

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

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) String

func (m *Payload) String() string

type PayloadCodec

type PayloadCodec struct{}

func (*PayloadCodec) Marshal

func (cb *PayloadCodec) Marshal(v interface{}) ([]byte, error)

func (*PayloadCodec) String

func (cb *PayloadCodec) String() string

func (*PayloadCodec) Unmarshal

func (cb *PayloadCodec) Unmarshal(data []byte, v interface{}) error

type Pool

type Pool struct {
	Addr string
	// contains filtered or unexported fields
}

func NewPool

func NewPool(addr string, maxCap int) *Pool

func (*Pool) Get

func (p *Pool) Get() (*grpc.ClientConn, error)

func (*Pool) Put

func (p *Pool) Put(conn *grpc.ClientConn) error

type WorkerClient

type WorkerClient interface {
	Hello(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error)
	GetOrAssign(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error)
	Mutate(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error)
	ServeTask(ctx context.Context, in *Payload, opts ...grpc.CallOption) (*Payload, error)
}

func NewWorkerClient

func NewWorkerClient(cc *grpc.ClientConn) WorkerClient

type WorkerServer

type WorkerServer interface {
	Hello(context.Context, *Payload) (*Payload, error)
	GetOrAssign(context.Context, *Payload) (*Payload, error)
	Mutate(context.Context, *Payload) (*Payload, error)
	ServeTask(context.Context, *Payload) (*Payload, error)
}

Jump to

Keyboard shortcuts

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