Exemplo n.º 1
0
 protected void free(FreespaceManager freespaceManager, Slot slot) {
   if (slot.isNull()) {
     return;
   }
   if (freespaceManager == null) {
     return;
   }
   freespaceManager.free(slot);
 }
Exemplo n.º 2
0
 private boolean growDatabaseByConfiguredSize() {
   int reservedStorageSpace = configImpl().databaseGrowthSize();
   if (reservedStorageSpace <= 0) {
     return false;
   }
   int reservedBlocks = _blockConverter.bytesToBlocks(reservedStorageSpace);
   int reservedBytes = _blockConverter.blocksToBytes(reservedBlocks);
   Slot slot = new Slot(_blockEndAddress, reservedBlocks);
   if (Debug4.xbytes && Deploy.overwrite) {
     overwriteDeletedBlockedSlot(slot);
   } else {
     writeBytes(new ByteArrayBuffer(reservedBytes), _blockEndAddress, 0);
   }
   _freespaceManager.free(_blockConverter.toNonBlockedLength(slot));
   _blockEndAddress += reservedBlocks;
   return true;
 }
Exemplo n.º 3
0
  public void free(Slot slot) {
    if (slot.isNull()) {
      return;

      // TODO: This should really be an IllegalArgumentException but old database files
      //       with index-based FreespaceManagers appear to deliver zeroed slots.
      // throw new IllegalArgumentException();
    }
    if (_freespaceManager == null) {
      // Can happen on early free before freespacemanager
      // is up, during conversion.
      return;
    }

    if (DTrace.enabled) {
      DTrace.FILE_FREE.logLength(slot.address(), slot.length());
    }

    _freespaceManager.free(slot);
  }
Exemplo n.º 4
0
 public void rollback(FreespaceManager freespaceManager) {
   if (isFreeOnRollback()) {
     freespaceManager.free(_newSlot);
   }
 }