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