/** * Starts a new sequence of spilled buffers and event and returns the current sequence of spilled buffers * for reading. This method returns {@code null}, if nothing was added since the creation of the spiller, or the * last call to this method. * * <p>The SpilledBufferOrEventSequence returned by this method is safe for concurrent consumption with * any previously returned sequence.</p> * * @return The readable sequence of spilled buffers and events, or 'null', if nothing was added. * @throws IOException Thrown, if the readable sequence could not be created, or no new spill * file could be created. */ public SpilledBufferOrEventSequence rollOverWithNewBuffer() throws IOException { return rollOverInternal(true); }
/** * Starts a new sequence of spilled buffers and event and returns the current sequence of spilled buffers * for reading. This method returns {@code null}, if nothing was added since the creation of the spiller, or the * last call to this method. * * <p>NOTE: The SpilledBufferOrEventSequences created by this method all reuse the same * reading memory (to reduce overhead) and can consequently not be read concurrently with each other. * To create a sequence that can be read concurrently with the previous SpilledBufferOrEventSequence, use the * {@link #rollOverWithNewBuffer()} method.</p> * * @return The readable sequence of spilled buffers and events, or 'null', if nothing was added. * @throws IOException Thrown, if the readable sequence could not be created, or no new spill * file could be created. */ public SpilledBufferOrEventSequence rollOver() throws IOException { return rollOverInternal(false); }