Mercurial > hg > Members > tatsuki > bench > jungle-core
changeset 163:7be56a1be5d9
modification index
author | one |
---|---|
date | Mon, 08 Dec 2014 10:49:53 +0900 |
parents | 38068be4fa4c |
children | 6615db346bf5 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungle.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultChangeSet.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java |
diffstat | 4 files changed, 24 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungle.java Mon Dec 08 03:42:26 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungle.java Mon Dec 08 10:49:53 2014 +0900 @@ -4,6 +4,7 @@ import java.util.concurrent.ConcurrentHashMap; import fj.data.List; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Journal; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.NullJournal; @@ -11,6 +12,7 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; @@ -78,9 +80,9 @@ }; DefaultTreeNode root = new DefaultTreeNode(); - Index index = new Index(); - ParentIndex parentIndex = new ParentIndex(); - ChangeSet set = new DefaultChangeSet(root,null,list,uuid,name,0,index,parentIndex); + TreeMap<String, TreeMap<String, List<TreeNode>>> indexList = new Index().getIndex(); + TreeMap<TreeNode, TreeNode> parentIndex = new ParentIndex().getParentIndex(); + ChangeSet set = new DefaultChangeSet(root,null,list,uuid,name,0,indexList,parentIndex); DefaultTreeContext tc = new DefaultTreeContext(root,set); JungleTree newTree = new DefaultJungleTree(tc,uuid,journal.getWriter(),editor); if(trees.putIfAbsent(name,newTree) != null){
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultChangeSet.java Mon Dec 08 03:42:26 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultChangeSet.java Mon Dec 08 10:49:53 2014 +0900 @@ -1,5 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction; +import fj.data.List; +import fj.data.TreeMap; 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.TreeNode; @@ -15,10 +17,11 @@ private final String uuid; private final String treeName; private final long revision; - private final Index index; - private final ParentIndex parentIndex; + private final TreeMap<String, TreeMap<String, List<TreeNode>>> indexList; + private final TreeMap<TreeNode, TreeNode> parentIndex; - public DefaultChangeSet(TreeNode _node,ChangeSet _prev,ChangeList _log,String _uuid, String _treeName, long _revision, Index index,ParentIndex parentIndex) + public DefaultChangeSet(TreeNode _node,ChangeSet _prev,ChangeList _log,String _uuid, String _treeName, long _revision,TreeMap<String, TreeMap<String, List<TreeNode>>> indexList, + TreeMap<TreeNode, TreeNode> parentIndex) { this.root = _node; this.previous = _prev; @@ -26,7 +29,7 @@ this.uuid = _uuid; this.treeName = _treeName; this.revision = _revision; - this.index = index; + this.indexList = indexList; this.parentIndex = parentIndex; } @@ -75,13 +78,13 @@ @Override public Index getIndex() { - return index; + return new Index(indexList); } @Override public ParentIndex getParentIndex() { - return parentIndex; + return new ParentIndex(parentIndex); } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java Mon Dec 08 03:42:26 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java Mon Dec 08 10:49:53 2014 +0900 @@ -79,10 +79,10 @@ e.printStackTrace(); } - Index nulIndex = traverser.getIndex(); - ParentIndex nulParentIndex = traverser.getParentIndex(); - DefaultChangeSet newCs = new DefaultChangeSet(_newRoot, cs, list, uuid, _treeName, nextRevision, nulIndex, - nulParentIndex); + Index index = traverser.getIndex(); + ParentIndex parentIndex = traverser.getParentIndex(); + DefaultChangeSet newCs = new DefaultChangeSet(_newRoot, cs, list, uuid, _treeName, nextRevision, index.getIndex(), + parentIndex.getParentIndex()); DefaultTreeContext newContext = new DefaultTreeContext(_newRoot, newCs); @SuppressWarnings("rawtypes")
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Mon Dec 08 03:42:26 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Mon Dec 08 10:49:53 2014 +0900 @@ -61,12 +61,12 @@ TreeNode targetNode = itNode.next(); if (parentUpdateFlag) parentIndex = parentIndex.set(targetNode); - List<String> keys = targetNode.getAttributes().getKeys(); - for (String key : keys) { - String value = targetNode.getAttributes().getString(key); - if (value != null) - index = index.set(key, value, targetNode); - } +// List<String> keys = targetNode.getAttributes().getKeys(); +// for (String key : keys) { +// String value = targetNode.getAttributes().getString(key); +// if (value != null) +// index = index.set(key, value, targetNode); +// } } }