changeset 85:331ad549e764

fix CreateTreeTopology
author akahori
date Sat, 15 Sep 2018 10:22:12 +0900
parents c0c29f989af3
children 07cbaa54db43
files src/main/java/christie/topology/manager/CreateTreeTopology.java
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/christie/topology/manager/CreateTreeTopology.java	Sat Sep 15 09:25:55 2018 +0900
+++ b/src/main/java/christie/topology/manager/CreateTreeTopology.java	Sat Sep 15 10:22:12 2018 +0900
@@ -56,7 +56,6 @@
             // ルートなので, connectNodeNumもreverseCountも0でいい.
             getDGM(nodeName).put("connectNodeNum", 0);
             getDGM(nodeName).put("reverseCount", 0);
-            getLocalDGM().put("start", true);
 
         } else {
             // 親のみにつながればいいので1
@@ -66,20 +65,23 @@
             HostMessage parent = nameTable.get(parentNodeName);
             int num = parentManager.getMyNumber();
 
-            HostMessage newHost = new HostMessage(parent.hostName, parent.port, "parent", "child" + num);
-            newHost.nodeName = parentNodeName;
-            newHost.remoteNodeName = nodeName; // address
+            HostMessage newParentHost = new HostMessage(parent.hostName, parent.port, "parent", "child" + num);
+            newParentHost.nodeName = parentNodeName;
+            newParentHost.remoteNodeName = nodeName; // address
 
-            getLocalDGM().put("nodeInfo", newHost);
+            getLocalDGM().put("nodeInfo", newParentHost);
             cgm.setup(new RecordTopology());
 
             // put own information parent
-            newHost = new HostMessage(newHost.hostName, newHost.port, "child" + num, "parent");
-            newHost.nodeName = nodeName;
-            newHost.remoteNodeName = parentNodeName;
+            HostMessage newChildHost = new HostMessage(newHost.hostName, newHost.port, "child" + num, "parent");
+            newChildHost.nodeName = nodeName;
+            newChildHost.remoteNodeName = parentNodeName;
 
-            getLocalDGM().put("nodeInfo", newHost);
+            getLocalDGM().put("nodeInfo", newChildHost);
             cgm.setup(new RecordTopology());
         }
+
+        getDGM(nodeName).put("start", "start");
+
     }
 }
\ No newline at end of file