public class LastFileReader extends FileReader
FileReader.EOFException, FileReader.ReadWindow
cksumValidator, currentEntryHeader, currentEntryOffset, currentEntryPrevOffset, envImpl, eof, fileManager, forward, logger, nextEntryOffset, startLsn, window
Constructor and Description |
---|
LastFileReader(EnvironmentImpl envImpl,
int readBufferSize)
This file reader is always positioned at the last file.
|
LastFileReader(EnvironmentImpl envImpl,
int readBufferSize,
java.lang.Long specificFileNumber)
Ctor which allows passing in the file number we want to read to the end
of.
|
Modifier and Type | Method and Description |
---|---|
long |
getEndOfLog() |
LogEntryType |
getEntryType() |
long |
getLastSeen(LogEntryType type) |
long |
getLastValidLsn() |
long |
getPrevOffset() |
protected boolean |
processEntry(java.nio.ByteBuffer entryBuffer)
Validate the checksum on each entry, see if we should remember the LSN
of this entry.
|
boolean |
readNextEntry()
readNextEntry will stop at a bad entry.
|
void |
setEndOfFile() |
void |
setTargetType(LogEntryType type)
Tell the reader that we are interested in these kind of entries.
|
entryIsReplicated, getAndResetNReads, getLastEntrySize, getLastLsn, getNRepeatIteratorReads, getNumRead, initStartingPosition, isTargetEntry, makeWindow, readNextEntryAllowExceptions, resyncReader, setAlwaysValidateChecksum, setBackwardPosition, setForwardPosition, skipData, skipEntry, threadSafeBufferFlip, threadSafeBufferPosition, threadSafeBufferPosition
public LastFileReader(EnvironmentImpl envImpl, int readBufferSize) throws DatabaseException
DatabaseException
- if the last file contains data and is invalid.LastFileReader(EnvironmentImpl envImpl, int readBufferSize, java.lang.Long specificFileNumber) throws ChecksumException, DatabaseException
ChecksumException
- rather than wrapping it, to allow
ScavengerFileReader to handle it specially -- we should not invalidate
the environment with EnvironmentFailureException.DatabaseException
public void setEndOfFile() throws java.io.IOException, DatabaseException
java.io.IOException
DatabaseException
public long getEndOfLog()
public long getLastValidLsn()
public long getPrevOffset()
public LogEntryType getEntryType()
public void setTargetType(LogEntryType type)
public long getLastSeen(LogEntryType type)
protected boolean processEntry(java.nio.ByteBuffer entryBuffer)
processEntry
in class FileReader
entryBuffer
- contains the entry data and is positioned at the
datapublic boolean readNextEntry()
readNextEntry
in class FileReader
Copyright (c) 2004-2012 Oracle. All rights reserved.