Mercurial > hg > Members > tatsuki > Alice
changeset 32:2bfb796b0fa1
change method to create DataSegmentReceiver
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 Jan 2012 20:49:26 +0900 |
parents | 5c704b9a9a87 |
children | 20c67f673224 |
files | src/alice/codesegment/InputDataSegment.java src/alice/test/codesegment/local/TestCodeSegment.java src/alice/test/codesegment/remote/RemoteIncrement.java src/alice/test/topology/ring/CheckMyName.java src/alice/test/topology/ring/FirstRingMessagePassing.java src/alice/test/topology/ring/RingFinish.java src/alice/test/topology/ring/RingMessagePassing.java src/alice/topology/manager/IncomingHosts.java src/alice/topology/manager/TopologyFinish.java src/alice/topology/node/ConfigurationFinish.java src/alice/topology/node/IncomingAbstractHostName.java src/alice/topology/node/IncomingConnectionInfo.java src/alice/topology/node/IncomingReverseKey.java |
diffstat | 13 files changed, 20 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/codesegment/InputDataSegment.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/codesegment/InputDataSegment.java Tue Jan 17 20:49:26 2012 +0900 @@ -2,6 +2,7 @@ import java.util.concurrent.atomic.AtomicInteger; +import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.DataSegmentReceiver; import alice.datasegment.DataSegmentValue; @@ -59,5 +60,9 @@ } } } + + public DataSegmentReceiver createReceiver(CommandType type) { + return new DataSegmentReceiver(this, type); + } }
--- a/src/alice/test/codesegment/local/TestCodeSegment.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/codesegment/local/TestCodeSegment.java Tue Jan 17 20:49:26 2012 +0900 @@ -9,7 +9,7 @@ public class TestCodeSegment extends CodeSegment { - DataSegmentReceiver arg1 = new DataSegmentReceiver(ids, CommandType.PEEK); + DataSegmentReceiver arg1 = ids.createReceiver(CommandType.PEEK); @Override public void run() {
--- a/src/alice/test/codesegment/remote/RemoteIncrement.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/codesegment/remote/RemoteIncrement.java Tue Jan 17 20:49:26 2012 +0900 @@ -8,7 +8,7 @@ public class RemoteIncrement extends CodeSegment { - public DataSegmentReceiver num = new DataSegmentReceiver(ids, CommandType.TAKE); + public DataSegmentReceiver num = ids.createReceiver(CommandType.TAKE); @Override public void run() {
--- a/src/alice/test/topology/ring/CheckMyName.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/topology/ring/CheckMyName.java Tue Jan 17 20:49:26 2012 +0900 @@ -6,7 +6,7 @@ public class CheckMyName extends CodeSegment { - DataSegmentReceiver host = new DataSegmentReceiver(ids, CommandType.PEEK); + DataSegmentReceiver host = ids.createReceiver(CommandType.PEEK); @Override public void run() {
--- a/src/alice/test/topology/ring/FirstRingMessagePassing.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/topology/ring/FirstRingMessagePassing.java Tue Jan 17 20:49:26 2012 +0900 @@ -8,7 +8,7 @@ public class FirstRingMessagePassing extends CodeSegment { - DataSegmentReceiver counter = new DataSegmentReceiver(ids, CommandType.TAKE); + DataSegmentReceiver counter = ids.createReceiver(CommandType.TAKE); @Override public void run() {
--- a/src/alice/test/topology/ring/RingFinish.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/topology/ring/RingFinish.java Tue Jan 17 20:49:26 2012 +0900 @@ -9,7 +9,7 @@ public class RingFinish extends CodeSegment { private String sendKey; - public DataSegmentReceiver finish = new DataSegmentReceiver(ids, CommandType.TAKE); + public DataSegmentReceiver finish = ids.createReceiver(CommandType.TAKE); public RingFinish(String sendKey) { this.sendKey = sendKey;
--- a/src/alice/test/topology/ring/RingMessagePassing.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/test/topology/ring/RingMessagePassing.java Tue Jan 17 20:49:26 2012 +0900 @@ -9,7 +9,7 @@ public class RingMessagePassing extends CodeSegment { - public DataSegmentReceiver counter = new DataSegmentReceiver(ids, CommandType.TAKE); + public DataSegmentReceiver counter = ids.createReceiver(CommandType.TAKE); @Override public void run() {
--- a/src/alice/topology/manager/IncomingHosts.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/manager/IncomingHosts.java Tue Jan 17 20:49:26 2012 +0900 @@ -19,7 +19,7 @@ HashMap<String, LinkedList<NodeInfo>> topology; LinkedList<String> nodeNames; - DataSegmentReceiver host = new DataSegmentReceiver(ids, CommandType.TAKE); + DataSegmentReceiver host = ids.createReceiver(CommandType.TAKE); Logger logger = Logger.getLogger(IncomingHosts.class); public IncomingHosts(HashMap<String, LinkedList<NodeInfo>> topology, LinkedList<String> nodeNames) {
--- a/src/alice/topology/manager/TopologyFinish.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/manager/TopologyFinish.java Tue Jan 17 20:49:26 2012 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.DataSegmentReceiver; public class TopologyFinish extends CodeSegment { - public DataSegmentReceiver finish = new DataSegmentReceiver(ids, CommandType.TAKE); + public DataSegmentReceiver finish = ids.createReceiver(CommandType.TAKE); @Override public void run() { System.exit(0);
--- a/src/alice/topology/node/ConfigurationFinish.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/node/ConfigurationFinish.java Tue Jan 17 20:49:26 2012 +0900 @@ -6,8 +6,8 @@ public class ConfigurationFinish extends CodeSegment { - public DataSegmentReceiver reverseCount = new DataSegmentReceiver(ids, CommandType.PEEK); - public DataSegmentReceiver configNodeNum = new DataSegmentReceiver(ids, CommandType.PEEK); + public DataSegmentReceiver reverseCount = ids.createReceiver(CommandType.PEEK); + public DataSegmentReceiver configNodeNum = ids.createReceiver(CommandType.PEEK); private Class<? extends CodeSegment> clazz; public ConfigurationFinish(Class<? extends CodeSegment> clazz) {
--- a/src/alice/topology/node/IncomingAbstractHostName.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/node/IncomingAbstractHostName.java Tue Jan 17 20:49:26 2012 +0900 @@ -6,7 +6,7 @@ public class IncomingAbstractHostName extends CodeSegment { - public DataSegmentReceiver absName = new DataSegmentReceiver(ids, CommandType.PEEK); + public DataSegmentReceiver absName = ids.createReceiver(CommandType.PEEK); @Override public void run() {
--- a/src/alice/topology/node/IncomingConnectionInfo.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/node/IncomingConnectionInfo.java Tue Jan 17 20:49:26 2012 +0900 @@ -14,7 +14,7 @@ public class IncomingConnectionInfo extends CodeSegment { - public DataSegmentReceiver hostInfo = new DataSegmentReceiver(ids, CommandType.TAKE); + public DataSegmentReceiver hostInfo = ids.createReceiver(CommandType.TAKE); private String absName; private int count;
--- a/src/alice/topology/node/IncomingReverseKey.java Tue Jan 17 20:24:46 2012 +0900 +++ b/src/alice/topology/node/IncomingReverseKey.java Tue Jan 17 20:49:26 2012 +0900 @@ -9,8 +9,9 @@ public class IncomingReverseKey extends CodeSegment { - public DataSegmentReceiver reverseKey = new DataSegmentReceiver(ids, CommandType.TAKE); - public DataSegmentReceiver reverseCount = new DataSegmentReceiver(ids, CommandType.PEEK); + public DataSegmentReceiver reverseKey = ids.createReceiver(CommandType.TAKE); + public DataSegmentReceiver reverseCount = ids.createReceiver(CommandType.PEEK); + @Override public void run() { String reverseKey = this.reverseKey.val.asRawValue().getString();