634635636637638639640641642643644
int charSublen = sublen / 2; Block block = store.allocateBlock(); long blockAddr = block.getBlockId(); block.free(); Block writeBlock = store.writeBlock(blockAddr, 0, buffer, offset, charSublen); xa.addUpdateBlock(writeBlock);
18781879188018811882188318841885188618871888
block.read(); byte []buffer = block.getBuffer(); long next = getPointer(buffer, NEXT_OFFSET); block.free(); return next / BlockStore.BLOCK_SIZE; } public static BTree createTest(Path path, int keySize)
293294295296297298299300301302303
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);
417418419420421422423424425426427
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);