Mercurial > hg > Database > Alice
changeset 546:15eeb439830c dispose
setAliceDaemon in setKey
line wrap: on
line diff
--- a/src/main/java/alice/codesegment/CodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/codesegment/CodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -8,14 +8,16 @@ public abstract class CodeSegment implements Runnable { - public InputDataSegment ids = new InputDataSegment(this); - public OutputDataSegment ods = new OutputDataSegment(this); + public InputDataSegment ids = new InputDataSegment(); + public OutputDataSegment ods = new OutputDataSegment(); public AliceDaemon aliceDaemon; private ArrayList<Receiver> list = new ArrayList<Receiver>(); private int priority = Thread.NORM_PRIORITY;//? public void execute(AliceDaemon aliceDaemon) { this.aliceDaemon = aliceDaemon; + ids.setAliceDaemon(this); + ods.setAliceDaemon(this); ids.receive(); } @@ -27,7 +29,6 @@ ids.init(); ids.setCounter(list.size()); for (Receiver receiver : list) { - receiver.index = 0; ids.recommand(receiver); } }
--- a/src/main/java/alice/codesegment/InputDataSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/codesegment/InputDataSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -18,16 +18,15 @@ */ 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 + private CodeSegment cs; + private AliceDaemon alice; - public InputDataSegment(CodeSegment cs) { + public void setAliceDaemon(CodeSegment cs){ this.cs = cs; this.alice = cs.getAliceDaemon(); } - public void init(){ count = new AtomicInteger(1); keyCount = new AtomicInteger(0); @@ -55,7 +54,6 @@ } public void reply(Receiver receiver, Command reply) { - receiver.index = reply.index; receiver.from = reply.reverseKey; receiver.setData(reply.rData); receive();
--- a/src/main/java/alice/codesegment/OutputDataSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/codesegment/OutputDataSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,10 +9,10 @@ public class OutputDataSegment { - private final CodeSegment cs; - private final AliceDaemon alice; + private CodeSegment cs; + private AliceDaemon alice; - public OutputDataSegment(CodeSegment cs){ + public void setAliceDaemon(CodeSegment cs){ this.cs = cs; this.alice = cs.getAliceDaemon(); }
--- a/src/main/java/alice/datasegment/Receiver.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/datasegment/Receiver.java Tue Aug 04 19:39:47 2015 +0900 @@ -1,7 +1,9 @@ package alice.datasegment; +import alice.codesegment.CodeSegment; import alice.codesegment.InputDataSegment; +import alice.test.codesegment.local.TestCodeSegment; /** * idsコマンド(create, setKey)の処理をする。コマンドの定義はids/LDSM内にある。 @@ -12,7 +14,6 @@ public class Receiver { private ReceiveData data; public InputDataSegment ids; - public int index; public String from; public CommandType type; public String managerKey;//DSMを一意に特定。localかremoteか、どのremoteからか。 @@ -32,11 +33,7 @@ this.compressedFlag = compressedFlag; } - public void setQuickKey(String managerKey, String key){ - setQuickKey(managerKey, key, 0); - }//? - - public void setQuickKey(String managerKey, String key, int index) { + public void setQuickKey(String managerKey, String key) { this.managerKey = managerKey; this.key = key; switch (type) { @@ -52,34 +49,20 @@ ids.setKey(); } - public void setKey(String managerKey, String key) { - setKey(managerKey, key, 0); + + public void setKey(String key, CodeSegment cs){ + ids.setAliceDaemon(cs); + setKey("local", key); } - public void setKey(String managerKey, String key, int index) { + public void setKey(String managerKey, String key, CodeSegment cs){ + ids.setAliceDaemon(cs); + setKey(managerKey, key); + } + + private void setKey(String managerKey, String key) { this.managerKey = managerKey; this.key = key; - this.index = index; - switch (type) { - case PEEK: - ids.peek(this); - break; - case TAKE: - ids.take(this); - break; - default: - break; - } - ids.setKey(); - } - - public void setKey(String key) { - setKey(key, 0); - } - - public void setKey(String key, int index) { - this.key = key; - this.index = index; switch (type) { case PEEK: ids.peek(this);
--- a/src/main/java/alice/test/codesegment/api/FlipTest.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/api/FlipTest.java Tue Aug 04 19:39:47 2015 +0900 @@ -11,7 +11,7 @@ public static boolean flag = false; public static int count = 10000; public FlipTest(String key){ - arg1.setKey(key); + arg1.setKey(key, arg1.index, this); } public FlipTest(String key, int index){
--- a/src/main/java/alice/test/codesegment/api/PeekCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/api/PeekCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -7,7 +7,7 @@ public class PeekCodeSegment extends CodeSegment{ private Receiver info0 = ids.create(CommandType.PEEK); public PeekCodeSegment(String key) { - info0.setKey(key); + info0.setKey(key, arg1.index, this); } @Override
--- a/src/main/java/alice/test/codesegment/api/StartCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/api/StartCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -21,7 +21,7 @@ for (String arg : args) { if ("-update".equals(arg)) { UpdateCodeSegment cs1 = new UpdateCodeSegment(); - cs1.ds1.setKey("key"); + cs1.ds1.setKey("key", arg1.index, this); int[] array = new int[65536]; array[0] = 0; ods.update("local", "key", array);
--- a/src/main/java/alice/test/codesegment/api/TakeCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/api/TakeCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ Receiver ds1 = ids.create(CommandType.TAKE); public TakeCodeSegment(String key){ - this.ds1.setKey(key); + this.ds1.setKey(key, arg1.index, this); } @Override public void run() {
--- a/src/main/java/alice/test/codesegment/local/StartCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/StartCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -1,7 +1,6 @@ package alice.test.codesegment.local; import alice.codesegment.CodeSegment; -import alice.daemon.AliceDaemon; public class StartCodeSegment extends CodeSegment { @@ -10,7 +9,7 @@ System.out.println("run StartCodeSegment"); TestCodeSegment cs = new TestCodeSegment(); - cs.arg1.setKey("key1"); // unbound datasegment key1 is created and connect to cs. + cs.arg1.setKey("key1", this); // unbound datasegment key1 is created and connect to cs. // cs is waiting for local.key1 System.out.println("create TestCodeSegment");
--- a/src/main/java/alice/test/codesegment/local/TestCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/TestCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -24,7 +24,8 @@ } TestCodeSegment cs = new TestCodeSegment(); - cs.arg1.setKey("key1", arg1.index);//Receiverに値をpeekしてくる + //cs.ids.setAliceDaemon(this); + cs.arg1.setKey("key1", arg1.index, this);//Receiverに値をpeekしてくる // DataSegment.get("local").update ods.update("local", "key1", "String data");
--- a/src/main/java/alice/test/codesegment/local/TestLocalAlice.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/TestLocalAlice.java Tue Aug 04 19:39:47 2015 +0900 @@ -10,5 +10,4 @@ new StartCodeSegment().execute(aliceDaemon); } - }
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/MakeData.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/MakeData.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ private Receiver info2 = ids.create(CommandType.TAKE); public MakeData(){ - info1.setKey("sortconf"); - info2.setKey("data"); + info1.setKey("sortconf", arg1.index, this); + info2.setKey("data", arg1.index, this); } @Override
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/SetTask.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/SetTask.java Tue Aug 04 19:39:47 2015 +0900 @@ -10,8 +10,8 @@ private Receiver info2 = ids.create(CommandType.TAKE); SetTask(){ - info1.setKey("sortconf"); - info2.setKey("list"); + info1.setKey("sortconf", arg1.index, this); + info2.setKey("list", arg1.index, this); } @Override
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/SortPhase.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/SortPhase.java Tue Aug 04 19:39:47 2015 +0900 @@ -13,11 +13,11 @@ public SortPhase(String key0, String key1, String key2, int index, String key4){ - info0.setKey(key0); + info0.setKey(key0, arg1.index, this); info1.setKey(key1,index); info2.setKey(key2,index); - info3.setKey("sort_count"); - info4.setKey(key4); + info3.setKey("sort_count", arg1.index, this); + info4.setKey(key4, arg1.index, this); } @Override
--- a/src/main/java/alice/test/codesegment/local/factorial/FactorialCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/factorial/FactorialCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -17,7 +17,7 @@ input[i] = ids.create(CommandType.TAKE);//take用Receiverを生成 } for (int i = 0; i < n; i++){//createと同じループではだめ。修論参照。 - input[i].setKey(key); + input[i].setKey(key, arg1.index, this); } }
--- a/src/main/java/alice/test/codesegment/local/wordcount/CorrectResult.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/CorrectResult.java Tue Aug 04 19:39:47 2015 +0900 @@ -14,7 +14,7 @@ array[i] = ids.create(CommandType.TAKE); } for (int i=0;i<size;i++) - array[i].setKey("result"); + array[i].setKey("result", arg1.index, this); } @Override
--- a/src/main/java/alice/test/codesegment/local/wordcount/WordCount.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/WordCount.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info1 = ids.create(CommandType.TAKE); public WordCount(){ - info1.setKey("array"); + info1.setKey("array", arg1.index, this); } @Override
--- a/src/main/java/alice/test/concurrent/AliceFinish.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/concurrent/AliceFinish.java Tue Aug 04 19:39:47 2015 +0900 @@ -19,7 +19,7 @@ if (--num == 0) System.exit(0); AliceFinish cs1 = new AliceFinish(num); - cs1.ds1.setKey("finish"); + cs1.ds1.setKey("finish", arg1.index, this); } }
--- a/src/main/java/alice/test/concurrent/StartConcurrent.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/concurrent/StartConcurrent.java Tue Aug 04 19:39:47 2015 +0900 @@ -17,11 +17,11 @@ int threadNum = Runtime.getRuntime().availableProcessors() * count; AliceFinish cs1 = new AliceFinish(threadNum); - cs1.ds1.setKey("finish"); + cs1.ds1.setKey("finish", arg1.index, this); for (int i = 0; i < threadNum; i++) { SleepCodeSegment cs2 = new SleepCodeSegment(i); - cs2.ds1.setKey("wait"); + cs2.ds1.setKey("wait", arg1.index, this); } for (int i = 0; i < threadNum; i++) {
--- a/src/main/java/alice/test/topology/aquarium/AutoIncrement.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/AutoIncrement.java Tue Aug 04 19:39:47 2015 +0900 @@ -11,7 +11,7 @@ private static final float MIN = -1.3f; public AutoIncrement(String key, int index) { - this.number.setKey("maxsize"); + this.number.setKey("maxsize", arg1.index, this); this.position.setKey(key, index); }
--- a/src/main/java/alice/test/topology/aquarium/CheckLocalIndex.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/CheckLocalIndex.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,7 +12,7 @@ private Receiver list = ids.create(CommandType.PEEK); public CheckLocalIndex(String key, int index){ - this.list.setKey("_CLIST"); + this.list.setKey("_CLIST", arg1.index, this); this.data.setKey(key, index); }
--- a/src/main/java/alice/test/topology/aquarium/CheckMyName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/CheckMyName.java Tue Aug 04 19:39:47 2015 +0900 @@ -15,7 +15,7 @@ private String key = "fish"; public CheckMyName(){ - host.setKey("host"); + host.setKey("host", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/RefreshWindow.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/RefreshWindow.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,8 +9,8 @@ private MakeFrame frame; public RefreshWindow(MakeFrame frame){ - this.host.setKey("host"); - this.num.setKey("host_num"); + this.host.setKey("host", this); + this.num.setKey("host_num", this); this.frame = frame; }
--- a/src/main/java/alice/test/topology/aquarium/SendLocation.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/SendLocation.java Tue Aug 04 19:39:47 2015 +0900 @@ -16,7 +16,7 @@ this.x = x; this.y = y; this.z = z; - position.setKey("fish"); + position.setKey("fish", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/TakeMynum.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/TakeMynum.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ private Receiver mynum = ids.create(CommandType.TAKE); public TakeMynum(){ - this.mynum.setKey("num"); + this.mynum.setKey("num", arg1.index, this); } public TakeMynum(int index){
--- a/src/main/java/alice/test/topology/aquarium/fx/AddObject.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/AddObject.java Tue Aug 04 19:39:47 2015 +0900 @@ -15,9 +15,9 @@ private boolean executed = false; public AddObject(){ - info.setKey("root"); - info1.setKey("addOffer"); - info2.setKey("host"); + info.setKey("root", arg1.index, this); + info1.setKey("addOffer", arg1.index, this); + info2.setKey("host", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Tue Aug 04 19:39:47 2015 +0900 @@ -11,9 +11,9 @@ private Receiver info2 = ids.create(CommandType.PEEK); public CalculatePosition(String key){ - info.setKey(key); - info1.setKey("OwnFishP"); - info2.setKey("host"); + info.setKey(key, arg1.index, this); + info1.setKey("OwnFishP", arg1.index, this); + info2.setKey("host", arg1.index, this); }
--- a/src/main/java/alice/test/topology/aquarium/fx/CheckAllFishInfoExist.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CheckAllFishInfoExist.java Tue Aug 04 19:39:47 2015 +0900 @@ -2,7 +2,6 @@ import java.io.IOException; -import alice.daemon.AliceDaemon; import javafx.scene.Group; import javafx.scene.Node; @@ -21,8 +20,8 @@ private Receiver info1 = ids.create(CommandType.PEEK); public CheckAllFishInfoExist(){ - info.setKey("receiveRegisteredList"); - info1.setKey("root"); + info.setKey("receiveRegisteredList", arg1.index, this); + info1.setKey("root", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/fx/CheckMyName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CheckMyName.java Tue Aug 04 19:39:47 2015 +0900 @@ -14,7 +14,7 @@ private int INNER_WIDTH = 10; public CheckMyName(){ - host.setKey("host"); + host.setKey("host", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java Tue Aug 04 19:39:47 2015 +0900 @@ -21,8 +21,8 @@ private Receiver info1 = ids.create(CommandType.PEEK); // fishInfo public CreateObject(){ - info.setKey("fishData"); - info1.setKey("type"); + info.setKey("fishData", arg1.index, this); + info1.setKey("type", arg1.index, this); }
--- a/src/main/java/alice/test/topology/aquarium/fx/GetMyHostName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/GetMyHostName.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info = ids.create(CommandType.PEEK); public GetMyHostName() { - info.setKey("host"); + info.setKey("host", arg1.index, this); } @Override public void run() {
--- a/src/main/java/alice/test/topology/aquarium/fx/MoveBeforePosition.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/MoveBeforePosition.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ public MoveBeforePosition(String key) { info.setKey("parent", key+"FishbackUp"); - info1.setKey("OwnFishP"); - info2.setKey("host"); + info1.setKey("OwnFishP", arg1.index, this); + info2.setKey("host", arg1.index, this); } @Override public void run() {
--- a/src/main/java/alice/test/topology/aquarium/fx/RegisterList.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/RegisterList.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // created fish List public RegisterList(){ - info.setKey("register"); - info1.setKey("registeredList"); + info.setKey("register", arg1.index, this); + info1.setKey("registeredList", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/fx/SendDataOthers.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/SendDataOthers.java Tue Aug 04 19:39:47 2015 +0900 @@ -16,7 +16,7 @@ public SendDataOthers(Receiver r, String key){ this.key = key; info1 = r; - info.setKey("_CLIST"); + info.setKey("_CLIST", this); } @Override
--- a/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Tue Aug 04 19:39:47 2015 +0900 @@ -15,9 +15,9 @@ private boolean executed = false; public SetTranslate(String key) { - info.setKey(key); - info1.setKey(key+"absoluteP"); - info2.setKey("median"); + info.setKey(key, arg1.index, this); + info1.setKey(key+"absoluteP", arg1.index, this); + info2.setKey("median", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/fish/CheckMyName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/fish/CheckMyName.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,7 +12,7 @@ private Receiver host = ids.create(CommandType.PEEK); public CheckMyName(){ - host.setKey("host"); + host.setKey("host", arg1.index, this); } @Override
--- a/src/main/java/alice/test/topology/fish/WidthReceiver.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/fish/WidthReceiver.java Tue Aug 04 19:39:47 2015 +0900 @@ -94,7 +94,7 @@ WidthReceiver cs = new WidthReceiver(); cs.widths.setKey("widths", this.widths.index); - cs.routing.setKey("routing"); + cs.routing.setKey("routing", arg1.index, this); //cs.routing.setKey("routing", this.routing.index); }
--- a/src/main/java/alice/test/topology/ring/CheckMyName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/ring/CheckMyName.java Tue Aug 04 19:39:47 2015 +0900 @@ -24,15 +24,15 @@ if (host.equals("node0")) { ods.put("local", "c", new byte[conf.size]); FirstRingMessagePassing cs1 = new FirstRingMessagePassing(conf.count, conf.nodeNum); - cs1.ds1.setKey("c"); + cs1.ds1.setKey("c", arg1.index, this); RingFinish cs2 = new RingFinish("manager"); - cs2.finish.setKey("finish"); + cs2.finish.setKey("finish", arg1.index, this); } else { ods.close("manager"); RingMessagePassing cs1 = new RingMessagePassing(); - cs1.ds1.setKey("c"); + cs1.ds1.setKey("c", arg1.index, this); RingFinish cs2 = new RingFinish("right"); - cs2.finish.setKey("finish"); + cs2.finish.setKey("finish", arg1.index, this); } }
--- a/src/main/java/alice/test/topology/ring/FirstRingMessagePassing.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/ring/FirstRingMessagePassing.java Tue Aug 04 19:39:47 2015 +0900 @@ -37,7 +37,7 @@ } FirstRingMessagePassing cs = new FirstRingMessagePassing(startTime, count, nodeNum); - cs.ds1.setKey("c"); + cs.ds1.setKey("c", arg1.index, this); } }
--- a/src/main/java/alice/test/topology/ring/RingMessagePassing.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/ring/RingMessagePassing.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,7 +12,7 @@ public void run() { ods.put("right", "c", this.ds1.getReceiveData()); RingMessagePassing cs = new RingMessagePassing(); - cs.ds1.setKey("c"); + cs.ds1.setKey("c", arg1.index, this); } }
--- a/src/main/java/alice/test/topology/ring/StartRing.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/ring/StartRing.java Tue Aug 04 19:39:47 2015 +0900 @@ -10,7 +10,7 @@ @Override public void run() { CheckMyName cs = new CheckMyName(conf); - cs.ds1.setKey("host"); + cs.ds1.setKey("host", arg1.index, this); } }
--- a/src/main/java/alice/test/topology/share/CheckLocalIndex.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/share/CheckLocalIndex.java Tue Aug 04 19:39:47 2015 +0900 @@ -14,8 +14,8 @@ public CheckLocalIndex(String key, int index) { - this.host.setKey("host"); - this.list.setKey("_CLIST"); + this.host.setKey("host", arg1.index, this); + this.list.setKey("_CLIST", arg1.index, this); this.data.setKey(key, index); }
--- a/src/main/java/alice/test/topology/share/CheckMyName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/test/topology/share/CheckMyName.java Tue Aug 04 19:39:47 2015 +0900 @@ -14,7 +14,7 @@ String key = "fish"; public CheckMyName(){ - this.host.setKey("host"); + this.host.setKey("host", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/fix/FixTopology.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/fix/FixTopology.java Tue Aug 04 19:39:47 2015 +0900 @@ -19,10 +19,10 @@ private Receiver info4 = ids.create(CommandType.TAKE); // parentManager public FixTopology() { - info.setKey("_DISCONNECTNODE"); - info1.setKey("topology"); - info3.setKey("nameTable"); - info4.setKey("parentManager"); + info.setKey("_DISCONNECTNODE", arg1.index, this); + info1.setKey("topology", arg1.index, this); + info3.setKey("nameTable", arg1.index, this); + info4.setKey("parentManager", arg1.index, this); } @SuppressWarnings("unchecked")
--- a/src/main/java/alice/topology/fix/ReceiveDisconnectMessage.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/fix/ReceiveDisconnectMessage.java Tue Aug 04 19:39:47 2015 +0900 @@ -8,7 +8,7 @@ private Receiver info = ids.create(CommandType.PEEK); public ReceiveDisconnectMessage() { - info.setKey("_DISCONNECTNODE"); + info.setKey("_DISCONNECTNODE", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/CheckComingHost.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/CheckComingHost.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ private Receiver absCookieTable = ids.create(CommandType.PEEK); // cookie, AbsName HashMap public CheckComingHost(){ - this.host.setKey("host"); - this.absCookieTable.setKey("absCookieTable"); + this.host.setKey("host", arg1.index, this); + this.absCookieTable.setKey("absCookieTable", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/ComingServiceHosts.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/ComingServiceHosts.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info = ids.create(CommandType.PEEK); public ComingServiceHosts(){ - info.setKey("newHost"); + info.setKey("newHost", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/CreateHash.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/CreateHash.java Tue Aug 04 19:39:47 2015 +0900 @@ -17,8 +17,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public CreateHash(){ - info.setKey("orderHash"); - info1.setKey("createdList"); + info.setKey("orderHash", arg1.index, this); + info1.setKey("createdList", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/CreateTreeTopology.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/CreateTreeTopology.java Tue Aug 04 19:39:47 2015 +0900 @@ -2,12 +2,10 @@ import java.util.HashMap; -import alice.daemon.AliceDaemon; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.HostMessage; @@ -21,12 +19,12 @@ private Receiver info6 = ids.create(CommandType.TAKE); public CreateTreeTopology(){ - info.setKey("newHost"); - info1.setKey("hostCount"); - info2.setKey("nameTable"); - info3.setKey("MD5"); - info4.setKey("absCookieTable"); - info6.setKey("parentManager"); + info.setKey("newHost", arg1.index, this); + info1.setKey("hostCount", arg1.index, this); + info2.setKey("nameTable", arg1.index, this); + info3.setKey("MD5", arg1.index, this); + info4.setKey("absCookieTable", arg1.index, this); + info6.setKey("parentManager", arg1.index, this); } @SuppressWarnings("unchecked")
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Tue Aug 04 19:39:47 2015 +0900 @@ -3,12 +3,10 @@ import java.util.HashMap; import java.util.LinkedList; -import alice.daemon.AliceDaemon; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.HostMessage; @@ -21,11 +19,11 @@ private Receiver cookie = ids.create(CommandType.TAKE); // MD5 public IncomingHosts() { - this.topology.setKey("resultParse"); - this.nodeNames.setKey("nodeNames"); - this.host.setKey("newHost"); - this.absCookieTable.setKey("absCookieTable"); - this.cookie.setKey("MD5"); + this.topology.setKey("resultParse", arg1.index, this); + this.nodeNames.setKey("nodeNames", arg1.index, this); + this.host.setKey("newHost", arg1.index, this); + this.absCookieTable.setKey("absCookieTable", arg1.index, this); + this.cookie.setKey("MD5", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/RecodeTopology.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/RecodeTopology.java Tue Aug 04 19:39:47 2015 +0900 @@ -14,8 +14,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // HashMap public RecodeTopology(){ - info.setKey("nodeInfo"); - info1.setKey("topology"); + info.setKey("nodeInfo", arg1.index, this); + info1.setKey("topology", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/SearchHostName.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/SearchHostName.java Tue Aug 04 19:39:47 2015 +0900 @@ -3,12 +3,10 @@ import java.util.HashMap; import java.util.LinkedList; -import alice.daemon.AliceDaemon; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.HostMessage; @@ -19,9 +17,9 @@ private Receiver info2 = ids.create(CommandType.PEEK); // check App running public SearchHostName(){ - info.setKey("reconnectHost"); - info1.setKey("topology"); - info2.setKey("running"); + info.setKey("reconnectHost", arg1.index, this); + info1.setKey("topology", arg1.index, this); + info2.setKey("running", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/keeparive/CreateTask.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/CreateTask.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ public static int INTERVAL = 5; public CreateTask(){ - info.setKey("_CLIST"); - info1.setKey("_SCHEDULER"); + info.setKey("_CLIST", arg1.index, this); + info1.setKey("_SCHEDULER", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,8 +9,8 @@ private Receiver info2 = ids.create(CommandType.TAKE); // remove task public RemoveTask(){ - info1.setKey("_SCHEDULER"); - info2.setKey("_REMOVETASK"); + info1.setKey("_SCHEDULER", arg1.index, this); + info2.setKey("_REMOVETASK", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/keeparive/RespondPing.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RespondPing.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ // private long pingedTime = System.currentTimeMillis(); public RespondPing(String key) { - respond.setKey(key); + respond.setKey(key, arg1.index, this); } @Override
--- a/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Tue Aug 04 19:39:47 2015 +0900 @@ -1,9 +1,7 @@ package alice.topology.manager.keeparive; import alice.codesegment.CodeSegment; -import alice.daemon.AliceDaemon; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; public class TaskExecuter extends CodeSegment { @@ -22,7 +20,7 @@ public void setKey() { ids.init(); - info.setKey("_SCHEDULER"); + info.setKey("_SCHEDULER", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -1,9 +1,7 @@ package alice.topology.node; import alice.codesegment.CodeSegment; -import alice.daemon.AliceDaemon; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.manager.keeparive.ListManager; @@ -15,10 +13,10 @@ private Receiver info3 = ids.create(CommandType.TAKE); public CloseRemoteDataSegment() { - info.setKey("_CLOSEMESSEAGE"); - info1.setKey("_CLOSEREADY"); - info2.setKey("_CLOSEREADY"); - info3.setKey("_SCHEDULER"); + info.setKey("_CLOSEMESSEAGE", arg1.index, this); + info1.setKey("_CLOSEREADY", arg1.index, this); + info2.setKey("_CLOSEREADY", arg1.index, this); + info3.setKey("_SCHEDULER", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/ClosedEventManager.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/ClosedEventManager.java Tue Aug 04 19:39:47 2015 +0900 @@ -21,7 +21,7 @@ public void setKey() { ids.init(); - info.setKey("_DISCONNECT"); + info.setKey("_DISCONNECT", arg1.index, this); } @SuppressWarnings("rawtypes")
--- a/src/main/java/alice/topology/node/CreateConnectionList.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/CreateConnectionList.java Tue Aug 04 19:39:47 2015 +0900 @@ -11,8 +11,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // connection names public CreateConnectionList() { - info.setKey("_CLIST"); - info1.setKey("cMember"); + info.setKey("_CLIST", arg1.index, this); + info1.setKey("cMember", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/DeleteConnection.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/DeleteConnection.java Tue Aug 04 19:39:47 2015 +0900 @@ -3,9 +3,7 @@ import java.util.List; import alice.codesegment.CloseEventCodeSegment; -import alice.daemon.AliceDaemon; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import alice.topology.manager.keeparive.ListManager; @@ -15,8 +13,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public DeleteConnection() { - info.setKey("_CLIST"); - info1.setKey("_SCHEDULER"); + info.setKey("_CLIST", arg1.index, this); + info1.setKey("_SCHEDULER", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/ExecuteEvent.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/ExecuteEvent.java Tue Aug 04 19:39:47 2015 +0900 @@ -13,8 +13,8 @@ public Receiver info1 = ids.create(CommandType.TAKE); public ExecuteEvent() { - info.setKey("_DEVENTLIST"); - info1.setKey("_DISCONNECT"); + info.setKey("_DEVENTLIST", arg1.index, this); + info1.setKey("_DISCONNECT", arg1.index, this); } @SuppressWarnings("unchecked")
--- a/src/main/java/alice/topology/node/PrepareToAddList.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/PrepareToAddList.java Tue Aug 04 19:39:47 2015 +0900 @@ -10,8 +10,8 @@ public Receiver info2 = ids.create(CommandType.TAKE); public PrepareToAddList(String key) { - info.setKey("connection"+key); - info2.setKey("connection"+key); + info.setKey("connection"+key, arg1.index, this); + info2.setKey("connection"+key, arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/PrepareToClose.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/PrepareToClose.java Tue Aug 04 19:39:47 2015 +0900 @@ -3,9 +3,7 @@ import java.util.List; import alice.codesegment.CodeSegment; -import alice.daemon.AliceDaemon; import alice.datasegment.CommandType; -import alice.datasegment.DataSegment; import alice.datasegment.DataSegmentManager; import alice.datasegment.Receiver; @@ -15,8 +13,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); public PrepareToClose() { - info.setKey("_CLOSEMESSEAGE"); - info1.setKey("_CLIST"); + info.setKey("_CLOSEMESSEAGE", arg1.index, this); + info1.setKey("_CLIST", arg1.index, this); } @SuppressWarnings("unchecked")
--- a/src/main/java/alice/topology/node/ReceiveCloseMessage.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/ReceiveCloseMessage.java Tue Aug 04 19:39:47 2015 +0900 @@ -10,7 +10,7 @@ public ReceiveCloseMessage(CommandType type) { info = ids.create(type); - info.setKey("_CLOSEMESSEAGE"); + info.setKey("_CLOSEMESSEAGE", arg1.index, this); } @Override
--- a/src/main/java/alice/topology/node/RegisterEvent.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/RegisterEvent.java Tue Aug 04 19:39:47 2015 +0900 @@ -12,8 +12,8 @@ private Receiver info1 = ids.create(CommandType.TAKE); // event list public RegisterEvent() { - info.setKey("_REGISTERDEVENT"); - info1.setKey("_DEVENTLIST"); + info.setKey("_REGISTERDEVENT", arg1.index, this); + info1.setKey("_DEVENTLIST", arg1.index, this); } @SuppressWarnings("unchecked")
--- a/src/main/java/alice/topology/node/SaveCookie.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/main/java/alice/topology/node/SaveCookie.java Tue Aug 04 19:39:47 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info = ids.create(CommandType.PEEK); public SaveCookie(){ - info.setKey("cookie"); + info.setKey("cookie", arg1.index, this); } @Override
--- a/src/test/java/alice/daemon/MulticastStartCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/test/java/alice/daemon/MulticastStartCodeSegment.java Tue Aug 04 19:39:47 2015 +0900 @@ -1,7 +1,6 @@ package alice.daemon; import alice.codesegment.CodeSegment; -import alice.datasegment.DataSegment; import alice.datasegment.MulticastDataSegmentManager.SocketType; public class MulticastStartCodeSegment extends CodeSegment { @@ -23,11 +22,11 @@ } else if (MulticastTest.type == SocketType.Receiver){ aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); ReceiveInteger cs = new ReceiveInteger(); - cs.num.setKey("num"); + cs.num.setKey("num", arg1.index, this); } else if (MulticastTest.type == SocketType.Sender){ aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); ReceiveString cs = new ReceiveString(); - cs.str.setKey("str"); + cs.str.setKey("str", arg1.index, this); for (int i=0;i < 11; i++) ods.put("multicast", "num", i);
--- a/src/test/java/alice/daemon/ReceiveInteger.java Tue Aug 04 16:24:59 2015 +0900 +++ b/src/test/java/alice/daemon/ReceiveInteger.java Tue Aug 04 19:39:47 2015 +0900 @@ -26,7 +26,7 @@ System.exit(0); } ReceiveInteger cs = new ReceiveInteger(); - cs.num.setKey("num"); + cs.num.setKey("num", arg1.index, this); }