annotate src/main/java/alice/test/topology/localTestTopology/LocalTestTopology.java @ 645:cb16036404ba

fix local topology test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 31 Dec 2017 11:04:29 +0900 (2017-12-31)
parents e0621f645e2e
children 3c060de44c2e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package alice.test.topology.localTestTopology;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import alice.daemon.AliceDaemon;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 import alice.datasegment.DataSegment;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 import alice.topology.manager.StartTopologyManager;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 import alice.topology.manager.TopologyManagerConfig;
645
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
7 import alice.topology.node.StartTopologyNode;
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
8 import alice.topology.node.TopologyNodeConfig;
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 import java.util.LinkedList;
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 public class LocalTestTopology {
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
645
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
14
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 public static void main(String[] args) {
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 LinkedList<LocalTestTopologyConfig> configs = new LinkedList<LocalTestTopologyConfig>();
645
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
17 int port = 10001;
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 configs.add(new LocalTestTopologyConfig(args, port++, "remote1"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 configs.add(new LocalTestTopologyConfig(args, port++, "remote2"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 configs.add(new LocalTestTopologyConfig(args, port++, "remote3"));
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
644
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
22 TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(args);
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
23 new AliceDaemon(topologyManagerConfig).listen();
e0621f645e2e add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
24 new StartTopologyManager(topologyManagerConfig).execute();
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 for (LocalTestTopologyConfig conf: configs ) {
645
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
27 String[] csarg = {"--port ", Integer.toString(topologyManagerConfig.localPort), "--host","localhost" };
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
28 TopologyNodeConfig cs = new TopologyNodeConfig(csarg);
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
29 cs.setLocalKey(conf.key);
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
30 cs.setManagerKey("manager");
cb16036404ba fix local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
31 new StartTopologyNode(cs, new LTRemoteIncrement(conf));
643
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 }
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 new LTopologyStartCodeSegment(configs).execute();
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 }
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
74dbb8809c73 add local topology test
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 }