Mercurial > hg > Database > Christie
view src/main/java/christie/test/topology/localTestTopology/StartLocalTestTopology.java @ 79:0a724c973fc9
fix conffile
author | akahori |
---|---|
date | Wed, 05 Sep 2018 10:47:04 +0900 |
parents | 32f6f9de97c1 |
children | 1e66fd626aff |
line wrap: on
line source
package christie.test.topology.localTestTopology; 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; import java.util.LinkedList; public class StartLocalTestTopology extends StartCodeGear{ public StartLocalTestTopology(CodeGearManager cgm) { super(cgm); } public static void main(String[] args) { LinkedList<LocalTestTopologyConfig> configs = new LinkedList<LocalTestTopologyConfig>(); configs.add(new LocalTestTopologyConfig(args, 10001, "node0")); configs.add(new LocalTestTopologyConfig(args, 10002, "node1")); configs.add(new LocalTestTopologyConfig(args, 10003, "node2")); String[] managerArg = {"--localPort", String.valueOf(10000), "--confFile", "scripts/ring.dot", "--showTime"}; TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(managerArg); CodeGearManager topologyManagerCGM = createCGM(topologyManagerConfig.localPort); new StartTopologyManager(topologyManagerCGM, topologyManagerConfig); for (LocalTestTopologyConfig conf: configs ) { CodeGearManager nodeCGM = createCGM(conf.localPort); String[] nodeArg = {"--localKey",conf.key, "--managerPort", String.valueOf(topologyManagerConfig.localPort), "--managerHost", "localhost"}; TopologyNodeConfig cs = new TopologyNodeConfig(nodeArg); new StartTopologyNode(nodeCGM, cs, new LTRemoteIncrement(conf)); } topologyManagerCGM.setup(new StartLTCodeGear()); } }