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;
|
62
|
16 @Take
|
64
|
17 String nodePrepareDone;
|
41
|
18
|
|
19 @Take
|
|
20 int nodeNum;
|
|
21
|
|
22 public ConfigWaiter() { }
|
|
23
|
|
24 @Override
|
57
|
25 protected void run(CodeGearManager cgm) {
|
41
|
26 nodeNum--;
|
|
27 if (nodeNum == 0) {
|
74
|
28 for (String nodeName: waiterNodeNames) getDGM(nodeName).put("start", "start");
|
44
|
29 getLocalDGM().put("startTime", System.currentTimeMillis());
|
|
30 getLocalDGM().put("running", true);
|
41
|
31
|
|
32 return;
|
|
33 }
|
|
34
|
|
35 cgm.setup(new ConfigWaiter());
|
|
36 getLocalDGM().put("nodeNum", nodeNum);
|
|
37 }
|
|
38
|
|
39 }
|