com.sleepycat.je.log
Class LatchedLogManager

java.lang.Object
  extended by com.sleepycat.je.log.LogManager
      extended by com.sleepycat.je.log.LatchedLogManager

public class LatchedLogManager
extends LogManager

The LatchedLogManager uses the latches to implement critical sections.


Field Summary
 
Fields inherited from class com.sleepycat.je.log.LogManager
envImpl, logBufferPool, logWriteLatch
 
Constructor Summary
LatchedLogManager(EnvironmentImpl envImpl, boolean readOnly)
          There is a single log manager per database environment.
 
Method Summary
 void countObsoleteDb(DatabaseImpl db)
           
 void countObsoleteNode(long lsn, LogEntryType type, int size, DatabaseImpl nodeDb, boolean countExact)
          Count node as obsolete under the log write latch.
 void countObsoleteNodeDupsAllowed(long lsn, LogEntryType type, int size, DatabaseImpl nodeDb)
          A flavor of countObsoleteNode which does not fire an assert if the offset has already been counted.
protected  void flushInternal()
           
 TrackedFileSummary getUnflushableTrackedSummary(long file)
          Returns a tracked summary for the given file which will not be flushed.
 void loadEndOfLogStat()
           
 boolean removeDbFileSummary(DatabaseImpl db, Long fileNum)
           
 void removeTrackedFile(TrackedFileSummary tfs)
          Removes the tracked summary for the given file.
(package private)  void serialLog(LogItem[] itemArray, LogContext context)
          Log one or more items while latched or synchronized in order to serialize log output.
 void transferToUtilizationTracker(LocalUtilizationTracker localTracker)
           
 
Methods inherited from class com.sleepycat.je.log.LogManager
countObsoleteDbInternal, countObsoleteNodeDupsAllowedInternal, countObsoleteNodeInternal, flush, flushNoSync, getByteBufferFromLog, getChecksumOnRead, getEntry, getEntryHandleFileNotFound, getLastLsnAtRecovery, getLogEntry, getLogEntryAllowChecksumException, getLogEntryAllowChecksumException, getLogEntryAllowInvisible, getLogEntryAllowInvisibleAtRecovery, getLogEntryHandleFileNotFound, getLogSource, getReadBufferByLsn, getUnflushableTrackedSummaryInternal, loadEndOfLogStatInternal, loadStats, log, log, log, log, logForceFlip, logForceFlush, logLazily, multiLog, putIntoBuffer, removeDbFileSummaryInternal, removeTrackedFileInternal, resetPool, serialLogInternal, setLastLsnAtRecovery, setReadHook, transferToUtilizationTrackerInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatchedLogManager

public LatchedLogManager(EnvironmentImpl envImpl,
                         boolean readOnly)
                  throws DatabaseException
There is a single log manager per database environment.

Throws:
DatabaseException
Method Detail

serialLog

void serialLog(LogItem[] itemArray,
               LogContext context)
         throws IOException,
                DatabaseException
Description copied from class: LogManager
Log one or more items while latched or synchronized in order to serialize log output. Implementations of this method call serialLogInternal.

Specified by:
serialLog in class LogManager
Throws:
IOException
DatabaseException

flushInternal

protected void flushInternal()
                      throws DatabaseException
Specified by:
flushInternal in class LogManager
Throws:
DatabaseException

getUnflushableTrackedSummary

public TrackedFileSummary getUnflushableTrackedSummary(long file)
                                                throws DatabaseException
Description copied from class: LogManager
Returns a tracked summary for the given file which will not be flushed. Used for watching changes that occur while a file is being cleaned.

Specified by:
getUnflushableTrackedSummary in class LogManager
Throws:
DatabaseException
See Also:
LogManager#getUnflusableTrackedSummary

removeTrackedFile

public void removeTrackedFile(TrackedFileSummary tfs)
                       throws DatabaseException
Description copied from class: LogManager
Removes the tracked summary for the given file.

Specified by:
removeTrackedFile in class LogManager
Throws:
DatabaseException
See Also:
LogManager.removeTrackedFile(com.sleepycat.je.cleaner.TrackedFileSummary)

countObsoleteNode

public void countObsoleteNode(long lsn,
                              LogEntryType type,
                              int size,
                              DatabaseImpl nodeDb,
                              boolean countExact)
                       throws DatabaseException
Description copied from class: LogManager
Count node as obsolete under the log write latch. This is done here because the log write latch is managed here, and all utilization counting must be performed under the log write latch.

Specified by:
countObsoleteNode in class LogManager
Throws:
DatabaseException
See Also:
LogManager.countObsoleteNode(long, com.sleepycat.je.log.LogEntryType, int, com.sleepycat.je.dbi.DatabaseImpl, boolean)

countObsoleteNodeDupsAllowed

public void countObsoleteNodeDupsAllowed(long lsn,
                                         LogEntryType type,
                                         int size,
                                         DatabaseImpl nodeDb)
                                  throws DatabaseException
Description copied from class: LogManager
A flavor of countObsoleteNode which does not fire an assert if the offset has already been counted. Called through the LogManager so that this incidence of all utilization counting can be performed under the log write latch.

Specified by:
countObsoleteNodeDupsAllowed in class LogManager
Throws:
DatabaseException
See Also:
LogManager.countObsoleteNodeDupsAllowed(long, com.sleepycat.je.log.LogEntryType, int, com.sleepycat.je.dbi.DatabaseImpl)

transferToUtilizationTracker

public void transferToUtilizationTracker(LocalUtilizationTracker localTracker)
                                  throws DatabaseException
Specified by:
transferToUtilizationTracker in class LogManager
Throws:
DatabaseException
See Also:
LogManager.transferToUtilizationTracker(com.sleepycat.je.cleaner.LocalUtilizationTracker)

countObsoleteDb

public void countObsoleteDb(DatabaseImpl db)
                     throws DatabaseException
Specified by:
countObsoleteDb in class LogManager
Throws:
DatabaseException
See Also:
LogManager.countObsoleteDb(com.sleepycat.je.dbi.DatabaseImpl)

removeDbFileSummary

public boolean removeDbFileSummary(DatabaseImpl db,
                                   Long fileNum)
                            throws DatabaseException
Specified by:
removeDbFileSummary in class LogManager
Throws:
DatabaseException
See Also:
LogManager.removeDbFileSummary(com.sleepycat.je.dbi.DatabaseImpl, java.lang.Long)

loadEndOfLogStat

public void loadEndOfLogStat()
                      throws DatabaseException
Specified by:
loadEndOfLogStat in class LogManager
Throws:
DatabaseException
See Also:
LogManager.loadEndOfLogStat()


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