changeset 150:206c7dd9cb48 working

remove version alpha beta
author sugi
date Tue, 27 Nov 2012 19:41:52 +0900
parents 3e8e16b33406
children 98a1292ae8ef
files src/alice/test/codesegment/local/TestCodeSegment.java src/alice/test/codesegment/local/TestLocalAlice.java src/alice/test/codesegment/remote/alpha/FishPoint.java src/alice/test/codesegment/remote/alpha/RemoteIncrement.java src/alice/test/codesegment/remote/alpha/RemoteStartCodeSegment.java src/alice/test/codesegment/remote/alpha/TestRemoteAlice.java src/alice/test/codesegment/remote/alpha/TestRemoteConfig.java src/alice/test/codesegment/remote/beta/FishPoint.java src/alice/test/codesegment/remote/beta/RemoteIncrement.java src/alice/test/codesegment/remote/beta/RemoteStartCodeSegment.java src/alice/test/codesegment/remote/beta/TestRemoteAlice.java src/alice/test/codesegment/remote/beta/TestRemoteConfig.java src/alice/test/topology/share/CheckLocalIndex.java src/alice/test/topology/share/CheckMyName.java
diffstat 14 files changed, 10 insertions(+), 254 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/TestCodeSegment.java	Tue Nov 20 14:04:57 2012 +0900
+++ b/src/alice/test/codesegment/local/TestCodeSegment.java	Tue Nov 27 19:41:52 2012 +0900
@@ -22,15 +22,16 @@
 	public void run() {
 		FishPoint fp = this.arg1.asClass(FishPoint.class);
 		//System.out.println("index = " + arg1.index);
-		System.out.println("data = " + arg1.val);
+		//System.out.println("data = " + arg1.val);
 		//System.out.println(arg1.val.getType());
 		
-		/*
-		if (arg1.index == 10) {
+		
+		if (arg1.index > 100000) {
+			System.out.println(System.currentTimeMillis()-TestLocalAlice.t);
 			System.exit(0);
 			return;
 		}
-		
+		/*
 		TestCodeSegment cs = new TestCodeSegment();
 		cs.arg1.setKey("key1", arg1.index);
 		*/
--- a/src/alice/test/codesegment/local/TestLocalAlice.java	Tue Nov 20 14:04:57 2012 +0900
+++ b/src/alice/test/codesegment/local/TestLocalAlice.java	Tue Nov 27 19:41:52 2012 +0900
@@ -1,6 +1,7 @@
 package alice.test.codesegment.local;
 
 public class TestLocalAlice {
+	static long t = System.currentTimeMillis();
 	public static void main(String args[]) {
 		new StartCodeSegment().execute();
 	}
--- a/src/alice/test/codesegment/remote/alpha/FishPoint.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-package alice.test.codesegment.remote.alpha;
-
-import org.msgpack.annotation.Message;
-
-@Message
-public class FishPoint {
-	// public fields are serialized.
-	public float x = 0.0f;
-	public float y = 0.0f;
-	public String vector = "light"; 
-	
-	public FishPoint(){}
-	
-	public FishPoint(float x,float y){
-		this.x = x;
-		this.y = y;
-	}
-		
-	public void setXY(float x,float y){
-		this.x = x;
-		this.y = y;
-	}
-	
-	public float getX(){
-		return this.x;
-	}
-	
-	public float getY(){
-		return this.y;
-	}
-	
-	public String getVector(){
-		return this.vector;
-	}
-
-}
--- a/src/alice/test/codesegment/remote/alpha/RemoteIncrement.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-package alice.test.codesegment.remote.alpha;
-
-import alice.codesegment.CodeSegment;
-import alice.datasegment.CommandType;
-import alice.datasegment.Receiver;
-
-public class RemoteIncrement extends CodeSegment {
-
-	public Receiver data = ids.create(CommandType.TAKE);
-	
-	public RemoteIncrement(int index){
-		this.data.setKey("remote", "num", index);
-	}
-	
-	@Override
-	public void run() {	
-		System.out.println(data.val);
-		FishPoint fp = this.data.asClass(FishPoint.class);
-		fp.setXY(fp.x+1.0f, fp.getY()+1.0f);
-		new RemoteIncrement(this.data.index);
-		ods.put("local", "num", fp);
-	}
-
-}
--- a/src/alice/test/codesegment/remote/alpha/RemoteStartCodeSegment.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package alice.test.codesegment.remote.alpha;
-
-import alice.codesegment.CodeSegment;
-
-public class RemoteStartCodeSegment extends CodeSegment {
-	
-	@Override
-	public void run() {
-		new RemoteIncrement(0);
-		//ods.put("local", "num", new FishPoint());
-	}
-
-}
--- a/src/alice/test/codesegment/remote/alpha/TestRemoteAlice.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-package alice.test.codesegment.remote.alpha;
-
-import alice.daemon.AliceDaemon;
-import alice.datasegment.DataSegment;
-
-public class TestRemoteAlice {
-
-	public static void main(String[] args) {
-		TestRemoteConfig conf = new TestRemoteConfig(args);
-
-		new AliceDaemon(conf).listen();
-		DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort);
-		
-		new RemoteStartCodeSegment().execute();
-	}
-
-}
--- a/src/alice/test/codesegment/remote/alpha/TestRemoteConfig.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-package alice.test.codesegment.remote.alpha;
-
-import alice.daemon.Config;
-
-public class TestRemoteConfig extends Config {
-
-	public String hostname;
-	public int connectPort = 10000;
-	public String key;
-
-	public TestRemoteConfig(String[] args) {
-		super(args);
-		for (int i = 0; i< args.length; i++) {
-			if ("-h".equals(args[i])) {
-				hostname = args[++i];
-			} else if ("-cp".equals(args[i])) {
-				connectPort = Integer.parseInt(args[++i]);
-			} else if ("-key".equals(args[i])) {
-				key = args[++i];
-			}
-		}
-	}
-
-}
--- a/src/alice/test/codesegment/remote/beta/FishPoint.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-package alice.test.codesegment.remote.beta;
-
-import org.msgpack.annotation.Message;
-import org.msgpack.annotation.Optional;
-
-@Message
-public class FishPoint {
-	// public fields are serialized.
-	public float x = 0.0f;
-	public float y = 0.0f;
-	public String vector = "light"; 
-	@Optional public float z = 0.0f;
-	
-	
-	public FishPoint(){}
-	
-	public FishPoint(float x,float y){
-		this.x = x;
-		this.y = y;
-	}
-	
-	public FishPoint(float x,float y,float z){
-		this.x = x;
-		this.y = y;
-		this.z = z;
-	}
-	
-	public void setXY(float x,float y){
-		this.x = x;
-		this.y = y;
-	}
-	
-	public void setXYZ(float x,float y,float z){
-		this.x = x;
-		this.y = y;
-		this.z = z;
-	}
-	
-	public float getX(){
-		return this.x;
-	}
-	
-	public float getY(){
-		return this.y;
-	}
-	
-	public float getZ(){
-		return this.z;
-	}
-	
-	public String getVector(){
-		return this.vector;
-	}
-
-}
--- a/src/alice/test/codesegment/remote/beta/RemoteIncrement.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-package alice.test.codesegment.remote.beta;
-
-import alice.codesegment.CodeSegment;
-import alice.datasegment.CommandType;
-import alice.datasegment.Receiver;
-
-public class RemoteIncrement extends CodeSegment {
-
-	public Receiver data = ids.create(CommandType.TAKE);
-	
-	public RemoteIncrement(int index){
-		this.data.setKey("remote", "num", index);
-	}
-	
-	@Override
-	public void run() {	
-		System.out.println(data.val);
-		FishPoint fp = this.data.asClass(FishPoint.class);
-		fp.setXYZ(fp.getX()+1.0f, fp.getY()+1.0f, fp.getZ()+1.0f);
-		new RemoteIncrement(this.data.index);
-		ods.put("local", "num", fp);
-	}
-}
--- a/src/alice/test/codesegment/remote/beta/RemoteStartCodeSegment.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package alice.test.codesegment.remote.beta;
-
-import alice.codesegment.CodeSegment;
-
-public class RemoteStartCodeSegment extends CodeSegment {
-	
-	@Override
-	public void run() {
-		new RemoteIncrement(0);
-		ods.put("local", "num", new FishPoint(0.0f, 0.0f, 0.0f));
-	}
-
-}
--- a/src/alice/test/codesegment/remote/beta/TestRemoteAlice.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-package alice.test.codesegment.remote.beta;
-
-import alice.daemon.AliceDaemon;
-import alice.datasegment.DataSegment;
-
-public class TestRemoteAlice {
-
-	public static void main(String[] args) {
-		TestRemoteConfig conf = new TestRemoteConfig(args);
-
-		new AliceDaemon(conf).listen();
-		DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort);
-		
-		new RemoteStartCodeSegment().execute();
-	}
-
-}
--- a/src/alice/test/codesegment/remote/beta/TestRemoteConfig.java	Tue Nov 20 14:04:57 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-package alice.test.codesegment.remote.beta;
-
-import alice.daemon.Config;
-
-public class TestRemoteConfig extends Config {
-
-	public String hostname;
-	public int connectPort = 10000;
-	public String key;
-
-	public TestRemoteConfig(String[] args) {
-		super(args);
-		for (int i = 0; i< args.length; i++) {
-			if ("-h".equals(args[i])) {
-				hostname = args[++i];
-			} else if ("-cp".equals(args[i])) {
-				connectPort = Integer.parseInt(args[++i]);
-			} else if ("-key".equals(args[i])) {
-				key = args[++i];
-			}
-		}
-	}
-
-}
--- a/src/alice/test/topology/share/CheckLocalIndex.java	Tue Nov 20 14:04:57 2012 +0900
+++ b/src/alice/test/topology/share/CheckLocalIndex.java	Tue Nov 27 19:41:52 2012 +0900
@@ -24,14 +24,16 @@
 	public void run() {
 		RoutingTable rt = this.list.asClass(RoutingTable.class);
 		int count = 0;
+		boolean flag = false;
 		for (Routing r : rt.table) {
+			if (r.name.equals("parent"))flag=true;
 			if (!r.name.equals(this.data.from)){
 				ods.update(r.name, this.key, this.data.val);
 				count++;
 			}
 			
 		}
-		if (count==0){
+		if (count==0&&flag){
 			ods.put("parent", "data", this.data.val);
 		}
 		new CheckLocalIndex(this.key, this.data.index);
--- a/src/alice/test/topology/share/CheckMyName.java	Tue Nov 20 14:04:57 2012 +0900
+++ b/src/alice/test/topology/share/CheckMyName.java	Tue Nov 27 19:41:52 2012 +0900
@@ -40,14 +40,12 @@
 			new AddRoutingTable(routing,0);
 			ods.put("parent", "member", name);
 			new SendData(0);
-			new CheckLocalIndex(key,1);
 		}else if (type.equals("node")){
 			//System.out.println("node"+num);
 			if (num != 0){
 				routing.table.add(new Routing("parent"));
 				ods.put("parent", "member", name);
 				new SendData(0);
-				new CheckLocalIndex(key,1);
 			}else{
 				new LookUpData("data",0);
 			}
@@ -59,6 +57,6 @@
 		ods.update("local", key, new DataInfo());
 		
 		if (num == 0) new AutoIncrement(key,0);
-				
+		new CheckLocalIndex(key,1);
 	}
 }