Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 348:944baaa4d345
Add debug Message
author | suruga |
---|---|
date | Sat, 16 Sep 2017 18:08:53 +0900 |
parents | ae75a2d618f4 |
children | 1be36ba5ac00 |
files | scripts/LogupdateTest.sh src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/codesegment/LogUpdateCodeSegment.java src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/logupdate/Logupdator.java |
diffstat | 4 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/LogupdateTest.sh Sat Sep 16 18:08:53 2017 +0900 @@ -0,0 +1,4 @@ +java -cp build/libs/Alice.jar alice.topology.manager.TopologyManager -host localhost -p 10000 -port 10001 --noKeepAlive & +sleep 3 +java -cp jungle-core.1.1.jar jp.ac_u-ryukyu.junglenetworl.logupdate.logupdateTest -host localhost -p 10003 -port 10000 --noKeepAlive & +java -cp jungle-core.1.1.jar jp.ac_u-ryukyu.junglenetworl.logupdate.logupdateTest -host localhost -p 10002 -port 10000 -write --noKeepAlive &
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/codesegment/LogUpdateCodeSegment.java Fri Sep 15 18:10:54 2017 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/codesegment/LogUpdateCodeSegment.java Sat Sep 16 18:08:53 2017 +0900 @@ -32,7 +32,7 @@ } public void run() { - int index = log.index; + // int index = log.index; NetworkTreeOperationLog netLog = log.asClass(NetworkTreeOperationLog.class); @SuppressWarnings("unchecked") @@ -40,18 +40,19 @@ for (String node : list) {//他ノードへlogの書き込み if (!node.equals(log.from)) { ods.put(node, log.key, log.getVal()); - new LogUpdateCodeSegment(); + System.out.println("LogUpdator: write to node " + node + " from " + log.from ); } } JungleDistributedUpdator u = updator.asClass(JungleDistributedUpdator.class); if (!log.from.equals("local")) {//ほかノードからのlogの更新 Either<Error, JungleTreeEditor> either = u.update(netLog); + System.out.println("LogUpdator: Update from " + log.from); if(either.isA()) { - new LogUpdateCodeSegment(index); - throw new IllegalStateException(); + // throw new IllegalStateException(); } } ods.put("updator",u); + new LogUpdateCodeSegment(); } }
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java Fri Sep 15 18:10:54 2017 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/bbs/BBSTest.java Sat Sep 16 18:08:53 2017 +0900 @@ -158,11 +158,14 @@ } editor = either.b(); either = editor.success(); + if (either.isA()) System.out.println("createMessage: failed."); } while (either.isA()); } - public void checkMessage(){ + static int checkCount = 0; + public void checkMessage() { + System.out.println("checkMessage: " + checkCount ++); JungleTree tree = jungle.getTreeByName(_board); TreeNode node = tree.getRootNode(); for (TreeNode child : node.getChildren()){
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/logupdate/Logupdator.java Fri Sep 15 18:10:54 2017 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/logupdate/Logupdator.java Sat Sep 16 18:08:53 2017 +0900 @@ -66,7 +66,7 @@ } editor = either.b(); either = editor.success(); - }while(either.isA()); + } while(either.isA()); requestIncrementAndGet(); bbsTest.checkMessage(); return either;