/** 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 ); } } }
/** 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 ); } } } }
/** 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); } } } }
/** Synchs in-core transactions to data file and opens a fresh log */ private void synchronizeLogFromMemory() throws IOException { close(); TreeSet blockList = new TreeSet( new BlockIoComparator() ); int numBlocks = 0; int writtenBlocks = 0; for (int i = 0; i < _maxTxns; i++) { if (txns[i] == null) continue; // Add each block to the blockList, replacing the old copy of this // block if necessary, thus avoiding writing the same block twice for (Iterator k = txns[i].iterator(); k.hasNext(); ) { BlockIo block = (BlockIo)k.next(); if ( blockList.contains( block ) ) { block.decrementTransactionCount(); } else { writtenBlocks++; boolean result = blockList.add( block ); } numBlocks++; } txns[i] = null; } // Write the blocks from the blockList to disk synchronizeBlocks(blockList.iterator(), true); owner.sync(); open(); }
/** Synchs in-core transactions to data file and opens a fresh log */ private void synchronizeLogFromMemory() throws IOException { close(); TreeSet blockList = new TreeSet( new BlockIoComparator() ); for ( int i = 0; i < _maxTxns; i++ ) { if ( txns[i] == null ) continue; // Add each block to the blockList, replacing the old copy of this // block if necessary, thus avoiding writing the same block twice for ( Iterator k = txns[i].iterator(); k.hasNext(); ) { BlockIo block = ( BlockIo ) k.next(); if ( blockList.contains( block ) ) { block.decrementTransactionCount(); } else { blockList.add( block ); } } txns[i] = null; } // Write the blocks from the blockList to disk synchronizeBlocks( blockList.iterator(), true ); owner.sync(); open(); }
/** Synchs in-core transactions to data file and opens a fresh log */ private void synchronizeLogFromMemory() throws IOException { close(); TreeSet<BlockIo> blockList = new TreeSet<BlockIo>( new BlockIoComparator() ); int numBlocks = 0; int writtenBlocks = 0; for (int i = 0; i < _maxTxns; i++) { if (txns[i] == null) continue; // Add each block to the blockList, replacing the old copy of this // block if necessary, thus avoiding writing the same block twice for (Iterator<BlockIo> k = txns[i].iterator(); k.hasNext(); ) { BlockIo block = k.next(); if ( blockList.contains( block ) ) { block.decrementTransactionCount(); } else { writtenBlocks++; boolean result = blockList.add( block ); } numBlocks++; } txns[i] = null; } // Write the blocks from the blockList to disk synchronizeBlocks(blockList, true); owner.sync(); open(); }