Mercurial > hg > Database > Alice
annotate src/alice/topology/node/IncomingConnectionInfo.java @ 316:9e84deb9b1e0
Respond Worked
author | sugi |
---|---|
date | Tue, 10 Dec 2013 17:40:13 +0900 |
parents | f866178f3018 |
children |
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); |
26 | 35 return; |
36 } | |
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
|
37 |
216 | 38 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); |
316 | 39 //System.out.println(hostInfo.reconnectFlag); |
274 | 40 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port, hostInfo.reconnectFlag); |
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 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); |
258 | 42 connectionList.add(hostInfo.connectionName); |
43 ods.update("_CLIST", connectionList); | |
44 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count, connectionList); | |
26 | 45 cs.hostInfo.setKey("manager", absName); |
271 | 46 |
25 | 47 } |
48 | |
49 } |