MCPcopy Create free account
hub / github.com/BWbwchen/MapReduce / startSingleMachineWorker

Function startSingleMachineWorker

util.go:68–88  ·  view source on GitHub ↗
(plugin string, nWorker int, nReducer int, storeInRAM bool)

Source from the content-addressed store, hash-verified

66}
67
68func startSingleMachineWorker(plugin string, nWorker int, nReducer int, storeInRAM bool) {
69 if nWorker < nReducer {
70 panic("Need more worker!")
71 }
72
73 pluginFile, _ := filepath.Abs(plugin)
74
75 var wg sync.WaitGroup
76 worker.Init(MasterIP)
77
78 // Start Worker
79 for i := 0; i < nWorker; i++ {
80 wg.Add(1)
81 go func(i0 int) {
82 worker.StartWorker(pluginFile, nReducer, fmt.Sprintf(":1000%v", i0+1), storeInRAM)
83 wg.Done()
84 }(i)
85 }
86
87 wg.Wait()
88}
89
90func startMaster(input []string, nWorker int, nReducer int) {
91 inputFiles := []string{}

Callers 1

singleMachineJobFunction · 0.85

Calls 2

InitFunction · 0.92
StartWorkerFunction · 0.92

Tested by

no test coverage detected