Mercurial > hg > Database > Alice
comparison 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 |
comparison
equal
deleted
inserted
replaced
646:3c060de44c2e | 647:e321c5ec9b58 |
---|---|
11 | 11 |
12 public Receiver hostInfo = ids.create(CommandType.TAKE); | 12 public Receiver hostInfo = ids.create(CommandType.TAKE); |
13 private String absName; | 13 private String absName; |
14 private int count; | 14 private int count; |
15 private Logger log = Logger.getLogger(IncomingConnectionInfo.class); | 15 private Logger log = Logger.getLogger(IncomingConnectionInfo.class); |
16 private String managerKey; | |
16 | 17 |
17 public IncomingConnectionInfo(String absName, int count) { | 18 public IncomingConnectionInfo(String absName, int count, String managerKey) { |
18 this.absName = absName; | 19 this.absName = absName; |
19 this.count = count; | 20 this.count = count; |
21 this.managerKey = managerKey; | |
22 hostInfo.setKey(managerKey,absName); | |
20 } | 23 } |
24 | |
25 | |
21 | 26 |
22 @Override | 27 @Override |
23 public void run() { | 28 public void run() { |
24 if (this.hostInfo.getVal() == null) { | 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); | |
25 ods.put("local", "configNodeNum", count); | 33 ods.put("local", "configNodeNum", count); |
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); | |
26 } else { | 40 } else { |
27 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); | 41 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); |
28 log.info("topology node " + absName + " will connect to " + hostInfo.name ); | 42 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); |
29 if (DataSegment.contains(hostInfo.connectionName)) { | 43 count++; |
30 // need to wait remove by DeleteConnection | |
31 ods.put("manager", absName, hostInfo); | |
32 } else { | |
33 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); | |
34 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); | |
35 count++; | |
36 | 44 |
37 ods.put("cMember", hostInfo.connectionName); | 45 ods.put("cMember", hostInfo.connectionName); |
38 new CreateConnectionList(); | 46 new CreateConnectionList(); |
39 } | |
40 | |
41 } | 47 } |
42 | 48 new IncomingConnectionInfo(absName, count, managerKey); |
43 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); | |
44 cs.hostInfo.setKey(absName); | |
45 } | 49 } |
46 | 50 |
47 } | 51 } |