annotate src/alice/topology/node/ConfigurationFinish.java @ 268:709936c00c89

creating reconnect manager
author sugi
date Sun, 18 Aug 2013 02:13:52 +0900
parents fec0726bb126
children 9982e1c4f099
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package alice.topology.node;
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
35
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
3 import org.msgpack.type.ValueFactory;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
4
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 import alice.codesegment.CodeSegment;
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 import alice.datasegment.CommandType;
33
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
7 import alice.datasegment.Receiver;
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 public class ConfigurationFinish extends CodeSegment {
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
33
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
11 public Receiver reverseCount = ids.create(CommandType.PEEK);
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
12 public Receiver configNodeNum = ids.create(CommandType.PEEK);
46
1a498f436332 bug fix for time calculate
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
13 private CodeSegment startCS;
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
46
1a498f436332 bug fix for time calculate
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
15 public ConfigurationFinish(CodeSegment startCS) {
1a498f436332 bug fix for time calculate
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
16 this.startCS = startCS;
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 @Override
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 public void run() {
214
fec0726bb126 remove error
one
parents: 212
diff changeset
21 if (reverseCount.getVal().equals(configNodeNum.getVal())) {
35
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
22 ods.put("manager", "done", ValueFactory.createNilValue());
46
1a498f436332 bug fix for time calculate
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
23 Start cs = new Start(startCS);
35
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
24 cs.done.setKey("manager", "start");
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 return;
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 }
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
46
1a498f436332 bug fix for time calculate
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 39
diff changeset
28 ConfigurationFinish cs3 = new ConfigurationFinish(startCS);
214
fec0726bb126 remove error
one
parents: 212
diff changeset
29 cs3.reverseCount.setKey("local", "reverseCount", this.reverseCount.index);
28
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 cs3.configNodeNum.setKey("local", "configNodeNum");
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 }
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
98ab26e09a98 Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 }