com.sleepycat.je.rep.stream
Class FeederSyncupReader

java.lang.Object
  extended by com.sleepycat.je.log.FileReader
      extended by com.sleepycat.je.rep.stream.VLSNReader
          extended by com.sleepycat.je.rep.stream.FeederSyncupReader

public class FeederSyncupReader
extends VLSNReader

The FeederSyncupReader scans the log backwards for requested log entries. It uses the vlsnIndex to optimize its search, repositioning when a concrete vlsn->lsn mapping is available. The FeederSyncupReader is not thread safe, and can only be used serially. It will stop at the finishLsn, which should be set using the GlobalCBVLSN.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sleepycat.je.log.FileReader
FileReader.EOFException, FileReader.ReadWindow
 
Field Summary
 
Fields inherited from class com.sleepycat.je.rep.stream.VLSNReader
currentFeedRecord, currentVLSN, nReposition, nScanned, vlsnIndex
 
Fields inherited from class com.sleepycat.je.log.FileReader
cksumValidator, currentEntryHeader, currentEntryOffset, currentEntryPrevOffset, envImpl, eof, fileManager, forward, logger, nextEntryOffset, startLsn, window
 
Constructor Summary
FeederSyncupReader(EnvironmentImpl envImpl, VLSNIndex vlsnIndex, long endOfLogLsn, int readBufferSize, NameIdPair nameIdPair, VLSN startVLSN, long finishLsn)
           
 
Method Summary
protected  boolean isTargetEntry()
           
protected  boolean processEntry(ByteBuffer entryBuffer)
          Instantiate a WireRecord to house this log entry.
 OutputWireRecord scanBackwards(VLSN vlsn)
          Backward scanning for records for the feeder's part in syncup.
 
Methods inherited from class com.sleepycat.je.rep.stream.VLSNReader
getNReposition, getNScanned, resetStats, setPosition
 
Methods inherited from class com.sleepycat.je.log.FileReader
entryIsReplicated, getAndResetNReads, getLastEntrySize, getLastLsn, getNRepeatIteratorReads, getNumRead, initStartingPosition, makeWindow, readNextEntry, readNextEntryAllowExceptions, resyncReader, setAlwaysValidateChecksum, setBackwardPosition, setForwardPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeederSyncupReader

public FeederSyncupReader(EnvironmentImpl envImpl,
                          VLSNIndex vlsnIndex,
                          long endOfLogLsn,
                          int readBufferSize,
                          NameIdPair nameIdPair,
                          VLSN startVLSN,
                          long finishLsn)
                   throws IOException,
                          DatabaseException
Throws:
IOException
DatabaseException
Method Detail

scanBackwards

public OutputWireRecord scanBackwards(VLSN vlsn)
                               throws FileNotFoundException,
                                      ChecksumException
Backward scanning for records for the feeder's part in syncup.

Throws:
ChecksumException
FileNotFoundException

isTargetEntry

protected boolean isTargetEntry()
                         throws DatabaseException
Overrides:
isTargetEntry in class FileReader
Returns:
true if this reader should process this entry, or just skip over it.
Throws:
DatabaseException - from subclasses.

processEntry

protected boolean processEntry(ByteBuffer entryBuffer)
Instantiate a WireRecord to house this log entry.

Overrides:
processEntry in class VLSNReader
Parameters:
entryBuffer - contains the entry data and is positioned at the data
Returns:
true if this entry should be returned


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