/** * Sets the block number. Should only be called by RecordFile. */ void setBlockId(long id) { if (isInTransaction()) throw new Error("BlockId assigned for transaction block"); blockId = id; }
/** Discards the indicated blocks and notify the owner. */ private void discardBlocks(ArrayList blocks) throws IOException { for (Iterator k = blocks.iterator(); k.hasNext(); ) { BlockIo cur = (BlockIo) k.next(); cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, false); } } }
/** Discards the indicated blocks and notify the owner. */ private void discardBlocks(List<BlockIo> blocks) throws IOException { for (Iterator<BlockIo> k = blocks.iterator(); k.hasNext(); ) { BlockIo cur = k.next(); cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, false); } } }
/** Discards the indicated blocks and notify the owner. */ private void discardBlocks( ArrayList blocks ) throws IOException { for ( Iterator k = blocks.iterator(); k.hasNext(); ) { BlockIo cur = ( BlockIo ) k.next(); cur.decrementTransactionCount(); if ( !cur.isInTransaction() ) { owner.releaseFromTransaction( cur, false ); } } }
/** * Sets the block number. Should only be called by RecordFile. * * @param The block identifier */ void setBlockId( long blockId ) { if ( isInTransaction() ) { throw new Error( I18n.err( I18n.ERR_540 ) ); } if ( blockId < 0 ) { throw new Error( I18n.err( I18n.ERR_539_BAD_BLOCK_ID, blockId ) ); } this.blockId = blockId; }
/** * Sets the block number. Should only be called by RecordFile. */ void setBlockId( long id ) { if ( isInTransaction() ) { throw new Error( I18n.err( I18n.ERR_540 ) ); } // remove me for production version if (id > 10000000000L) { throw new Error( I18n.err( I18n.ERR_539, id ) ); } blockId = id; }
/** * Sets the block number. Should only be called by RecordFile. * * @param The block identifier */ /*No qualifier*/ void setBlockId( long blockId ) { if ( isInTransaction() ) { throw new Error( I18n.err( I18n.ERR_540 ) ); } if ( blockId < 0 ) { throw new Error( I18n.err( I18n.ERR_539_BAD_BLOCK_ID, blockId ) ); } this.blockId = blockId; }
/** Discards the indicated blocks and notify the owner. */ private void discardBlocks(ArrayList<BlockIo> blocks) throws IOException { for (BlockIo cur:blocks) { cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, false); } } }
/** Synchronizes the indicated blocks with the owner. */ private void synchronizeBlocks(Iterator blockIterator, boolean fromCore) throws IOException { // write block vector elements to the data file. while ( blockIterator.hasNext() ) { BlockIo cur = (BlockIo)blockIterator.next(); owner.synch(cur); if (fromCore) { cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, true); } } } }
/** Synchronizes the indicated blocks with the owner. */ private void synchronizeBlocks(Iterator<BlockIo> blockIterator, boolean fromCore) throws IOException { // write block vector elements to the data file. while ( blockIterator.hasNext() ) { BlockIo cur = blockIterator.next(); owner.sync(cur); if (fromCore) { cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, true); } } } }
/** Synchronizes the indicated blocks with the owner. */ private void synchronizeBlocks( Iterator blockIterator, boolean fromCore ) throws IOException { // write block vector elements to the data file. while ( blockIterator.hasNext() ) { BlockIo cur = ( BlockIo ) blockIterator.next(); owner.synch( cur ); if ( fromCore ) { cur.decrementTransactionCount(); if ( !cur.isInTransaction() ) { owner.releaseFromTransaction( cur, true ); } } } }
/** * Releases a block. * * @param block The block to release. */ void release( BlockIo block ) { inUse.remove( block.getBlockId() ); if ( block.isDirty() ) { // System.out.println( "Dirty: " + key + block ); dirty.put( block.getBlockId(), block ); } else { if ( !transactionsDisabled && block.isInTransaction() ) { inTxn.put( block.getBlockId(), block ); } else { free.add( block ); } } }
if ( blockIo.isInTransaction() )
/** * Releases a block. * * @param block The block to release. */ void release( BlockIo block ) { inUse.remove( block.getBlockId() ); if ( block.isDirty() ) { // System.out.println( "Dirty: " + key + block ); dirty.put( block.getBlockId(), block ); } else { if ( ! transactionsDisabled && block.isInTransaction() ) { inTxn.put( block.getBlockId(), block ); } else { free.add( block ); } } }
/** * Releases a block. * * @param block The block to release. */ void release( BlockIo block ) { inUse.remove( block.getBlockId() ); if ( block.isDirty() ) { // System.out.println( "Dirty: " + key + block ); dirty.put( block.getBlockId(), block ); } else { if ( ! transactionsDisabled && block.isInTransaction() ) { inTxn.put( block.getBlockId(), block ); } else { free.add( block ); } } }
/** Synchronizes the indicated blocks with the owner. */ private void synchronizeBlocks(Iterable<BlockIo> blocks, boolean fromCore) throws IOException { // write block vector elements to the data file. for(BlockIo cur:blocks){ owner.synch(cur); if (fromCore) { cur.decrementTransactionCount(); if (!cur.isInTransaction()) { owner.releaseFromTransaction(cur, true); } } } }
/** * Releases a block. * * @param block The block to release. */ void release(BlockIo block) { long key =block.getBlockId(); inUse.remove(key); if (block.isDirty()) { // System.out.println( "Dirty: " + key + block ); dirty.put(key, block); } else { if (!transactionsDisabled && block.isInTransaction()) { inTxn.put(key, block); } else { free.put(block.getBlockId(),block); } } }