| java.lang.Object com.sleepycat.je.log.FileReader
All known Subclasses: com.sleepycat.je.log.SearchFileReader, com.sleepycat.je.log.CheckpointFileReader, com.sleepycat.je.log.INFileReader, com.sleepycat.je.log.DumpFileReader, com.sleepycat.je.log.CleanerFileReader, com.sleepycat.je.log.LNFileReader, com.sleepycat.je.log.UtilizationFileReader, com.sleepycat.je.log.ScavengerFileReader, com.sleepycat.je.log.TestUtilLogReader, com.sleepycat.je.recovery.stepwise.EntryTrackerReader, com.sleepycat.je.log.LastFileReader,
FileReader | abstract public class FileReader (Code) | | A FileReader is an abstract class that traverses the log files, reading in
chunks of the file at a time. Concrete subclasses perform a particular
action to each entry.
|
Constructor Summary | |
public | FileReader(EnvironmentImpl envImpl, int readBufferSize, boolean forward, long startLsn, Long singleFileNumber, long endOfFileLsn, long finishLsn) A FileReader just needs to know what size chunks to read in. |
Method Summary | |
public int | getAndResetNReads() Returns the number of reads since the last time this method was called. | public int | getLastEntrySize() Returns the total size (including header) of the last entry read. | public long | getLastLsn() Get LSN of the last entry read. | public long | getNRepeatIteratorReads() | public int | getNumRead() | protected void | initStartingPosition(long endOfFileLsn, Long ignoreSingleFileNumber) Helper for determining the starting position and opening up a file at
the desired location. | protected boolean | isTargetEntry(byte logEntryTypeNumber, byte logEntryTypeVersion) | abstract protected boolean | processEntry(ByteBuffer entryBuffer) Each file reader implements this method to process the entry data. | void | readEntry(LogEntry entry, ByteBuffer buffer, boolean readFullItem) A bottleneck for all calls to LogEntry.readEntry. | public boolean | readNextEntry() readNextEntry scans the log files until either it's reached the end of
the log or has hit an invalid portion. | protected boolean | resyncReader(long nextGoodRecordPostCorruption, boolean dumpCorruptedBounds) | public void | setAlwaysValidateChecksum(boolean validate) Whether to always validate the checksum, even for non-target entries. | Buffer | threadSafeBufferPosition(ByteBuffer buffer, int newPosition) |
anticipateChecksumErrors | protected boolean anticipateChecksumErrors(Code) | | |
currentEntryOffset | protected long currentEntryOffset(Code) | | |
currentEntryPrevOffset | protected long currentEntryPrevOffset(Code) | | |
eof | protected boolean eof(Code) | | |
nextEntryOffset | protected long nextEntryOffset(Code) | | |
readBufferFileEnd | protected long readBufferFileEnd(Code) | | |
readBufferFileNum | protected long readBufferFileNum(Code) | | |
readBufferFileStart | protected long readBufferFileStart(Code) | | |
startLsn | protected long startLsn(Code) | | |
FileReader | public FileReader(EnvironmentImpl envImpl, int readBufferSize, boolean forward, long startLsn, Long singleFileNumber, long endOfFileLsn, long finishLsn) throws IOException, DatabaseException(Code) | | A FileReader just needs to know what size chunks to read in.
Parameters: endOfFileLsn - indicates the end of the log file |
getAndResetNReads | public int getAndResetNReads()(Code) | | Returns the number of reads since the last time this method was called.
|
getLastEntrySize | public int getLastEntrySize()(Code) | | Returns the total size (including header) of the last entry read.
|
getLastLsn | public long getLastLsn()(Code) | | Get LSN of the last entry read.
|
getNRepeatIteratorReads | public long getNRepeatIteratorReads()(Code) | | |
getNumRead | public int getNumRead()(Code) | | the number of entries processed by this reader. |
initStartingPosition | protected void initStartingPosition(long endOfFileLsn, Long ignoreSingleFileNumber) throws IOException, DatabaseException(Code) | | Helper for determining the starting position and opening up a file at
the desired location.
|
isTargetEntry | protected boolean isTargetEntry(byte logEntryTypeNumber, byte logEntryTypeVersion) throws DatabaseException(Code) | | true if this reader should process this entry, or justskip over it. |
processEntry | abstract protected boolean processEntry(ByteBuffer entryBuffer) throws DatabaseException(Code) | | Each file reader implements this method to process the entry data.
Parameters: enteryBuffer - contains the entry data and is positioned at thedata true if this entry should be returned |
readEntry | void readEntry(LogEntry entry, ByteBuffer buffer, boolean readFullItem) throws DatabaseException(Code) | | A bottleneck for all calls to LogEntry.readEntry. This method ensures
that setLastLogSize is called after LogEntry.readEntry, and should be
called by all FileReaders instead of calling LogEntry.readEntry
directly.
|
readNextEntry | public boolean readNextEntry() throws DatabaseException, IOException(Code) | | readNextEntry scans the log files until either it's reached the end of
the log or has hit an invalid portion. It then returns false.
true if an element has been read |
setAlwaysValidateChecksum | public void setAlwaysValidateChecksum(boolean validate)(Code) | | Whether to always validate the checksum, even for non-target entries.
|
threadSafeBufferPosition | Buffer threadSafeBufferPosition(ByteBuffer buffer, int newPosition)(Code) | | |
|
|