2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package TransactionalIO.core;
11 import TransactionalIO.exceptions.AbortedException;
12 import TransactionalIO.benchmarks.benchmark;
13 import TransactionalIO.benchmarks.customhandler;
14 import TransactionalIO.benchmarks.customhandler;
15 import TransactionalIO.interfaces.BlockAccessModesEnum;
16 import TransactionalIO.interfaces.ContentionManager;
17 import TransactionalIO.interfaces.TransactionStatu;
18 //import dstm2.file.managers.BaseManager;
19 import java.awt.event.ActionListener;
20 import java.beans.EventHandler;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.beans.PropertyChangeSupport;
24 import java.io.FileDescriptor;
25 import java.io.IOException;
26 import java.io.RandomAccessFile;
27 import java.util.Collections;
28 import java.util.HashMap;
29 import java.util.Iterator;
31 import java.util.TreeMap;
32 import java.util.Vector;
33 import java.util.concurrent.locks.Lock;
34 import java.util.concurrent.locks.ReentrantLock;
35 import java.util.concurrent.locks.ReentrantReadWriteLock;
36 import java.util.logging.Level;
37 import java.util.logging.Logger;
43 public class ExtendedTransaction implements TransactionStatu {
46 private native int nativepwrite(byte buff[], long offset, int size, FileDescriptor fd);
49 // System.load("/home/navid/libkooni.so");
52 private boolean flag = true;
53 public TransactionStatu memorystate;
54 private PropertyChangeSupport changes = new PropertyChangeSupport(this);
58 public TreeMap msg = new TreeMap();
59 public int numberofwrites;
60 public int numberofreads;
62 public enum Status {ABORTED, ACTIVE, COMMITTED};
63 private boolean writesmerged = true;
65 //private Vector<ReentrantLock> heldoffsetlocks;
66 private Vector heldoffsetlocks;
68 //private Vector<ReentrantLock> heldblocklocks;
69 private Vector heldblocklocks;
71 //private HashMap<INode, Vector<TransactionalFile>> AccessedFiles;
72 private HashMap AccessedFiles;
75 //private HashMap<INode, HashMap<Integer, BlockAccessModesEnum> > accessedBlocks;
76 private HashMap accessedBlocks;
78 //private HashMap<TransactionalFile, TransactionLocalFileAttributes> LocaltoGlobalMappings;
79 private HashMap GlobaltoLocalMappings;
81 public HashMap merge_for_writes_done;
86 private HashMap writeBuffer;
88 private ContentionManager contentionmanager;
89 private /*volatile*/ Status status;
95 public ExtendedTransaction() {
97 // id = Integer.valueOf(Thread.currentThread().getName().substring(7));
98 heldblocklocks = new Vector() ;
99 heldoffsetlocks= new Vector();
100 AccessedFiles = new HashMap();
101 GlobaltoLocalMappings = new HashMap/*<TransactionalFile, TransactionLocalFileAttributes >*/();
102 writeBuffer = new HashMap();
103 status = Status.ACTIVE;
104 accessedBlocks = new HashMap();
105 merge_for_writes_done = new HashMap();
107 // setContentionmanager(new BaseManager());
108 // beginTransaction();
112 public ExtendedTransaction(TransactionStatu memorystate){
114 /* heldblocklocks = new Vector() ;
115 heldoffsetlocks= new Vector();
116 AccessedFiles = new HashMap();
117 GlobaltoLocalMappings = new HashMap();
118 writeBuffer = new HashMap();
119 status = Status.ACTIVE;
120 accessedBlocks = new HashMap();
121 merge_for_writes_done = new HashMap();
122 writesmerged = true;*/
123 this.memorystate = memorystate ;
126 private int invokeNativepwrite(byte buff[], long offset, int size, RandomAccessFile file) {
128 //System.out.println(buff.length);
129 // System.out.println(offset);
130 return nativepwrite(buff, offset, buff.length, file.getFD());
131 } catch (IOException ex) {
133 Logger.getLogger(TransactionalFile.class.getName()).log(Level.SEVERE, null, ex);
139 public void beginTransaction(){
140 this.addPropertyChangeListener(new customhandler(Status.ABORTED));
146 public void abort() {
148 // Status oldst = getStatus();
149 /* synchronized(benchmark.lock){
150 System.out.println("be ga raftim 0");
152 this.status = Status.ABORTED;
153 if (this.memorystate !=null && !(this.memorystate).isAborted()){
154 /* synchronized(benchmark.lock){
155 System.out.println(Thread.currentThread() +" be ga raftim 1 file");
157 this.memorystate.abortThisSystem();
158 /* synchronized(benchmark.lock){
159 System.out.println(Thread.currentThread() + " be ga raftim 2 file");
162 // Thread[] group = new Thread[30];
163 // Thread.currentThread().enumerate(group);
164 // group[this.id].interrupt();
165 /*synchronized(benchmark.lock){
166 System.out.println("/////////////");
167 System.out.println(Thread.currentThread() + " " +Thread.currentThread().enumerate(group));
168 System.out.println(Thread.currentThread() + " " +group[0]);
169 System.out.println(Thread.currentThread() + " " +group[1]);
170 System.out.println(Thread.currentThread() + " " +group[2]);
171 System.out.println("/////////////");
175 // this.changes.firePropertyChange("status", oldst, Status.ABORTED);
180 public Status getStatus() {
184 public boolean isActive() {
185 return this.getStatus() == Status.ACTIVE;
189 public boolean isAborted() {
190 return this.getStatus() == Status.ABORTED;
193 public ContentionManager getContentionmanager() {
194 return contentionmanager;
197 public void setContentionmanager(ContentionManager contentionmanager) {
198 this.contentionmanager = contentionmanager;
202 public HashMap getWriteBuffer() {
206 public HashMap getAccessedFiles() {
207 return AccessedFiles;
210 public boolean isWritesmerged() {
214 public void setWritesmerged(boolean writesmerged) {
215 this.writesmerged = writesmerged;
223 public HashMap getGlobaltoLocalMappings() {
224 return GlobaltoLocalMappings;
227 public HashMap getAccessedBlocks() {
228 return accessedBlocks;
232 public ContentionManager getBlockContentionManager(){
233 return ManagerRepository.getBlockcm();
236 public ContentionManager getOffsetContentionManager(){
237 return ManagerRepository.getOffsetcm();
240 public TreeMap getSortedFileAccessMap(HashMap hmap) {
241 /*TreeMap sortedMap = new TreeMap(hmap);
243 return new TreeMap(hmap);
247 public void setStatus(Status st){
248 Status oldst = getStatus();
250 this.changes.firePropertyChange("status", oldst, st);
256 public void addFile(TransactionalFile tf, long offstenumber) {
259 //tf.lockOffset(this);
261 TransactionLocalFileAttributes tmp = new TransactionLocalFileAttributes(offstenumber/*, tf.getInodestate().commitedfilesize.get()*/);
263 //tf.offsetlock.unlock();
269 if (AccessedFiles.containsKey(tf.getInode())){
270 dummy = (Vector) AccessedFiles.get(tf.getInode());
273 dummy = new Vector();
274 AccessedFiles.put(tf.getInode(), dummy);
278 GlobaltoLocalMappings.put(tf, tmp);
279 merge_for_writes_done.put(tf.getInode(), Boolean.TRUE);
284 public boolean lockOffsets() { /// Locking offsets for File Descriptors
287 TreeMap hm = getSortedFileAccessMap(AccessedFiles);
288 Iterator iter = hm.keySet().iterator();
290 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE)) {
291 INode key = (INode) iter.next();
293 Vector vec = (Vector) AccessedFiles.get(key);
294 Collections.sort(vec);
295 Iterator it = vec.iterator();
296 while (it.hasNext()){
297 TransactionalFile value = (TransactionalFile) it.next();
298 while (this.getStatus() ==Status.ACTIVE){
299 //if (value.offsetlock.tryLock()) {
300 value.offsetlock.lock();
302 // synchronized(value.getCommitedoffset()){
303 // value.getCommitedoffset().setOffsetOwner(this);
305 // this.msg.put(System.nanoTime(), Thread.currentThread().getName() + " Locked the offset lock in commit for file " + value.getInode() + " from descriptor "+ value.getSequenceNum() +"\n");
306 heldoffsetlocks.add(value.offsetlock);
309 // getContentionmanager().resolveConflict(this, value.getCommitedoffset());
313 if (this.getStatus() != Status.ACTIVE){
321 if (this.getStatus() != Status.ACTIVE){
329 /*public boolean commit() { /// Locking offsets for File Descriptors
331 Map hm = getSortedFileAccessMap(FilesAccesses);
333 Iterator iter = hm.keySet().iterator();
334 TransactionLocalFileAttributes value;
335 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE)) {
336 INode key = (INode) iter.next();
337 value = (TransactionLocalFileAttributes) hm.get(key);
338 synchronized(value.getCurrentcommitedoffset()){
339 if (value.offsetlock.tryLock()) {
340 value.getCurrentcommitedoffset().setOffsetOwner(this);
341 heldblocklocks.add(value.offsetlock);
342 Iterator it = value.getCurrentcommitedoffset().getOffsetReaders().iterator(); // for in-place aborting visible readers strategy
345 ExtendedTransaction tr = (ExtendedTransaction) it.next();
351 getOffsetContentionManager().resolveConflict(this, value.getCurrentcommitedoffset().getOffsetOwner());
356 /*public boolean commit() { /// Locking offsets for File Descriptors with checking strategy
358 Map hm = getSortedFileAccessMap(FilesAccesses);
360 Iterator iter = hm.keySet().iterator();
361 TransactionLocalFileAttributes value;
362 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE)) {
363 INode key = (INode) iter.next();
364 value = (TransactionLocalFileAttributes) hm.get(key);
366 if (value.isValidatelocaloffset()) {
367 if (value.getCopylocaloffset() == value.currentcommitedoffset.getOffsetnumber()) {
368 value.offsetlock.lock();
369 heldoffsetlocks.add(value.offsetlock);
370 if (!(value.getCopylocaloffset() == value.currentcommitedoffset.getOffsetnumber())) {
379 value.offsetlock.lock();
380 heldoffsetlocks.add(value.offsetlock);
388 public boolean lockBlock(BlockDataStructure block, BlockAccessModesEnum mode/*, GlobalINodeState adapter, BlockAccessModesEnum mode, int expvalue, INode inode, TransactionLocalFileAttributes tf*/) {
391 //boolean locked = false;
396 if (mode == BlockAccessModesEnum.READ){
397 lock = block.getLock().readLock();
400 lock = block.getLock().writeLock();
403 while (this.getStatus() == Status.ACTIVE) {
405 heldblocklocks.add(lock);
412 public boolean lockBlock(BlockDataStructure block, Adapter adapter, BlockAccessModesEnum mode, int expvalue) { // from here for visible readers strategy
413 while (this.getStatus() == Status.ACTIVE) {
414 if (lock.tryLock()) {
415 Thread.onAbortOnce(new Runnable() {
422 heldblocklocks.add(lock);
424 synchronized (adapter) {
425 block.setOwner(this);
426 // Iterator it = block.getReaders().iterator();
427 // while (it.hasNext())
429 // ExtendedTransaction tr = (ExtendedTransaction) it.next();
436 getBlockContentionManager().resolveConflict(this, block.getOwner());
443 public boolean lockBlock(BlockDataStructure block, Adapter adapter, BlockAccessModesEnum mode, int expvalue) { // versioning strat
444 while (this.getStatus() == Status.ACTIVE) {
445 if (lock.tryLock()) {
446 Thread.onAbortOnce(new Runnable() {
453 heldblocklocks.add(lock);
454 if (mode != BlockAccessModesEnum.WRITE) { egy
455 if (block.getVersion().get() != expvalue) {
460 synchronized (adapter) {
461 block.setOwner(this);
466 getContentionManager().resolveConflict(this, block.getOwner());
472 public void prepareCommit() {
473 if (this.status != Status.ACTIVE)
474 throw new AbortedException();
480 // this.msg.put(System.nanoTime(),Thread.currentThread().getName() + " Aborted \n");
481 /* synchronized(benchmark.lock){
482 benchmark.msg += Thread.currentThread().getName() + " Aborted in prepare commit\n";
484 //Thread.currentThread().stop();
485 throw new AbortedException();
489 ///////////////////////////
492 Map hm = getWriteBuffer();
494 Iterator iter = hm.keySet().iterator();
495 WriteOperations value;
496 Vector vec = new Vector();
497 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE) && ok) {
500 INode key = (INode) iter.next();
501 vec = (Vector) hm.get(key);
502 Collections.sort(vec);
503 Iterator it = vec.iterator();
504 while (it.hasNext()){
506 value = (WriteOperations) it.next();
507 if (value.isUnknownoffset()){
512 //synchronized(value.getOwnertransactionalFile().getCommitedoffset()){
513 start = value.getRange().getStart() - value.getTFA().getCopylocaloffset() + value.getOwnerTF().getCommitedoffset().getOffsetnumber();
514 end = value.getRange().getEnd() - value.getTFA().getCopylocaloffset() + value.getOwnerTF().getCommitedoffset().getOffsetnumber();
515 if (value.getTFA().isUnknown_inital_offset_for_write()){
516 value.getTFA().setLocaloffset(value.getTFA().getLocaloffset() - value.getTFA().getCopylocaloffset() + value.getOwnerTF().getCommitedoffset().getOffsetnumber());
517 value.getTFA().setUnknown_inital_offset_for_write(false);
521 // System.out.println("start write " + start);
522 /// System.out.println("end write " + end);
523 int startblock = FileBlockManager.getCurrentFragmentIndexofTheFile(start);
524 int targetblock = FileBlockManager.getTargetFragmentIndexofTheFile(start, value.getRange().getEnd() - value.getRange().getStart());
527 if (this.getAccessedBlocks().get(key) != null){
528 sset = (TreeMap) this.getAccessedBlocks().get(key);
532 sset = new TreeMap();
533 this.getAccessedBlocks().put(key, sset);
537 for (int i = startblock; i <= targetblock; i++) {
538 if (sset.containsKey(Integer.valueOf(i))){
539 if (sset.get(Integer.valueOf(i)) != BlockAccessModesEnum.WRITE)
540 sset.put(Integer.valueOf(i), BlockAccessModesEnum.READ_WRITE);
543 sset.put(Integer.valueOf(i), BlockAccessModesEnum.WRITE);
545 // tt.add(Integer.valueOf(i));
548 value.getRange().setStart(start);
549 value.getRange().setEnd(end);
551 // System.out.println(Thread.currentThread().);
552 // System.out.println(value.getRange().getStart());
553 // System.out.println(value.getRange().getEnd());
554 // System.out.println("---------------");
555 //this.getAccessedBlocks().put(value.getOwnertransactionalFile().getInode(), sset);
561 Iterator it = this.getAccessedBlocks().keySet().iterator();
562 while (it.hasNext() && (this.getStatus() == Status.ACTIVE)) {
563 INode inode = (INode) it.next();
564 GlobalINodeState inodestate = TransactionalFileWrapperFactory.getTateransactionalFileINodeState(inode);
565 TreeMap vec2 = (TreeMap) this.getAccessedBlocks().get(inode);
566 Iterator iter2 = vec2.keySet().iterator();
567 while(iter2.hasNext()){
568 Integer num = (Integer) iter2.next();
570 //BlockDataStructure blockobj = (BlockDataStructure) inodestate.lockmap.get(num);
571 BlockDataStructure blockobj;
572 // if (((BlockAccessModesEnum)vec2.get(num)) == BlockAccessModesEnum.WRITE){
573 blockobj = inodestate.getBlockDataStructure(num);
576 // blockobj = (BlockDataStructure) inodestate.lockmap.get(num);
578 ok = this.lockBlock(blockobj, (BlockAccessModesEnum)vec2.get(num));
581 /* synchronized(benchmark.lock){
582 benchmark.msg += Thread.currentThread().getName() + " Locked the Block Number " + blockobj.getBlocknumber() +" for " + inode + "\n";
584 // this.msg.put(System.nanoTime(), Thread.currentThread().getName() + " Locked the Block Number " + blockobj.getBlocknumber() + " for file " + inode + "\n");
588 if (this.getStatus() != Status.ACTIVE){
590 // this.msg.put(System.nanoTime(), Thread.currentThread().getName() + " Aborted \n");
591 /* synchronized(benchmark.lock){
592 benchmark.msg += Thread.currentThread().getName() + " Aborted \n";
594 // Thread.currentThread().stop();
595 throw new AbortedException();
600 //expvalue = ((Integer) value.getBlockversions().get(it)).intValue(); //for versioning strategy
601 /*if (!(value.isValidatelocaloffset())) {
602 if (((BlockAccessModesEnum) (value.getAccesedblocks().get(blockno))) != BlockAccessModesEnum.WRITE) { //versioning strategy
604 /if (blockobj.getVersion().get() == expvalue) {
606 ok = this.lock(blockobj, value.adapter, (BlockAccessModesEnum) (value.getAccesedblocks().get(blockno)), expvalue);
617 ok = this.lock(blockobj, value.adapter, (BlockAccessModesEnum) (value.getAccesedblocks().get(blockno)), expvalue);
627 throw new AbortedException();
631 public void commitChanges(){
633 // this.msg.put(System.nanoTime(), Thread.currentThread().getName() + " is committing \n");
637 //synchronized(benchmark.lock){
638 // System.out.println(Thread.currentThread().getName() + " is commiting");
642 Map hm = getWriteBuffer();
643 Iterator iter = hm.keySet().iterator();
645 WriteOperations writeop;
647 while (iter.hasNext() && (this.getStatus() == Status.ACTIVE)) {
648 INode key = (INode) iter.next();
650 vec = (Vector) hm.get(key);
651 Collections.sort(vec);
653 while (it.hasNext()){
656 //value = (WriteOperations) it.next();
657 // writeop = (WriteOperations) writeBuffer.get(key);
658 writeop = (WriteOperations) it.next();
659 // System.out.println(writeop);
660 Byte[] data = new Byte[(int) (writeop.getRange().getEnd() - writeop.getRange().getStart())];
661 byte[] bytedata = new byte[(int) (writeop.getRange().getEnd() - writeop.getRange().getStart())];
662 data = (Byte[]) writeop.getData();
664 for (int i = 0; i < data.length; i++) {
665 bytedata[i] = data[i];
670 // writeop.getOwnertransactionalFile().file.seek(writeop.getRange().getStart());
671 // System.out.println(Thread.currentThread() + " range " + writeop.getRange().getStart());
672 // writeop.getOwnertransactionalFile().file.write(bytedata);
673 invokeNativepwrite(bytedata, writeop.getRange().getStart(), bytedata.length, writeop.getOwnerTF().file);
674 // System.out.println(Thread.currentThread() + " " + bytedata);
676 // } catch (IOException ex) {
677 // Logger.getLogger(ExtendedTransaction.class.getName()).log(Level.SEVERE, null, ex);
684 /*if (((FileAccessModesEum) (this.FilesAccessModes.get(key))) == FileAccessModesEum.APPEND) {
686 Range range = (Range) value.getWrittendata().firstKey();
689 //synchronized(value.adapter){
690 //value.f.seek(value.adapter.commitedfilesize.get());
691 value.f.seek(value.getFilelength());
694 Byte[] data = new Byte[(int) (range.getEnd() - range.getStart())];
695 byte[] bytedata = new byte[(int) (range.getEnd() - range.getStart())];
696 data = (Byte[]) value.getWrittendata().get(range);
698 for (int i = 0; i < data.length; i++) {
699 bytedata[i] = data[i];
701 value.f.write(bytedata);
703 } catch (IOException ex) {
704 Logger.getLogger(ExtendedTransaction.class.getName()).log(Level.SEVERE, null, ex);
707 } else if (((FileAccessModesEum) (this.FilesAccessModes.get(key))) == FileAccessModesEum.READ) {
710 else if (value.relocatablewrite && value.getContinious_written_data() != null){
714 else if (!(value.getNon_Speculative_Writtendata().isEmpty())) {
715 int tobeaddedoffset = 0;
717 if (value.isValidatelocaloffset()) {
720 tobeaddedoffset = (int) (value.getCurrentcommitedoffset().getOffsetnumber() - value.getCopylocaloffset());
722 Iterator it = value.getNon_Speculative_Writtendata().keySet().iterator();
724 while (it.hasNext() && (this.getStatus() == Status.ACTIVE)) {
726 Range range = (Range) it.next();
729 value.f.seek(range.getStart() + tobeaddedoffset);
731 Byte[] data = new Byte[(int) (range.getEnd() - range.getStart())];
732 byte[] bytedata = new byte[(int) (range.getEnd() - range.getStart())];
733 data = (Byte[]) value.getNon_Speculative_Writtendata().get(range);
735 for (int i = 0; i < data.length; i++) {
736 bytedata[i] = data[i];
738 value.f.write(bytedata);
741 } catch (IOException ex) {
742 Logger.getLogger(ExtendedTransaction.class.getName()).log(Level.SEVERE, null, ex);
751 iter = hm.keySet().iterator();
752 while (iter.hasNext() ) {
753 INode key = (INode) iter.next();
754 value = (TransactionLocalFileAttributes) hm.get(key);
755 Iterator it = value.getAccesedblocks().keySet().iterator();
757 while (it.hasNext()) {
758 Integer blockno = (Integer) it.next();
759 synchronized (value.adapter) {
760 //BlockDataStructure blockobj = (BlockDataStructure) value.adapter.lockmap.get(blockno);
761 //blockobj.getVersion().getAndIncrement(); for versioning strategy
762 //value.getCurrentcommitedoffset().setOffsetnumber(value.getLocaloffset());
763 //value.adapter.commitedfilesize.getAndSet(value.getFilelength());
767 Iterator k = GlobaltoLocalMappings.keySet().iterator();
769 TransactionalFile trf = (TransactionalFile) (k.next());
770 // synchronized(trf.getCommitedoffset()){
771 trf.getCommitedoffset().setOffsetnumber(((TransactionLocalFileAttributes)GlobaltoLocalMappings.get(trf)).getLocaloffset());
772 /*synchronized(benchmark.lock){
773 System.out.println(Thread.currentThread() + " KIRIR " +GlobaltoLocalMappings.get(trf).getLocaloffset());
781 public void unlockAllLocks() {
782 Iterator it = heldblocklocks.iterator();
784 while (it.hasNext()) {
786 Lock lock = (Lock) it.next();
789 /*synchronized(benchmark.lock){
790 System.out.println(Thread.currentThread().getName() + " Released the block lock for " + lock);
793 heldblocklocks.clear();
795 it = heldoffsetlocks.iterator();
796 while (it.hasNext()) {
797 ReentrantLock lock = (ReentrantLock) it.next();
799 // synchronized(benchmark.lock){
800 // System.out.println(Thread.currentThread().getName() + " Released the offset lock for "+ lock +"\n");
803 heldoffsetlocks.clear();
806 public void abortAllReaders(){
807 TreeMap hm = getSortedFileAccessMap(AccessedFiles);
809 Iterator iter = hm.keySet().iterator();
810 TransactionalFile value;
811 while (iter.hasNext()) {
812 INode key = (INode) iter.next();
813 Vector vec = (Vector) AccessedFiles.get(key);
814 Iterator it = vec.iterator();
818 value = (TransactionalFile)it.next();
820 //value = (TransactionalFile) hm.get(key);
821 //System.out.println(value.getCommitedoffset().getOffsetReaders());
823 Iterator it2 = value.getCommitedoffset().getOffsetReaders().iterator(); // for visible readers strategy
824 while ( it2.hasNext())
827 ExtendedTransaction tr = (ExtendedTransaction) it2.next();
831 value.getCommitedoffset().getOffsetReaders().clear();
838 if (accessedBlocks.get(key) != null){
839 vec2 = (TreeMap) accessedBlocks.get(key);
842 vec2 = new TreeMap();
845 GlobalINodeState inodestate = TransactionalFileWrapperFactory.getTateransactionalFileINodeState(key);
846 Iterator it2 = vec2.keySet().iterator();
848 while (it2.hasNext())
851 Integer num = (Integer)it2.next();
852 if (vec2.get(num) != BlockAccessModesEnum.READ)
854 BlockDataStructure blockobj = (BlockDataStructure) inodestate.getBlockDataStructure(num);//lockmap.get(num);
855 Iterator it4 = blockobj.getReaders().iterator(); // from here for visible readers strategy
857 while (it4.hasNext())
860 ExtendedTransaction tr = (ExtendedTransaction) it4.next();
864 blockobj.getReaders().clear();
872 /* SortedSet sst = (SortedSet) this.getAccessedBlocks().get(key);
873 Iterator it3 = sst.iterator();
874 while (it3.hasNext()){
875 Integer num = (Integer)it.next();
876 BlockDataStructure blockobj = (BlockDataStructure) value.getInodestate().lockmap.get(num);
877 Iterator it4 = blockobj.getReaders().iterator(); // from here for visible readers strategy
878 while (it4.hasNext())
880 ExtendedTransaction tr = (ExtendedTransaction) it3.next();
889 public void addPropertyChangeListener(PropertyChangeListener listener){
890 this.changes.addPropertyChangeListener("status",listener);
893 public void removePropertyChangeListener(PropertyChangeListener listener){
894 this.changes.removePropertyChangeListener("status",listener);
897 public TransactionStatu getOtherSystem() {
901 public void setOtherSystem(TransactionStatu othersystem) {
902 memorystate = othersystem;
905 public Vector getHeldblocklocks() {
906 return heldblocklocks;
909 public void setHeldblocklocks(Vector heldblocklocks) {
910 this.heldblocklocks = heldblocklocks;
913 public Vector getHeldoffsetlocks() {
914 return heldoffsetlocks;
917 public void setHeldoffsetlocks(Vector heldoffsetlocks) {
918 this.heldoffsetlocks = heldoffsetlocks;
921 public void abortThisSystem() {
925 public boolean isCommitted() {
926 if (this.status == Status.COMMITTED)