Documentation ¶
Index ¶
- Variables
- func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)
- func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
- type Empty
- type IMDInfo
- type IMDLoc
- type JSONKVs
- type KV
- type MapFileInfo
- func (*MapFileInfo) Descriptor() ([]byte, []int)deprecated
- func (x *MapFileInfo) GetFileName() string
- func (x *MapFileInfo) GetFrom() int64
- func (x *MapFileInfo) GetTo() int64
- func (*MapFileInfo) ProtoMessage()
- func (x *MapFileInfo) ProtoReflect() protoreflect.Message
- func (x *MapFileInfo) Reset()
- func (x *MapFileInfo) String() string
- type MapInfo
- type MasterClient
- type MasterServer
- type ReduceFileInfo
- func (*ReduceFileInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ReduceFileInfo) GetFilename() string
- func (x *ReduceFileInfo) GetIp() string
- func (*ReduceFileInfo) ProtoMessage()
- func (x *ReduceFileInfo) ProtoReflect() protoreflect.Message
- func (x *ReduceFileInfo) Reset()
- func (x *ReduceFileInfo) String() string
- type ReduceInfo
- type RegisterResult
- func (*RegisterResult) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterResult) GetId() int64
- func (x *RegisterResult) GetResult() bool
- func (*RegisterResult) ProtoMessage()
- func (x *RegisterResult) ProtoReflect() protoreflect.Message
- func (x *RegisterResult) Reset()
- func (x *RegisterResult) String() string
- type Result
- type UnimplementedMasterServer
- type UnimplementedWorkerServer
- func (UnimplementedWorkerServer) End(context.Context, *Empty) (*Empty, error)
- func (UnimplementedWorkerServer) GetIMDData(context.Context, *IMDLoc) (*JSONKVs, error)
- func (UnimplementedWorkerServer) Health(context.Context, *Empty) (*WorkerState, error)
- func (UnimplementedWorkerServer) Map(context.Context, *MapInfo) (*Result, error)
- func (UnimplementedWorkerServer) Reduce(context.Context, *ReduceInfo) (*Result, error)
- type UnsafeMasterServer
- type UnsafeWorkerServer
- type UpdateResult
- type WorkerClient
- type WorkerInfo
- type WorkerServer
- type WorkerState
- type WorkerState_State
- func (WorkerState_State) Descriptor() protoreflect.EnumDescriptor
- func (x WorkerState_State) Enum() *WorkerState_State
- func (WorkerState_State) EnumDescriptor() ([]byte, []int)deprecated
- func (x WorkerState_State) Number() protoreflect.EnumNumber
- func (x WorkerState_State) String() string
- func (WorkerState_State) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( WorkerState_State_name = map[int32]string{ 0: "IDLE", 1: "BUSY", } WorkerState_State_value = map[string]int32{ "IDLE": 0, "BUSY": 1, } )
Enum value maps for WorkerState_State.
var File_rpc_master_proto protoreflect.FileDescriptor
var File_rpc_worker_proto protoreflect.FileDescriptor
var Master_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Master", HandlerType: (*MasterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "WorkerRegister", Handler: _Master_WorkerRegister_Handler, }, { MethodName: "UpdateIMDInfo", Handler: _Master_UpdateIMDInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc/master.proto", }
Master_ServiceDesc is the grpc.ServiceDesc for Master service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Worker_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Worker", HandlerType: (*WorkerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Map", Handler: _Worker_Map_Handler, }, { MethodName: "Reduce", Handler: _Worker_Reduce_Handler, }, { MethodName: "GetIMDData", Handler: _Worker_GetIMDData_Handler, }, { MethodName: "End", Handler: _Worker_End_Handler, }, { MethodName: "Health", Handler: _Worker_Health_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc/worker.proto", }
Worker_ServiceDesc is the grpc.ServiceDesc for Worker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMasterServer ¶
func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)
func RegisterWorkerServer ¶
func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
Types ¶
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type IMDInfo ¶
type IMDInfo struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` Filenames []string `protobuf:"bytes,2,rep,name=filenames,proto3" json:"filenames,omitempty"` // contains filtered or unexported fields }
func (*IMDInfo) Descriptor
deprecated
func (*IMDInfo) GetFilenames ¶
func (*IMDInfo) ProtoMessage ¶
func (*IMDInfo) ProtoMessage()
func (*IMDInfo) ProtoReflect ¶
func (x *IMDInfo) ProtoReflect() protoreflect.Message
type IMDLoc ¶
type IMDLoc struct { Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // contains filtered or unexported fields }
func (*IMDLoc) Descriptor
deprecated
func (*IMDLoc) GetFilename ¶
func (*IMDLoc) ProtoMessage ¶
func (*IMDLoc) ProtoMessage()
func (*IMDLoc) ProtoReflect ¶
func (x *IMDLoc) ProtoReflect() protoreflect.Message
type JSONKVs ¶ added in v1.0.0
type JSONKVs struct { Kvs string `protobuf:"bytes,1,opt,name=kvs,proto3" json:"kvs,omitempty"` // contains filtered or unexported fields }
func (*JSONKVs) Descriptor
deprecated
added in
v1.0.0
func (*JSONKVs) ProtoMessage ¶ added in v1.0.0
func (*JSONKVs) ProtoMessage()
func (*JSONKVs) ProtoReflect ¶ added in v1.0.0
func (x *JSONKVs) ProtoReflect() protoreflect.Message
type KV ¶
type KV struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*KV) Descriptor
deprecated
func (*KV) ProtoMessage ¶
func (*KV) ProtoMessage()
func (*KV) ProtoReflect ¶
func (x *KV) ProtoReflect() protoreflect.Message
type MapFileInfo ¶
type MapFileInfo struct { FileName string `protobuf:"bytes,1,opt,name=FileName,proto3" json:"FileName,omitempty"` From int64 `protobuf:"varint,2,opt,name=From,proto3" json:"From,omitempty"` To int64 `protobuf:"varint,3,opt,name=To,proto3" json:"To,omitempty"` // contains filtered or unexported fields }
func (*MapFileInfo) Descriptor
deprecated
func (*MapFileInfo) Descriptor() ([]byte, []int)
Deprecated: Use MapFileInfo.ProtoReflect.Descriptor instead.
func (*MapFileInfo) GetFileName ¶
func (x *MapFileInfo) GetFileName() string
func (*MapFileInfo) GetFrom ¶
func (x *MapFileInfo) GetFrom() int64
func (*MapFileInfo) GetTo ¶
func (x *MapFileInfo) GetTo() int64
func (*MapFileInfo) ProtoMessage ¶
func (*MapFileInfo) ProtoMessage()
func (*MapFileInfo) ProtoReflect ¶
func (x *MapFileInfo) ProtoReflect() protoreflect.Message
func (*MapFileInfo) Reset ¶
func (x *MapFileInfo) Reset()
func (*MapFileInfo) String ¶
func (x *MapFileInfo) String() string
type MapInfo ¶
type MapInfo struct { Files []*MapFileInfo `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` // contains filtered or unexported fields }
func (*MapInfo) Descriptor
deprecated
func (*MapInfo) GetFiles ¶
func (x *MapInfo) GetFiles() []*MapFileInfo
func (*MapInfo) ProtoMessage ¶
func (*MapInfo) ProtoMessage()
func (*MapInfo) ProtoReflect ¶
func (x *MapInfo) ProtoReflect() protoreflect.Message
type MasterClient ¶
type MasterClient interface { WorkerRegister(ctx context.Context, in *WorkerInfo, opts ...grpc.CallOption) (*RegisterResult, error) // IMD = InterMeDiate UpdateIMDInfo(ctx context.Context, in *IMDInfo, opts ...grpc.CallOption) (*UpdateResult, error) }
MasterClient is the client API for Master service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewMasterClient ¶
func NewMasterClient(cc grpc.ClientConnInterface) MasterClient
type MasterServer ¶
type MasterServer interface { WorkerRegister(context.Context, *WorkerInfo) (*RegisterResult, error) // IMD = InterMeDiate UpdateIMDInfo(context.Context, *IMDInfo) (*UpdateResult, error) // contains filtered or unexported methods }
MasterServer is the server API for Master service. All implementations must embed UnimplementedMasterServer for forward compatibility
type ReduceFileInfo ¶
type ReduceFileInfo struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` // contains filtered or unexported fields }
func (*ReduceFileInfo) Descriptor
deprecated
func (*ReduceFileInfo) Descriptor() ([]byte, []int)
Deprecated: Use ReduceFileInfo.ProtoReflect.Descriptor instead.
func (*ReduceFileInfo) GetFilename ¶
func (x *ReduceFileInfo) GetFilename() string
func (*ReduceFileInfo) GetIp ¶
func (x *ReduceFileInfo) GetIp() string
func (*ReduceFileInfo) ProtoMessage ¶
func (*ReduceFileInfo) ProtoMessage()
func (*ReduceFileInfo) ProtoReflect ¶
func (x *ReduceFileInfo) ProtoReflect() protoreflect.Message
func (*ReduceFileInfo) Reset ¶
func (x *ReduceFileInfo) Reset()
func (*ReduceFileInfo) String ¶
func (x *ReduceFileInfo) String() string
type ReduceInfo ¶
type ReduceInfo struct { Files []*ReduceFileInfo `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` // contains filtered or unexported fields }
func (*ReduceInfo) Descriptor
deprecated
func (*ReduceInfo) Descriptor() ([]byte, []int)
Deprecated: Use ReduceInfo.ProtoReflect.Descriptor instead.
func (*ReduceInfo) GetFiles ¶
func (x *ReduceInfo) GetFiles() []*ReduceFileInfo
func (*ReduceInfo) ProtoMessage ¶
func (*ReduceInfo) ProtoMessage()
func (*ReduceInfo) ProtoReflect ¶
func (x *ReduceInfo) ProtoReflect() protoreflect.Message
func (*ReduceInfo) Reset ¶
func (x *ReduceInfo) Reset()
func (*ReduceInfo) String ¶
func (x *ReduceInfo) String() string
type RegisterResult ¶
type RegisterResult struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*RegisterResult) Descriptor
deprecated
func (*RegisterResult) Descriptor() ([]byte, []int)
Deprecated: Use RegisterResult.ProtoReflect.Descriptor instead.
func (*RegisterResult) GetId ¶
func (x *RegisterResult) GetId() int64
func (*RegisterResult) GetResult ¶
func (x *RegisterResult) GetResult() bool
func (*RegisterResult) ProtoMessage ¶
func (*RegisterResult) ProtoMessage()
func (*RegisterResult) ProtoReflect ¶
func (x *RegisterResult) ProtoReflect() protoreflect.Message
func (*RegisterResult) Reset ¶
func (x *RegisterResult) Reset()
func (*RegisterResult) String ¶
func (x *RegisterResult) String() string
type Result ¶
type Result struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` Result bool `protobuf:"varint,2,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*Result) Descriptor
deprecated
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type UnimplementedMasterServer ¶
type UnimplementedMasterServer struct { }
UnimplementedMasterServer must be embedded to have forward compatible implementations.
func (UnimplementedMasterServer) UpdateIMDInfo ¶
func (UnimplementedMasterServer) UpdateIMDInfo(context.Context, *IMDInfo) (*UpdateResult, error)
func (UnimplementedMasterServer) WorkerRegister ¶
func (UnimplementedMasterServer) WorkerRegister(context.Context, *WorkerInfo) (*RegisterResult, error)
type UnimplementedWorkerServer ¶
type UnimplementedWorkerServer struct { }
UnimplementedWorkerServer must be embedded to have forward compatible implementations.
func (UnimplementedWorkerServer) GetIMDData ¶
func (UnimplementedWorkerServer) Health ¶ added in v1.0.0
func (UnimplementedWorkerServer) Health(context.Context, *Empty) (*WorkerState, error)
func (UnimplementedWorkerServer) Reduce ¶
func (UnimplementedWorkerServer) Reduce(context.Context, *ReduceInfo) (*Result, error)
type UnsafeMasterServer ¶
type UnsafeMasterServer interface {
// contains filtered or unexported methods
}
UnsafeMasterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MasterServer will result in compilation errors.
type UnsafeWorkerServer ¶
type UnsafeWorkerServer interface {
// contains filtered or unexported methods
}
UnsafeWorkerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkerServer will result in compilation errors.
type UpdateResult ¶
type UpdateResult struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*UpdateResult) Descriptor
deprecated
func (*UpdateResult) Descriptor() ([]byte, []int)
Deprecated: Use UpdateResult.ProtoReflect.Descriptor instead.
func (*UpdateResult) GetResult ¶
func (x *UpdateResult) GetResult() bool
func (*UpdateResult) ProtoMessage ¶
func (*UpdateResult) ProtoMessage()
func (*UpdateResult) ProtoReflect ¶
func (x *UpdateResult) ProtoReflect() protoreflect.Message
func (*UpdateResult) Reset ¶
func (x *UpdateResult) Reset()
func (*UpdateResult) String ¶
func (x *UpdateResult) String() string
type WorkerClient ¶
type WorkerClient interface { Map(ctx context.Context, in *MapInfo, opts ...grpc.CallOption) (*Result, error) Reduce(ctx context.Context, in *ReduceInfo, opts ...grpc.CallOption) (*Result, error) // IMD = InterMeDiate GetIMDData(ctx context.Context, in *IMDLoc, opts ...grpc.CallOption) (*JSONKVs, error) // rpc HealthCheck (IMDInfo) returns (UpdateResult); End(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) Health(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*WorkerState, error) }
WorkerClient is the client API for Worker service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewWorkerClient ¶
func NewWorkerClient(cc grpc.ClientConnInterface) WorkerClient
type WorkerInfo ¶
type WorkerInfo struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
func (*WorkerInfo) Descriptor
deprecated
func (*WorkerInfo) Descriptor() ([]byte, []int)
Deprecated: Use WorkerInfo.ProtoReflect.Descriptor instead.
func (*WorkerInfo) GetIp ¶
func (x *WorkerInfo) GetIp() string
func (*WorkerInfo) GetUuid ¶
func (x *WorkerInfo) GetUuid() string
func (*WorkerInfo) ProtoMessage ¶
func (*WorkerInfo) ProtoMessage()
func (*WorkerInfo) ProtoReflect ¶
func (x *WorkerInfo) ProtoReflect() protoreflect.Message
func (*WorkerInfo) Reset ¶
func (x *WorkerInfo) Reset()
func (*WorkerInfo) String ¶
func (x *WorkerInfo) String() string
type WorkerServer ¶
type WorkerServer interface { Map(context.Context, *MapInfo) (*Result, error) Reduce(context.Context, *ReduceInfo) (*Result, error) // IMD = InterMeDiate GetIMDData(context.Context, *IMDLoc) (*JSONKVs, error) // rpc HealthCheck (IMDInfo) returns (UpdateResult); End(context.Context, *Empty) (*Empty, error) Health(context.Context, *Empty) (*WorkerState, error) // contains filtered or unexported methods }
WorkerServer is the server API for Worker service. All implementations must embed UnimplementedWorkerServer for forward compatibility
type WorkerState ¶ added in v1.0.0
type WorkerState struct { State WorkerState_State `protobuf:"varint,1,opt,name=state,proto3,enum=WorkerState_State" json:"state,omitempty"` // contains filtered or unexported fields }
func (*WorkerState) Descriptor
deprecated
added in
v1.0.0
func (*WorkerState) Descriptor() ([]byte, []int)
Deprecated: Use WorkerState.ProtoReflect.Descriptor instead.
func (*WorkerState) GetState ¶ added in v1.0.0
func (x *WorkerState) GetState() WorkerState_State
func (*WorkerState) ProtoMessage ¶ added in v1.0.0
func (*WorkerState) ProtoMessage()
func (*WorkerState) ProtoReflect ¶ added in v1.0.0
func (x *WorkerState) ProtoReflect() protoreflect.Message
func (*WorkerState) Reset ¶ added in v1.0.0
func (x *WorkerState) Reset()
func (*WorkerState) String ¶ added in v1.0.0
func (x *WorkerState) String() string
type WorkerState_State ¶ added in v1.0.0
type WorkerState_State int32
const ( WorkerState_IDLE WorkerState_State = 0 WorkerState_BUSY WorkerState_State = 1 )
func (WorkerState_State) Descriptor ¶ added in v1.0.0
func (WorkerState_State) Descriptor() protoreflect.EnumDescriptor
func (WorkerState_State) Enum ¶ added in v1.0.0
func (x WorkerState_State) Enum() *WorkerState_State
func (WorkerState_State) EnumDescriptor
deprecated
added in
v1.0.0
func (WorkerState_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use WorkerState_State.Descriptor instead.
func (WorkerState_State) Number ¶ added in v1.0.0
func (x WorkerState_State) Number() protoreflect.EnumNumber
func (WorkerState_State) String ¶ added in v1.0.0
func (x WorkerState_State) String() string
func (WorkerState_State) Type ¶ added in v1.0.0
func (WorkerState_State) Type() protoreflect.EnumType