com.sleepycat.je.log
Class FileSource

java.lang.Object
  extended by com.sleepycat.je.log.FileSource
All Implemented Interfaces:
LogSource
Direct Known Subclasses:
FileHandleSource

 class FileSource
extends Object
implements LogSource

FileSource is used as a channel to a log file when faulting in objects from the log.


Constructor Summary
FileSource(RandomAccessFile file, int readBufferSize, FileManager fileManager, long fileNum, int logVersion)
           
 
Method Summary
 ByteBuffer getBytes(long fileOffset)
          Fill the destination byte array with bytes.
 ByteBuffer getBytes(long fileOffset, int numBytes)
          Fill the destination byte array with the requested number of bytes.
 int getLogVersion()
          Returns the log version of the log entries from this source.
 void release()
          We're done with this log source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSource

FileSource(RandomAccessFile file,
           int readBufferSize,
           FileManager fileManager,
           long fileNum,
           int logVersion)
Method Detail

release

public void release()
             throws DatabaseException
Description copied from interface: LogSource
We're done with this log source.

Specified by:
release in interface LogSource
Throws:
DatabaseException - in subclasses.
See Also:
LogSource.release()

getBytes

public ByteBuffer getBytes(long fileOffset)
                    throws DatabaseException
Description copied from interface: LogSource
Fill the destination byte array with bytes. The offset indicates the absolute log file position.

Specified by:
getBytes in interface LogSource
Throws:
DatabaseException
See Also:
LogSource.getBytes(long)

getBytes

public ByteBuffer getBytes(long fileOffset,
                           int numBytes)
                    throws ChecksumException,
                           DatabaseException
Description copied from interface: LogSource
Fill the destination byte array with the requested number of bytes. The offset indicates the absolute position in the log file.

Specified by:
getBytes in interface LogSource
Throws:
ChecksumException
DatabaseException
See Also:
LogSource.getBytes(long)

getLogVersion

public int getLogVersion()
Description copied from interface: LogSource
Returns the log version of the log entries from this source.

Specified by:
getLogVersion in interface LogSource


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