# HG changeset patch # User akahori # Date 1535594794 -32400 # Node ID 4e2453333508c70f342db798b287182f21b755f6 # Parent 5deea416f980ae93a39b55047b71111feb2b15e8 del IncomingAbstractHostName diff -r 5deea416f980 -r 4e2453333508 src/main/java/christie/topology/node/IncomingAbstractHostName.java --- a/src/main/java/christie/topology/node/IncomingAbstractHostName.java Thu Aug 30 10:56:37 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -package christie.topology.node; - - -import christie.annotation.Peek; -import christie.codegear.CodeGear; -import christie.codegear.CodeGearManager; - -public class IncomingAbstractHostName extends CodeGear { - - private final TopologyNodeConfig conf; - @Peek - String nodeName; - - public IncomingAbstractHostName(TopologyNodeConfig conf) { - this.conf = conf; - } - - @Override - protected void run(CodeGearManager cgm) { - cgm.setup(new IncomingConnectionInfo(nodeName, 0, conf.getManagerKey())); - } - -} diff -r 5deea416f980 -r 4e2453333508 src/main/java/christie/topology/node/IncomingConnectionInfo.java --- a/src/main/java/christie/topology/node/IncomingConnectionInfo.java Thu Aug 30 10:56:37 2018 +0900 +++ b/src/main/java/christie/topology/node/IncomingConnectionInfo.java Thu Aug 30 11:06:34 2018 +0900 @@ -1,6 +1,7 @@ package christie.topology.node; +import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; @@ -8,37 +9,39 @@ import org.apache.log4j.Logger; public class IncomingConnectionInfo extends CodeGear { + @Peek + TopologyNodeConfig topologyNodeConfig; + + @Peek + String nodeName; @Take HostMessage remoteNodeInfo; - private String absName; - private int count; - private Logger log = Logger.getLogger(IncomingConnectionInfo.class); - private String managerKey; + @Take + int count; - public IncomingConnectionInfo(String absName, int count, String managerKey) { - this.absName = absName; - this.count = count; - this.managerKey = managerKey; - //remoteNodeInfo.setKey(managerKey,absName); + private Logger log = Logger.getLogger(IncomingConnectionInfo.class); + + + public IncomingConnectionInfo() { } @Override protected void run(CodeGearManager cgm) { - + String managerKey = topologyNodeConfig.getManagerKey(); log.info(remoteNodeInfo.toString()); if ( remoteNodeInfo.hostName.equals("")) { // end case - log.info(" topology node finished " + absName); + log.info(" topology node finished " + nodeName); getLocalDGM().put("configNodeNum", 0); return ; } - log.info("topology node " + absName + " will connect to " + remoteNodeInfo.hostName ); + log.info("topology node " + nodeName + " will connect to " + remoteNodeInfo.hostName ); if (cgm.getDgmList().contains(remoteNodeInfo.connectionName)) { // need to wait remove by DeleteConnection - getDGM("manager").put(absName, remoteNodeInfo); + getDGM("manager").put(nodeName, remoteNodeInfo); } else { cgm.createRemoteDGM(remoteNodeInfo.connectionName, remoteNodeInfo.hostName, remoteNodeInfo.port); @@ -52,7 +55,8 @@ cgm.setup(new CreateConnectionList()); } - cgm.setup(new IncomingConnectionInfo(absName, count, managerKey)); + cgm.setup(new IncomingConnectionInfo()); + getLocalDGM().put("count", count); } } diff -r 5deea416f980 -r 4e2453333508 src/main/java/christie/topology/node/TopologyNode.java --- a/src/main/java/christie/topology/node/TopologyNode.java Thu Aug 30 10:56:37 2018 +0900 +++ b/src/main/java/christie/topology/node/TopologyNode.java Thu Aug 30 11:06:34 2018 +0900 @@ -33,12 +33,6 @@ e.printStackTrace(); } - - if (cgm.localPort == 0) { - // local test mode - localHostName = topologyNodeConfig.getLocalKey(); - - } getLocalDGM().put("config" , topologyNodeConfig); HostMessage host = new HostMessage(localHostName, cgm.localPort); @@ -47,9 +41,10 @@ getDGM(topologyNodeConfig.getManagerKey()).put("hostMessage", host); getLocalDGM().put("_CLIST", new ArrayList()); getLocalDGM().put("reverseCount", 0); + getLocalDGM().put("count", 0); cgm.setup(new SaveCookie()); - cgm.setup(new IncomingAbstractHostName(topologyNodeConfig)); + cgm.setup(new IncomingConnectionInfo()); cgm.setup(new IncomingReverseKey()); cgm.setup(new ConfigurationFinish());