Mercurial > hg > Database > Alice
changeset 428:93995b7a9a05 dispose
change HostMessage field from parentAbsName to remoteAbsName
author | sugi |
---|---|
date | Tue, 22 Jul 2014 12:56:25 +0900 |
parents | 6a5925219dc6 |
children | 1b32ea1263f3 |
files | .classpath .hgignore src/main/java/alice/topology/HostMessage.java src/main/java/alice/topology/manager/ComingServiceHosts.java src/main/java/alice/topology/manager/IncomingHosts.java src/main/java/alice/topology/manager/RecodeTopology.java |
diffstat | 6 files changed, 19 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Tue Jul 22 12:53:55 2014 +0900 +++ b/.classpath Tue Jul 22 12:56:25 2014 +0900 @@ -6,6 +6,7 @@ <classpathentry kind="src" path="src/test/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/> <classpathentry kind="lib" path="/Users/YU/workspace/Alice/lib/com.alexmerz.graphviz.jar" exported="true"/> + <classpathentry kind="lib" path="/Users/YU/workspace/Alice/lib/commons-lang3-3.3.2.jar" exported="true"/> <classpathentry kind="lib" path="/Users/YU/workspace/Alice/lib/javassist.jar" exported="true"/> <classpathentry kind="lib" path="/Users/YU/workspace/Alice/lib/jimColModelImporterJFX.jar" exported="true"/> <classpathentry kind="lib" path="/Users/YU/workspace/Alice/lib/jimObjModelImporterJFX.jar" exported="true"/>
--- a/.hgignore Tue Jul 22 12:53:55 2014 +0900 +++ b/.hgignore Tue Jul 22 12:56:25 2014 +0900 @@ -1,6 +1,8 @@ +syntax: glob +.classpath syntax: regexp ^classes$ syntax: regexp ^Alice\.jar$ -syntax: regexp +syntax: regexp \ No newline at end of file
--- a/src/main/java/alice/topology/HostMessage.java Tue Jul 22 12:53:55 2014 +0900 +++ b/src/main/java/alice/topology/HostMessage.java Tue Jul 22 12:56:25 2014 +0900 @@ -9,8 +9,9 @@ public int port; public String connectionName; public String reverseName; + public String absName; - public String parentAbsName; + public String remoteAbsName; public String cookie; public HostMessage() { }
--- a/src/main/java/alice/topology/manager/ComingServiceHosts.java Tue Jul 22 12:53:55 2014 +0900 +++ b/src/main/java/alice/topology/manager/ComingServiceHosts.java Tue Jul 22 12:56:25 2014 +0900 @@ -38,7 +38,7 @@ for (int i=1;i < BINATY_TREE+1; i++) { int num = 2 * comingHostCount+i; HostMessage newHost = new HostMessage(host.name, host.port, "parent", "child"+(i-1)); - newHost.parentAbsName = nodeName; + newHost.remoteAbsName = nodeName; newHost.absName = "node"+num; parentInfo.put(newHost.absName, newHost); ods.put(newHost.absName, newHost); @@ -46,7 +46,7 @@ if (comingHostCount!=0) { HostMessage parent = parentInfo.get(nodeName); HostMessage newHost = new HostMessage(host.name, host.port, parent.reverseName, parent.connectionName); - ods.put(parent.parentAbsName, newHost); + ods.put(parent.remoteAbsName, newHost); } ods.put("nodeConnectionInfo", parentInfo);
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Tue Jul 22 12:53:55 2014 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Tue Jul 22 12:56:25 2014 +0900 @@ -42,7 +42,9 @@ ods.put(this.nodes.key, nodes); new SearchHostName(); } - } + } + } else { + System.out.println("cookie is null"); } // not have or match cookie @@ -58,7 +60,8 @@ for (NodeInfo nodeInfo : nodes) { HostMessage newHost = new HostMessage(host.name, host.port, nodeInfo.connectionName, nodeInfo.reverseName); - newHost.parentAbsName = nodeInfo.sourceNodeName; + newHost.absName = nodeName; + newHost.remoteAbsName = nodeInfo.sourceNodeName; ods.put("nodeInfo", newHost); ods.put(nodeInfo.sourceNodeName, newHost); new RecodeTopology();
--- a/src/main/java/alice/topology/manager/RecodeTopology.java Tue Jul 22 12:53:55 2014 +0900 +++ b/src/main/java/alice/topology/manager/RecodeTopology.java Tue Jul 22 12:56:25 2014 +0900 @@ -24,19 +24,21 @@ @SuppressWarnings("unchecked") HashMap<String, LinkedList<HostMessage>> topology = info1.asClass(HashMap.class); LinkedList<HostMessage> connections; - if (!topology.containsKey(hostInfo.parentAbsName)) { + if (!topology.containsKey(hostInfo.remoteAbsName)) { connections = new LinkedList<HostMessage>(); } else { - connections = topology.get(hostInfo.parentAbsName); + connections = topology.get(hostInfo.remoteAbsName); } connections.add(hostInfo); - topology.put(hostInfo.parentAbsName, connections); + topology.put(hostInfo.remoteAbsName, connections); ods.update(info1.key, topology); for (LinkedList<HostMessage> list :topology.values()){ + System.out.print(list.get(0).remoteAbsName+" : "); for (HostMessage host : list){ - System.out.println(host.parentAbsName+" : "+host.name+" "+host.port+" "+host.connectionName+" "+host.reverseName); + System.out.print("[ "+host.absName+" "+host.name+" "+host.port+" "+host.connectionName+" "+host.reverseName+" ]"); } + System.out.println(); } }