Mercurial > hg > Members > tatsuki > bench > jungle-core
comparison src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java @ 73:e97a59269bf5
change to Various
author | one |
---|---|
date | Wed, 27 Aug 2014 01:02:11 +0900 |
parents | 57e965b73c9e |
children | a4e2f1d45fdc |
comparison
equal
deleted
inserted
replaced
72:5969848b1bb8 | 73:e97a59269bf5 |
---|---|
30 writer = _writer; | 30 writer = _writer; |
31 uuid = _uuid; | 31 uuid = _uuid; |
32 } | 32 } |
33 | 33 |
34 @Override | 34 @Override |
35 public Either<Error,TransactionManager<T>> commit(T _newRoot,final TreeOperationLog _log) | 35 public Either<Error,TransactionManager<T>> commit(TreeNode<T> _newRoot,final TreeOperationLog _log) |
36 { | 36 { |
37 ChangeSet cs = tip.getChangeSet(); | 37 ChangeSet<T> cs = tip.getChangeSet(); |
38 long currentRevision = cs.revision(); | 38 long currentRevision = cs.revision(); |
39 long nextRevision = currentRevision + 1; | 39 long nextRevision = currentRevision + 1; |
40 | 40 |
41 final String _treeName = cs.getTreeName(); | 41 final String _treeName = cs.getTreeName(); |
42 ChangeList list = new ChangeList(){ | 42 ChangeList list = new ChangeList(){ |
52 public String uuid(){ | 52 public String uuid(){ |
53 return uuid; | 53 return uuid; |
54 } | 54 } |
55 }; | 55 }; |
56 | 56 |
57 Node root = _newRoot.getAsNode(); | 57 TreeNode<T> root = _newRoot; |
58 DefaultChangeSet newCs = new DefaultChangeSet(root,cs,list,uuid, _treeName, nextRevision); | 58 DefaultChangeSet<T> newCs = new DefaultChangeSet(root,cs,list,uuid, _treeName, nextRevision); |
59 DefaultTreeContext<T> newContext = new DefaultTreeContext<T>(_newRoot,newCs); | 59 DefaultTreeContext<T> newContext = new DefaultTreeContext<T>(_newRoot,newCs); |
60 | 60 |
61 @SuppressWarnings("rawtypes") | 61 @SuppressWarnings("rawtypes") |
62 Reservation reservation = repository.makeReservation(tip,newContext); | 62 Reservation reservation = repository.makeReservation(tip,newContext); |
63 if(reservation == null){ | 63 if(reservation == null){ |
79 } | 79 } |
80 | 80 |
81 @Override | 81 @Override |
82 public long getRevision() | 82 public long getRevision() |
83 { | 83 { |
84 ChangeSet cs = tip.getChangeSet(); | 84 ChangeSet<T> cs = tip.getChangeSet(); |
85 return cs.revision(); | 85 return cs.revision(); |
86 } | 86 } |
87 } | 87 } |