forked from mateuszdyminski/gomr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrk.go
30 lines (24 loc) · 745 Bytes
/
wrk.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"flag"
"log"
"github.com/mateuszdyminski/gomr/mapreduce"
)
var (
id = flag.String("id", "1", "Worker id")
host = flag.String("host", "localhost", "Worker host")
rpcPort = flag.Int("rpc-port", 8101, "gRPC port - internode communication")
httpPort = flag.Int("http-port", 8201, "Http port - health check status")
debug = flag.Bool("debug", false, "Whether to run worket with debug mode")
workDir = flag.String("work-dir", "results", "Work directory for intermediate files and result")
)
func main() {
flag.Parse()
wrk, err := mapreduce.NewWorker(*id, *host, *rpcPort, *httpPort, *workDir, *debug)
if err != nil {
log.Fatal(err)
}
if err := wrk.Start(); err != nil {
log.Fatal(err)
}
}