2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package TransactionalIO.core;
7 import TransactionalIO.exceptions.AbortedException;
10 import TransactionalIO.interfaces.BlockAccessModesEnum;
11 import TransactionalIO.interfaces.ContentionManager;
12 import TransactionalIO.interfaces.TransactionStatu;
13 //import dstm2.file.managers.BaseManager;
17 import java.io.FileDescriptor;
18 import java.io.IOException;
19 import java.io.RandomAccessFile;
20 import java.util.Collections;
21 import java.util.HashMap;
22 import java.util.Iterator;
24 import java.util.TreeMap;
25 import java.util.Vector;
26 import java.util.concurrent.locks.Lock;
27 import java.util.concurrent.locks.ReentrantLock;
29 import java.util.concurrent.locks.ReentrantReadWriteLock;
30 import java.util.logging.Level;
31 import java.util.logging.Logger;
37 public class ExtendedTransaction implements TransactionStatu {
39 private static native int nativepwrite(byte buff[], long offset, int size, FileDescriptor fd);
40 public TransactionStatu memorystate;
43 public int numberofwrites;
44 public int numberofreads;
45 private TreeMap sortedAccesedFiles;
49 ABORTED, ACTIVE, COMMITTED
51 private boolean writesmerged = true;
52 //private Vector heldlengthlocks;
53 //private Vector<ReentrantLock> heldoffsetlocks;
54 // private Vector heldoffsetlocks;
55 //private Vector<ReentrantLock> heldblocklocks;
56 //private Vector heldblocklocks;
57 //private HashMap<INode, Vector<TransactionalFile>> AccessedFiles;
58 private HashMap AccessedFiles;
59 //private HashMap<INode, HashMap<Integer, BlockAccessModesEnum> > accessedBlocks;
60 private HashMap accessedBlocks;
61 //private HashMap<TransactionalFile, TransactionLocalFileAttributes> LocaltoGlobalMappings;
62 private HashMap GlobaltoLocalMappings;
63 public HashMap merge_for_writes_done;
64 private HashMap writeBuffer;
65 private volatile Status status;
66 //public ReentrantReadWriteLock[] toholoffsetlocks;
67 public MYLock[] toholoffsetlocks;
68 public int offsetcount = 0;
69 //public Lock[] toholdblocklocks;
70 public MYReadWriteLock[] toholdblocklocks;
71 public int blockcount = 0;
73 public ExtendedTransaction() {
75 // id = Integer.valueOf(Thread.currentThread().getName().substring(7));
76 //toholoffsetlocks = new ReentrantReadWriteLock[20];
77 toholoffsetlocks = new MYLock[20];
78 toholdblocklocks = new MYReadWriteLock[20];
79 // for (int i=0; i<20; i++)
80 // toholoffsetlocks[i] = new ReentrantLock();
81 // heldlengthlocks = new Vector();
82 // heldblocklocks = new Vector();
83 // heldoffsetlocks = new Vector();
84 AccessedFiles = new HashMap();
85 GlobaltoLocalMappings = new HashMap/*<TransactionalFile, TransactionLocalFileAttributes >*/();
86 writeBuffer = new HashMap();
87 status = Status.ACTIVE;
88 accessedBlocks = new HashMap();
89 merge_for_writes_done = new HashMap();
91 // setContentionmanager(new BaseManager());
92 // beginTransaction();
96 public ExtendedTransaction(TransactionStatu memorystate) {
99 this.memorystate = memorystate;
102 public static int invokeNativepwrite(byte buff[], long offset, int size, RandomAccessFile file) {
104 return nativepwrite(buff, offset, buff.length, file.getFD());
105 } catch (IOException ex) {
107 Logger.getLogger(TransactionalFile.class.getName()).log(Level.SEVERE, null, ex);
113 public void abort() {
114 synchronized (this) {
115 this.status = Status.ABORTED;
116 if (this.memorystate != null && !(this.memorystate).isAborted()) {
117 this.memorystate.abortThisSystem();
122 public Status getStatus() {
126 public boolean isActive() {
127 return this.getStatus() == Status.ACTIVE;
130 public boolean isAborted() {
131 return this.getStatus() == Status.ABORTED;
134 public HashMap getWriteBuffer() {
138 public HashMap getAccessedFiles() {
139 return AccessedFiles;
142 public boolean isWritesmerged() {
146 public void setWritesmerged(boolean writesmerged) {
147 this.writesmerged = writesmerged;
150 public HashMap getGlobaltoLocalMappings() {
151 return GlobaltoLocalMappings;
154 public HashMap getAccessedBlocks() {
155 return accessedBlocks;
158 public ContentionManager getBlockContentionManager() {
159 return ManagerRepository.getBlockcm();
162 public ContentionManager getOffsetContentionManager() {
163 return ManagerRepository.getOffsetcm();
166 public TreeMap getSortedFileAccessMap(HashMap hmap) {
167 /*TreeMap sortedMap = new TreeMap(hmap);
169 sortedAccesedFiles = new TreeMap(hmap);
170 return sortedAccesedFiles;
171 //return new TreeMap(hmap);
174 public void addFile(TransactionalFile tf, long offsetnumber/*, TransactionLocalFileAttributes tmp*/) {
175 //tf.getInodestate().commitedfilesize.lengthlock.lock();
176 //TransactionLocalFileAttributes tmp = new TransactionLocalFileAttributes(offsetnumber, tf.getInodestate().commitedfilesize.getLength());
177 TransactionLocalFileAttributes tmp = new TransactionLocalFileAttributes(offsetnumber, 0);
178 //tf.getInodestate().commitedfilesize.lengthlock.unlock();
181 if (AccessedFiles.containsKey(tf.getInode())) {
182 dummy = (Vector) AccessedFiles.get(tf.getInode());
184 dummy = new Vector();
185 AccessedFiles.put(tf.getInode(), dummy);
188 GlobaltoLocalMappings.put(tf, tmp);
189 merge_for_writes_done.put(tf.getInode(), Boolean.TRUE);
192 public boolean lockOffsets() { /// Locking offsets for File Descriptors
196 TreeMap<INode, Vector<TransactionalFile>> hm = getSortedFileAccessMap(AccessedFiles);
197 //for (Map.Entry<INode>Vector<TransactionalFile>> entry : hm.entrySet()) {
200 // entry.getKey().someMethod(entry.getValue());
201 Iterator iter = hm.keySet().iterator();
203 for (Map.Entry<INode,Vector<TransactionalFile>> entry : hm.entrySet()) {
204 // for (int j=0; j< hm.size(); j++){
205 //while (iter.hasNext()/* && (this.getStatus() == Status.ACTIVE)*/) {
206 // INode key = (INode) iter.next();
207 //Vector vec = (Vector) AccessedFiles.get(key);
208 INode key = entry.getKey();
209 Vector vec = entry.getValue();
210 Collections.sort(vec);
211 for (int i = 0; i < vec.size(); i++) {
212 //Iterator it = vec.iterator();
213 //while (it.hasNext() /*&& this.getStatus() == Status.ACTIVE*/) {
214 //TransactionalFile value = (TransactionalFile) it.next();
215 TransactionalFile value = (TransactionalFile) vec.get(i);
216 //System.out.println(Thread.currentThread() + " offset " + value);
217 /* if (toholoffsetlocks[offsetcount] == null)
218 toholoffsetlocks[offsetcount] = new ReentrantReadWriteLock();
219 toholoffsetlocks[offsetcount] = value.offsetlock;*/
220 toholoffsetlocks[offsetcount] = value.myoffsetlock;
223 value.myoffsetlock.acquire(this);
224 //value.offsetlock.writeLock().lock();
226 //heldoffsetlocks.add(value.offsetlock);
229 //should be uncommented
230 /*if (((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(value)).lenght_read) {
231 if (!(value.getInodestate().commitedfilesize.lengthlock.isHeldByCurrentThread())) {
232 value.getInodestate().commitedfilesize.lengthlock.lock();
233 heldlengthlocks.add(value.getInodestate().commitedfilesize.lengthlock);
240 if (this.getStatus() != Status.ACTIVE) {
241 // for (int i=0; i<offsetcount; i++){
242 // heldoffsetlocks.add(toholoffsetlocks[i]);
250 public boolean lockBlock(BlockDataStructure block, BlockAccessModesEnum mode/*, GlobalINodeState adapter, BlockAccessModesEnum mode, int expvalue, INode inode, TransactionLocalFileAttributes tf*/) {
253 if (mode == BlockAccessModesEnum.READ) {
255 //lock =block.getLock().readLock();
256 block.getLock().readLock();
260 //lock = block.getLock().writeLock();
261 block.getLock().writeLock();
267 if (toholdblocklocks[blockcount] == null) {
268 //if (mode == BlockAccessModesEnum.READ) {
269 // toholdblocklocks[blockcount] = new ReentrantReadWriteLock().readLock();
272 //toholdblocklocks[blockcount] = new ReentrantReadWriteLock().writeLock();
273 toholdblocklocks[blockcount] = new MYReadWriteLock();
275 //toholdblocklocks[blockcount] = lock;
276 toholdblocklocks[blockcount] = block.getLock();
278 //heldblocklocks.add(lock);
283 public void prepareCommit() {
284 if (this.status != Status.ACTIVE) {
285 throw new AbortedException();
287 if (!lockOffsets()) {
288 throw new AbortedException();
291 // boolean lengthslock = true;
292 // if (!lockOffsets()) {
293 // throw new AbortedException();
297 ///////////////////////////
300 Map hm = getWriteBuffer();
302 Iterator iter = hm.keySet().iterator();
303 WriteOperations value;
304 Vector vec = new Vector();
305 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE)) {
306 INode key = (INode) iter.next();
307 vec = (Vector) hm.get(key);
308 //if (!(isWritesmerged()))
309 Collections.sort(vec);
310 //Iterator it = vec.iterator();
311 for (int j = 0; j < vec.size(); j++) {
312 //while (it.hasNext()) {
313 value = (WriteOperations) vec.get(j);
314 //value = (WriteOperations) it.next();
315 if (value.isUnknownoffset()) {
318 start = value.getRange().getStart() - value.getBelongingto().getCopylocaloffset() + value.getOwnertransactionalFile().getCommitedoffset().getOffsetnumber();
319 end = value.getRange().getEnd() - value.getBelongingto().getCopylocaloffset() + value.getOwnertransactionalFile().getCommitedoffset().getOffsetnumber();
320 if (value.getBelongingto().isUnknown_inital_offset_for_write()) {
321 value.getBelongingto().setLocaloffset(value.getBelongingto().getLocaloffset() - value.getBelongingto().getCopylocaloffset() + value.getOwnertransactionalFile().getCommitedoffset().getOffsetnumber());
322 value.getBelongingto().setUnknown_inital_offset_for_write(false);
325 int startblock = FileBlockManager.getCurrentFragmentIndexofTheFile(start);
326 int targetblock = FileBlockManager.getTargetFragmentIndexofTheFile(start, value.getRange().getEnd() - value.getRange().getStart());
329 if (this.getAccessedBlocks().get(key) != null) {
330 sset = (TreeMap) this.getAccessedBlocks().get(key);
332 sset = new TreeMap();
333 this.getAccessedBlocks().put(key, sset);
337 for (int i = startblock; i <= targetblock; i++) {
338 if (sset.containsKey(Integer.valueOf(i))) {
339 if (sset.get(Integer.valueOf(i)) != BlockAccessModesEnum.WRITE) {
340 sset.put(Integer.valueOf(i), BlockAccessModesEnum.READ_WRITE);
343 sset.put(Integer.valueOf(i), BlockAccessModesEnum.WRITE);
347 value.getRange().setStart(start);
348 value.getRange().setEnd(end);
354 //toholdblocklocks = new Lock[100];
356 Iterator it = this.getAccessedBlocks().keySet().iterator();
357 while (it.hasNext() /*&& (this.getStatus() == Status.ACTIVE)*/) {
358 INode inode = (INode) it.next();
359 GlobalINodeState inodestate = TransactionalFileWrapperFactory.getTateransactionalFileINodeState(inode);
360 TreeMap vec2 = (TreeMap) this.getAccessedBlocks().get(inode);
361 Iterator iter2 = vec2.keySet().iterator();
362 while (iter2.hasNext()/* && this.getStatus() == Status.ACTIVE*/) {
363 Integer num = (Integer) iter2.next();
365 BlockDataStructure blockobj = inodestate.getBlockDataStructure(num);
367 this.lockBlock(blockobj, (BlockAccessModesEnum) vec2.get(num));
374 if (this.getStatus() != Status.ACTIVE) {
375 // for (int i=0; i<blockcount; i++)
376 // heldblocklocks.add(toholdblocklocks[i]);
377 throw new AbortedException();
387 public void commitOffset() {
388 Iterator k = GlobaltoLocalMappings.keySet().iterator();
389 while (k.hasNext()) {
390 TransactionalFile trf = (TransactionalFile) (k.next());
391 trf.getCommitedoffset().setOffsetnumber(((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getLocaloffset());
394 //should be uncommented
395 /* if (((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getInitiallocallength() != ((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getLocalsize()) {
397 if (!(trf.getInodestate().commitedfilesize.lengthlock.isHeldByCurrentThread())) {
398 trf.getInodestate().commitedfilesize.lengthlock.lock();
400 //Iterator it2 = trf.getInodestate().commitedfilesize.getLengthReaders().iterator();
403 // if (((TransactionLocalFileAttributes) getGlobaltoLocalMappings().get(trf)).getInitiallocallength() != ((TransactionLocalFileAttributes) getGlobaltoLocalMappings().get(trf)).getLocalsize()) {
404 for (int adad = 0; adad < trf.getInodestate().commitedfilesize.getLengthReaders().size(); adad++) {
405 // while (it2.hasNext()) {
406 ExtendedTransaction tr = (ExtendedTransaction) trf.getInodestate().commitedfilesize.getLengthReaders().get(adad);
407 //ExtendedTransaction tr = (ExtendedTransaction) it2.next();
412 trf.getInodestate().commitedfilesize.getLengthReaders().clear();
414 trf.getInodestate().commitedfilesize.setLength(trf.file.length());
416 if (trf.getInodestate().commitedfilesize.lengthlock.isHeldByCurrentThread()) {
417 heldlengthlocks.remove(trf.getInodestate().commitedfilesize.lengthlock);
418 trf.getInodestate().commitedfilesize.lengthlock.unlock();
420 if (((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).lenght_read) {
421 trf.getInodestate().commitedfilesize.getLengthReaders().remove(this);
422 //heldlengthlocks.remove(trf.getInodestate().commitedfilesize.lengthlock);
423 //trf.getInodestate().commitedfilesize.lengthlock.unlock();
426 } catch (IOException ex) {
427 Logger.getLogger(ExtendedTransaction.class.getName()).log(Level.SEVERE, null, ex);
431 for (int i=0; i<offsetcount; i++)
432 toholoffsetlocks[i].release(this);
435 /*for (int i = 0; i < heldlengthlocks.size(); i++) {
436 ReentrantLock lock = (ReentrantLock) heldlengthlocks.get(i);
437 //ReentrantLock lock = (ReentrantLock) it.next();
443 public void commitChanges() {
445 Map hm = getWriteBuffer();
446 Iterator iter = hm.keySet().iterator();
448 WriteOperations writeop;
450 while (iter.hasNext()) {
451 INode key = (INode) iter.next();
453 vec = (Vector) hm.get(key);
454 //Collections.sort(vec);
455 for (int j = 0; j < vec.size(); j++) {
456 //it = vec.iterator();
457 //while (it.hasNext()) {
458 writeop = (WriteOperations) vec.get(j);
459 //writeop = (WriteOperations) it.next();
460 Byte[] data = new Byte[(int) (writeop.getRange().getEnd() - writeop.getRange().getStart())];
461 byte[] bytedata = new byte[(int) (writeop.getRange().getEnd() - writeop.getRange().getStart())];
462 data = (Byte[]) writeop.getData();
464 for (int i = 0; i < data.length; i++) {
465 bytedata[i] = data[i];
467 invokeNativepwrite(bytedata, writeop.getRange().getStart(), bytedata.length, writeop.getOwnertransactionalFile().file);
471 /* Iterator k = GlobaltoLocalMappings.keySet().iterator();
472 while (k.hasNext()) {
473 TransactionalFile trf = (TransactionalFile) (k.next());
474 trf.getCommitedoffset().setOffsetnumber(((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getLocaloffset());
475 if (((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getInitiallocallength() != ((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).getLocalsize()) {
477 if (!(trf.getInodestate().commitedfilesize.lengthlock.isHeldByCurrentThread())) {
478 trf.getInodestate().commitedfilesize.lengthlock.lock();
480 //Iterator it2 = trf.getInodestate().commitedfilesize.getLengthReaders().iterator();
483 // if (((TransactionLocalFileAttributes) getGlobaltoLocalMappings().get(trf)).getInitiallocallength() != ((TransactionLocalFileAttributes) getGlobaltoLocalMappings().get(trf)).getLocalsize()) {
484 for (int adad = 0; adad < trf.getInodestate().commitedfilesize.getLengthReaders().size(); adad++) {
485 // while (it2.hasNext()) {
486 ExtendedTransaction tr = (ExtendedTransaction) trf.getInodestate().commitedfilesize.getLengthReaders().get(adad);
487 //ExtendedTransaction tr = (ExtendedTransaction) it2.next();
492 trf.getInodestate().commitedfilesize.getLengthReaders().clear();
494 trf.getInodestate().commitedfilesize.setLength(trf.file.length());
496 if (trf.getInodestate().commitedfilesize.lengthlock.isHeldByCurrentThread()) {
497 heldlengthlocks.remove(trf.getInodestate().commitedfilesize.lengthlock);
498 trf.getInodestate().commitedfilesize.lengthlock.unlock();
500 if (((TransactionLocalFileAttributes) GlobaltoLocalMappings.get(trf)).lenght_read) {
501 trf.getInodestate().commitedfilesize.getLengthReaders().remove(this);
502 //heldlengthlocks.remove(trf.getInodestate().commitedfilesize.lengthlock);
503 //trf.getInodestate().commitedfilesize.lengthlock.unlock();
506 } catch (IOException ex) {
507 Logger.getLogger(ExtendedTransaction.class.getName()).log(Level.SEVERE, null, ex);
513 /* for (int i =0; i<blockcount; i++){
514 toholdblocklocks[i].unlock();
516 for (int i =0; i<offsetcount; i++){
517 toholoffsetlocks[i].unlock();
521 public void unlockAllLocks() {
522 //Iterator it = heldblocklocks.iterator();
524 // for (int i=0; i<heldblocklocks.size(); i++){
526 //while (it.hasNext()) {
528 //Lock lock = (Lock) it.next();
529 // Lock lock = (Lock) heldblocklocks.get(i);
532 // heldblocklocks.clear();
534 for (int i = 0; i < blockcount; i++) {
535 toholdblocklocks[i].unlock();
540 if (this.getStatus() == Status.ABORTED){
541 for (int i = 0; i < offsetcount; i++) {
542 //toholoffsetlocks[i].writeLock().unlock();
543 toholoffsetlocks[i].release(this);
548 //it = heldoffsetlocks.iterator();
549 // for (int i=0; i<heldoffsetlocks.size(); i++){
550 //while (it.hasNext()) {
551 // ReentrantLock lock = (ReentrantLock) heldoffsetlocks.get(i);
552 //ReentrantLock lock = (ReentrantLock) it.next();
555 // heldoffsetlocks.clear();
557 //it = heldlengthlocks.iterator();
558 //while (it.hasNext()) {
560 /* for (int i = 0; i < heldlengthlocks.size(); i++) {
561 ReentrantLock lock = (ReentrantLock) heldlengthlocks.get(i);
562 //ReentrantLock lock = (ReentrantLock) it.next();
566 // heldlengthlocks.clear();
569 public void abortAllReaders() {
570 //TreeMap hm = getSortedFileAccessMap(AccessedFiles);
573 Iterator iter = sortedAccesedFiles.keySet().iterator();
574 TransactionalFile value;
575 while (iter.hasNext()) {
576 INode key = (INode) iter.next();
577 Vector vec = (Vector) AccessedFiles.get(key);
578 for (int i = 0; i < vec.size(); i++) {
579 //Iterator it = vec.iterator();
580 //while (it.hasNext()) {
582 //value = (TransactionalFile) it.next();
583 value = (TransactionalFile) vec.get(i);
584 //Iterator it2 = value.getCommitedoffset().getOffsetReaders().iterator(); // for visible readers strategy
586 //while (it2.hasNext()) {
587 for (int j = 0; j < value.getCommitedoffset().getOffsetReaders().size(); j++) {
588 //ExtendedTransaction tr = (ExtendedTransaction) it2.next();
589 ExtendedTransaction tr = (ExtendedTransaction) value.getCommitedoffset().getOffsetReaders().get(j);
594 value.getCommitedoffset().getOffsetReaders().clear();
601 if (accessedBlocks.get(key) != null) {
602 vec2 = (TreeMap) accessedBlocks.get(key);
604 vec2 = new TreeMap();
607 GlobalINodeState inodestate = TransactionalFileWrapperFactory.getTateransactionalFileINodeState(key);
608 Iterator it2 = vec2.keySet().iterator();
610 while (it2.hasNext()) {
612 Integer num = (Integer) it2.next();
613 if (vec2.get(num) != BlockAccessModesEnum.READ) {
614 BlockDataStructure blockobj = (BlockDataStructure) inodestate.getBlockDataStructure(num);
616 //Iterator it4 = blockobj.getReaders().iterator(); // from here for visible readers strategy
617 for (int i = 0; i < blockobj.getReaders().size(); i++) {
619 //while (it4.hasNext()) {
620 ExtendedTransaction tr = (ExtendedTransaction) blockobj.getReaders().get(i);
621 //ExtendedTransaction tr = (ExtendedTransaction) it4.next();
626 blockobj.getReaders().clear();
634 public TransactionStatu getOtherSystem() {
638 public void setOtherSystem(TransactionStatu othersystem) {
639 memorystate = othersystem;
642 // public Vector getHeldblocklocks() {
643 // return heldblocklocks;
646 // public void setHeldblocklocks(Vector heldblocklocks) {
647 // this.heldblocklocks = heldblocklocks;
650 // public Vector getHeldoffsetlocks() {
651 // return heldoffsetlocks;
653 // public Vector getHeldlengthlocks() {
654 // return heldlengthlocks;
657 // public void setHeldoffsetlocks(Vector heldoffsetlocks) {
658 // this.heldoffsetlocks = heldoffsetlocks;
660 public void abortThisSystem() {
664 public boolean isCommitted() {
665 if (this.status == Status.COMMITTED) {
673 public boolean lockBlock(BlockDataStructure block, Adapter adapter, BlockAccessModesEnum mode, int expvalue) { // from here for visible readers strategy
674 while (this.getStatus() == Status.ACTIVE) {
675 if (lock.tryLock()) {
676 Thread.onAbortOnce(new Runnable() {
683 heldblocklocks.add(lock);
685 synchronized (adapter) {
686 block.setOwner(this);
687 // Iterator it = block.getReaders().iterator();
688 // while (it.hasNext())
690 // ExtendedTransaction tr = (ExtendedTransaction) it.next();
697 getBlockContentionManager().resolveConflict(this, block.getOwner());
702 public boolean lockBlock(BlockDataStructure block, Adapter adapter, BlockAccessModesEnum mode, int expvalue) { // versioning strat
703 while (this.getStatus() == Status.ACTIVE) {
704 if (lock.tryLock()) {
705 Thread.onAbortOnce(new Runnable() {
712 heldblocklocks.add(lock);
713 if (mode != BlockAccessModesEnum.WRITE) { egy
714 if (block.getVersion().get() != expvalue) {
719 synchronized (adapter) {
720 block.setOwner(this);
725 getContentionManager().resolveConflict(this, block.getOwner());
731 //expvalue = ((Integer) value.getBlockversions().get(it)).intValue(); //for versioning strategy
732 /*if (!(value.isValidatelocaloffset())) {
733 if (((BlockAccessModesEnum) (value.getAccesedblocks().get(blockno))) != BlockAccessModesEnum.WRITE) { //versioning strategy
735 /if (blockobj.getVersion().get() == expvalue) {
737 ok = this.lock(blockobj, value.adapter, (BlockAccessModesEnum) (value.getAccesedblocks().get(blockno)), expvalue);
748 ok = this.lock(blockobj, value.adapter, (BlockAccessModesEnum) (value.getAccesedblocks().get(blockno)), expvalue);
758 throw new AbortedException();