api

package
v0.0.0-...-26feacf Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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) Enum

func (x IntercomType) Enum() *IntercomType

func (IntercomType) EnumDescriptor deprecated

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

Deprecated: Use IntercomType.Descriptor instead.

func (IntercomType) Number

func (IntercomType) String

func (x IntercomType) String() string

func (IntercomType) Type

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetInputs

func (x *Task) GetInputs() []string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

func (x *Task) ProtoReflect() protoreflect.Message

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

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

type TaskType

type TaskType int32
const (
	TaskType_TASK_TYPE_MAP    TaskType = 0
	TaskType_TASK_TYPE_REDUCE TaskType = 1
)

func (TaskType) Descriptor

func (TaskType) Descriptor() protoreflect.EnumDescriptor

func (TaskType) Enum

func (x TaskType) Enum() *TaskType

func (TaskType) EnumDescriptor deprecated

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

Deprecated: Use TaskType.Descriptor instead.

func (TaskType) Number

func (x TaskType) Number() protoreflect.EnumNumber

func (TaskType) String

func (x TaskType) String() string

func (TaskType) Type

type UnimplementedMapReduceRPCServiceServer

type UnimplementedMapReduceRPCServiceServer struct {
}

UnimplementedMapReduceRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedMapReduceRPCServiceServer) AddTask

func (*UnimplementedMapReduceRPCServiceServer) Intercom

func (*UnimplementedMapReduceRPCServiceServer) ListWorkers

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) Descriptor() ([]byte, []int)

Deprecated: Use Worker.ProtoReflect.Descriptor instead.

func (*Worker) GetId

func (x *Worker) GetId() string

func (*Worker) GetStatus

func (x *Worker) GetStatus() WorkerStatus

func (*Worker) ProtoMessage

func (*Worker) ProtoMessage()

func (*Worker) ProtoReflect

func (x *Worker) ProtoReflect() protoreflect.Message

func (*Worker) Reset

func (x *Worker) Reset()

func (*Worker) String

func (x *Worker) String() string

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

func (x WorkerStatus) Enum() *WorkerStatus

func (WorkerStatus) EnumDescriptor deprecated

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

Deprecated: Use WorkerStatus.Descriptor instead.

func (WorkerStatus) Number

func (WorkerStatus) String

func (x WorkerStatus) String() string

func (WorkerStatus) Type

Jump to

Keyboard shortcuts

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