diff src/alice/topology/node/StartTopologyNode.java @ 34:ca079a730d0b

added method to OutputDataSegment and Receiver, to convert type from Value to Class<?> without MessagePack
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Thu, 19 Jan 2012 16:01:50 +0900
parents b5a21baf0b07
children 1a498f436332
line wrap: on
line diff
--- a/src/alice/topology/node/StartTopologyNode.java	Wed Jan 18 01:34:23 2012 +0900
+++ b/src/alice/topology/node/StartTopologyNode.java	Thu Jan 19 16:01:50 2012 +0900
@@ -1,15 +1,10 @@
 package alice.topology.node;
 
-import java.io.IOException;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
-import org.msgpack.MessagePack;
-import org.msgpack.type.ValueFactory;
-
 import alice.codesegment.CodeSegment;
 import alice.datasegment.DataSegment;
-import alice.datasegment.DataSegmentManager;
 import alice.topology.HostMessage;
 
 public class StartTopologyNode extends CodeSegment {
@@ -24,17 +19,16 @@
 	
 	@Override
 	public void run() {
-		DataSegmentManager manager = DataSegment.connect("manager", "", conf.managerHostName, conf.managerPort);
+		DataSegment.connect("manager", "", conf.managerHostName, conf.managerPort);
+		String localHostName = null;
 		try {
-			HostMessage host;
-			host = new HostMessage(InetAddress.getLocalHost().getHostName(), conf.localPort);
-			MessagePack msgpack = new MessagePack();
-			manager.put("host", msgpack.unconvert(host));
+			localHostName = InetAddress.getLocalHost().getHostName();
 		} catch (UnknownHostException e) {
 			e.printStackTrace();
-		} catch (IOException e) {
-			e.printStackTrace();
 		}
+		HostMessage host;
+		host = new HostMessage(localHostName, conf.localPort);
+		ods.put("manager", "host", host);
 		
 		IncomingAbstractHostName cs1 = new IncomingAbstractHostName();
 		cs1.absName.setKey("local", "host");
@@ -43,7 +37,7 @@
 		cs2.reverseKey.setKey("local", "reverseKey");
 		cs2.reverseCount.setKey("local", "reverseCount");
 		
-		ods.put("local", "reverseCount", ValueFactory.createIntegerValue(0));
+		ods.put("local", "reverseCount", 0);
 		
 		ConfigurationFinish cs3 = new ConfigurationFinish(clazz);
 		cs3.reverseCount.setKey("local", "reverseCount");