41
|
1 package christie.topology.manager;
|
|
2
|
|
3
|
68
|
4 import christie.annotation.Peek;
|
41
|
5 import christie.annotation.Take;
|
|
6 import christie.codegear.CodeGear;
|
|
7 import christie.codegear.CodeGearManager;
|
|
8
|
74
|
9
|
68
|
10 import java.util.LinkedList;
|
|
11
|
41
|
12 public class ConfigWaiter extends CodeGear {
|
|
13
|
68
|
14 @Peek
|
74
|
15 LinkedList<String> waiterNodeNames;
|
168
|
16
|
62
|
17 @Take
|
64
|
18 String nodePrepareDone;
|
41
|
19
|
|
20 @Take
|
161
|
21 int nodeNum;
|
41
|
22
|
|
23 public ConfigWaiter() { }
|
|
24
|
|
25 @Override
|
57
|
26 protected void run(CodeGearManager cgm) {
|
161
|
27 nodeNum--;
|
|
28 if (nodeNum == 0) {
|
121
|
29 getLocalDGM().put("start", "start");
|
74
|
30 for (String nodeName: waiterNodeNames) getDGM(nodeName).put("start", "start");
|
44
|
31 getLocalDGM().put("startTime", System.currentTimeMillis());
|
|
32 getLocalDGM().put("running", true);
|
41
|
33
|
|
34 return;
|
|
35 }
|
|
36
|
|
37 cgm.setup(new ConfigWaiter());
|
161
|
38 getLocalDGM().put("nodeNum", nodeNum);
|
41
|
39 }
|
|
40
|
|
41 }
|