public abstract class LogManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected EnvironmentImpl |
envImpl |
protected 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 |
countObsoleteDb(DatabaseImpl db) |
(package private) void |
countObsoleteDbInternal(DatabaseImpl db) |
abstract void |
countObsoleteINs(java.util.List<java.lang.Long> lsnList,
DatabaseImpl nodeDb)
Counts the given obsolete IN LSNs under the log write latch.
|
(package private) void |
countObsoleteINsInternal(java.util.List<java.lang.Long> lsnList,
DatabaseImpl nodeDb) |
abstract void |
countObsoleteNode(long lsn,
LogEntryType type,
int size,
DatabaseImpl nodeDb)
Count node as obsolete under the log write latch.
|
(package private) void |
countObsoleteNodeInternal(long lsn,
LogEntryType type,
int size,
DatabaseImpl nodeDb) |
void |
flush()
Flush all log entries, fsync the log file.
|
(package private) 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.
|
java.nio.ByteBuffer |
getByteBufferFromLog(long lsn)
Return a ByteBuffer holding the log entry at this LSN.
|
boolean |
getChecksumOnRead() |
long |
getLastLsnAtRecovery() |
LogEntry |
getLogEntry(long lsn)
Instantiate all the objects in the log entry at this LSN.
|
(package private) LogEntry |
getLogEntry(long lsn,
java.io.RandomAccessFile file) |
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.
|
(package private) TrackedFileSummary |
getUnflushableTrackedSummaryInternal(long file) |
abstract void |
loadEndOfLogStat(EnvironmentStats stats) |
(package private) void |
loadEndOfLogStatInternal(EnvironmentStats stats) |
void |
loadStats(StatsConfig config,
EnvironmentStats stats) |
long |
log(LogEntry entry,
boolean isProvisional,
boolean backgroundIO,
long oldNodeLsn,
DatabaseImpl nodeDb,
ReplicationContext repContext)
Write a log entry.
|
long |
log(LogEntry entry,
Provisional provisional,
boolean backgroundIO,
long oldNodeLsn,
DatabaseImpl nodeDb,
ReplicationContext repContext)
Write a log entry.
|
long |
log(LogEntry entry,
ReplicationContext repContext)
Write a log entry.
|
void |
log(LogItem item,
LogContext context)
Convenience method for logging a single entry.
|
long |
logForceFlip(LogEntry entry)
Log this single object and force a flip of the log files.
|
long |
logForceFlush(LogEntry entry,
boolean fsyncRequired,
ReplicationContext repContext)
Log this single object and force a write of the log files.
|
java.nio.ByteBuffer |
marshallIntoBuffer(LogEntryHeader header,
LogEntry entry)
Serialize a loggable object into this buffer.
|
void |
multiLog(LogItem[] itemArray,
LogContext context) |
(package private) java.nio.ByteBuffer |
putIntoBuffer(LogEntry entry,
long prevLogEntryOffset)
Serialize a log entry into this buffer with proper entry header.
|
abstract boolean |
removeDbFileSummary(DatabaseImpl db,
java.lang.Long fileNum) |
(package private) boolean |
removeDbFileSummaryInternal(DatabaseImpl db,
java.lang.Long fileNum) |
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.
|
(package private) abstract void |
serialLog(LogItem[] itemArray,
LogContext context)
Log one or more items while latched or synchronized in order to
serialize log output.
|
(package private) void |
serialLogInternal(LogItem[] itemArray,
LogContext context)
Called within the log write critical section.
|
void |
setLastLsnAtRecovery(long lastLsnAtRecovery) |
void |
setReadHook(TestHook hook) |
abstract void |
transferToUtilizationTracker(LocalUtilizationTracker localTracker) |
(package private) void |
transferToUtilizationTrackerInternal(LocalUtilizationTracker localTracker) |
protected 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 entry, boolean fsyncRequired, ReplicationContext repContext) throws DatabaseException
entry - object to be loggedfsyncRequired - if true, log files should also be fsynced.DatabaseExceptionpublic long logForceFlip(LogEntry entry) throws DatabaseException
entry - object to be loggedDatabaseExceptionpublic long log(LogEntry entry, ReplicationContext repContext) throws DatabaseException
entry - object to be loggedDatabaseExceptionpublic long log(LogEntry entry, boolean isProvisional, boolean backgroundIO, long oldNodeLsn, DatabaseImpl nodeDb, ReplicationContext repContext) throws DatabaseException
entry - object to be loggedisProvisional - true if this entry should not be read during
recovery.backgroundIO - if true, sleep when the backgroundIOLimit is
exceeded.oldNodeLsn - is the previous version of the node to be counted as
obsolete, or NULL_LSN if the entry is not a node or has no old LSN.nodeDb - database of the node, or null if entry is not a node.DatabaseExceptionpublic long log(LogEntry entry, Provisional provisional, boolean backgroundIO, long oldNodeLsn, DatabaseImpl nodeDb, ReplicationContext repContext) throws DatabaseException
entry - object to be loggedprovisional - whether this entry should be processed during
recovery.backgroundIO - if true, sleep when the backgroundIOLimit is
exceeded.oldNodeLsn - is the previous version of the node to be counted as
obsolete, or NULL_LSN if the entry is not a node or has no old LSN.nodeDb - database of the node, or null if entry is not a node.DatabaseExceptionpublic void log(LogItem item, LogContext context) throws DatabaseException
DatabaseExceptionpublic void multiLog(LogItem[] itemArray, LogContext context) throws DatabaseException
DatabaseExceptionabstract void serialLog(LogItem[] itemArray, LogContext context) throws java.io.IOException, DatabaseException
java.io.IOExceptionDatabaseExceptionvoid serialLogInternal(LogItem[] itemArray, LogContext context) throws java.io.IOException, DatabaseException
java.io.IOExceptionDatabaseExceptionpublic java.nio.ByteBuffer marshallIntoBuffer(LogEntryHeader header, LogEntry entry) throws DatabaseException
DatabaseExceptionjava.nio.ByteBuffer putIntoBuffer(LogEntry entry, long prevLogEntryOffset) throws DatabaseException
DatabaseExceptionpublic LogEntry getLogEntry(long lsn) throws DatabaseException
lsn - location of entry in log.DatabaseExceptionLogEntry getLogEntry(long lsn, java.io.RandomAccessFile file) throws DatabaseException
DatabaseExceptionpublic java.nio.ByteBuffer getByteBufferFromLog(long lsn)
throws DatabaseException
lsn - location of entry in logDatabaseExceptionpublic 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
DatabaseExceptionabstract void flushInternal()
throws LogException,
DatabaseException
LogExceptionDatabaseExceptionpublic void loadStats(StatsConfig config, EnvironmentStats stats) throws DatabaseException
DatabaseExceptionpublic abstract TrackedFileSummary getUnflushableTrackedSummary(long file) throws DatabaseException
DatabaseExceptionTrackedFileSummary 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,
DatabaseImpl nodeDb)
throws DatabaseException
DatabaseExceptionvoid countObsoleteNodeInternal(long lsn,
LogEntryType type,
int size,
DatabaseImpl nodeDb)
throws DatabaseException
DatabaseExceptionpublic abstract void transferToUtilizationTracker(LocalUtilizationTracker localTracker) throws DatabaseException
void transferToUtilizationTrackerInternal(LocalUtilizationTracker localTracker) throws DatabaseException
DatabaseExceptionpublic abstract void countObsoleteINs(java.util.List<java.lang.Long> lsnList,
DatabaseImpl nodeDb)
throws DatabaseException
DatabaseExceptionvoid countObsoleteINsInternal(java.util.List<java.lang.Long> lsnList,
DatabaseImpl nodeDb)
throws DatabaseException
DatabaseExceptionpublic abstract void countObsoleteDb(DatabaseImpl db) throws DatabaseException
void countObsoleteDbInternal(DatabaseImpl db)
public abstract boolean removeDbFileSummary(DatabaseImpl db, java.lang.Long fileNum) throws DatabaseException
DatabaseExceptionboolean removeDbFileSummaryInternal(DatabaseImpl db, java.lang.Long fileNum)
public abstract void loadEndOfLogStat(EnvironmentStats stats) throws DatabaseException
DatabaseExceptionvoid loadEndOfLogStatInternal(EnvironmentStats stats)
public void setReadHook(TestHook hook)
Copyright (c) 2004,2008 Oracle. All rights reserved.