Mercurial > hg > Database > Alice
view src/main/java/alice/topology/manager/RecodeTopology.java @ 466:268b1280dc18 dispose
remove debug message
author | sugi |
---|---|
date | Sat, 15 Nov 2014 04:48:35 +0900 |
parents | 41bb86275910 |
children | 116e0fde9233 |
line wrap: on
line source
package alice.topology.manager; import java.util.HashMap; import java.util.LinkedList; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import alice.topology.HostMessage; public class RecodeTopology extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); // NodeInfo private Receiver info1 = ids.create(CommandType.TAKE); // HashMap public RecodeTopology(){ info.setKey("nodeInfo"); info1.setKey("topology"); } @Override public void run() { HostMessage hostInfo = info.asClass(HostMessage.class); @SuppressWarnings("unchecked") HashMap<String, LinkedList<HostMessage>> topology = info1.asClass(HashMap.class); LinkedList<HostMessage> connections; if (!topology.containsKey(hostInfo.remoteAbsName)) { connections = new LinkedList<HostMessage>(); } else { connections = topology.get(hostInfo.remoteAbsName); } connections.add(hostInfo); topology.put(hostInfo.remoteAbsName, connections); // need debug option // for (LinkedList<HostMessage> list :topology.values()){ // System.out.print(list.get(0).remoteAbsName+" : "); // for (HostMessage host : list){ // System.out.print("[ "+host.absName+" "+host.name+" "+host.port+" "+host.connectionName+" "+host.reverseName+" "+host.remoteAbsName+" ]"); // } // System.out.println(); // } ods.update(info1.key, topology); } }