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

Function UpdateIMDInfo

worker/rpcClient.go:40–61  ·  view source on GitHub ↗
(u *rpc.IMDInfo)

Source from the content-addressed store, hash-verified

38}
39
40func UpdateIMDInfo(u *rpc.IMDInfo) bool {
41 conn, err := grpc.Dial(MasterIP, grpc.WithInsecure())
42 if err != nil {
43 log.Panic(err)
44 }
45 defer conn.Close()
46 c := rpc.NewMasterClient(conn)
47
48 ctx, cancel := context.WithTimeout(context.Background(), time.Second)
49 defer cancel()
50
51 r, err := c.UpdateIMDInfo(ctx, u)
52 if err != nil {
53 log.Panic(err)
54 }
55
56 if r.Result == false {
57 log.Panic("Update IMD Info Error")
58 }
59
60 return r.Result
61}
62
63func GetIMDData(ip string, filename string) []KV {
64 conn, err := grpc.Dial(ip, grpc.WithInsecure())

Callers 1

MapMethod · 0.85

Calls 2

UpdateIMDInfoMethod · 0.95
NewMasterClientFunction · 0.92

Tested by

no test coverage detected