annotate src/main/java/alice/topology/manager/ConfigWaiter.java @ 419:aefbe41fcf12 dispose

change tab to space
author sugi
date Tue, 15 Jul 2014 16:00:22 +0900
parents 91e1b063a89f
children 59e84cd75403
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
401
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
1 package alice.topology.manager;
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
2
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
3 import org.msgpack.type.ValueFactory;
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
4
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
5 import alice.codesegment.CodeSegment;
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
6 import alice.datasegment.CommandType;
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
7 import alice.datasegment.Receiver;
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
8
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
9 public class ConfigWaiter extends CodeSegment {
419
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
10
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
11 public Receiver done = ids.create(CommandType.TAKE);
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
12 public int count;
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
13
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
14 public ConfigWaiter(int nodeNum) {
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
15 this.count = nodeNum;
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
16 }
401
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
17
419
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
18 @Override
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
19 public void run() {
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
20 count--;
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
21 if (count == 0) {
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
22 ods.put("local", "start", ValueFactory.createNilValue());
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
23 return;
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
24 }
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
25 ConfigWaiter cs3 = new ConfigWaiter(count);
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
26 cs3.done.setKey("local", "done");
aefbe41fcf12 change tab to space
sugi
parents: 401
diff changeset
27 }
401
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
28
91e1b063a89f haven't to remove manager package
sugi
parents:
diff changeset
29 }