Mercurial > hg > Database > Christie
view src/main/java/christie/topology/manager/RecordTopology.java @ 198:dd3c0ba6a0a6
fix topology manager
author | akahori |
---|---|
date | Sat, 09 Mar 2019 21:53:37 +0900 |
parents | e295cb59e514 |
children |
line wrap: on
line source
package christie.topology.manager; import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; import christie.topology.HostMessage; import java.util.HashMap; import java.util.LinkedList; public class RecordTopology extends CodeGear { @Take HostMessage nodeInfo; @Take HashMap<String, LinkedList<HostMessage>> topology; @Override protected void run(CodeGearManager cgm) { String nodeName = nodeInfo.getNodeName(); LinkedList<HostMessage> connections; if (!topology.containsKey(nodeName)) { connections = new LinkedList<HostMessage>(); } else { connections = topology.get(nodeName); } connections.add(nodeInfo); topology.put(nodeName, connections); getLocalDGM().put("topology", topology); } }