com.sleepycat.je.rep.stream
Class FeederReader.SwitchWindow

java.lang.Object
  extended by com.sleepycat.je.log.FileReader.ReadWindow
      extended by com.sleepycat.je.rep.stream.FeederReader.SwitchWindow
Enclosing class:
FeederReader

static class FeederReader.SwitchWindow
extends FileReader.ReadWindow

The SwitchWindow can fill itself from either the log file or the log buffers.


Field Summary
 
Fields inherited from class com.sleepycat.je.log.FileReader.ReadWindow
endOffset, envImpl, fileManager, readBuffer, startOffset
 
Constructor Summary
FeederReader.SwitchWindow(int readBufferSize, EnvironmentImpl envImpl)
           
 
Method Summary
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.
 void slideAndFill(long windowFileNum, long windowStartOffset, long targetOffset, boolean forward)
           
 
Methods inherited from class com.sleepycat.je.log.FileReader.ReadWindow
adjustReadBufferSize, containsLsn, currentFileNum, fillFromFile, getEndOffset, initAtFileStart, positionBuffer, setFileNum, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeederReader.SwitchWindow

FeederReader.SwitchWindow(int readBufferSize,
                          EnvironmentImpl envImpl)
Method Detail

slideAndFill

public void slideAndFill(long windowFileNum,
                         long windowStartOffset,
                         long targetOffset,
                         boolean forward)
                  throws ChecksumException,
                         FileNotFoundException,
                         DatabaseException
Overrides:
slideAndFill in class FileReader.ReadWindow
Throws:
ChecksumException
FileNotFoundException
DatabaseException

fillNext

protected boolean fillNext(boolean singleFile,
                           int bytesNeeded)
                    throws ChecksumException,
                           DatabaseException,
                           FileReader.EOFException
Fill up the read buffer with more data, moving along to the following file (next largest number) if needed. Unlike other file readers, we are reading log files that are concurrently growing, so this read window must also know to look in the log buffers. The contract between the feeder reader and the VLSNIndex lets us assume that the feeder reader is only active when it is sure that there is more data available somewhere -- whether it's in the log buffers, write queue, or on disk.

Overrides:
fillNext in class FileReader.ReadWindow
Returns:
true if the fill moved us to a new file.
Throws:
ChecksumException
DatabaseException
FileReader.EOFException
See Also:
ReadWindow#fillNext


Copyright (c) 2004-2010 Oracle. All rights reserved.