Mercurial > hg > Database > Alice
annotate src/alice/topology/node/IncomingConnectionInfo.java @ 270:23e53aaa8720
reconnect manager worked.
author | sugi |
---|---|
date | Wed, 21 Aug 2013 15:33:49 +0900 |
parents | 7f7b3506bff9 |
children | 3667ab045530 |
rev | line source |
---|---|
25 | 1 package alice.topology.node; |
2 | |
258 | 3 import java.util.ArrayList; |
4 import java.util.List; | |
5 | |
25 | 6 import alice.codesegment.CodeSegment; |
7 import alice.datasegment.CommandType; | |
8 import alice.datasegment.DataSegment; | |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
9 import alice.datasegment.Receiver; |
25 | 10 import alice.topology.HostMessage; |
11 | |
12 public class IncomingConnectionInfo extends CodeSegment { | |
13 | |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
14 public Receiver hostInfo = ids.create(CommandType.TAKE); |
258 | 15 private List<String> connectionList; |
26 | 16 private String absName; |
28
98ab26e09a98
Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
27
diff
changeset
|
17 private int count; |
26 | 18 |
28
98ab26e09a98
Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
27
diff
changeset
|
19 public IncomingConnectionInfo(String absName, int count) { |
25 | 20 this.absName = absName; |
28
98ab26e09a98
Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
27
diff
changeset
|
21 this.count = count; |
258 | 22 this.connectionList = new ArrayList<String>(); |
23 } | |
24 | |
25 public IncomingConnectionInfo(String absName, int count, List<String> connectionList) { | |
26 this.absName = absName; | |
27 this.count = count; | |
28 this.connectionList = connectionList; | |
25 | 29 } |
30 | |
31 @Override | |
32 public void run() { | |
214 | 33 if (this.hostInfo.getVal() == null) { |
31 | 34 ods.put("local", "configNodeNum", count); |
270 | 35 System.out.println("bbb"); |
26 | 36 return; |
37 } | |
34
ca079a730d0b
added method to OutputDataSegment and Receiver, to convert type from Value to Class<?> without MessagePack
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
33
diff
changeset
|
38 |
216 | 39 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); |
270 | 40 System.out.println(hostInfo.connectionName+" "+hostInfo.name+" "+hostInfo.port ); |
34
ca079a730d0b
added method to OutputDataSegment and Receiver, to convert type from Value to Class<?> without MessagePack
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
33
diff
changeset
|
41 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); |
ca079a730d0b
added method to OutputDataSegment and Receiver, to convert type from Value to Class<?> without MessagePack
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
33
diff
changeset
|
42 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); |
258 | 43 connectionList.add(hostInfo.connectionName); |
44 ods.update("_CLIST", connectionList); | |
45 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count, connectionList); | |
26 | 46 cs.hostInfo.setKey("manager", absName); |
270 | 47 System.out.println("aaa"); |
25 | 48 } |
49 | |
50 } |