Package com.caucho.db.block

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


        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.unlock();
      }
    } 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.unlock();
      }
    } 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

        while (_blockList.size() <= _length / BlockStore.BLOCK_SIZE) {
          Block block = _store.allocateBlock();

          _blockList.add(block.getBlockId());
         
          block.free();
        }

        int blockOffset = (int) (_length % BlockStore.BLOCK_SIZE);
        long blockAddress = _blockList.get(_blockList.size() - 1);
View Full Code Here

        while (_blockList.size() <= _length / BlockStore.BLOCK_SIZE) {
          Block block = _store.allocateBlock();

          _blockList.add(block.getBlockId());
         
          block.free();
        }

        int blockOffset = (int) (_length % BlockStore.BLOCK_SIZE);
        long blockId = _blockList.get(_blockList.size() - 1);
View Full Code Here

    BlockStore store = new BlockStore(db, "test", null);
    store.create();

    Block block = store.allocateIndexBlock();
    long blockId = block.getBlockId();
    block.free();

    return new BTree(store, blockId, keySize, new KeyCompare());
  }

  public static BTree createStringTest(Path path, int keySize)
View Full Code Here

      long indAddr = readLong(inode, inodeOffset + (DIRECT_BLOCKS + 1) * 8);

      if (indAddr == 0) {
        Block block = store.allocateBlock();
        indAddr = block.getBlockId();
        block.free();

        writeLong(inode, inodeOffset + (DIRECT_BLOCKS + 1) * 8, indAddr);
      }

      int blockOffset = 8 * (blockCount - DIRECT_BLOCKS);
View Full Code Here

      if (dblIndAddr == 0) {
        Block block = store.allocateBlock();

        dblIndAddr = BlockStore.blockIdToAddress(block.getBlockId());

        block.free();

        Block writeBlock = store.writeBlockLong(indAddr, dblBlockIndex, dblIndAddr);
        xa.addUpdateBlock(writeBlock);
      }
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.