public abstract class LogManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected EnvironmentImpl |
envImpl |
protected com.sleepycat.je.log.LogBufferPool |
logBufferPool |
protected Latch |
logWriteLatch |
| Constructor and Description |
|---|
LogManager(EnvironmentImpl envImpl,
boolean readOnly)
There is a single log manager per database environment.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
countObsoleteINs(java.util.List lsnList)
Counts the given obsolete IN LSNs under the log write latch.
|
protected void |
countObsoleteINsInternal(java.util.List lsnList) |
abstract void |
countObsoleteNode(long lsn,
LogEntryType type,
int size)
Count node as obsolete under the log write latch.
|
protected void |
countObsoleteNodeInternal(UtilizationTracker tracker,
long lsn,
LogEntryType type,
int size) |
abstract void |
countObsoleteNodes(java.util.Collection summaries)
Counts file summary info under the log write latch.
|
protected void |
countObsoleteNodesInternal(UtilizationTracker tracker,
java.util.Collection summaries) |
void |
flush()
Flush all log entries, fsync the log file.
|
protected abstract void |
flushInternal() |
void |
flushNoSync()
May be used to avoid sync to speed unit tests.
|
java.lang.Object |
get(long lsn)
Fault in the first object in the log entry log entry at this LSN.
|
boolean |
getChecksumOnRead() |
long |
getLastLsnAtRecovery() |
LogEntry |
getLogEntry(long lsn)
Instantiate all the objects in the log entry at this LSN.
|
LogSource |
getLogSource(long lsn)
Find the LSN, whether in a file or still in the log buffers.
|
abstract TrackedFileSummary |
getUnflushableTrackedSummary(long file)
Returns a tracked summary for the given file which will not be flushed.
|
protected TrackedFileSummary |
getUnflushableTrackedSummaryInternal(long file) |
abstract void |
loadEndOfLogStat(EnvironmentStats stats) |
void |
loadStats(StatsConfig config,
EnvironmentStats stats) |
long |
log(LogEntry item)
Write a log entry.
|
long |
log(LogEntry item,
boolean isProvisional,
boolean backgroundIO,
long oldNodeLsn,
int oldNodeSize)
Write a log entry.
|
long |
logForceFlip(LogEntry item)
Log this single object and force a flip of the log files.
|
long |
logForceFlush(LogEntry item,
boolean fsyncRequired)
Log this single object and force a write of the log files.
|
protected com.sleepycat.je.log.LogManager.LogResult |
logInternal(LogEntryHeader header,
LogEntry item,
boolean isProvisional,
boolean flushRequired,
boolean forceNewLogFile,
long oldNodeLsn,
int oldNodeSize,
boolean marshallOutsideLatch,
java.nio.ByteBuffer marshalledBuffer,
UtilizationTracker tracker,
boolean shouldReplicate)
Called within the log write critical section.
|
protected abstract com.sleepycat.je.log.LogManager.LogResult |
logItem(LogEntryHeader header,
LogEntry item,
boolean isProvisional,
boolean flushRequired,
boolean forceNewLogFile,
long oldNodeLsn,
int oldNodeSize,
boolean marshallOutsideLatch,
java.nio.ByteBuffer marshalledBuffer,
UtilizationTracker tracker,
boolean shouldReplicate) |
abstract void |
removeTrackedFile(TrackedFileSummary tfs)
Removes the tracked summary for the given file.
|
protected void |
removeTrackedFileInternal(TrackedFileSummary tfs) |
void |
resetPool(DbConfigManager configManager)
Reset the pool when the cache is resized.
|
void |
setLastLsnAtRecovery(long lastLsnAtRecovery) |
void |
setReadHook(TestHook hook) |
protected com.sleepycat.je.log.LogBufferPool logBufferPool
protected Latch logWriteLatch
protected EnvironmentImpl envImpl
public LogManager(EnvironmentImpl envImpl, boolean readOnly) throws DatabaseException
DatabaseExceptionpublic boolean getChecksumOnRead()
public long getLastLsnAtRecovery()
public void setLastLsnAtRecovery(long lastLsnAtRecovery)
public void resetPool(DbConfigManager configManager) throws DatabaseException
DatabaseExceptionpublic long logForceFlush(LogEntry item, boolean fsyncRequired) throws DatabaseException
item - object to be loggedfsyncRequired - if true, log files should also be fsynced.DatabaseExceptionpublic long logForceFlip(LogEntry item) throws DatabaseException
item - object to be loggedfsyncRequired - if true, log files should also be fsynced.DatabaseExceptionpublic long log(LogEntry item) throws DatabaseException
DatabaseExceptionpublic long log(LogEntry item, boolean isProvisional, boolean backgroundIO, long oldNodeLsn, int oldNodeSize) throws DatabaseException
DatabaseExceptionprotected abstract com.sleepycat.je.log.LogManager.LogResult logItem(LogEntryHeader header, LogEntry item, boolean isProvisional, boolean flushRequired, boolean forceNewLogFile, long oldNodeLsn, int oldNodeSize, boolean marshallOutsideLatch, java.nio.ByteBuffer marshalledBuffer, UtilizationTracker tracker, boolean shouldReplicate) throws java.io.IOException, DatabaseException
java.io.IOExceptionDatabaseExceptionprotected com.sleepycat.je.log.LogManager.LogResult logInternal(LogEntryHeader header, LogEntry item, boolean isProvisional, boolean flushRequired, boolean forceNewLogFile, long oldNodeLsn, int oldNodeSize, boolean marshallOutsideLatch, java.nio.ByteBuffer marshalledBuffer, UtilizationTracker tracker, boolean shouldReplicate) throws java.io.IOException, DatabaseException
java.io.IOExceptionDatabaseExceptionpublic LogEntry getLogEntry(long lsn) throws DatabaseException
lsn - location of entry in log.DatabaseExceptionpublic java.lang.Object get(long lsn)
throws DatabaseException
lsn - location of object in logDatabaseExceptionpublic LogSource getLogSource(long lsn) throws DatabaseException
DatabaseExceptionpublic void flush()
throws DatabaseException
DatabaseExceptionpublic void flushNoSync()
throws DatabaseException
DatabaseExceptionprotected abstract void flushInternal()
throws LogException,
DatabaseException
LogExceptionDatabaseExceptionpublic void loadStats(StatsConfig config, EnvironmentStats stats) throws DatabaseException
DatabaseExceptionpublic abstract TrackedFileSummary getUnflushableTrackedSummary(long file) throws DatabaseException
DatabaseExceptionprotected TrackedFileSummary getUnflushableTrackedSummaryInternal(long file) throws DatabaseException
DatabaseExceptionpublic abstract void removeTrackedFile(TrackedFileSummary tfs) throws DatabaseException
DatabaseExceptionprotected void removeTrackedFileInternal(TrackedFileSummary tfs)
public abstract void countObsoleteNode(long lsn,
LogEntryType type,
int size)
throws DatabaseException
DatabaseExceptionprotected void countObsoleteNodeInternal(UtilizationTracker tracker, long lsn, LogEntryType type, int size) throws DatabaseException
DatabaseExceptionpublic abstract void countObsoleteNodes(java.util.Collection summaries)
throws DatabaseException
DatabaseExceptionprotected void countObsoleteNodesInternal(UtilizationTracker tracker, java.util.Collection summaries) throws DatabaseException
DatabaseExceptionpublic abstract void countObsoleteINs(java.util.List lsnList)
throws DatabaseException
DatabaseExceptionprotected void countObsoleteINsInternal(java.util.List lsnList)
throws DatabaseException
DatabaseExceptionpublic abstract void loadEndOfLogStat(EnvironmentStats stats) throws DatabaseException
DatabaseExceptionpublic void setReadHook(TestHook hook)