Mercurial > hg > Database > Christie
changeset 97:1f7f8d9a4126
update StartLocalTestTopology
author | akahori |
---|---|
date | Mon, 17 Sep 2018 11:21:13 +0900 |
parents | bf6ab64325f9 |
children | c0ce4d151f93 |
files | src/main/java/christie/test/topology/localTestTopology/StartLocalTestTopology.java |
diffstat | 1 files changed, 8 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/test/topology/localTestTopology/StartLocalTestTopology.java Mon Sep 17 11:20:26 2018 +0900 +++ b/src/main/java/christie/test/topology/localTestTopology/StartLocalTestTopology.java Mon Sep 17 11:21:13 2018 +0900 @@ -7,8 +7,8 @@ import christie.topology.manager.TopologyManagerConfig; import christie.topology.node.StartTopologyNode; import christie.topology.node.TopologyNodeConfig; +import java.util.LinkedList; -import java.util.LinkedList; public class StartLocalTestTopology extends StartCodeGear{ @@ -18,19 +18,15 @@ } 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"}; + int managerPort = 10000; + int nodeNum = 3; + String[] managerArg = {"--localPort", String.valueOf(managerPort), "--confFile", "scripts/ring.dot", "--showTime"}; TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(managerArg); - CodeGearManager topologyManagerCGM = createCGM(topologyManagerConfig.localPort); - new StartTopologyManager(topologyManagerCGM, topologyManagerConfig); + new StartTopologyManager(topologyManagerConfig); - for (LocalTestTopologyConfig conf: configs ) { - CodeGearManager nodeCGM = createCGM(conf.localPort); - String[] nodeArg = {"--localKey",conf.key, - "--managerPort", String.valueOf(topologyManagerConfig.localPort), + for (int i = 1; i<=nodeNum; i++) { + CodeGearManager nodeCGM = createCGM(managerPort + i); + String[] nodeArg = {"--managerPort", String.valueOf(topologyManagerConfig.localPort), "--managerHost", "localhost"}; TopologyNodeConfig cs = new TopologyNodeConfig(nodeArg);