/** * Reinitializes the NodePool so that it is empty. This should be called after * constructing a NodePoolImpl when creating a new triple store. * * @param phaseNumber the initial phase number. * @throws IOException if an I/O error occurs. * @throws SimpleXAResourceException if it is inappropriate to call clear() at * this time. */ public synchronized void clear( int phaseNumber ) throws IOException, SimpleXAResourceException { if (currentPhase != null) { throw new IllegalStateException( "NodePool already has a current phase." ); } openMetarootFile(true); try { synchronized (committedPhaseLock) { committedPhaseToken = freeList.new Phase(MIN_NODE).use(); } this.phaseNumber = phaseNumber; phaseIndex = 1; freeList.clear(); } catch (IllegalStateException ex) { throw new SimpleXAResourceException("Cannot initialize free list.", ex); } currentPhase = freeList.new Phase(); }
currentPhase = freeList.new Phase();
freeList.new Phase(committedPhaseToken.getPhase()); } catch (Throwable t) { logger.warn("Exception while rolling back in unmap()", t);
} finally { try { currentPhase = freeList.new Phase(committedPhaseToken.getPhase()); } catch (IOException ex) { throw new SimpleXAResourceException(
/** * Creates a new phase, using a freelist block. * * @param b The block in the freelist to start the new phase in. * @param offset The offset in the block to find the start of the freelist block. * @throws IOException If an I/O error occurred on the free list. */ public Phase(Block b, int offset) throws IOException { freeListPhase = freeList.new Phase(b, offset); currentPhase = this; check(); }
/** * Creates a new phase, duplicating another existing phase. * * @throws IOException If an I/O error occurred on the free list. */ public Phase(Phase p) throws IOException { assert p != null; freeListPhase = freeList.new Phase(p.freeListPhase); currentPhase = this; }
/** * Creates a new writing phase for this ManagedBlockFile. * * @throws IOException If an I/O error occurred on the free list. */ public Phase() throws IOException { freeListPhase = freeList.new Phase(); currentPhase = this; }