Documentation ¶
Index ¶
- Constants
- func CallExample()
- func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string)
- type ByKey
- type ExampleArgs
- type ExampleReply
- type HeartbeatArgs
- type HeartbeatReply
- type KeyValue
- type MapFinishArgs
- type MapFinishReply
- type MapInputArgs
- type MapInputReply
- type MapState
- type MapTask
- type Master
- func (m *Master) Done() bool
- func (m *Master) Example(args *ExampleArgs, reply *ExampleReply) error
- func (m *Master) GetMapInput(in *MapInputArgs, reply *MapInputReply) error
- func (m *Master) GetReduceInput(in *ReduceInputArgs, reply *ReduceInputReply) error
- func (m *Master) Heartbeat(in *HeartbeatArgs, reply *HeartbeatReply) error
- func (m *Master) MapFinished(in *MapFinishArgs, reply *MapFinishReply) error
- func (m *Master) ReduceFinished(in *ReduceFinishArgs, reply *ReduceFinishReply) error
- type ReduceFinishArgs
- type ReduceFinishReply
- type ReduceInputArgs
- type ReduceInputReply
- type ReduceTask
- type Task
Constants ¶
View Source
const ( STATE_PENDING = 1 + iota STATE_IDLE STATE_COMPLETED )
View Source
const (
HEARTBEAT = 10 * time.Second
)
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.
Types ¶
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type HeartbeatArgs ¶
type HeartbeatReply ¶
type HeartbeatReply struct { }
type MapFinishReply ¶
type MapFinishReply struct { }
type Master ¶
type Master struct { // Your definitions here. NReduce int // 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.
func (*Master) GetMapInput ¶
func (m *Master) GetMapInput(in *MapInputArgs, reply *MapInputReply) error
Your code here -- RPC handlers for the worker to call.
func (*Master) GetReduceInput ¶
func (m *Master) GetReduceInput(in *ReduceInputArgs, reply *ReduceInputReply) error
func (*Master) Heartbeat ¶
func (m *Master) Heartbeat(in *HeartbeatArgs, reply *HeartbeatReply) error
func (*Master) MapFinished ¶
func (m *Master) MapFinished(in *MapFinishArgs, reply *MapFinishReply) error
func (*Master) ReduceFinished ¶
func (m *Master) ReduceFinished(in *ReduceFinishArgs, reply *ReduceFinishReply) error
type ReduceFinishArgs ¶
type ReduceFinishArgs struct {
Id int
}
type ReduceFinishReply ¶
type ReduceFinishReply struct { }
type ReduceInputArgs ¶
type ReduceInputArgs struct { }
type ReduceInputReply ¶
type ReduceTask ¶
type ReduceTask struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.