345
|
1 package alice.topology.node;
|
|
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.ReceiveReconnectData;
|
|
9
|
|
10 public class ConfigurationFinish extends CodeSegment {
|
|
11
|
|
12 public Receiver reverseCount = ids.create(CommandType.PEEK);
|
|
13 public Receiver configNodeNum = ids.create(CommandType.PEEK);
|
|
14 private CodeSegment startCS;
|
|
15
|
|
16 public ConfigurationFinish(CodeSegment startCS) {
|
|
17 this.startCS = startCS;
|
|
18 }
|
|
19
|
|
20 @Override
|
|
21 public void run() {
|
|
22 if (reverseCount.getVal().equals(configNodeNum.getVal())) {
|
|
23 new ReceiveReconnectData();
|
|
24
|
|
25 ods.put("manager", "done", ValueFactory.createNilValue());
|
|
26 Start cs = new Start(startCS);
|
|
27 cs.done.setKey("manager", "start");
|
|
28 return;
|
|
29 }
|
|
30
|
|
31 ConfigurationFinish cs3 = new ConfigurationFinish(startCS);
|
|
32 cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index);
|
|
33 cs3.configNodeNum.setKey("local", "configNodeNum");
|
|
34 }
|
|
35
|
|
36 }
|