Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comparable ¶
type Comparable interface {
Equals(other Comparable) bool
}
限制队列中的元素类型,需实现equals方法
type ExampleArgs ¶
type ExampleArgs struct {
X int
}
type ExampleReply ¶
type ExampleReply struct {
Y int
}
type KeyValue ¶
Map functions return a slice of KeyValue.
func (KeyValue) MarshalJSON ¶
实现 json.Marshaler 接口 ,使得可以将自定义类型变为JSON
type Master ¶
type Master struct { NFinalmidFiles 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.
产生master的方法,全局只运行一次
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 QueueNorm ¶
type QueueNorm struct {
// contains filtered or unexported fields
}
func (*QueueNorm) FindIndexNormal ¶
查找某个元素的下标(对于普通类型)
Click to show internal directories.
Click to hide internal directories.