Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/StartTopologyNode.java @ 374:5ceb1c4db167 multicast
create setter and getter for TopologyNodeConfig member-variables
author | sugi |
---|---|
date | Wed, 04 Jun 2014 00:18:26 +0900 |
parents | 8f71c3e6f11d |
children | 3a0056e03040 |
line wrap: on
line source
package alice.topology.node; import java.net.InetAddress; import java.net.UnknownHostException; import alice.codesegment.CodeSegment; import alice.datasegment.DataSegment; import alice.topology.HostMessage; public class StartTopologyNode extends CodeSegment { private TopologyNodeConfig conf; private CodeSegment startCS; public StartTopologyNode(TopologyNodeConfig conf, CodeSegment startCS) { this.conf = conf; this.startCS = startCS; } @Override public void run() { DataSegment.connect("manager", "", conf.getManagerHostName(), conf.getManagerPort(), false); String localHostName = null; try { localHostName = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { e.printStackTrace(); } HostMessage host = new HostMessage(localHostName, conf.localPort); ods.put("manager", "host", host); IncomingAbstractHostName cs = new IncomingAbstractHostName(host); cs.absName.setKey("local", "host"); IncomingReverseKey cs2 = new IncomingReverseKey(); cs2.reverseKey.setKey("local", "reverseKey"); cs2.reverseCount.setKey("local", "reverseCount"); ods.put("local", "reverseCount", 0); ConfigurationFinish cs3 = new ConfigurationFinish(startCS); cs3.reverseCount.setKey("local", "reverseCount"); cs3.configNodeNum.setKey("local", "configNodeNum"); } }