# HG changeset patch # User Nozomi Teruya # Date 1438594777 -32400 # Node ID 97bd6efa6e696e28e7fa971be5ddab9c66c9d3bf # Parent 0832af83583f9a93234d0e0be067aa56259edeea ods&ids have AliceDeamon diff -r 0832af83583f -r 97bd6efa6e69 src/main/java/alice/codesegment/CodeSegment.java --- a/src/main/java/alice/codesegment/CodeSegment.java Mon Aug 03 18:31:19 2015 +0900 +++ b/src/main/java/alice/codesegment/CodeSegment.java Mon Aug 03 18:39:37 2015 +0900 @@ -3,12 +3,14 @@ import java.util.ArrayList; import alice.codesegment.InputDataSegment; +import alice.daemon.AliceDaemon; import alice.datasegment.Receiver; public abstract class CodeSegment implements Runnable { public InputDataSegment ids = new InputDataSegment(this); - public OutputDataSegment ods = new OutputDataSegment(); + public OutputDataSegment ods = new OutputDataSegment(this); + private AliceDaemon aliceDaemon; private ArrayList list = new ArrayList(); private int priority = Thread.NORM_PRIORITY;//? @@ -36,4 +38,8 @@ public void setPriority(int priority) { this.priority = priority; } + + public AliceDaemon getAliceDaemon() { + return aliceDaemon; + } } diff -r 0832af83583f -r 97bd6efa6e69 src/main/java/alice/codesegment/InputDataSegment.java --- a/src/main/java/alice/codesegment/InputDataSegment.java Mon Aug 03 18:31:19 2015 +0900 +++ b/src/main/java/alice/codesegment/InputDataSegment.java Mon Aug 03 18:39:37 2015 +0900 @@ -19,11 +19,13 @@ public class InputDataSegment { public CodeSegment cs; + private final AliceDaemon alice; private AtomicInteger count = new AtomicInteger(1); // 1 for no input data segments private AtomicInteger keyCount = new AtomicInteger(0); // number of DataSegments public InputDataSegment(CodeSegment cs) { this.cs = cs; + this.alice = cs.getAliceDaemon(); } public void init(){ diff -r 0832af83583f -r 97bd6efa6e69 src/main/java/alice/codesegment/OutputDataSegment.java --- a/src/main/java/alice/codesegment/OutputDataSegment.java Mon Aug 03 18:31:19 2015 +0900 +++ b/src/main/java/alice/codesegment/OutputDataSegment.java Mon Aug 03 18:39:37 2015 +0900 @@ -9,6 +9,14 @@ public class OutputDataSegment { + private final CodeSegment cs; + private final AliceDaemon alice; + + public OutputDataSegment(CodeSegment cs){ + this.cs = cs; + this.alice = cs.getAliceDaemon(); + } + /** * for local */ diff -r 0832af83583f -r 97bd6efa6e69 src/main/java/alice/daemon/AliceDaemon.java --- a/src/main/java/alice/daemon/AliceDaemon.java Mon Aug 03 18:31:19 2015 +0900 +++ b/src/main/java/alice/daemon/AliceDaemon.java Mon Aug 03 18:39:37 2015 +0900 @@ -26,7 +26,6 @@ // static public static final MessagePack packer = new MessagePack(); public static DataSegment dataSegment = new DataSegment(); - //public static CommandType commandType = CommandType.PUT; public static HashMap hash = new HashMap();//コマンド対応表 public static int lastId = 0;//コマンドの総数 public static CodeSegmentManager codeSegmentManager = new CodeSegmentManager(); diff -r 0832af83583f -r 97bd6efa6e69 src/main/java/alice/test/codesegment/local/TestLocalAlice.java --- a/src/main/java/alice/test/codesegment/local/TestLocalAlice.java Mon Aug 03 18:31:19 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/TestLocalAlice.java Mon Aug 03 18:39:37 2015 +0900 @@ -5,8 +5,6 @@ public class TestLocalAlice { public static void main(String args[]) { - //AliceDaemon deamon = new AliceDaemon(new Config(args)); // logger off - //deamon.listen(); new AliceDaemon(new Config(args)).listen(); new StartCodeSegment().execute(); }