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