MCPcopy
hub / github.com/chaozh/MIT-6.824 / Query

Method Query

src/shardctrler/client.go:31–46  ·  view source on GitHub ↗
(num int)

Source from the content-addressed store, hash-verified

29}
30
31func (ck *Clerk) Query(num int) Config {
32 args := &QueryArgs{}
33 // Your code here.
34 args.Num = num
35 for {
36 // try each known server.
37 for _, srv := range ck.servers {
38 var reply QueryReply
39 ok := srv.Call("ShardCtrler.Query", args, &reply)
40 if ok && reply.WrongLeader == false {
41 return reply.Config
42 }
43 }
44 time.Sleep(100 * time.Millisecond)
45 }
46}
47
48func (ck *Clerk) Join(servers map[int][]string) {
49 args := &JoinArgs{}

Callers 7

checkFunction · 0.45
TestBasicFunction · 0.45
TestMultiFunction · 0.45
TestChallenge2UnaffectedFunction · 0.45
TestChallenge2PartialFunction · 0.45
GetMethod · 0.45
PutAppendMethod · 0.45

Calls 1

CallMethod · 0.80

Tested by 5

checkFunction · 0.36
TestBasicFunction · 0.36
TestMultiFunction · 0.36
TestChallenge2UnaffectedFunction · 0.36
TestChallenge2PartialFunction · 0.36