Mercurial > hg > Database > Alice
changeset 587:4d38c71938f5 dispose
change ConfigrationFinish
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Jan 2016 20:31:06 +0900 |
parents | ba4ec1a593f9 |
children | dd9bd18fd878 |
files | src/main/java/alice/topology/node/ConfigurationFinish.java src/main/java/alice/topology/node/IncomingConnectionInfo.java src/main/java/alice/topology/node/StartTopologyNode.java |
diffstat | 3 files changed, 17 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/topology/node/ConfigurationFinish.java Sat Jan 30 16:53:50 2016 +0900 +++ b/src/main/java/alice/topology/node/ConfigurationFinish.java Sat Jan 30 20:31:06 2016 +0900 @@ -12,9 +12,11 @@ public Receiver reverseCount = ids.create(CommandType.PEEK); public Receiver configNodeNum = ids.create(CommandType.PEEK); private CodeSegment startCS; + private int topMNumber; - public ConfigurationFinish(CodeSegment startCS) { + public ConfigurationFinish(CodeSegment startCS, int topMNum) { this.startCS = startCS; + this.topMNumber = topMNum; } @Override @@ -22,18 +24,22 @@ int rcount = reverseCount.asInteger(); int ncount = configNodeNum.asInteger(); if (rcount == ncount) { - ods.put("manager", "done", ValueFactory.createNilValue()); - Start cs = new Start(startCS); - cs.done.setKey("manager", "start"); + ods.put("manager"+topMNumber, "done", ValueFactory.createNilValue()); + + if (topMNumber == 1){ + Start cs = new Start(startCS); + cs.done.setKey("manager"+topMNumber, "start"); - new StartKeepAlive().execute(); - new ReceiveCloseMessage(CommandType.PEEK); - ClosedEventManager.getInstance().register(DeleteConnection.class); - ClosedEventManager.getInstance().setKey(); + new StartKeepAlive().execute(); + new ReceiveCloseMessage(CommandType.PEEK); + ClosedEventManager.getInstance().register(DeleteConnection.class); + ClosedEventManager.getInstance().setKey(); + } + return; } - ConfigurationFinish cs3 = new ConfigurationFinish(startCS); + ConfigurationFinish cs3 = new ConfigurationFinish(startCS, topMNumber); cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); cs3.configNodeNum.setKey("local", "configNodeNum"); }
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sat Jan 30 16:53:50 2016 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sat Jan 30 20:31:06 2016 +0900 @@ -21,7 +21,7 @@ @Override public void run() { - if (this.hostInfo.getVal() == null) { + if (this.hostInfo.getVal() == null) {//hostMessageがなかったら? ods.put("local", "configNodeNum", count); } else { HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class);
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Sat Jan 30 16:53:50 2016 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Sat Jan 30 20:31:06 2016 +0900 @@ -50,7 +50,7 @@ ods.put("local", "reverseCount", 0); if (topMNumber == 1){ - ConfigurationFinish cs3 = new ConfigurationFinish(startCS); + ConfigurationFinish cs3 = new ConfigurationFinish(startCS, topMNumber); cs3.reverseCount.setKey("local", "reverseCount"); cs3.configNodeNum.setKey("local", "configNodeNum"); } else {