41
|
1 package christie.topology.manager;
|
|
2
|
|
3
|
|
4 import christie.annotation.Take;
|
|
5 import christie.codegear.CodeGear;
|
|
6 import christie.codegear.CodeGearManager;
|
|
7 import org.msgpack.type.ValueFactory;
|
|
8
|
|
9 public class ConfigWaiter extends CodeGear {
|
|
10
|
|
11
|
44
|
12 // Question: done 変数がわからない...何やっているんだろう.
|
41
|
13 // public Receiver done = ids.create(CommandType.TAKE);
|
|
14 @Take
|
|
15 boolean done;
|
|
16
|
|
17 @Take
|
|
18 int nodeNum;
|
|
19
|
|
20 public ConfigWaiter() { }
|
|
21
|
|
22 @Override
|
|
23 public void run(CodeGearManager cgm) {
|
|
24 nodeNum--;
|
|
25 if (nodeNum == 0) {
|
44
|
26 getLocalDGM().put("start", ValueFactory.createNilValue());
|
|
27 getLocalDGM().put("startTime", System.currentTimeMillis());
|
|
28 getLocalDGM().put("running", true);
|
41
|
29
|
|
30 return;
|
|
31 }
|
|
32
|
|
33 cgm.setup(new ConfigWaiter());
|
|
34 getLocalDGM().put("nodeNum", nodeNum);
|
|
35 }
|
|
36
|
|
37 }
|