Mercurial > hg > Members > tatsuki > bench > jungle-core
comparison src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java @ 153:20af7f25ef32
miner change
author | one |
---|---|
date | Tue, 25 Nov 2014 17:52:41 +0900 |
parents | 8a0aa8fc137c |
children | b8cef4b640a3 |
comparison
equal
deleted
inserted
replaced
152:8a0aa8fc137c | 153:20af7f25ef32 |
---|---|
22 private final AtomicReservableReference<TreeContext> repository; | 22 private final AtomicReservableReference<TreeContext> repository; |
23 private final TreeContext tip; | 23 private final TreeContext tip; |
24 private final ChangeListWriter writer; | 24 private final ChangeListWriter writer; |
25 private final String uuid; | 25 private final String uuid; |
26 | 26 |
27 public DefaultTransactionManager(ChangeListWriter _writer,TreeContext _tip, | 27 public DefaultTransactionManager(ChangeListWriter _writer,TreeContext _tip, AtomicReservableReference<TreeContext> _repository,String _uuid) |
28 AtomicReservableReference<TreeContext> _repository,String _uuid) | |
29 { | 28 { |
30 repository = _repository; | 29 repository = _repository; |
31 tip = _tip; | 30 tip = _tip; |
32 writer = _writer; | 31 writer = _writer; |
33 uuid = _uuid; | 32 uuid = _uuid; |
34 } | 33 } |
35 | 34 |
36 @Override | 35 @Override |
37 public Either<Error,TransactionManager> commit(TreeNode _newRoot,final TreeOperationLog _log, Index index,ParentIndex parentIndex) | 36 public Either<Error,TransactionManager> commit(TreeNode _newRoot,final TreeOperationLog _log) |
38 { | 37 { |
39 ChangeSet cs = tip.getChangeSet(); | 38 ChangeSet cs = tip.getChangeSet(); |
40 long currentRevision = cs.revision(); | 39 long currentRevision = cs.revision(); |
41 long nextRevision = currentRevision + 1; | 40 long nextRevision = currentRevision + 1; |
42 | 41 |
55 return uuid; | 54 return uuid; |
56 } | 55 } |
57 | 56 |
58 }; | 57 }; |
59 | 58 |
60 DefaultChangeSet newCs = new DefaultChangeSet(_newRoot,cs,list,uuid, _treeName, nextRevision,index,parentIndex); | 59 Index nulIndex = new Index(); |
60 ParentIndex nulParentIndex = new ParentIndex(); | |
61 DefaultChangeSet newCs = new DefaultChangeSet(_newRoot,cs,list,uuid, _treeName, nextRevision, nulIndex, nulParentIndex); | |
61 DefaultTreeContext newContext = new DefaultTreeContext(_newRoot,newCs); | 62 DefaultTreeContext newContext = new DefaultTreeContext(_newRoot,newCs); |
62 | 63 |
63 @SuppressWarnings("rawtypes") | 64 @SuppressWarnings("rawtypes") |
64 Reservation reservation = repository.makeReservation(tip,newContext); | 65 Reservation reservation = repository.makeReservation(tip,newContext); |
65 if(reservation == null){ | 66 if(reservation == null){ |