Mercurial > hg > Database > jungle-network
changeset 113:7d9b7fcb4d9a
Add LogPutCodeSegment
author | one |
---|---|
date | Wed, 04 Dec 2013 20:38:51 +0900 |
parents | 8f9811a1e00c |
children | fdbd9679bd7b |
files | .classpath src/main/java/alice/jungle/operations/NetworkNodeOperation.java src/main/java/alice/jungle/persistent/JungleUpdater.java src/main/java/alice/jungle/transaction/JungleUpdater.java src/main/java/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java src/main/java/app/bbs/JungleManager.java src/main/java/app/bbs/codesegment/LogPutCodeSegment.java src/main/java/app/bbs/codesegment/LogUpdateCodeSegment.java src/test/java/alice/jungle/PersistenJournalTest.java |
diffstat | 9 files changed, 137 insertions(+), 115 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Fri Nov 29 04:31:22 2013 +0900 +++ b/.classpath Wed Dec 04 20:38:51 2013 +0900 @@ -1,52 +1,52 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/> - <classpathentry kind="src" path="src/main/java" including="**/*.java"/> - <classpathentry kind="output" path="target/classes"/> - <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="var" path="M2_REPO/junit/junit/4.7/junit-4.7.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2.jar" sourcepath="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar" sourcepath="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/thrift/libthrift/0.7.0/libthrift-0.7.0.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/> - <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/eaio-uuid/uuid/3.3.0/uuid-3.3.0.jar"/> - <classpathentry kind="var" path="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9.jar" sourcepath="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar" sourcepath="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4.jar" sourcepath="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3.jar" sourcepath="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.2/antlr-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr/3.2/antlr-3.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1.jar" sourcepath="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/jline/jline/1.0/jline-1.0.jar" sourcepath="M2_REPO/jline/jline/1.0/jline-1.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" sourcepath="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2.jar" sourcepath="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1.jar" sourcepath="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3.jar" sourcepath="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar" sourcepath="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1.jar" sourcepath="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/alice/alice/0.2/alice-0.2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/msgpack/msgpack/0.6.8/msgpack-0.6.8.jar"/> - <classpathentry kind="var" path="M2_REPO/org/javassist/javassist/3.16.1-GA/javassist-3.16.1-GA.jar"/> - <classpathentry kind="src" path="/jungle-core"/> - <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13-sources.jar"/> -</classpath> \ No newline at end of file + <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry including="**/*.java" kind="src" path="src/main/java"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/4.7/junit-4.7.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2.jar" sourcepath="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar" sourcepath="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/thrift/libthrift/0.7.0/libthrift-0.7.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/> + <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/eaio-uuid/uuid/3.3.0/uuid-3.3.0.jar"/> + <classpathentry kind="var" path="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9.jar" sourcepath="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar" sourcepath="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4.jar" sourcepath="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3.jar" sourcepath="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.2/antlr-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr/3.2/antlr-3.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1.jar" sourcepath="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/jline/jline/1.0/jline-1.0.jar" sourcepath="M2_REPO/jline/jline/1.0/jline-1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" sourcepath="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2.jar" sourcepath="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1.jar" sourcepath="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3.jar" sourcepath="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar" sourcepath="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1.jar" sourcepath="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/msgpack/msgpack/0.6.8/msgpack-0.6.8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/javassist/javassist/3.16.1-GA/javassist-3.16.1-GA.jar"/> + <classpathentry kind="src" path="/jungle-core"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13-sources.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/Alice"/> + <classpathentry kind="output" path="target/classes"/> +</classpath>
--- a/src/main/java/alice/jungle/operations/NetworkNodeOperation.java Fri Nov 29 04:31:22 2013 +0900 +++ b/src/main/java/alice/jungle/operations/NetworkNodeOperation.java Wed Dec 04 20:38:51 2013 +0900 @@ -4,13 +4,13 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.AppendChildAt; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -import alice.jungle.datasegment.transformer.NetworkAppendChildAt; import org.msgpack.annotation.Message; @@ -96,7 +96,7 @@ PutAttribute putAttribute = new PutAttribute(key,value); return putAttribute.edit(_target); case APPEND_CHILD: - NetworkAppendChildAt appendChildAt = new NetworkAppendChildAt(pos); + AppendChildAt appendChildAt = new AppendChildAt(pos); return appendChildAt.edit(_target); case DELETE_CHILD: DeleteChildAt deleteChildAt = new DeleteChildAt(pos);
--- a/src/main/java/alice/jungle/persistent/JungleUpdater.java Fri Nov 29 04:31:22 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -package alice.jungle.persistent; - -import java.nio.ByteBuffer; - -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; - -public class JungleUpdater { - - public JungleUpdater() { - - } - - public static Either<Error, JungleTreeEditor> edit(JungleTreeEditor _editor ,TreeOperationLog _log) { - JungleTreeEditor editor = _editor; - Either<Error, JungleTreeEditor> either = null; - for (TreeOperation op : _log) { - either = _edit(editor, op); - if(either.isA()) { - return either; - } - editor = either.b(); - } - return either; - } - - private static Either<Error, JungleTreeEditor> _edit(JungleTreeEditor editor, - TreeOperation op) { - DefaultNodePath path = new DefaultNodePath(); - NodeOperation nodeOp = op.getNodeOperation(); - int pos = nodeOp.getPosition(); - Command c = nodeOp.getCommand(); - String key = ""; - switch (c) { - case PUT_ATTRIBUTE: - key = nodeOp.getKey(); - ByteBuffer value = nodeOp.getValue(); - return editor.putAttribute(path, key, value); - case DELETE_ATTRIBUTE: - key = nodeOp.getKey(); - return editor.deleteAttribute(path, key); - case APPEND_CHILD: - return editor.addNewChildAt(path, pos); - case DELETE_CHILD: - return editor.deleteChildAt(path, 0); - } - return null; - } - - - -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/jungle/transaction/JungleUpdater.java Wed Dec 04 20:38:51 2013 +0900 @@ -0,0 +1,58 @@ +package alice.jungle.transaction; + +import java.nio.ByteBuffer; + +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; + +public class JungleUpdater { + + public JungleUpdater() { + + } + + public static Either<Error, JungleTreeEditor> edit(JungleTreeEditor _editor ,TreeOperationLog _log) { + JungleTreeEditor editor = _editor; + Either<Error, JungleTreeEditor> either = null; + for (TreeOperation op : _log) { + either = _edit(editor, op); + if(either.isA()) { + return either; + } + editor = either.b(); + } + return either; + } + + private static Either<Error, JungleTreeEditor> _edit(JungleTreeEditor editor, + TreeOperation op) { + DefaultNodePath path = new DefaultNodePath(); + NodeOperation nodeOp = op.getNodeOperation(); + int pos = nodeOp.getPosition(); + Command c = nodeOp.getCommand(); + String key = ""; + switch (c) { + case PUT_ATTRIBUTE: + key = nodeOp.getKey(); + ByteBuffer value = nodeOp.getValue(); + return editor.putAttribute(path, key, value); + case DELETE_ATTRIBUTE: + key = nodeOp.getKey(); + return editor.deleteAttribute(path, key); + case APPEND_CHILD: + return editor.addNewChildAt(path, pos); + case DELETE_CHILD: + return editor.deleteChildAt(path, 0); + } + return null; + } + + + +}
--- a/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java Fri Nov 29 04:31:22 2013 +0900 +++ b/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java Wed Dec 04 20:38:51 2013 +0900 @@ -4,8 +4,9 @@ import java.io.IOException; import java.nio.ByteBuffer; +import alice.codesegment.CodeSegment; import alice.jungle.operations.NetworkTreeOperationLog; -import app.bbs.codesegment.NullCodeSegment; +import app.bbs.codesegment.LogPutCodeSegment; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; @@ -187,8 +188,7 @@ public void putDataSegment(String _uuid, String _treeName, String _updaterName, Iterable<TreeOperation> newLog, String nextRevision) throws IOException { NetworkTreeOperationLog netLog = new NetworkTreeOperationLog(_uuid, _treeName,newLog); - NullCodeSegment cs = new NullCodeSegment(); - cs.ods.put("log", netLog); + CodeSegment cs = new LogPutCodeSegment(netLog); cs.execute(); } }
--- a/src/main/java/app/bbs/JungleManager.java Fri Nov 29 04:31:22 2013 +0900 +++ b/src/main/java/app/bbs/JungleManager.java Wed Dec 04 20:38:51 2013 +0900 @@ -29,6 +29,10 @@ jungle = new DefaultJungle(null,"hogehoge",new DefaultTreeEditor(new DefaultTraverser())); } + public static JungleManager getInstantce() { + return jm; + } + public static void setJungle(Jungle _j) { jm.jungle = _j; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/app/bbs/codesegment/LogPutCodeSegment.java Wed Dec 04 20:38:51 2013 +0900 @@ -0,0 +1,19 @@ +package app.bbs.codesegment; + +import alice.codesegment.CodeSegment; +import alice.jungle.operations.NetworkTreeOperationLog; + +public class LogPutCodeSegment extends CodeSegment{ + + NetworkTreeOperationLog log; + + public LogPutCodeSegment(NetworkTreeOperationLog _log) { + log = _log; + } + + @Override + public void run() { + ods.put("log", log); + } + +}
--- a/src/main/java/app/bbs/codesegment/LogUpdateCodeSegment.java Fri Nov 29 04:31:22 2013 +0900 +++ b/src/main/java/app/bbs/codesegment/LogUpdateCodeSegment.java Wed Dec 04 20:38:51 2013 +0900 @@ -18,7 +18,6 @@ Receiver log = ids.create(CommandType.PEEK); Receiver clist = ids.create(CommandType.PEEK); - public LogUpdateCodeSegment() { log.setKey("log"); clist.setKey("_CLIST");;
--- a/src/test/java/alice/jungle/PersistenJournalTest.java Fri Nov 29 04:31:22 2013 +0900 +++ b/src/test/java/alice/jungle/PersistenJournalTest.java Wed Dec 04 20:38:51 2013 +0900 @@ -5,10 +5,10 @@ import java.nio.ByteBuffer; import alice.jungle.operations.NetworkNodePath; -import alice.jungle.persistent.JungleUpdater; import alice.jungle.persistent.PersistentChangeList; import alice.jungle.persistent.PersistentJournal; import alice.jungle.persistent.PersistentJungle; +import alice.jungle.transaction.JungleUpdater; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor;