Documentation
¶
Index ¶
- Constants
- func CallExample()
- func CallTaskDone(taskInfo *TaskInfo)
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ByKey
- type ExampleArgs
- type ExampleReply
- type KeyValue
- type MapTaskStat
- type Master
- type ReduceTaskStat
- type TaskInfo
- type TaskStat
- type TaskStatInterface
- type TaskStatQueue
- func (this *TaskStatQueue) Lock()
- func (this *TaskStatQueue) MoveAppend(rhs []TaskStatInterface)
- func (this *TaskStatQueue) Pop() TaskStatInterface
- func (this *TaskStatQueue) Push(taskStat TaskStatInterface)
- func (this *TaskStatQueue) RemoveTask(fileIndex int, partIndex int)
- func (this *TaskStatQueue) Size() int
- func (this *TaskStatQueue) TimeOutQueue() []TaskStatInterface
- func (this *TaskStatQueue) Unlock()
- type TryMapArgs
- type TryMapReply
Constants ¶
View Source
const ( TaskMap = 0 TaskReduce = 1 TaskWait = 2 TaskEnd = 3 )
Variables ¶
This section is empty.
Functions ¶
func CallExample ¶
func CallExample()
example function to show how to make an RPC call to the master.
the RPC argument and reply types are defined in rpc.go.
func CallTaskDone ¶
func CallTaskDone(taskInfo *TaskInfo)
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type MapTaskStat ¶
type MapTaskStat struct {
TaskStat
}
func (*MapTaskStat) GenerateTaskInfo ¶
func (this *MapTaskStat) GenerateTaskInfo() TaskInfo
type Master ¶
type Master struct {
// contains filtered or unexported fields
}
func MakeMaster ¶
create a Master. main/mrmaster.go calls this function. nReduce is the number of reduce tasks to use.
func (*Master) Done ¶
main/mrmaster.go calls Done() periodically to find out if the entire job has finished.
func (*Master) Example ¶
func (m *Master) Example(args *ExampleArgs, reply *ExampleReply) error
an example RPC handler.
the RPC argument and reply types are defined in rpc.go.
type ReduceTaskStat ¶
type ReduceTaskStat struct {
TaskStat
}
func (*ReduceTaskStat) GenerateTaskInfo ¶
func (this *ReduceTaskStat) GenerateTaskInfo() TaskInfo
type TaskInfo ¶
type TaskInfo struct {
State int
FileName string
FileIndex int
PartIndex int
NReduce int
NFiles int
}
func CallAskTask ¶
func CallAskTask() *TaskInfo
type TaskStat ¶
type TaskStat struct {
// contains filtered or unexported fields
}
func (*TaskStat) GetFileIndex ¶
func (*TaskStat) GetPartIndex ¶
type TaskStatInterface ¶
type TaskStatQueue ¶
type TaskStatQueue struct {
// contains filtered or unexported fields
}
func (*TaskStatQueue) Lock ¶
func (this *TaskStatQueue) Lock()
func (*TaskStatQueue) MoveAppend ¶
func (this *TaskStatQueue) MoveAppend(rhs []TaskStatInterface)
func (*TaskStatQueue) Pop ¶
func (this *TaskStatQueue) Pop() TaskStatInterface
func (*TaskStatQueue) Push ¶
func (this *TaskStatQueue) Push(taskStat TaskStatInterface)
func (*TaskStatQueue) RemoveTask ¶
func (this *TaskStatQueue) RemoveTask(fileIndex int, partIndex int)
func (*TaskStatQueue) Size ¶
func (this *TaskStatQueue) Size() int
func (*TaskStatQueue) TimeOutQueue ¶
func (this *TaskStatQueue) TimeOutQueue() []TaskStatInterface
func (*TaskStatQueue) Unlock ¶
func (this *TaskStatQueue) Unlock()
type TryMapArgs ¶
type TryMapArgs struct {
}
type TryMapReply ¶
type TryMapReply struct {
// if should not run map, so should run reduce
RunMap bool
}
Click to show internal directories.
Click to hide internal directories.