Mercurial > hg > Database > Christie
view src/test/java/christie/example/PrefixTree/StartPrefixTree.java @ 207:437f06e034b8
Correct PrefixTree
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 11 Mar 2019 22:21:23 +0900 |
parents | d15467cd08cc |
children | 6cbf93a11d24 |
line wrap: on
line source
package christie.example.PrefixTree; import christie.codegear.CodeGearManager; import christie.codegear.StartCodeGear; import christie.topology.manager.StartTopologyManager; import christie.topology.manager.TopologyManagerConfig; import christie.topology.node.StartTopologyNode; import christie.topology.node.TopologyNodeConfig; public class StartPrefixTree extends StartCodeGear { public StartPrefixTree(CodeGearManager cgm) { super(cgm); } public static void main(String[] args) { int topologyManagerPort = 10000; int topologyNodePort = 10001; int nodeNum = 10; String[] managerArg = {"--localPort", String.valueOf(topologyManagerPort), "--Topology", "tree"}; TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(managerArg); new StartTopologyManager(topologyManagerConfig); //TopologyManagerの作成 for (int i = 0; i < nodeNum ; i++){ String[] nodeArg = { "--managerPort", String.valueOf(topologyManagerPort), //使うトポロジーマネージャーを選ぶ "--managerHost", "localhost", "--localPort", String.valueOf(topologyNodePort + i)}; TopologyNodeConfig nodeConfig = new TopologyNodeConfig(nodeArg); StartTopologyNode startTopologyNode = new StartTopologyNode(nodeConfig, new CheckMyName()); startTopologyNode.put("num", i); startTopologyNode.put("totalNodeNum", nodeNum - 1);//rootを除いた分のノード数 } } }