Mercurial > hg > Database > Alice
diff src/main/java/alice/test/topology/aquarium/CheckLocalIndex.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | aefbe41fcf12 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/test/topology/aquarium/CheckLocalIndex.java Wed Apr 16 18:26:07 2014 +0900 @@ -0,0 +1,33 @@ +package alice.test.topology.aquarium; + +import java.util.List; + +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class CheckLocalIndex extends CodeSegment { + + private Receiver data = ids.create(CommandType.PEEK); + private Receiver list = ids.create(CommandType.PEEK); + + public CheckLocalIndex(String key, int index){ + this.list.setKey("_CLIST"); + this.data.setKey(key, index); + } + + @Override + public void run() { + @SuppressWarnings("unchecked") + List<String> r = list.asClass(List.class); + for (String node : r) { + if (!node.equals(data.from)) { + System.out.println(data.from); + ods.update(node, data.key, data.getVal()); + } + } + new CheckLocalIndex(data.key, data.index); + + } + +}