changeset 271:3667ab045530

refactor
author sugi
date Sat, 24 Aug 2013 18:17:42 +0900
parents 23e53aaa8720
children 4c74418eaf96
files src/alice/test/topology/aquarium/CheckMyName.java src/alice/topology/manager/IncomingHosts.java src/alice/topology/manager/reconnection/CheckABSName.java src/alice/topology/manager/reconnection/CheckConnectionList.java src/alice/topology/manager/reconnection/ReceiveError.java src/alice/topology/manager/reconnection/ReceiveReconnectData.java src/alice/topology/node/IncomingAbstractHostName.java src/alice/topology/node/IncomingConnectionInfo.java src/alice/topology/node/IncomingReverseKey.java
diffstat 9 files changed, 4 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/CheckMyName.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/test/topology/aquarium/CheckMyName.java	Sat Aug 24 18:17:42 2013 +0900
@@ -54,7 +54,7 @@
 			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
 		}
-		/*
+		
 		for (int i = 3; i < 6 ; i++){
 			key = "fish"+i;
 			if (num == 1) new AutoIncrement(key,0);
@@ -91,7 +91,7 @@
 					-(float)Math.random(), (float)Math.random()));
 			new SetLocation(new MakeObject(frame), key, 0);
 			new CheckLocalIndex(key,1);
-		}*/
+		}
 		
 	}
 }
--- a/src/alice/topology/manager/IncomingHosts.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/manager/IncomingHosts.java	Sat Aug 24 18:17:42 2013 +0900
@@ -34,12 +34,10 @@
 		// Manager connect to Node
 		// this connection must disconnect
 		DataSegment.connect(nodeName, "", host.name, host.port);
-		System.out.println(nodeName);
 		ods.put(nodeName, "host", nodeName);
 		LinkedList<NodeInfo> nodes = topology.get(nodeName);
 		ArrayList<HostMessage> list;
 		for (NodeInfo nodeInfo : nodes) {
-			//System.out.println(host.name+" "+host.port+" "+nodeInfo.connectionName+" "+ nodeInfo.reverseName+" "+nodeInfo.sourceNodeName);
 			HostMessage newHost = new HostMessage(host.name, host.port, nodeInfo.connectionName, nodeInfo.reverseName);
 			ods.put("local", nodeInfo.sourceNodeName, newHost);
 			
@@ -64,14 +62,6 @@
 			cs.host.setKey("local", "host");
 			cs.connection.setKey("local", "connection");
 		}
-		
-		// for Debug
-		if (connectionList.containsKey("node0")){
-			ArrayList<HostMessage> maplist = connectionList.get("node0");
-			for (HostMessage i : maplist){
-				System.out.println(i.name+" "+i.port+" "+i.connectionName+" "+i.reverseName);
-			}
-		}
 	}
 
 }
--- a/src/alice/topology/manager/reconnection/CheckABSName.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/manager/reconnection/CheckABSName.java	Sat Aug 24 18:17:42 2013 +0900
@@ -21,14 +21,12 @@
 
 	@Override
 	public void run() {
-		System.out.println("CheckABSName");
 		@SuppressWarnings("unchecked")
 		List<HostMessage> ABSIPList = abs.asClass(List.class);
 		HostMessage hostInfo = host.asClass(HostMessage.class);
 		for (HostMessage mes : ABSIPList){
 			if (mes.name.equals(message.name)&&mes.port == message.port){
 				DataSegment.remove(mes.getABSName());
-				System.out.println(mes.getABSName()+" "+hostInfo.name+" "+hostInfo.port );
 				DataSegment.connect(mes.getABSName(), "", hostInfo.name, hostInfo.port);
 				ods.put(mes.getABSName(), "host", mes.getABSName());
 				ods.put("_RECABSNAME", mes.getABSName());
@@ -42,10 +40,7 @@
 		}
 		ods.put("host", hostInfo);
 		new ReceiveError();
-		
-		
-		// check node side 
-		
+
 	}
 
 }
--- a/src/alice/topology/manager/reconnection/CheckConnectionList.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/manager/reconnection/CheckConnectionList.java	Sat Aug 24 18:17:42 2013 +0900
@@ -27,7 +27,6 @@
 	
 	@Override
 	public void run() {
-		System.out.println("CheckConnectionList");
 		@SuppressWarnings("unchecked")
 		HashMap<String, ArrayList<HostMessage>> connectionList = connection.asClass(HashMap.class);
 		@SuppressWarnings("unchecked")
@@ -53,22 +52,15 @@
 						if (mes3.name.equals(oldInfo.name)&&mes3.port == oldInfo.port){
 							mes3.name = newInfo.name;
 							mes3.port = newInfo.port;
-							System.out.println(mes3.port);
-							System.out.println(mes3.name);
-							System.out.println(absName2+" "+newInfo.port);
 							ods.put(absName2, "_RECODATA", mes3);
 							break;
 						}
-						
-						
 					}
 					break;
 				}			
 			}
 		}
 		ods.put(absName, ValueFactory.createNilValue());
-		
-		
 		ods.update("connection", connectionList);
 		new ReceiveError();
 	}
--- a/src/alice/topology/manager/reconnection/ReceiveError.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/manager/reconnection/ReceiveError.java	Sat Aug 24 18:17:42 2013 +0900
@@ -16,15 +16,11 @@
 	
 	@Override
 	public void run() {		
-		System.out.println("run Receive Error");
 		HostMessage message = reportInfo.asClass(HostMessage.class);
 		try {
 			Socket socket = new Socket(message.name, message.port);
 			socket.close();
 		} catch (IOException e) {
-			System.out.println("Erorr");
-			System.out.println(message.name);
-			System.out.println(message.port);
 			new CheckABSName(message);
 			return;
 		}
--- a/src/alice/topology/manager/reconnection/ReceiveReconnectData.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/manager/reconnection/ReceiveReconnectData.java	Sat Aug 24 18:17:42 2013 +0900
@@ -15,7 +15,6 @@
 	
 	@Override
 	public void run() {
-		System.out.println("ReceiveReconnectData");
 		HostMessage host = hostData.asClass(HostMessage.class);
 		DataSegment.remove(host.connectionName);
 		DataSegment.connect(host.connectionName, host.reverseName, host.name, host.port);
--- a/src/alice/topology/node/IncomingAbstractHostName.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/node/IncomingAbstractHostName.java	Sat Aug 24 18:17:42 2013 +0900
@@ -19,7 +19,6 @@
 		String absName = this.absName.asString();
 		IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, 0);
 		cs.hostInfo.setKey("manager", absName);
-		System.out.println(absName);
 		host.setABSName(absName);
 		ods.put("manager","_ABS_IP", host);
 	}
--- a/src/alice/topology/node/IncomingConnectionInfo.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/node/IncomingConnectionInfo.java	Sat Aug 24 18:17:42 2013 +0900
@@ -32,19 +32,17 @@
 	public void run() {
 		if (this.hostInfo.getVal() == null) {
 			ods.put("local", "configNodeNum", count);
-			System.out.println("bbb");
 			return;
 		}
 		
 		HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class);
-		System.out.println(hostInfo.connectionName+" "+hostInfo.name+" "+hostInfo.port );
 		DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port);
 		ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName);
 		connectionList.add(hostInfo.connectionName);
 		ods.update("_CLIST", connectionList);
 		IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count, connectionList);
 		cs.hostInfo.setKey("manager", absName);
-		System.out.println("aaa");
+		
 	}
 
 }
--- a/src/alice/topology/node/IncomingReverseKey.java	Wed Aug 21 15:33:49 2013 +0900
+++ b/src/alice/topology/node/IncomingReverseKey.java	Sat Aug 24 18:17:42 2013 +0900
@@ -13,7 +13,6 @@
 	
 	@Override
 	public void run() {
-		System.out.println("incomingReversekey");
 		String reverseKey = ((Value)this.reverseKey.getVal()).asRawValue().getString();
 		String from = this.reverseKey.from;
 		DataSegment.getAccept(from).reverseKey = reverseKey;