Mercurial > hg > Database > Christie
comparison src/main/java/christie/topology/node/IncomingConnectionInfo.java @ 65:5deea416f980
fix variable name
author | akahori |
---|---|
date | Thu, 30 Aug 2018 10:56:37 +0900 |
parents | 20d4c0cce914 |
children | 4e2453333508 |
comparison
equal
deleted
inserted
replaced
64:f884c1bd0d36 | 65:5deea416f980 |
---|---|
1 package christie.topology.node; | 1 package christie.topology.node; |
2 | 2 |
3 | 3 |
4 import christie.annotation.TakeFrom; | 4 import christie.annotation.Take; |
5 import christie.codegear.CodeGear; | 5 import christie.codegear.CodeGear; |
6 import christie.codegear.CodeGearManager; | 6 import christie.codegear.CodeGearManager; |
7 import christie.topology.HostMessage; | 7 import christie.topology.HostMessage; |
8 import org.apache.log4j.Logger; | 8 import org.apache.log4j.Logger; |
9 | 9 |
10 public class IncomingConnectionInfo extends CodeGear { | 10 public class IncomingConnectionInfo extends CodeGear { |
11 | 11 |
12 @TakeFrom("manager") | 12 @Take |
13 HostMessage hostInfo; | 13 HostMessage remoteNodeInfo; |
14 | 14 |
15 private String absName; | 15 private String absName; |
16 private int count; | 16 private int count; |
17 private Logger log = Logger.getLogger(IncomingConnectionInfo.class); | 17 private Logger log = Logger.getLogger(IncomingConnectionInfo.class); |
18 private String managerKey; | 18 private String managerKey; |
19 | 19 |
20 public IncomingConnectionInfo(String absName, int count, String managerKey) { | 20 public IncomingConnectionInfo(String absName, int count, String managerKey) { |
21 this.absName = absName; | 21 this.absName = absName; |
22 this.count = count; | 22 this.count = count; |
23 this.managerKey = managerKey; | 23 this.managerKey = managerKey; |
24 //hostInfo.setKey(managerKey,absName); | 24 //remoteNodeInfo.setKey(managerKey,absName); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 | 28 |
29 @Override | 29 @Override |
30 protected void run(CodeGearManager cgm) { | 30 protected void run(CodeGearManager cgm) { |
31 | 31 |
32 log.info(hostInfo.toString()); | 32 log.info(remoteNodeInfo.toString()); |
33 if ( hostInfo.hostName.equals("")) { // end case | 33 if ( remoteNodeInfo.hostName.equals("")) { // end case |
34 log.info(" topology node finished " + absName); | 34 log.info(" topology node finished " + absName); |
35 getLocalDGM().put("configNodeNum", 0); | 35 getLocalDGM().put("configNodeNum", 0); |
36 return ; | 36 return ; |
37 } | 37 } |
38 log.info("topology node " + absName + " will connect to " + hostInfo.hostName ); | 38 log.info("topology node " + absName + " will connect to " + remoteNodeInfo.hostName ); |
39 if (cgm.getDgmList().contains(hostInfo.connectionName)) { | 39 if (cgm.getDgmList().contains(remoteNodeInfo.connectionName)) { |
40 // need to wait remove by DeleteConnection | 40 // need to wait remove by DeleteConnection |
41 getDGM("manager").put(absName, hostInfo); | 41 getDGM("manager").put(absName, remoteNodeInfo); |
42 } else { | 42 } else { |
43 cgm.createRemoteDGM(hostInfo.connectionName, hostInfo.hostName, hostInfo.port); | 43 cgm.createRemoteDGM(remoteNodeInfo.connectionName, remoteNodeInfo.hostName, remoteNodeInfo.port); |
44 | 44 |
45 getDGM(hostInfo.connectionName).put("reverseKey", hostInfo.reverseName); | 45 getDGM(remoteNodeInfo.connectionName).put("reverseKey", remoteNodeInfo.reverseName); |
46 getDGM(hostInfo.connectionName).put("reverseHostName", hostInfo.hostName); | 46 getDGM(remoteNodeInfo.connectionName).put("reverseHostName", remoteNodeInfo.hostName); |
47 getDGM(hostInfo.connectionName).put("reverseKeyPort", hostInfo.port); | 47 getDGM(remoteNodeInfo.connectionName).put("reverseKeyPort", remoteNodeInfo.port); |
48 | 48 |
49 count++; | 49 count++; |
50 | 50 |
51 getLocalDGM().put("cMember", hostInfo.connectionName); | 51 getLocalDGM().put("cMember", remoteNodeInfo.connectionName); |
52 cgm.setup(new CreateConnectionList()); | 52 cgm.setup(new CreateConnectionList()); |
53 | 53 |
54 } | 54 } |
55 cgm.setup(new IncomingConnectionInfo(absName, count, managerKey)); | 55 cgm.setup(new IncomingConnectionInfo(absName, count, managerKey)); |
56 } | 56 } |