Mercurial > hg > Database > Alice
annotate src/alice/test/topology/aquarium/CheckLocalIndex.java @ 303:6e0a909b4b12
add PingScheduler
author | sugi |
---|---|
date | Tue, 19 Nov 2013 14:04:57 +0900 |
parents | 84b7eac2ff7d |
children |
rev | line source |
---|---|
134 | 1 package alice.test.topology.aquarium; |
109 | 2 |
259 | 3 import java.util.List; |
4 | |
109 | 5 import alice.codesegment.CodeSegment; |
6 import alice.datasegment.CommandType; | |
7 import alice.datasegment.Receiver; | |
8 | |
9 public class CheckLocalIndex extends CodeSegment { | |
10 | |
11 private Receiver data = ids.create(CommandType.PEEK); | |
138 | 12 private Receiver list = ids.create(CommandType.PEEK); |
109 | 13 |
14 public CheckLocalIndex(String key, int index){ | |
259 | 15 this.list.setKey("_CLIST"); |
217 | 16 this.data.setKey(key, index); |
109 | 17 } |
18 | |
19 @Override | |
20 public void run() { | |
259 | 21 @SuppressWarnings("unchecked") |
22 List<String> r = list.asClass(List.class); | |
290
4074077d118d
Refactor iterating process with for-each sentence.
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
23 for (String node : r) { |
4074077d118d
Refactor iterating process with for-each sentence.
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
259
diff
changeset
|
24 if (!node.equals(data.from)) { |
303 | 25 System.out.println(data.from); |
259 | 26 ods.update(node, data.key, data.getVal()); |
138 | 27 } |
28 } | |
259 | 29 new CheckLocalIndex(data.key, data.index); |
109 | 30 |
31 } | |
32 | |
33 } |