Mercurial > hg > Database > Alice
diff src/main/java/alice/topology/manager/CheckComingHost.java @ 515:6161dcd3da02 dispose
dynamic reconnect
author | sugi |
---|---|
date | Wed, 21 Jan 2015 14:08:26 +0900 |
parents | 268b1280dc18 |
children | 80e461aa10e9 |
line wrap: on
line diff
--- a/src/main/java/alice/topology/manager/CheckComingHost.java Sat Jan 17 16:49:02 2015 +0900 +++ b/src/main/java/alice/topology/manager/CheckComingHost.java Wed Jan 21 14:08:26 2015 +0900 @@ -1,6 +1,7 @@ package alice.topology.manager; import java.util.HashMap; + import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; @@ -10,10 +11,12 @@ // checkIncomingHost private Receiver host = ids.create(CommandType.TAKE); private Receiver absCookieTable = ids.create(CommandType.PEEK); // cookie, AbsName HashMap + private Receiver config = ids.create(CommandType.PEEK); public CheckComingHost(){ this.host.setKey("host"); this.absCookieTable.setKey("absCookieTable"); + this.config.setKey("TMConfig"); } @Override @@ -21,6 +24,7 @@ HostMessage host = this.host.asClass(HostMessage.class); @SuppressWarnings("unchecked") HashMap<String, String> absCookieTable = this.absCookieTable.asClass(HashMap.class); + TopologyManagerConfig conf = this.config.asClass(TopologyManagerConfig.class); boolean match = false; // check cookie if (host.cookie != null) { @@ -34,7 +38,14 @@ if (match){ // coming host has ever joined this App ods.put("reconnectHost", host); - new SearchHostName(); + if (conf.dynamic) { //dynamic topology + if (conf.type == TopologyType.Tree) { + ods.put("orderHash", "order"); + ods.put("newHost", host); + } + } else { // static topology + new SearchHostName(); + } } else { ods.put("orderHash", "order"); ods.put("newHost", host);