com.sleepycat.je.utilint
Class FileMapper

java.lang.Object
  extended by com.sleepycat.je.utilint.FileMapper

public class FileMapper
extends java.lang.Object

A FileMapper instance represents the VLSN->LSN mappings for a single log file. There are persistent FileMappers that are stored in the log, and temporary instances that are used for collecting mappings found in the log during recovery. Note that we only need to store the file offset portion of the lsn persistently on disk, because the file number is self evident. We still need to use longs in memory to represent the offset, since the file offset is an unsigned int.


Constructor Summary
FileMapper(long fileNumber)
           
 
Method Summary
 long getFileNumber()
           
 VLSN getLastCommitVLSN()
           
 VLSN getLastSyncVLSN()
           
 long getLSN(long vlsn)
           
 java.util.Set<java.lang.Long> getVLSNs()
          Return the set of VLSNs in this mapper.
 void putAll(FileMapper other)
          Put all the VLSN->LSN mappings in the file mapper parameter into this one.
 void putLSN(long vlsn, long lsn, LogEntryType entryType)
          Record the LSN location for this VLSN.
static FileMapper readFromDatabase(DatabaseEntry data)
           
 void removeLSN(long vlsn)
          Individual mappings are removed if this VLSN is written more than once to the log, as might happen on some kind of replay.
 void setFileNumber(long fileNumber)
           
 java.lang.String toString()
           
 void writeToDatabase(Database fileMapperDb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileMapper

public FileMapper(long fileNumber)
Method Detail

setFileNumber

public void setFileNumber(long fileNumber)

getFileNumber

public long getFileNumber()

getLastSyncVLSN

public VLSN getLastSyncVLSN()

getLastCommitVLSN

public VLSN getLastCommitVLSN()

writeToDatabase

public void writeToDatabase(Database fileMapperDb)
                     throws DatabaseException
Throws:
DatabaseException

readFromDatabase

public static FileMapper readFromDatabase(DatabaseEntry data)

putLSN

public void putLSN(long vlsn,
                   long lsn,
                   LogEntryType entryType)
Record the LSN location for this VLSN.


putAll

public void putAll(FileMapper other)
Put all the VLSN->LSN mappings in the file mapper parameter into this one.


getLSN

public long getLSN(long vlsn)

removeLSN

public void removeLSN(long vlsn)
Individual mappings are removed if this VLSN is written more than once to the log, as might happen on some kind of replay.


getVLSNs

public java.util.Set<java.lang.Long> getVLSNs()
Return the set of VLSNs in this mapper.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object