Mercurial > hg > Database > Christie
changeset 66:4e2453333508
del IncomingAbstractHostName
author | akahori |
---|---|
date | Thu, 30 Aug 2018 11:06:34 +0900 |
parents | 5deea416f980 |
children | d74a64a3940a |
files | src/main/java/christie/topology/node/IncomingAbstractHostName.java src/main/java/christie/topology/node/IncomingConnectionInfo.java src/main/java/christie/topology/node/TopologyNode.java |
diffstat | 3 files changed, 20 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- 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())); - } - -}
--- 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); } }
--- 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<String>()); 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());