service

package
v0.0.0-...-39572d5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2016 License: MIT Imports: 5 Imported by: 0

README

Requirements

  • Protobuf github.com/google/protobuf
  • Golang protoc wrapper (go get github.com/golang/protobuf/protoc-gen-go)
protoc ./mr.proto --go_out=plugins=grpc:.

Documentation

Overview

Package service is a generated protocol buffer package.

It is generated from these files:

mr.proto

It has these top-level messages:

MrStatus
MrJob

Index

Constants

This section is empty.

Variables

View Source
var Phase_name = map[int32]string{
	0: "MAP",
	1: "REDUCE",
}
View Source
var Phase_value = map[string]int32{
	"MAP":    0,
	"REDUCE": 1,
}
View Source
var Status_name = map[int32]string{
	0: "DONE",
	1: "ALL_DONE",
	2: "PLUGIN_LOADED",
	3: "INPUT_LOADED",
	4: "INTERMEDIATE_FILES_CREATED",
	5: "ERROR",
}
View Source
var Status_value = map[string]int32{
	"DONE":                       0,
	"ALL_DONE":                   1,
	"PLUGIN_LOADED":              2,
	"INPUT_LOADED":               3,
	"INTERMEDIATE_FILES_CREATED": 4,
	"ERROR":                      5,
}

Functions

func RegisterMapReduceServer

func RegisterMapReduceServer(s *grpc.Server, srv MapReduceServer)

func RegisterMasterServer

func RegisterMasterServer(s *grpc.Server, srv MasterServer)

Types

type MapReduceClient

type MapReduceClient interface {
	// Map starts map phase and returns the status of the tasks as long as its ongoing.
	Map(ctx context.Context, in *MrJob, opts ...grpc.CallOption) (MapReduce_MapClient, error)
	// Reduce starts reduce phase and returns the status of the tasks as long as its ongoing.
	Reduce(ctx context.Context, in *MrJob, opts ...grpc.CallOption) (MapReduce_ReduceClient, error)
}

func NewMapReduceClient

func NewMapReduceClient(cc *grpc.ClientConn) MapReduceClient

type MapReduceServer

type MapReduceServer interface {
	// Map starts map phase and returns the status of the tasks as long as its ongoing.
	Map(*MrJob, MapReduce_MapServer) error
	// Reduce starts reduce phase and returns the status of the tasks as long as its ongoing.
	Reduce(*MrJob, MapReduce_ReduceServer) error
}

type MapReduce_MapClient

type MapReduce_MapClient interface {
	Recv() (*MrStatus, error)
	grpc.ClientStream
}

type MapReduce_MapServer

type MapReduce_MapServer interface {
	Send(*MrStatus) error
	grpc.ServerStream
}

type MapReduce_ReduceClient

type MapReduce_ReduceClient interface {
	Recv() (*MrStatus, error)
	grpc.ClientStream
}

type MapReduce_ReduceServer

type MapReduce_ReduceServer interface {
	Send(*MrStatus) error
	grpc.ServerStream
}

type MasterClient

type MasterClient interface {
	// Submit submits map reduce job and returns stream of statuses until the job is ongoing.
	Submit(ctx context.Context, in *MrJob, opts ...grpc.CallOption) (Master_SubmitClient, error)
}

func NewMasterClient

func NewMasterClient(cc *grpc.ClientConn) MasterClient

type MasterServer

type MasterServer interface {
	// Submit submits map reduce job and returns stream of statuses until the job is ongoing.
	Submit(*MrJob, Master_SubmitServer) error
}

type Master_SubmitClient

type Master_SubmitClient interface {
	Recv() (*MrStatus, error)
	grpc.ClientStream
}

type Master_SubmitServer

type Master_SubmitServer interface {
	Send(*MrStatus) error
	grpc.ServerStream
}

type MrJob

type MrJob struct {
	Name              string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	MapTasksNum       int32  `protobuf:"varint,2,opt,name=mapTasksNum" json:"mapTasksNum,omitempty"`
	ReduceTasksNum    int32  `protobuf:"varint,3,opt,name=reduceTasksNum" json:"reduceTasksNum,omitempty"`
	CurrentReduceTask int32  `protobuf:"varint,4,opt,name=currentReduceTask" json:"currentReduceTask,omitempty"`
	Input             string `protobuf:"bytes,5,opt,name=input" json:"input,omitempty"`
	WorkDir           string `protobuf:"bytes,6,opt,name=workDir" json:"workDir,omitempty"`
	MapReducePlugin   []byte `protobuf:"bytes,7,opt,name=mapReducePlugin,proto3" json:"mapReducePlugin,omitempty"`
}

func (*MrJob) Descriptor

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

func (*MrJob) GetCurrentReduceTask

func (m *MrJob) GetCurrentReduceTask() int32

func (*MrJob) GetInput

func (m *MrJob) GetInput() string

func (*MrJob) GetMapReducePlugin

func (m *MrJob) GetMapReducePlugin() []byte

func (*MrJob) GetMapTasksNum

func (m *MrJob) GetMapTasksNum() int32

func (*MrJob) GetName

func (m *MrJob) GetName() string

func (*MrJob) GetReduceTasksNum

func (m *MrJob) GetReduceTasksNum() int32

func (*MrJob) GetWorkDir

func (m *MrJob) GetWorkDir() string

func (*MrJob) ProtoMessage

func (*MrJob) ProtoMessage()

func (*MrJob) Reset

func (m *MrJob) Reset()

func (*MrJob) String

func (m *MrJob) String() string

type MrStatus

type MrStatus struct {
	ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
	Status    Status `protobuf:"varint,2,opt,name=status,enum=service.Status" json:"status,omitempty"`
	Phase     Phase  `protobuf:"varint,3,opt,name=phase,enum=service.Phase" json:"phase,omitempty"`
	Msg       string `protobuf:"bytes,4,opt,name=msg" json:"msg,omitempty"`
}

func (*MrStatus) Descriptor

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

func (*MrStatus) GetMsg

func (m *MrStatus) GetMsg() string

func (*MrStatus) GetPhase

func (m *MrStatus) GetPhase() Phase

func (*MrStatus) GetServiceId

func (m *MrStatus) GetServiceId() string

func (*MrStatus) GetStatus

func (m *MrStatus) GetStatus() Status

func (*MrStatus) ProtoMessage

func (*MrStatus) ProtoMessage()

func (*MrStatus) Reset

func (m *MrStatus) Reset()

func (*MrStatus) String

func (m *MrStatus) String() string

type Phase

type Phase int32
const (
	Phase_MAP    Phase = 0
	Phase_REDUCE Phase = 1
)

func (Phase) EnumDescriptor

func (Phase) EnumDescriptor() ([]byte, []int)

func (Phase) String

func (x Phase) String() string

type Status

type Status int32
const (
	Status_DONE                       Status = 0
	Status_ALL_DONE                   Status = 1
	Status_PLUGIN_LOADED              Status = 2
	Status_INPUT_LOADED               Status = 3
	Status_INTERMEDIATE_FILES_CREATED Status = 4
	Status_ERROR                      Status = 5
)

func (Status) EnumDescriptor

func (Status) EnumDescriptor() ([]byte, []int)

func (Status) String

func (x Status) String() string

Jump to

Keyboard shortcuts

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