|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.FileReader
public abstract class FileReader
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.
Field Summary | |
---|---|
protected boolean |
anticipateChecksumErrors
|
protected ChecksumValidator |
cksumValidator
|
protected long |
currentEntryChecksum
|
protected long |
currentEntryOffset
|
protected long |
currentEntryPrevOffset
|
protected int |
currentEntrySize
|
protected byte |
currentEntryTypeNum
|
protected byte |
currentEntryTypeVersion
|
protected EnvironmentImpl |
env
|
protected boolean |
eof
|
protected FileManager |
fileManager
|
protected long |
nextEntryOffset
|
protected long |
readBufferFileEnd
|
protected long |
readBufferFileNum
|
protected long |
readBufferFileStart
|
protected long |
startLsn
|
Constructor Summary | |
---|---|
FileReader(EnvironmentImpl env,
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 | |
---|---|
long |
getLastLsn()
Get LSN of the last entry read. |
long |
getNRepeatIteratorReads()
|
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)
|
protected abstract boolean |
processEntry(ByteBuffer entryBuffer)
Each file reader implements this method to process the entry data. |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected EnvironmentImpl env
protected FileManager fileManager
protected boolean eof
protected long readBufferFileNum
protected long readBufferFileStart
protected long readBufferFileEnd
protected byte currentEntryTypeNum
protected byte currentEntryTypeVersion
protected long currentEntryPrevOffset
protected int currentEntrySize
protected long currentEntryChecksum
protected long currentEntryOffset
protected long nextEntryOffset
protected long startLsn
protected ChecksumValidator cksumValidator
protected boolean anticipateChecksumErrors
Constructor Detail |
---|
public FileReader(EnvironmentImpl env, int readBufferSize, boolean forward, long startLsn, Long singleFileNumber, long endOfFileLsn, long finishLsn) throws IOException, DatabaseException
endOfFileLsn
- indicates the end of the log file
IOException
DatabaseException
Method Detail |
---|
protected void initStartingPosition(long endOfFileLsn, Long ignoreSingleFileNumber) throws IOException, DatabaseException
IOException
DatabaseException
public int getNumRead()
public long getNRepeatIteratorReads()
public long getLastLsn()
public boolean readNextEntry() throws DatabaseException, IOException
DatabaseException
IOException
protected boolean resyncReader(long nextGoodRecordPostCorruption, boolean dumpCorruptedBounds) throws DatabaseException, IOException
DatabaseException
IOException
protected boolean isTargetEntry(byte logEntryTypeNumber, byte logEntryTypeVersion) throws DatabaseException
DatabaseException
protected abstract boolean processEntry(ByteBuffer entryBuffer) throws DatabaseException
enteryBuffer
- contains the entry data and is positioned at the
data
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |