Documentation
¶
Index ¶
- func AssignIdleMapTasksToAvailableWorkers(masterState *MasterState, rpcGateway rpc.RpcGateway)
- func AssignIdleReduceTasksToAvailableWorkers(masterState *MasterState, rpcGateway rpc.RpcGateway)
- func UpdateWorkerTasksFromHeartbeats(state *MasterState, rpcGateway rpc.RpcGateway)
- type MapTask
- type MasterState
- func (state *MasterState) AssignMapTaskToWorker(mapTaskId uint16, workerId WorkerId)
- func (state *MasterState) AssignReduceTaskToWorker(reduceTaskId uint16, workerId WorkerId)
- func (state *MasterState) ChangeWorkerOnlineStatus(workerId WorkerId, status WorkerStatus)
- func (state *MasterState) ChangeWorkerWithMapTaskToOnline(workerId WorkerId, mapTaskId uint16, intermediateFiles []rpc.IntermediateFile, ...)
- func (state *MasterState) ChangeWorkerWithReduceTaskToOnline(workerId WorkerId, reduceTaskId uint16, outputFileLocation string, ...)
- func (state *MasterState) GetReduceTaskById(reduceTaskId uint16) *ReduceTask
- type ReduceTask
- type Request
- type Worker
- type WorkerId
- type WorkerServer
- func (workerServer *WorkerServer) AbortReduceTask(args rpc.AbortReduceTaskArgs, reply *rpc.AbortReduceTaskReply) error
- func (workerServer *WorkerServer) EnqueueAbortReduceTaskReply(reply rpc.AbortReduceTaskReply)
- func (workerServer *WorkerServer) EnqueueGetHeartbeatReply(reply rpc.GetHeartBeatReply)
- func (workerServer *WorkerServer) EnqueueStartMapTask(reply rpc.StartMapTaskReply)
- func (workerServer *WorkerServer) EnqueueStartReduceTask(reply rpc.StartReduceTaskReply)
- func (workerServer *WorkerServer) GetHeartbeat(args rpc.GetHeartBeatArgs, reply *rpc.GetHeartBeatReply) error
- func (workerServer *WorkerServer) StartMapTask(args rpc.StartMapTaskArgs, reply *rpc.StartMapTaskReply) error
- func (workerServer *WorkerServer) StartReduceTask(args rpc.StartReduceTaskArgs, reply *rpc.StartReduceTaskReply) error
- func (mockWorkerServer *WorkerServer) StartServer()
- func (mockWorkerServer *WorkerServer) StopServer()
- func (workerServer *WorkerServer) TakeRequest() Request
- type WorkerStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignIdleMapTasksToAvailableWorkers ¶
func AssignIdleMapTasksToAvailableWorkers(masterState *MasterState, rpcGateway rpc.RpcGateway)
func AssignIdleReduceTasksToAvailableWorkers ¶
func AssignIdleReduceTasksToAvailableWorkers(masterState *MasterState, rpcGateway rpc.RpcGateway)
func UpdateWorkerTasksFromHeartbeats ¶
func UpdateWorkerTasksFromHeartbeats(state *MasterState, rpcGateway rpc.RpcGateway)
Types ¶
type MapTask ¶
type MapTask struct { Id uint16 Status rpc.TaskStatus InputFileSplitLocation string IntermediateFiles []rpc.IntermediateFile WorkerAssignedId *WorkerId }
type MasterState ¶
type MasterState struct { Workers []Worker MapTasks []MapTask ReduceTasks []ReduceTask // contains filtered or unexported fields }
func (*MasterState) AssignMapTaskToWorker ¶
func (state *MasterState) AssignMapTaskToWorker(mapTaskId uint16, workerId WorkerId)
func (*MasterState) AssignReduceTaskToWorker ¶
func (state *MasterState) AssignReduceTaskToWorker(reduceTaskId uint16, workerId WorkerId)
func (*MasterState) ChangeWorkerOnlineStatus ¶
func (state *MasterState) ChangeWorkerOnlineStatus(workerId WorkerId, status WorkerStatus)
func (*MasterState) ChangeWorkerWithMapTaskToOnline ¶
func (state *MasterState) ChangeWorkerWithMapTaskToOnline( workerId WorkerId, mapTaskId uint16, intermediateFiles []rpc.IntermediateFile, mapTaskStatus rpc.TaskStatus, )
func (*MasterState) ChangeWorkerWithReduceTaskToOnline ¶
func (state *MasterState) ChangeWorkerWithReduceTaskToOnline( workerId WorkerId, reduceTaskId uint16, outputFileLocation string, reduceTaskStatus rpc.TaskStatus, )
func (*MasterState) GetReduceTaskById ¶
func (state *MasterState) GetReduceTaskById(reduceTaskId uint16) *ReduceTask
type ReduceTask ¶
type WorkerServer ¶
type WorkerServer struct { Hostname string Port uint16 RequestCount int // contains filtered or unexported fields }
func (*WorkerServer) AbortReduceTask ¶
func (workerServer *WorkerServer) AbortReduceTask( args rpc.AbortReduceTaskArgs, reply *rpc.AbortReduceTaskReply, ) error
func (*WorkerServer) EnqueueAbortReduceTaskReply ¶
func (workerServer *WorkerServer) EnqueueAbortReduceTaskReply(reply rpc.AbortReduceTaskReply)
func (*WorkerServer) EnqueueGetHeartbeatReply ¶
func (workerServer *WorkerServer) EnqueueGetHeartbeatReply(reply rpc.GetHeartBeatReply)
func (*WorkerServer) EnqueueStartMapTask ¶
func (workerServer *WorkerServer) EnqueueStartMapTask(reply rpc.StartMapTaskReply)
func (*WorkerServer) EnqueueStartReduceTask ¶
func (workerServer *WorkerServer) EnqueueStartReduceTask(reply rpc.StartReduceTaskReply)
func (*WorkerServer) GetHeartbeat ¶
func (workerServer *WorkerServer) GetHeartbeat( args rpc.GetHeartBeatArgs, reply *rpc.GetHeartBeatReply, ) error
func (*WorkerServer) StartMapTask ¶
func (workerServer *WorkerServer) StartMapTask( args rpc.StartMapTaskArgs, reply *rpc.StartMapTaskReply, ) error
func (*WorkerServer) StartReduceTask ¶
func (workerServer *WorkerServer) StartReduceTask( args rpc.StartReduceTaskArgs, reply *rpc.StartReduceTaskReply, ) error
func (*WorkerServer) StartServer ¶
func (mockWorkerServer *WorkerServer) StartServer()
func (*WorkerServer) StopServer ¶
func (mockWorkerServer *WorkerServer) StopServer()
func (*WorkerServer) TakeRequest ¶
func (workerServer *WorkerServer) TakeRequest() Request
type WorkerStatus ¶
type WorkerStatus uint8
const ( Online WorkerStatus = 0 Offline WorkerStatus = 1 )
Click to show internal directories.
Click to hide internal directories.