Class JournalReader
- java.lang.Object
-
- org.apache.jackrabbit.oak.commons.collections.AbstractIterator<JournalEntry>
-
- org.apache.jackrabbit.oak.segment.file.JournalReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<JournalEntry>
public final class JournalReader extends AbstractIterator<JournalEntry> implements Closeable
Iterator over the revisions in the journal in reverse order (end of the file to beginning).
-
-
Constructor Summary
Constructors Constructor Description JournalReader(JournalFile journal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected JournalEntrycomputeNext()Computes the next element in the iteration.-
Methods inherited from class org.apache.jackrabbit.oak.commons.collections.AbstractIterator
endOfData, hasNext, next
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
JournalReader
public JournalReader(JournalFile journal) throws IOException
- Throws:
IOException
-
-
Method Detail
-
computeNext
protected JournalEntry computeNext()
Description copied from class:AbstractIteratorComputes the next element in the iteration. Subclasses must implement this method and callAbstractIterator.endOfData()when no more elements are available.- Specified by:
computeNextin classAbstractIterator<JournalEntry>- Returns:
- the next element, or
AbstractIterator.endOfData()if iteration is over - Throws:
IllegalStateException- if anIOExceptionoccurs while reading from the journal file.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-