Mercurial > hg > Database > Christie
comparison src/main/java/christie/topology/node/IncomingConnectionInfo.java @ 170:f9f83bb213e8
fix topology manager
author | akahori |
---|---|
date | Tue, 22 Jan 2019 18:32:39 +0900 |
parents | c7300be0fff6 |
children | 6eb548c188e5 |
comparison
equal
deleted
inserted
replaced
169:1e696b2d3c6d | 170:f9f83bb213e8 |
---|---|
12 public class IncomingConnectionInfo extends CodeGear { | 12 public class IncomingConnectionInfo extends CodeGear { |
13 | 13 |
14 @Take | 14 @Take |
15 HostMessage remoteNodeInfo; | 15 HostMessage remoteNodeInfo; |
16 | 16 |
17 int count; | |
18 | |
17 @Take | 19 @Take |
18 TopologyDataGear topoDG; | 20 TopologyDataGear topoDG; |
19 | |
20 int count; | |
21 | 21 |
22 public IncomingConnectionInfo() { | 22 public IncomingConnectionInfo() { |
23 this.count = 0; | 23 this.count = 0; |
24 } | 24 } |
25 | 25 |
30 | 30 |
31 @Override | 31 @Override |
32 protected void run(CodeGearManager cgm) { | 32 protected void run(CodeGearManager cgm) { |
33 String connectionName = remoteNodeInfo.getConnectionName(); | 33 String connectionName = remoteNodeInfo.getConnectionName(); |
34 | 34 |
35 | |
36 if (remoteNodeInfo.getHostName().equals("")) { // end case | 35 if (remoteNodeInfo.getHostName().equals("")) { // end case |
37 put("connectNodeNum", count); | |
38 getLocalDGM().put("topoDG", topoDG); | 36 getLocalDGM().put("topoDG", topoDG); |
39 return; | 37 return; |
40 }else{ | 38 } |
41 | 39 |
42 cgm.createRemoteDGM(connectionName, | 40 cgm.createRemoteDGM(connectionName, |
43 remoteNodeInfo.getHostName(), | 41 remoteNodeInfo.getHostName(), |
44 remoteNodeInfo.getPort()); | 42 remoteNodeInfo.getPort()); |
45 | 43 |
46 getDGM(connectionName).put("reverseNodeName", topoDG.getNodeName()); | |
47 topoDG.addConnection(connectionName); | 44 topoDG.addConnection(connectionName); |
48 getLocalDGM().put("topoDG", topoDG); | 45 getLocalDGM().put("topoDG", topoDG); |
46 getDGM(connectionName).put("reverseNodeName",connectionName); | |
49 count++; | 47 count++; |
50 } | |
51 | 48 |
52 cgm.setup(new IncomingConnectionInfo(count)); | 49 cgm.setup(new IncomingConnectionInfo(count)); |
53 } | 50 } |
54 | 51 |
55 } | 52 } |