Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/jungle/test/bbs/codesegment/ChildLogCheckCodeSegment.java @ 52:61b2de3f7730
add HashSetDataSegment and HashLogUpdateCodeSegment.
fix bugs
author | one |
---|---|
date | Sat, 13 Jul 2013 17:10:14 +0900 |
parents | 9e782b4eb06e |
children | f47a02368099 |
comparison
equal
deleted
inserted
replaced
51:9e782b4eb06e | 52:61b2de3f7730 |
---|---|
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; | 9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; |
10 import jungle.test.bbs.JungleManager; | 10 import jungle.test.bbs.JungleManager; |
11 import alice.codesegment.CodeSegment; | 11 import alice.codesegment.CodeSegment; |
12 import alice.datasegment.CommandType; | 12 import alice.datasegment.CommandType; |
13 import alice.datasegment.Receiver; | 13 import alice.datasegment.Receiver; |
14 import alice.jungle.codesegment.HashLogUpdateCodeSegment; | |
15 import alice.jungle.datasegment.HashSetDataSegment; | |
14 import alice.jungle.datasegment.store.operations.DefaultTreeOperationLogContainer; | 16 import alice.jungle.datasegment.store.operations.DefaultTreeOperationLogContainer; |
15 | 17 |
16 public class ChildLogCheckCodeSegment extends CodeSegment { | 18 public class ChildLogCheckCodeSegment extends CodeSegment { |
17 | 19 |
20 Receiver host = ids.create(CommandType.PEEK); | |
18 Receiver childLog = ids.create(CommandType.TAKE); | 21 Receiver childLog = ids.create(CommandType.TAKE); |
19 Receiver host = ids.create(CommandType.PEEK); | 22 Receiver hashLog = ids.create(CommandType.PEEK); |
20 | 23 |
21 public ChildLogCheckCodeSegment() { | 24 public ChildLogCheckCodeSegment() { |
22 host.setKey("host"); | 25 host.setKey("host"); |
23 childLog.setKey("local","childLog"); | 26 childLog.setKey("local","childLog"); |
27 hashLog.setKey("hashLog"); | |
24 } | 28 } |
25 | 29 |
26 public void run() { | 30 public void run() { |
27 System.out.println("--ChildLogCheckCodeSegment--"); | 31 System.out.println("--ChildLogCheckCodeSegment--"); |
28 String hostName = host.asString(); | 32 String hostName = host.asString(); |
47 } | 51 } |
48 editor = either.b(); | 52 editor = either.b(); |
49 either = editor.success(); | 53 either = editor.success(); |
50 if(either.isA()) { | 54 if(either.isA()) { |
51 throw new IllegalStateException(); | 55 throw new IllegalStateException(); |
52 } | 56 } |
57 HashSetDataSegment ds = hashLog.asClass(HashSetDataSegment.class); | |
58 ds.hash.add(container.getHashLogString()); | |
59 ods.update("hashLog", ds); | |
60 System.out.println("ods.put log container"); | |
53 ods.put("log", container); | 61 ods.put("log", container); |
54 new ChildLogCheckCodeSegment(); | 62 new ChildLogCheckCodeSegment(); |
55 if(!hostName.equals("node0")) { | 63 if(!hostName.equals("node0")) { |
56 | |
57 ods.put("parent", "childLog", container); | 64 ods.put("parent", "childLog", container); |
58 } | 65 } |
59 } | 66 } |
60 | 67 |
61 | 68 |