Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 319:b606b727dc2b
fix editor data export bux
author | tatsuki |
---|---|
date | Fri, 03 Feb 2017 20:21:53 +0900 |
parents | 5c4f8a7b4468 |
children | e3e4ffd746cb |
files | build.gradle src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java |
diffstat | 2 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/build.gradle Fri Feb 03 03:55:43 2017 +0900 +++ b/build.gradle Fri Feb 03 20:21:53 2017 +0900 @@ -1,6 +1,6 @@ apply plugin: "java" apply plugin: 'maven' - +apply plugin: 'idea' sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -21,8 +21,6 @@ compile "com.google.guava:guava:12.0" compile fileTree(dir: 'lib', include: '*.jar') compile group: 'junit', name: 'junit', version: '4.11' - compile group: 'org.msgpack', name: 'msgpack', version: '0.6.12' - compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.1', ext: 'jar' } jar {
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java Fri Feb 03 03:55:43 2017 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java Fri Feb 03 20:21:53 2017 +0900 @@ -27,7 +27,6 @@ import java.nio.ByteBuffer; public class NetworkDefaultJungleTreeEditor implements JungleTreeEditor { - private final TransactionManager txManager; private final TreeNode root; private final TreeEditor editor; @@ -87,7 +86,7 @@ if (exportLog) { newEditor = new NetworkDefaultJungleTreeEditor(treeName, type, newNode, txManager, editor, newTreeOpLog); } else { - newEditor = NetworkDefaultJungleTreeEditor.NewLocalJungleTreeEditor(treeName, type,newNode, txManager, editor, newTreeOpLog); + newEditor = NetworkDefaultJungleTreeEditor.NewLocalJungleTreeEditor(treeName, type, newNode, txManager, editor, newTreeOpLog); } return DefaultEither.newB(newEditor); } @@ -140,16 +139,19 @@ if (either.isA()) { return DefaultEither.newA(either.a()); } + TransactionManager newTxManager = either.b(); + JungleTreeEditor newTreeEditor = null; if (exportLog) { try { + newTreeEditor = new NetworkDefaultJungleTreeEditor(treeName, type, root, newTxManager, editor); putTreeOperationLog(log); } catch (IOException e) { return DefaultEither.newA(either.a()); } + } else { + newTreeEditor = NewLocalJungleTreeEditor(treeName, type, root, newTxManager, editor); } - TransactionManager newTxManager = either.b(); - JungleTreeEditor newTreeEditor = new NetworkDefaultJungleTreeEditor(treeName,type, root, newTxManager, editor); return DefaultEither.newB(newTreeEditor); } @@ -175,7 +177,7 @@ return log; } - private int getType(){ + private int getType() { return type; } @@ -185,11 +187,11 @@ String updaterName = getID(); String revision = getRevision(); int type = getType(); - putDataSegment(uuid, treeName,type, updaterName, newLog, revision); + putDataSegment(uuid, treeName, type, updaterName, newLog, revision); } - public void putDataSegment(String _uuid, String _treeName, int type,String _updaterName, Iterable<TreeOperation> newLog, String nextRevision) throws IOException { - NetworkTreeOperationLog netLog = new NetworkTreeOperationLog(_uuid, _treeName,type, newLog); + public void putDataSegment(String _uuid, String _treeName, int type, String _updaterName, Iterable<TreeOperation> newLog, String nextRevision) throws IOException { + NetworkTreeOperationLog netLog = new NetworkTreeOperationLog(_uuid, _treeName, type, newLog); CodeSegment cs = new LogPutCodeSegment(netLog); cs.execute(); }