# HG changeset patch # User sugi # Date 1373716532 -32400 # Node ID 7f7b3506bff91bd78516d0d7ec8c0360af6f2d1a # Parent 16bfc302bff274dc91f320ab0dcd3d90f9009800 client can get connection list setkey(_CLIST); diff -r 16bfc302bff2 -r 7f7b3506bff9 src/alice/test/topology/aquarium/CheckMyName.java --- a/src/alice/test/topology/aquarium/CheckMyName.java Tue Jul 09 17:41:18 2013 +0900 +++ b/src/alice/test/topology/aquarium/CheckMyName.java Sat Jul 13 20:55:32 2013 +0900 @@ -1,5 +1,6 @@ package alice.test.topology.aquarium; +import java.util.List; import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -11,16 +12,19 @@ public class CheckMyName extends CodeSegment { private Receiver host = ids.create(CommandType.PEEK); + private Receiver clist = ids.create(CommandType.PEEK); private Pattern pattern = Pattern.compile("^(node|cli)([0-9]+)$"); private String key = "fish"; public CheckMyName(){ host.setKey("host"); + clist.setKey("_CLIST"); } @Override public void run(){ - + List list = clist.asClass(List.class); + System.out.println(list); String name = host.asString(); Matcher matcher = pattern.matcher(name); diff -r 16bfc302bff2 -r 7f7b3506bff9 src/alice/topology/manager/StartTopologyManager.java --- a/src/alice/topology/manager/StartTopologyManager.java Tue Jul 09 17:41:18 2013 +0900 +++ b/src/alice/topology/manager/StartTopologyManager.java Sat Jul 13 20:55:32 2013 +0900 @@ -73,7 +73,7 @@ logger.error("File format error: " + conf.confFilePath); e.printStackTrace(); } - + IncomingHosts cs1 = new IncomingHosts(topology, nodeNames); cs1.host.setKey("local", "host"); diff -r 16bfc302bff2 -r 7f7b3506bff9 src/alice/topology/node/IncomingAbstractHostName.java --- a/src/alice/topology/node/IncomingAbstractHostName.java Tue Jul 09 17:41:18 2013 +0900 +++ b/src/alice/topology/node/IncomingAbstractHostName.java Sat Jul 13 20:55:32 2013 +0900 @@ -6,11 +6,7 @@ public class IncomingAbstractHostName extends CodeSegment { - private Receiver absName = ids.create(CommandType.PEEK); - - public IncomingAbstractHostName(){ - absName.setKey("local", "host"); - } + public Receiver absName = ids.create(CommandType.PEEK); @Override public void run() { diff -r 16bfc302bff2 -r 7f7b3506bff9 src/alice/topology/node/IncomingConnectionInfo.java --- a/src/alice/topology/node/IncomingConnectionInfo.java Tue Jul 09 17:41:18 2013 +0900 +++ b/src/alice/topology/node/IncomingConnectionInfo.java Sat Jul 13 20:55:32 2013 +0900 @@ -1,5 +1,8 @@ package alice.topology.node; +import java.util.ArrayList; +import java.util.List; + import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; @@ -9,12 +12,20 @@ public class IncomingConnectionInfo extends CodeSegment { public Receiver hostInfo = ids.create(CommandType.TAKE); + private List connectionList; private String absName; private int count; public IncomingConnectionInfo(String absName, int count) { this.absName = absName; this.count = count; + this.connectionList = new ArrayList(); + } + + public IncomingConnectionInfo(String absName, int count, List connectionList) { + this.absName = absName; + this.count = count; + this.connectionList = connectionList; } @Override @@ -27,8 +38,9 @@ HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); - - IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count); + connectionList.add(hostInfo.connectionName); + ods.update("_CLIST", connectionList); + IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, ++count, connectionList); cs.hostInfo.setKey("manager", absName); } diff -r 16bfc302bff2 -r 7f7b3506bff9 src/alice/topology/node/StartTopologyNode.java --- a/src/alice/topology/node/StartTopologyNode.java Tue Jul 09 17:41:18 2013 +0900 +++ b/src/alice/topology/node/StartTopologyNode.java Sat Jul 13 20:55:32 2013 +0900 @@ -33,7 +33,8 @@ HostMessage host = new HostMessage(localHostName, conf.localPort); ods.put("manager", "host", host); - new IncomingAbstractHostName(); + IncomingAbstractHostName cs = new IncomingAbstractHostName(); + cs.absName.setKey("local", "host"); IncomingReverseKey cs2 = new IncomingReverseKey(); cs2.reverseKey.setKey("local", "reverseKey");