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

Function GetIMDData

worker/rpcClient.go:63–86  ·  view source on GitHub ↗
(ip string, filename string)

Source from the content-addressed store, hash-verified

61}
62
63func GetIMDData(ip string, filename string) []KV {
64 conn, err := grpc.Dial(ip, grpc.WithInsecure())
65 if err != nil {
66 panic(err)
67 }
68 defer conn.Close()
69 c := rpc.NewWorkerClient(conn)
70
71 ctx, cancel := context.WithTimeout(context.Background(), time.Second)
72 defer cancel()
73
74 r, err := c.GetIMDData(ctx, &rpc.IMDLoc{
75 Filename: filename,
76 })
77
78 var ret []KV
79
80 err = json.Unmarshal([]byte(r.Kvs), &ret)
81 if err != nil {
82 panic(err)
83 }
84
85 return ret
86}

Callers 1

ReduceMethod · 0.85

Calls 2

GetIMDDataMethod · 0.95
NewWorkerClientFunction · 0.92

Tested by

no test coverage detected