/** * Puts an integer into the payload of this node. * * @param offset The offset into the payload, in ints. * @param i The value to put into the payload. */ public void putPayloadInt(int offset, int i) { assert dirty; assert offset > 0; block.putInt(IDX_PAYLOAD_I + offset, i); }
/** * Initializes a FreeList block file or repairs the back-pointers in * an existing file. This is called from Phase.init(llll). */ private void initFreeListFile(boolean clear) throws IOException { if (clear || blockFile.getNrBlocks() < 2) { // File is too small to be valid. Reset to two blocks. nextBlockId = 2; blockFile.setNrBlocks(nextBlockId); allocateHeadBlock(0); headBlock.putInt(IDX_NEXT, 1); headBlock.putInt(IDX_PREV, 1); headBlockDirty = true; allocateHeadBlock(1); headBlock.putInt(IDX_NEXT, 0); headBlock.putInt(IDX_PREV, 0); headBlockDirty = true; force(); } else { nextBlockId = findMaxBlockId() + 1; blockFile.setNrBlocks(nextBlockId); } }
metarootBlocks[0].putInt(IDX_MAGIC, FILE_MAGIC); metarootBlocks[0].putInt(IDX_VERSION, FILE_VERSION); metarootBlocks[0].putInt(IDX_VALID, 0); metarootBlocks[0].write(); metarootBlocks[1].putInt(IDX_MAGIC, 0); metarootBlocks[1].putInt(IDX_VERSION, 0); metarootBlocks[1].putInt(IDX_VALID, 0); metarootBlocks[1].write(); metarootFile.force();
metarootBlocks[0].putInt(IDX_MAGIC, FILE_MAGIC); metarootBlocks[0].putInt(IDX_VERSION, FILE_VERSION); metarootBlocks[0].putInt(IDX_VALID, 0); metarootBlocks[0].write(); metarootBlocks[1].putInt(IDX_MAGIC, 0); metarootBlocks[1].putInt(IDX_VERSION, 0); metarootBlocks[1].putInt(IDX_VALID, 0); metarootBlocks[1].write(); metarootFile.force();
block.putInt(IDX_VALID, 0); // should already be invalid. block.putInt(IDX_PHASE_NUMBER, newPhaseNumber); logger.debug("Writing node pool metaroot for phase: " + newPhaseNumber); recordingPhase.writeToBlock(block, HEADER_SIZE); block.write(); metarootFile.force(); block.putInt(IDX_VALID, 1); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); // should already be invalid. block.putInt(IDX_PHASE_NUMBER, newPhaseNumber); logger.debug("Writing string pool metaroot for phase: " + newPhaseNumber); recordingPhase.writeToBlock(block, HEADER_SIZE_LONGS); block.write(); metarootFile.force(); block.putInt(IDX_VALID, 1); block.write(); metarootFile.force();
blockFile.setNrBlocks(nextBlockId); allocateHeadBlock(newHeadBlockId); headBlock.putInt(IDX_NEXT, nextHeadBlockId); headBlock.putInt(IDX_PREV, (int) prevHeadBlock.getBlockId()); headBlockDirty = true; force(); prevHeadBlock.putInt(IDX_NEXT, newHeadBlockId); prevHeadBlock.write(); prevHeadBlock.release(); nextHeadBlock.putInt(IDX_PREV, newHeadBlockId); nextHeadBlock.write(); nextHeadBlock.release();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();
block.putInt(IDX_VALID, 0); block.write(); metarootFile.force();