com.sleepycat.je.log
Class CleanerFileReader

java.lang.Object
  extended by com.sleepycat.je.log.FileReader
      extended by com.sleepycat.je.log.CleanerFileReader

public class CleanerFileReader
extends FileReader

CleanerFileReader scans log files for INs and LNs.


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.log.FileReader
cksumValidator, currentEntryHeader, currentEntryOffset, currentEntryPrevOffset, envImpl, eof, fileManager, forward, logger, nextEntryOffset, startLsn, window
 
Constructor Summary
CleanerFileReader(EnvironmentImpl env, int readBufferSize, long startLsn, Long fileNum)
          Create this reader to start at a given LSN.
 
Method Summary
 DatabaseId getDatabaseId()
          Get the last databaseId seen by the reader.
 byte[] getDupTreeKey()
          Get the last key seen by the reader.
 FileHeader getFileHeader()
           
 IN getIN()
          Get the last entry seen by the reader as an IN.
 byte[] getKey()
          Get the last key seen by the reader.
 LN getLN()
          Get the last LN seen by the reader.
 VLSN getVLSN()
          Get the VLSN from the current entry header, or null if the entry is not replicated or has no VLSN.
 boolean isFileHeader()
           
 boolean isIN()
           
 boolean isLN()
           
 boolean isRoot()
           
protected  boolean isTargetEntry()
           
protected  boolean processEntry(ByteBuffer entryBuffer)
          This reader instantiates an LN and key for every LN entry.
 
Methods inherited from class com.sleepycat.je.log.FileReader
entryIsReplicated, getAndResetNReads, getLastEntrySize, getLastLsn, getNRepeatIteratorReads, getNumRead, initStartingPosition, makeWindow, readNextEntry, readNextEntryAllowExceptions, resyncReader, setAlwaysValidateChecksum, setBackwardPosition, setForwardPosition, threadSafeBufferFlip, threadSafeBufferPosition, threadSafeBufferPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanerFileReader

public CleanerFileReader(EnvironmentImpl env,
                         int readBufferSize,
                         long startLsn,
                         Long fileNum)
                  throws DatabaseException
Create this reader to start at a given LSN.

Parameters:
env - The relevant EnvironmentImpl.
readBufferSize - buffer size in bytes for reading in log.
startLsn - where to start in the log, or null for the beginning.
fileNum - single file number.
Throws:
DatabaseException
Method Detail

isTargetEntry

protected boolean isTargetEntry()
Overrides:
isTargetEntry in class FileReader
Returns:
true if this is a type we're interested in.

processEntry

protected boolean processEntry(ByteBuffer entryBuffer)
                        throws DatabaseException
This reader instantiates an LN and key for every LN entry.

Specified by:
processEntry in class FileReader
Parameters:
entryBuffer - contains the entry data and is positioned at the data
Returns:
true if this entry should be returned
Throws:
DatabaseException

isIN

public boolean isIN()
Returns:
true if the last entry was an IN.

isLN

public boolean isLN()
Returns:
true if the last entry was a LN.

isRoot

public boolean isRoot()
Returns:
true if the last entry was a root

isFileHeader

public boolean isFileHeader()

getLN

public LN getLN()
Get the last LN seen by the reader.


getIN

public IN getIN()
Get the last entry seen by the reader as an IN.


getFileHeader

public FileHeader getFileHeader()

getDatabaseId

public DatabaseId getDatabaseId()
Get the last databaseId seen by the reader.


getVLSN

public VLSN getVLSN()
Get the VLSN from the current entry header, or null if the entry is not replicated or has no VLSN.


getKey

public byte[] getKey()
Get the last key seen by the reader.


getDupTreeKey

public byte[] getDupTreeKey()
Get the last key seen by the reader.



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