|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.FileReader
com.sleepycat.je.log.ScavengerFileReader
public abstract class ScavengerFileReader
A ScavengerFileReader reads the log backwards. If it encounters a checksum error, it goes to the start of that log file and reads forward until it encounters a checksum error. It then continues the reading backwards in the log. The caller may set "dumpCorruptedBounds" to true if information about the start and finish of the corrupted portion should be displayed on stderr. The caller is expected to implement processEntryCallback. This method is called once for each entry that the ScavengerFileReader finds in the log.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.log.FileReader |
---|
anticipateChecksumErrors, cksumValidator, currentEntryChecksum, currentEntryOffset, currentEntryPrevOffset, currentEntrySize, currentEntryTypeNum, currentEntryTypeVersion, env, eof, fileManager, nextEntryOffset, readBufferFileEnd, readBufferFileNum, readBufferFileStart, startLsn |
Constructor Summary | |
---|---|
ScavengerFileReader(EnvironmentImpl env,
int readBufferSize,
long startLsn,
long finishLsn,
long endOfFileLsn)
Create this reader to start at a given LSN. |
Method Summary | |
---|---|
protected boolean |
isTargetEntry(byte logEntryTypeNumber,
byte logEntryTypeVersion)
|
protected boolean |
processEntry(ByteBuffer entryBuffer)
Each file reader implements this method to process the entry data. |
protected abstract void |
processEntryCallback(LogEntry entry,
LogEntryType entryType)
|
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 showCorruptedBounds)
|
void |
setDumpCorruptedBounds(boolean dumpCorruptedBounds)
Set to true if corrupted boundaries should be dumped to stderr. |
void |
setTargetType(LogEntryType type)
Tell the reader that we are interested in these kind of entries. |
Methods inherited from class com.sleepycat.je.log.FileReader |
---|
getLastLsn, getNRepeatIteratorReads, getNumRead, initStartingPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScavengerFileReader(EnvironmentImpl env, int readBufferSize, long startLsn, long finishLsn, long endOfFileLsn) throws IOException, DatabaseException
IOException
DatabaseException
Method Detail |
---|
public void setDumpCorruptedBounds(boolean dumpCorruptedBounds)
public void setTargetType(LogEntryType type)
protected boolean processEntry(ByteBuffer entryBuffer) throws DatabaseException
FileReader
processEntry
in class FileReader
DatabaseException
protected abstract void processEntryCallback(LogEntry entry, LogEntryType entryType) throws DatabaseException
DatabaseException
public boolean readNextEntry() throws DatabaseException, IOException
FileReader
readNextEntry
in class FileReader
DatabaseException
IOException
protected boolean resyncReader(long nextGoodRecordPostCorruption, boolean showCorruptedBounds) throws DatabaseException, IOException
resyncReader
in class FileReader
DatabaseException
IOException
protected boolean isTargetEntry(byte logEntryTypeNumber, byte logEntryTypeVersion)
isTargetEntry
in class FileReader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |