Mercurial > hg > Members > nobuyasu > jungle-network
changeset 88:0c98717f186e
Removed cast code
author | one |
---|---|
date | Tue, 05 Nov 2013 09:13:30 +0900 (2013-11-05) |
parents | f142dd4abc74 |
children | f3f89613c7e3 |
files | src/alice/jungle/persistence/PersistentChangeList.java src/alice/jungle/persistence/PersistentChangeListWriter.java src/alice/jungle/persistence/PersistentJournal.java src/alice/jungle/persistence/PersistentJungle.java src/alice/jungle/persistence/PersistentJungleTree.java src/alice/jungle/persistence/PersistentTransactionManager.java |
diffstat | 6 files changed, 12 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/jungle/persistence/PersistentChangeList.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentChangeList.java Tue Nov 05 09:13:30 2013 +0900 @@ -5,6 +5,7 @@ import alice.jungle.operations.NetworkTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; @@ -26,7 +27,7 @@ uuid = _log.getUUID(); } - public PersistentChangeList(PersistentChangeSet cs) { + public PersistentChangeList(ChangeSet cs) { treeName = cs.getTreeName(); uuid = cs.uuid(); log = new NetworkTreeOperationLog(cs.getChangeList());
--- a/src/alice/jungle/persistence/PersistentChangeListWriter.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentChangeListWriter.java Tue Nov 05 09:13:30 2013 +0900 @@ -20,10 +20,9 @@ } @Override - public Result write(ChangeList _operations) + public Result write(ChangeList cs) { - PersistentChangeList plist = (PersistentChangeList) _operations; - NetworkTreeOperationLog log = new NetworkTreeOperationLog(plist.uuid(), plist.getTreeName(), plist.getTreeOperationLog()); + NetworkTreeOperationLog log = new NetworkTreeOperationLog(cs.uuid(), cs.getTreeName(), cs); try { msgpack.write(out, log); out.flush();
--- a/src/alice/jungle/persistence/PersistentJournal.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentJournal.java Tue Nov 05 09:13:30 2013 +0900 @@ -16,8 +16,8 @@ public class PersistentJournal implements Journal { - private static PersistentChangeListWriter WRITER; - private static PersistentChangeListReader READER; + private static ChangeListWriter WRITER; + private static ChangeListReader READER; private static MessagePack msgpack; private static OutputStream out = null; private static InputStream in = null;
--- a/src/alice/jungle/persistence/PersistentJungle.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentJungle.java Tue Nov 05 09:13:30 2013 +0900 @@ -55,7 +55,7 @@ DefaultTreeNode root = new DefaultTreeNode(); ChangeSet set = new PersistentChangeSet(root.getAsNode(),null,list,uuid,_name,0); DefaultTreeContext<DefaultTreeNode> tc = new DefaultTreeContext<DefaultTreeNode>(root,set); - JungleTree newTree = new PersistentJungleTree<DefaultTreeNode>(_name, tc,uuid, (PersistentChangeListWriter)journal.getWriter(),editor); + JungleTree newTree = new PersistentJungleTree<DefaultTreeNode>(_name, tc,uuid, journal.getWriter(),editor); if(trees.putIfAbsent(_name,newTree) != null){ return null; }
--- a/src/alice/jungle/persistence/PersistentJungleTree.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentJungleTree.java Tue Nov 05 09:13:30 2013 +0900 @@ -15,10 +15,10 @@ private final AtomicReservableReference<TreeContext<T>> repository; private final String uuid; private final String treeName; - private final PersistentChangeListWriter writer; + private final ChangeListWriter writer; private final TreeEditor editor; - public PersistentJungleTree(String _treeName, TreeContext<T> _tc,String _uuid,PersistentChangeListWriter _writer,TreeEditor _editor) + public PersistentJungleTree(String _treeName, TreeContext<T> _tc,String _uuid, ChangeListWriter _writer,TreeEditor _editor) { treeName = _treeName; repository = new AtomicReservableReference<TreeContext<T>>(_tc);
--- a/src/alice/jungle/persistence/PersistentTransactionManager.java Tue Nov 05 08:41:12 2013 +0900 +++ b/src/alice/jungle/persistence/PersistentTransactionManager.java Tue Nov 05 09:13:30 2013 +0900 @@ -3,12 +3,11 @@ import java.util.Iterator; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Result; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TransactionManager; @@ -22,11 +21,11 @@ public class PersistentTransactionManager<T extends TreeNode<T>> implements TransactionManager<T> { private final AtomicReservableReference<TreeContext<T>> repository; private final TreeContext<T> tip; - private final PersistentChangeListWriter writer; + private final ChangeListWriter writer; private final String uuid; private final String treeName; - public PersistentTransactionManager(String _treeName, PersistentChangeListWriter _writer,TreeContext<T> _tip, + public PersistentTransactionManager(String _treeName, ChangeListWriter _writer,TreeContext<T> _tip, AtomicReservableReference<TreeContext<T>> _repository,String _uuid) { repository = _repository;