Mercurial > hg > Database > Alice
annotate src/main/java/alice/topology/node/IncomingConnectionInfo.java @ 647:e321c5ec9b58
fix toplogy manager; ring worked
author | suruga |
---|---|
date | Sun, 31 Dec 2017 19:32:27 +0900 |
parents | 646f705e65b1 |
children |
rev | line source |
---|---|
345 | 1 package alice.topology.node; |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.DataSegment; | |
6 import alice.datasegment.Receiver; | |
7 import alice.topology.HostMessage; | |
641 | 8 import org.apache.log4j.Logger; |
345 | 9 |
10 public class IncomingConnectionInfo extends CodeSegment { | |
11 | |
419 | 12 public Receiver hostInfo = ids.create(CommandType.TAKE); |
13 private String absName; | |
14 private int count; | |
641 | 15 private Logger log = Logger.getLogger(IncomingConnectionInfo.class); |
647 | 16 private String managerKey; |
404 | 17 |
647 | 18 public IncomingConnectionInfo(String absName, int count, String managerKey) { |
419 | 19 this.absName = absName; |
20 this.count = count; | |
647 | 21 this.managerKey = managerKey; |
22 hostInfo.setKey(managerKey,absName); | |
419 | 23 } |
404 | 24 |
647 | 25 |
26 | |
419 | 27 @Override |
28 public void run() { | |
647 | 29 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); |
30 log.info(hostInfo.toString()); | |
31 if ( hostInfo.name.equals("")) { // end case | |
32 log.info(" topology node finished " + absName); | |
419 | 33 ods.put("local", "configNodeNum", count); |
647 | 34 return ; |
35 } | |
36 log.info("topology node " + absName + " will connect to " + hostInfo.name ); | |
37 if (DataSegment.contains(hostInfo.connectionName)) { | |
38 // need to wait remove by DeleteConnection | |
39 ods.put("manager", absName, hostInfo); | |
419 | 40 } else { |
647 | 41 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); |
42 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); | |
43 count++; | |
523
145c425db88d
add CompressedLDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
517
diff
changeset
|
44 |
647 | 45 ods.put("cMember", hostInfo.connectionName); |
46 new CreateConnectionList(); | |
419 | 47 } |
647 | 48 new IncomingConnectionInfo(absName, count, managerKey); |
419 | 49 } |
345 | 50 |
51 } |