Mercurial > hg > Database > Alice
diff src/main/java/alice/topology/node/ConfigurationFinish.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | 3a0056e03040 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/topology/node/ConfigurationFinish.java Wed Apr 16 18:26:07 2014 +0900 @@ -0,0 +1,36 @@ +package alice.topology.node; + +import org.msgpack.type.ValueFactory; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; +import alice.topology.manager.reconnection.ReceiveReconnectData; + +public class ConfigurationFinish extends CodeSegment { + + public Receiver reverseCount = ids.create(CommandType.PEEK); + public Receiver configNodeNum = ids.create(CommandType.PEEK); + private CodeSegment startCS; + + public ConfigurationFinish(CodeSegment startCS) { + this.startCS = startCS; + } + + @Override + public void run() { + if (reverseCount.getVal().equals(configNodeNum.getVal())) { + new ReceiveReconnectData(); + + ods.put("manager", "done", ValueFactory.createNilValue()); + Start cs = new Start(startCS); + cs.done.setKey("manager", "start"); + return; + } + + ConfigurationFinish cs3 = new ConfigurationFinish(startCS); + cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index); + cs3.configNodeNum.setKey("local", "configNodeNum"); + } + +}