protected static class FileReader.ReadWindow
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
endOffset |
protected EnvironmentImpl |
envImpl |
protected FileManager |
fileManager |
protected java.nio.ByteBuffer |
readBuffer |
protected long |
startOffset |
Modifier | Constructor and Description |
---|---|
protected |
FileReader.ReadWindow(int readBufferSize,
EnvironmentImpl envImpl) |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustReadBufferSize(int amountToRead)
Change the read buffer size if we start hitting large log entries so
we don't get into an expensive cycle of multiple reads and piecing
together of log entries.
|
(package private) int |
capacity() |
boolean |
containsLsn(long targetFileNumber,
long targetOffset) |
(package private) boolean |
containsOffset(long targetOffset) |
long |
currentFileNum() |
protected boolean |
fillFromFile(FileHandle fileHandle,
long targetOffset) |
protected boolean |
fillNext(boolean singleFile,
int bytesNeeded)
Fill up the read buffer with more data, moving along to the
following file (next largest number) if needed.
|
(package private) int |
getAndResetNReads()
Returns the number of reads since the last time this method was
called.
|
(package private) java.nio.ByteBuffer |
getBuffer() |
long |
getEndOffset() |
(package private) long |
getNRepeatIteratorReads() |
(package private) boolean |
hasRemaining() |
(package private) void |
incrementBufferPosition(int increment) |
void |
initAtFileStart(long startLsn) |
void |
positionBuffer(long targetOffset) |
(package private) int |
remaining() |
protected void |
setFileNum(long fileNum,
int logVersion)
Ensure that whenever we change the fileNum, the logVersion is also
updated.
|
void |
slideAndFill(long windowfileNum,
long windowStartOffset,
long targetOffset,
boolean forward) |
java.lang.String |
toString() |
protected long startOffset
protected long endOffset
protected java.nio.ByteBuffer readBuffer
protected final EnvironmentImpl envImpl
protected final FileManager fileManager
protected FileReader.ReadWindow(int readBufferSize, EnvironmentImpl envImpl)
public void initAtFileStart(long startLsn)
public long getEndOffset()
protected void setFileNum(long fileNum, int logVersion)
public long currentFileNum()
boolean containsOffset(long targetOffset)
public boolean containsLsn(long targetFileNumber, long targetOffset)
public void positionBuffer(long targetOffset)
void incrementBufferPosition(int increment)
public void slideAndFill(long windowfileNum, long windowStartOffset, long targetOffset, boolean forward) throws ChecksumException, java.io.FileNotFoundException, DatabaseException
ChecksumException
java.io.FileNotFoundException
DatabaseException
protected boolean fillNext(boolean singleFile, int bytesNeeded) throws ChecksumException, java.io.FileNotFoundException, FileReader.EOFException, DatabaseException
ChecksumException
java.io.FileNotFoundException
FileReader.EOFException
DatabaseException
protected boolean fillFromFile(FileHandle fileHandle, long targetOffset) throws DatabaseException
DatabaseException
protected void adjustReadBufferSize(int amountToRead)
int capacity()
int remaining()
boolean hasRemaining()
java.nio.ByteBuffer getBuffer()
int getAndResetNReads()
long getNRepeatIteratorReads()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2004-2012 Oracle. All rights reserved.