Example #1
0
 public Slot debugReadPointerSlot(int id) {
   if (Deploy.debug) {
     readBytes(_pointerIo._buffer, id, Const4.POINTER_LENGTH);
     _pointerIo.seek(0);
     _pointerIo.readBegin(Const4.YAPPOINTER);
     int debugAddress = _pointerIo.readInt();
     int debugLength = _pointerIo.readInt();
     _pointerIo.readEnd();
     return new Slot(debugAddress, debugLength);
   }
   return null;
 }
 private boolean lockFileSignalsInterruptedTransaction() {
   openLockFile();
   ByteArrayBuffer buffer = newLockFileBuffer();
   read(_lockFile, buffer);
   for (int i = 0; i < 2; i++) {
     int checkInt = buffer.readInt();
     if (checkInt != LOCK_INT) {
       closeLockFile();
       return false;
     }
   }
   closeLockFile();
   return true;
 }
 public void completeInterruptedTransaction(int transactionId1, int transactionId2) {
   if (!File4.exists(lockFileName(_fileName))) {
     return;
   }
   if (!lockFileSignalsInterruptedTransaction()) {
     return;
   }
   ByteArrayBuffer buffer = new ByteArrayBuffer(Const4.INT_LENGTH);
   openLogFile();
   read(_logFile, buffer);
   int length = buffer.readInt();
   if (length > 0) {
     buffer = new ByteArrayBuffer(length);
     read(_logFile, buffer);
     buffer.incrementOffset(Const4.INT_LENGTH);
     readWriteSlotChanges(buffer);
   }
   deleteLockFile();
   closeLogFile();
   deleteLogFile();
 }