345
|
1 package alice.test.topology.aquarium;
|
|
2
|
|
3 import java.util.List;
|
|
4
|
|
5 import alice.codesegment.CodeSegment;
|
|
6 import alice.datasegment.CommandType;
|
|
7 import alice.datasegment.Receiver;
|
|
8
|
|
9 public class CheckLocalIndex extends CodeSegment {
|
|
10
|
419
|
11 private Receiver data = ids.create(CommandType.PEEK);
|
|
12 private Receiver list = ids.create(CommandType.PEEK);
|
|
13
|
547
|
14 public CheckLocalIndex(String key){
|
|
15 this.list.setKey("_CLIST", this);
|
|
16 this.data.setKey(key, this);
|
419
|
17 }
|
|
18
|
|
19 @Override
|
|
20 public void run() {
|
|
21 @SuppressWarnings("unchecked")
|
|
22 List<String> r = list.asClass(List.class);
|
|
23 for (String node : r) {
|
|
24 if (!node.equals(data.from)) {
|
|
25 System.out.println(data.from);
|
|
26 ods.update(node, data.key, data.getVal());
|
|
27 }
|
|
28 }
|
547
|
29 new CheckLocalIndex(data.key);
|
419
|
30
|
|
31 }
|
345
|
32
|
|
33 }
|