annotate src/main/java/alice/topology/node/StartTopologyNode.java @ 523:145c425db88d dispose

add CompressedLDSM
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Thu, 09 Apr 2015 18:36:26 +0900
parents fc313323c53b
children 0832af83583f 767d93626b88 1a860019b2fe 1cf2697d51a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
1 package alice.topology.node;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
2
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
3 import java.net.InetAddress;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
4 import java.net.UnknownHostException;
439
9f6674e503df change timing putting Connection list
sugi
parents: 427
diff changeset
5 import java.util.ArrayList;
9f6674e503df change timing putting Connection list
sugi
parents: 427
diff changeset
6
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
7 import alice.codesegment.CodeSegment;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
8 import alice.datasegment.DataSegment;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
9 import alice.topology.HostMessage;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
10
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
11 public class StartTopologyNode extends CodeSegment {
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
12
419
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
13 private TopologyNodeConfig conf;
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
14 private CodeSegment startCS;
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
15
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
16 public StartTopologyNode(TopologyNodeConfig conf, CodeSegment startCS) {
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
17 this.conf = conf;
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
18 this.startCS = startCS;
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
19 }
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
20
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
21 @Override
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
22 public void run() {
480
c06070403ed4 named IncomingTcp and OutboundTcp Thread
sugi
parents: 467
diff changeset
23 DataSegment.connect("manager", "manager", conf.getManagerHostName(), conf.getManagerPort());
419
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
24 String localHostName = null;
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
25 try {
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
26 localHostName = InetAddress.getLocalHost().getHostName();
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
27 } catch (UnknownHostException e) {
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
28 e.printStackTrace();
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
29 }
427
6a5925219dc6 add argument "-cookie"
sugi
parents: 419
diff changeset
30 new SaveCookie();
419
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
31
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
32 HostMessage host = new HostMessage(localHostName, conf.localPort);
427
6a5925219dc6 add argument "-cookie"
sugi
parents: 419
diff changeset
33 host.cookie = conf.cookie;
419
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
34 ods.put("manager", "host", host);
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
35
439
9f6674e503df change timing putting Connection list
sugi
parents: 427
diff changeset
36 ods.put("_CLIST", new ArrayList<String>());
467
6e304a7a60e7 remove white space
sugi
parents: 439
diff changeset
37
419
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
38 IncomingAbstractHostName cs = new IncomingAbstractHostName();
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
39 cs.absName.setKey("local", "host");
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
40
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
41 IncomingReverseKey cs2 = new IncomingReverseKey();
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
42 cs2.reverseKey.setKey("local", "reverseKey");
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
43 cs2.reverseCount.setKey("local", "reverseCount");
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
44
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
45 ods.put("local", "reverseCount", 0);
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
46
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
47 ConfigurationFinish cs3 = new ConfigurationFinish(startCS);
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
48 cs3.reverseCount.setKey("local", "reverseCount");
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
49 cs3.configNodeNum.setKey("local", "configNodeNum");
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
50
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
51 }
aefbe41fcf12 change tab to space
sugi
parents: 404
diff changeset
52
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
53 }