Documentation ¶
Index ¶
- Variables
- func RegisterMapReduceRPCServiceServer(s *grpc.Server, srv MapReduceRPCServiceServer)
- type AddTaskRequest
- type AddTaskResponse
- type IntercomRequest
- func (*IntercomRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IntercomRequest) GetExtra() string
- func (x *IntercomRequest) GetMsgContent() string
- func (x *IntercomRequest) GetMsgType() IntercomType
- func (*IntercomRequest) ProtoMessage()
- func (x *IntercomRequest) ProtoReflect() protoreflect.Message
- func (x *IntercomRequest) Reset()
- func (x *IntercomRequest) String() string
- type IntercomResponse
- func (*IntercomResponse) Descriptor() ([]byte, []int)deprecated
- func (x *IntercomResponse) GetFile() string
- func (x *IntercomResponse) GetMapTaskAttached() int32
- func (x *IntercomResponse) GetNReduce() int32
- func (x *IntercomResponse) GetReduceFiles() []string
- func (x *IntercomResponse) GetReduceTaskAttached() int32
- func (x *IntercomResponse) GetTaskType() TaskType
- func (*IntercomResponse) ProtoMessage()
- func (x *IntercomResponse) ProtoReflect() protoreflect.Message
- func (x *IntercomResponse) Reset()
- func (x *IntercomResponse) String() string
- type IntercomType
- func (IntercomType) Descriptor() protoreflect.EnumDescriptor
- func (x IntercomType) Enum() *IntercomType
- func (IntercomType) EnumDescriptor() ([]byte, []int)deprecated
- func (x IntercomType) Number() protoreflect.EnumNumber
- func (x IntercomType) String() string
- func (IntercomType) Type() protoreflect.EnumType
- type ListWorkersRequest
- type ListWorkersResponse
- func (*ListWorkersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListWorkersResponse) GetWorkers() []*Worker
- func (*ListWorkersResponse) ProtoMessage()
- func (x *ListWorkersResponse) ProtoReflect() protoreflect.Message
- func (x *ListWorkersResponse) Reset()
- func (x *ListWorkersResponse) String() string
- type MapReduceRPCServiceClient
- type MapReduceRPCServiceServer
- type Task
- type TaskStatus
- type TaskType
- type UnimplementedMapReduceRPCServiceServer
- func (*UnimplementedMapReduceRPCServiceServer) AddTask(context.Context, *AddTaskRequest) (*AddTaskResponse, error)
- func (*UnimplementedMapReduceRPCServiceServer) Intercom(context.Context, *IntercomRequest) (*IntercomResponse, error)
- func (*UnimplementedMapReduceRPCServiceServer) ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error)
- type Worker
- type WorkerStatus
- func (WorkerStatus) Descriptor() protoreflect.EnumDescriptor
- func (x WorkerStatus) Enum() *WorkerStatus
- func (WorkerStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x WorkerStatus) Number() protoreflect.EnumNumber
- func (x WorkerStatus) String() string
- func (WorkerStatus) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( WorkerStatus_name = map[int32]string{ 0: "WORKER_STATUS_ONLINE", 1: "WORKER_STATUS_OFFLINE", 2: "WORKER_STATUS_READY", 3: "WORKER_STATUS_BUSY", 4: "WORKER_STATUS_UNAVAILABLE", } WorkerStatus_value = map[string]int32{ "WORKER_STATUS_ONLINE": 0, "WORKER_STATUS_OFFLINE": 1, "WORKER_STATUS_READY": 2, "WORKER_STATUS_BUSY": 3, "WORKER_STATUS_UNAVAILABLE": 4, } )
Enum value maps for WorkerStatus.
var ( TaskType_name = map[int32]string{ 0: "TASK_TYPE_MAP", 1: "TASK_TYPE_REDUCE", } TaskType_value = map[string]int32{ "TASK_TYPE_MAP": 0, "TASK_TYPE_REDUCE": 1, } )
Enum value maps for TaskType.
var ( TaskStatus_name = map[int32]string{ 0: "TASK_STATUS_UNATTACHED", 1: "TASK_STATUS_ATTACHED", 2: "TASK_STATUS_ONDOING", 3: "TASK_STATUS_DONE", } TaskStatus_value = map[string]int32{ "TASK_STATUS_UNATTACHED": 0, "TASK_STATUS_ATTACHED": 1, "TASK_STATUS_ONDOING": 2, "TASK_STATUS_DONE": 3, } )
Enum value maps for TaskStatus.
var ( IntercomType_name = map[int32]string{ 0: "INTERCOM_TYPE_ASK_TASK", 1: "INTERCOM_TYPE_FINISH_MAP_TASK", 2: "INTERCOM_TYPE_FINISH_REDUCE_TASK", 3: "INTERCOM_TYPE_SEND_INTER_FILE", } IntercomType_value = map[string]int32{ "INTERCOM_TYPE_ASK_TASK": 0, "INTERCOM_TYPE_FINISH_MAP_TASK": 1, "INTERCOM_TYPE_FINISH_REDUCE_TASK": 2, "INTERCOM_TYPE_SEND_INTER_FILE": 3, } )
Enum value maps for IntercomType.
var File_mapreduce_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMapReduceRPCServiceServer ¶
func RegisterMapReduceRPCServiceServer(s *grpc.Server, srv MapReduceRPCServiceServer)
Types ¶
type AddTaskRequest ¶
type AddTaskRequest struct { Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` // contains filtered or unexported fields }
---------- request + response ----------
func (*AddTaskRequest) Descriptor
deprecated
func (*AddTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddTaskRequest.ProtoReflect.Descriptor instead.
func (*AddTaskRequest) GetTask ¶
func (x *AddTaskRequest) GetTask() *Task
func (*AddTaskRequest) ProtoMessage ¶
func (*AddTaskRequest) ProtoMessage()
func (*AddTaskRequest) ProtoReflect ¶
func (x *AddTaskRequest) ProtoReflect() protoreflect.Message
func (*AddTaskRequest) Reset ¶
func (x *AddTaskRequest) Reset()
func (*AddTaskRequest) String ¶
func (x *AddTaskRequest) String() string
type AddTaskResponse ¶
type AddTaskResponse struct {
// contains filtered or unexported fields
}
func (*AddTaskResponse) Descriptor
deprecated
func (*AddTaskResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddTaskResponse.ProtoReflect.Descriptor instead.
func (*AddTaskResponse) ProtoMessage ¶
func (*AddTaskResponse) ProtoMessage()
func (*AddTaskResponse) ProtoReflect ¶
func (x *AddTaskResponse) ProtoReflect() protoreflect.Message
func (*AddTaskResponse) Reset ¶
func (x *AddTaskResponse) Reset()
func (*AddTaskResponse) String ¶
func (x *AddTaskResponse) String() string
type IntercomRequest ¶
type IntercomRequest struct { MsgType IntercomType `` /* 132-byte string literal not displayed */ MsgContent string `protobuf:"bytes,2,opt,name=MsgContent,proto3" json:"MsgContent,omitempty"` Extra string `protobuf:"bytes,3,opt,name=Extra,proto3" json:"Extra,omitempty"` // contains filtered or unexported fields }
func (*IntercomRequest) Descriptor
deprecated
func (*IntercomRequest) Descriptor() ([]byte, []int)
Deprecated: Use IntercomRequest.ProtoReflect.Descriptor instead.
func (*IntercomRequest) GetExtra ¶
func (x *IntercomRequest) GetExtra() string
func (*IntercomRequest) GetMsgContent ¶
func (x *IntercomRequest) GetMsgContent() string
func (*IntercomRequest) GetMsgType ¶
func (x *IntercomRequest) GetMsgType() IntercomType
func (*IntercomRequest) ProtoMessage ¶
func (*IntercomRequest) ProtoMessage()
func (*IntercomRequest) ProtoReflect ¶
func (x *IntercomRequest) ProtoReflect() protoreflect.Message
func (*IntercomRequest) Reset ¶
func (x *IntercomRequest) Reset()
func (*IntercomRequest) String ¶
func (x *IntercomRequest) String() string
type IntercomResponse ¶
type IntercomResponse struct { TaskType TaskType `` /* 130-byte string literal not displayed */ File string `protobuf:"bytes,2,opt,name=File,proto3" json:"File,omitempty"` NReduce int32 `protobuf:"varint,3,opt,name=NReduce,proto3" json:"NReduce,omitempty"` MapTaskAttached int32 `protobuf:"varint,4,opt,name=MapTaskAttached,proto3" json:"MapTaskAttached,omitempty"` ReduceTaskAttached int32 `protobuf:"varint,5,opt,name=ReduceTaskAttached,proto3" json:"ReduceTaskAttached,omitempty"` ReduceFiles []string `protobuf:"bytes,6,rep,name=ReduceFiles,proto3" json:"ReduceFiles,omitempty"` // contains filtered or unexported fields }
func (*IntercomResponse) Descriptor
deprecated
func (*IntercomResponse) Descriptor() ([]byte, []int)
Deprecated: Use IntercomResponse.ProtoReflect.Descriptor instead.
func (*IntercomResponse) GetFile ¶
func (x *IntercomResponse) GetFile() string
func (*IntercomResponse) GetMapTaskAttached ¶
func (x *IntercomResponse) GetMapTaskAttached() int32
func (*IntercomResponse) GetNReduce ¶
func (x *IntercomResponse) GetNReduce() int32
func (*IntercomResponse) GetReduceFiles ¶
func (x *IntercomResponse) GetReduceFiles() []string
func (*IntercomResponse) GetReduceTaskAttached ¶
func (x *IntercomResponse) GetReduceTaskAttached() int32
func (*IntercomResponse) GetTaskType ¶
func (x *IntercomResponse) GetTaskType() TaskType
func (*IntercomResponse) ProtoMessage ¶
func (*IntercomResponse) ProtoMessage()
func (*IntercomResponse) ProtoReflect ¶
func (x *IntercomResponse) ProtoReflect() protoreflect.Message
func (*IntercomResponse) Reset ¶
func (x *IntercomResponse) Reset()
func (*IntercomResponse) String ¶
func (x *IntercomResponse) String() string
type IntercomType ¶
type IntercomType int32
const ( IntercomType_INTERCOM_TYPE_ASK_TASK IntercomType = 0 IntercomType_INTERCOM_TYPE_FINISH_MAP_TASK IntercomType = 1 IntercomType_INTERCOM_TYPE_FINISH_REDUCE_TASK IntercomType = 2 IntercomType_INTERCOM_TYPE_SEND_INTER_FILE IntercomType = 3 )
func (IntercomType) Descriptor ¶
func (IntercomType) Descriptor() protoreflect.EnumDescriptor
func (IntercomType) Enum ¶
func (x IntercomType) Enum() *IntercomType
func (IntercomType) EnumDescriptor
deprecated
func (IntercomType) EnumDescriptor() ([]byte, []int)
Deprecated: Use IntercomType.Descriptor instead.
func (IntercomType) Number ¶
func (x IntercomType) Number() protoreflect.EnumNumber
func (IntercomType) String ¶
func (x IntercomType) String() string
func (IntercomType) Type ¶
func (IntercomType) Type() protoreflect.EnumType
type ListWorkersRequest ¶
type ListWorkersRequest struct {
// contains filtered or unexported fields
}
func (*ListWorkersRequest) Descriptor
deprecated
func (*ListWorkersRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListWorkersRequest.ProtoReflect.Descriptor instead.
func (*ListWorkersRequest) ProtoMessage ¶
func (*ListWorkersRequest) ProtoMessage()
func (*ListWorkersRequest) ProtoReflect ¶
func (x *ListWorkersRequest) ProtoReflect() protoreflect.Message
func (*ListWorkersRequest) Reset ¶
func (x *ListWorkersRequest) Reset()
func (*ListWorkersRequest) String ¶
func (x *ListWorkersRequest) String() string
type ListWorkersResponse ¶
type ListWorkersResponse struct { Workers []*Worker `protobuf:"bytes,1,rep,name=workers,proto3" json:"workers,omitempty"` // contains filtered or unexported fields }
func (*ListWorkersResponse) Descriptor
deprecated
func (*ListWorkersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListWorkersResponse.ProtoReflect.Descriptor instead.
func (*ListWorkersResponse) GetWorkers ¶
func (x *ListWorkersResponse) GetWorkers() []*Worker
func (*ListWorkersResponse) ProtoMessage ¶
func (*ListWorkersResponse) ProtoMessage()
func (*ListWorkersResponse) ProtoReflect ¶
func (x *ListWorkersResponse) ProtoReflect() protoreflect.Message
func (*ListWorkersResponse) Reset ¶
func (x *ListWorkersResponse) Reset()
func (*ListWorkersResponse) String ¶
func (x *ListWorkersResponse) String() string
type MapReduceRPCServiceClient ¶
type MapReduceRPCServiceClient interface { AddTask(ctx context.Context, in *AddTaskRequest, opts ...grpc.CallOption) (*AddTaskResponse, error) ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) Intercom(ctx context.Context, in *IntercomRequest, opts ...grpc.CallOption) (*IntercomResponse, error) }
MapReduceRPCServiceClient is the client API for MapReduceRPCService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMapReduceRPCServiceClient ¶
func NewMapReduceRPCServiceClient(cc grpc.ClientConnInterface) MapReduceRPCServiceClient
type MapReduceRPCServiceServer ¶
type MapReduceRPCServiceServer interface { AddTask(context.Context, *AddTaskRequest) (*AddTaskResponse, error) ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) Intercom(context.Context, *IntercomRequest) (*IntercomResponse, error) }
MapReduceRPCServiceServer is the server API for MapReduceRPCService service.
type Task ¶
type Task struct { Inputs []string `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` // contains filtered or unexported fields }
func (*Task) Descriptor
deprecated
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
type TaskStatus ¶
type TaskStatus int32
const ( TaskStatus_TASK_STATUS_UNATTACHED TaskStatus = 0 TaskStatus_TASK_STATUS_ATTACHED TaskStatus = 1 TaskStatus_TASK_STATUS_ONDOING TaskStatus = 2 TaskStatus_TASK_STATUS_DONE TaskStatus = 3 )
func (TaskStatus) Descriptor ¶
func (TaskStatus) Descriptor() protoreflect.EnumDescriptor
func (TaskStatus) Enum ¶
func (x TaskStatus) Enum() *TaskStatus
func (TaskStatus) EnumDescriptor
deprecated
func (TaskStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use TaskStatus.Descriptor instead.
func (TaskStatus) Number ¶
func (x TaskStatus) Number() protoreflect.EnumNumber
func (TaskStatus) String ¶
func (x TaskStatus) String() string
func (TaskStatus) Type ¶
func (TaskStatus) Type() protoreflect.EnumType
type TaskType ¶
type TaskType int32
func (TaskType) Descriptor ¶
func (TaskType) Descriptor() protoreflect.EnumDescriptor
func (TaskType) EnumDescriptor
deprecated
func (TaskType) Number ¶
func (x TaskType) Number() protoreflect.EnumNumber
func (TaskType) Type ¶
func (TaskType) Type() protoreflect.EnumType
type UnimplementedMapReduceRPCServiceServer ¶
type UnimplementedMapReduceRPCServiceServer struct { }
UnimplementedMapReduceRPCServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedMapReduceRPCServiceServer) AddTask ¶
func (*UnimplementedMapReduceRPCServiceServer) AddTask(context.Context, *AddTaskRequest) (*AddTaskResponse, error)
func (*UnimplementedMapReduceRPCServiceServer) Intercom ¶
func (*UnimplementedMapReduceRPCServiceServer) Intercom(context.Context, *IntercomRequest) (*IntercomResponse, error)
func (*UnimplementedMapReduceRPCServiceServer) ListWorkers ¶
func (*UnimplementedMapReduceRPCServiceServer) ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error)
type Worker ¶
type Worker struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Status WorkerStatus `` /* 130-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Worker) Descriptor
deprecated
func (*Worker) GetStatus ¶
func (x *Worker) GetStatus() WorkerStatus
func (*Worker) ProtoMessage ¶
func (*Worker) ProtoMessage()
func (*Worker) ProtoReflect ¶
func (x *Worker) ProtoReflect() protoreflect.Message
type WorkerStatus ¶
type WorkerStatus int32
const ( WorkerStatus_WORKER_STATUS_ONLINE WorkerStatus = 0 WorkerStatus_WORKER_STATUS_OFFLINE WorkerStatus = 1 WorkerStatus_WORKER_STATUS_READY WorkerStatus = 2 WorkerStatus_WORKER_STATUS_BUSY WorkerStatus = 3 WorkerStatus_WORKER_STATUS_UNAVAILABLE WorkerStatus = 4 )
func (WorkerStatus) Descriptor ¶
func (WorkerStatus) Descriptor() protoreflect.EnumDescriptor
func (WorkerStatus) Enum ¶
func (x WorkerStatus) Enum() *WorkerStatus
func (WorkerStatus) EnumDescriptor
deprecated
func (WorkerStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use WorkerStatus.Descriptor instead.
func (WorkerStatus) Number ¶
func (x WorkerStatus) Number() protoreflect.EnumNumber
func (WorkerStatus) String ¶
func (x WorkerStatus) String() string
func (WorkerStatus) Type ¶
func (WorkerStatus) Type() protoreflect.EnumType