Mercurial > hg > Database > Christie
annotate src/main/java/christie/topology/manager/TopologyManager.java @ 143:443bf8351933
add FizzBuzz
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 04 Jan 2019 04:18:36 +0900 |
parents | daf37151dd97 |
children | e295cb59e514 |
rev | line source |
---|---|
38 | 1 package christie.topology.manager; |
2 | |
60 | 3 import christie.annotation.Peek; |
38 | 4 import christie.codegear.CodeGear; |
5 import christie.codegear.CodeGearManager; | |
6 | |
41 | 7 import java.util.HashMap; |
8 import java.util.LinkedList; | |
9 | |
45 | 10 import christie.topology.HostMessage; |
41 | 11 |
38 | 12 public class TopologyManager extends CodeGear { |
13 | |
74 | 14 @Peek |
15 TopologyManagerConfig topologyManagerConfig; | |
16 | |
60 | 17 public TopologyManager() { |
45 | 18 } |
41 | 19 |
38 | 20 @Override |
21 protected void run(CodeGearManager cgm) { | |
41 | 22 cgm.setup(new CheckComingHost()); |
45 | 23 getLocalDGM().put("absCookieTable", new HashMap<String, String>()); |
24 | |
103 | 25 if(topologyManagerConfig.dynamic) { |
83 | 26 getLocalDGM().put("running", true); |
118
daf37151dd97
refactor constract StartTopologyManage and StartTopologyNode
akahori
parents:
103
diff
changeset
|
27 getLocalDGM().put("start", "start"); |
83 | 28 |
29 if (topologyManagerConfig.type == TopologyType.Tree) { | |
30 getLocalDGM().put("parentManager", new ParentManager(topologyManagerConfig.hasChild)); | |
31 getLocalDGM().put("nameTable", new HashMap<String, HostMessage>()); | |
32 getLocalDGM().put("hostCount", 0); | |
92 | 33 cgm.setup(new CreateTreeTopology()); |
83 | 34 //cgm.setup(new ReceiveDisconnectMessage()); |
35 } | |
103 | 36 |
37 }else{ | |
38 getLocalDGM().put("running", false); | |
39 cgm.setup(new FileParser()); | |
40 cgm.setup(new IncomingHosts()); | |
41 cgm.setup(new ConfigWaiter()); | |
42 | |
74 | 43 } |
44 | |
45 | 45 cgm.setup(new CreateHash()); |
46 cgm.setup(new TopologyFinish()); | |
38 | 47 |
73 | 48 getLocalDGM().put("topology", new HashMap<String, HashMap<String, HostMessage>>()); |
49 getLocalDGM().put("createdList", new LinkedList<String>()); | |
38 | 50 } |
51 | |
41 | 52 |
38 | 53 } |