diff src/alice/test/topology/aquarium/CheckLocalIndex.java @ 259:ccce30f84380

use "_CLIST" Key
author sugi
date Tue, 16 Jul 2013 16:00:41 +0900
parents b5c642ba998e
children 4074077d118d
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/CheckLocalIndex.java	Sat Jul 13 20:55:32 2013 +0900
+++ b/src/alice/test/topology/aquarium/CheckLocalIndex.java	Tue Jul 16 16:00:41 2013 +0900
@@ -1,5 +1,8 @@
 package alice.test.topology.aquarium;
 
+import java.util.Iterator;
+import java.util.List;
+
 import alice.codesegment.CodeSegment;
 import alice.datasegment.CommandType;
 import alice.datasegment.Receiver;
@@ -10,21 +13,22 @@
 	private Receiver list = ids.create(CommandType.PEEK);
 	
 	public CheckLocalIndex(String key, int index){
-		
-		this.list.setKey("list");
+		this.list.setKey("_CLIST");
 		this.data.setKey(key, index);
 	}
 	
 	@Override
 	public void run() {
-		RoutingTable rt = this.list.asClass(RoutingTable.class);
-		for (Routing r : rt.table) {
-			if (!r.name.equals(this.data.from)){
-				ods.update(r.name, data.key, this.data.getVal());
+		@SuppressWarnings("unchecked")
+		List<String> r = list.asClass(List.class);
+		for (Iterator<String> ir = r.iterator();ir.hasNext();) {
+			String node = ir.next();
+			if (!node.equals(data.from)){
+				ods.update(node, data.key, data.getVal());
 			}
 			
 		}
-		new CheckLocalIndex(this.data.key, this.data.index);
+		new CheckLocalIndex(data.key, data.index);
 		
 	}