345
|
1 package alice.topology.manager;
|
|
2
|
|
3 import org.msgpack.type.ValueFactory;
|
|
4
|
|
5 import alice.codesegment.CodeSegment;
|
|
6 import alice.datasegment.CommandType;
|
|
7 import alice.datasegment.Receiver;
|
|
8 import alice.topology.manager.reconnection.ReceiveError;
|
|
9
|
|
10 public class ConfigWaiter extends CodeSegment {
|
|
11
|
|
12 public Receiver done = ids.create(CommandType.TAKE);
|
|
13 public int count;
|
|
14
|
|
15 public ConfigWaiter(int nodeNum) {
|
|
16 this.count = nodeNum;
|
|
17 }
|
|
18
|
|
19 @Override
|
|
20 public void run() {
|
|
21 count--;
|
|
22 if (count == 0) {
|
|
23 ods.put("local", "start", ValueFactory.createNilValue());
|
|
24 new ReceiveError();
|
|
25 return;
|
|
26 }
|
|
27 ConfigWaiter cs3 = new ConfigWaiter(count);
|
|
28 cs3.done.setKey("local", "done");
|
|
29 }
|
|
30
|
|
31 }
|