Package com.caucho.db.block

Examples of com.caucho.db.block.Block.free()


      Block block = allocateRow();

      blockId = block.getBlockId();
      // System.out.println("ALLOC: " + blockId + " " + _rowTailOffset.get() + " " + _rowTailTop);

      block.free();
    }

    _rowTailOffset.compareAndSet(rowTailOffset, blockId + BLOCK_SIZE);
   
    return blockId;
View Full Code Here


          _clockRowUsed++;
      }

      return isFree;
    } finally {
      block.free();
    }
  }

  private boolean isFreeRowBlockIdAvailable()
  {
View Full Code Here

    return lookup(keyBuffer, keyOffset, keyLength, value);
      } finally {
        blockLock.unlockRead();
      }
    } finally {
      block.free();
    }
  }
 
  /**
   * Inserts the new value for the given key.
View Full Code Here

        return true;
      else
        return insertWriteChild(keyBuffer, keyOffset, keyLength,
                                value, isOverride, block);
    } finally {
      block.free();
    }
  }

  private boolean insertReadChild(byte []keyBuffer,
                                  int keyOffset,
View Full Code Here

        validate(block);
      } finally {
        blockLock.unlockReadAndWrite();
      }
    } finally {
      block.free();
    }
  }

  /**
   * The length in lBuf is assumed to be the length of the buffer.
View Full Code Here

     
      leftBlock.setDirty(0, BlockStore.BLOCK_SIZE);
      parentBlock.setDirty(0, BlockStore.BLOCK_SIZE);
    } finally {
      if (leftBlock != null)
  leftBlock.free();
     
      block.setDirty(0, BlockStore.BLOCK_SIZE);
    }
  }
View Full Code Here

        validate(rootBlock);
      } finally {
  rootLock.unlockReadAndWrite();
      }
    } finally {
      rootBlock.free();
    }
  }

  /**
   * Splits the current leaf into two.  Half of the entries go to the
View Full Code Here

    } finally {
      if (leftBlock != null)
  leftBlock.free();
     
      if (rightBlock != null)
  rightBlock.free();
    }
  }
 
  public void remove(byte []keyBuffer,
          int keyOffset,
View Full Code Here

  public void close()
  {
    if (_block != null) {
      Block block = _block;
      _block = null;
      block.free();
    }
  }

  /**
   * Updates the buffer.
View Full Code Here

    throws IOException
  {
    if (_block != null) {
      Block block = _block;
      _block = null;
      block.free();
    }

    long addr;

    int blockCount = (int) (_offset / BlockStore.BLOCK_SIZE);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.