changeset 55:34181394333f

fix RecordTopology
author akahori
date Thu, 23 Aug 2018 10:31:48 +0900
parents 84089813455f
children 1850b3eb93d8
files src/main/java/christie/topology/manager/IncomingHosts.java src/main/java/christie/topology/manager/RecordTopology.java
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/christie/topology/manager/IncomingHosts.java	Thu Aug 23 10:10:35 2018 +0900
+++ b/src/main/java/christie/topology/manager/IncomingHosts.java	Thu Aug 23 10:31:48 2018 +0900
@@ -64,6 +64,7 @@
             getLocalDGM().put(nodeInfo.sourceNodeName, hostMessage);
             log.info(" write to " + nodeInfo.sourceNodeName + " config message =" + hostMessage.toString() + " remain "
                     + Integer.toString((nodeNames.size())));
+            // RecordTopologyは, !conf.dynamic のときは呼ばれない.
             cgm.setup(new RecordTopology());
         }
 
--- a/src/main/java/christie/topology/manager/RecordTopology.java	Thu Aug 23 10:10:35 2018 +0900
+++ b/src/main/java/christie/topology/manager/RecordTopology.java	Thu Aug 23 10:31:48 2018 +0900
@@ -13,7 +13,7 @@
 public class RecordTopology extends CodeGear {
 
     @Take
-    HostMessage hostInfo;
+    HostMessage nodeInfo;
 
     @Peek
     HashMap<String, LinkedList<HostMessage>> topology;
@@ -22,13 +22,13 @@
     @Override
     public void run(CodeGearManager cgm) {
         LinkedList<HostMessage> connections;
-        if (!topology.containsKey(hostInfo.remoteAbsName)) {
+        if (!topology.containsKey(nodeInfo.remoteAbsName)) {
             connections = new LinkedList<HostMessage>();
         } else {
-            connections = topology.get(hostInfo.remoteAbsName);
+            connections = topology.get(nodeInfo.remoteAbsName);
         }
-        connections.add(hostInfo);
-        topology.put(hostInfo.remoteAbsName, connections);
+        connections.add(nodeInfo);
+        topology.put(nodeInfo.remoteAbsName, connections);
 // need debug option
 //        for (LinkedList<HostMessage> list :topology.values()){
 //            System.out.print(list.get(0).remoteAbsName+" : ");