|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.LogManager
public abstract class LogManager
The LogManager supports reading and writing to the JE log.
Nested Class Summary | |
---|---|
(package private) static class |
LogManager.LogResult
LogResult holds the multivalue return from logInternal. |
Field Summary | |
---|---|
protected EnvironmentImpl |
envImpl
|
(package private) static int |
HEADER_BYTES
|
(package private) static int |
HEADER_CHECKSUM_OFFSET
|
(package private) static int |
HEADER_CONTENT_BYTES
|
(package private) static int |
HEADER_ENTRY_TYPE_OFFSET
|
(package private) static int |
HEADER_PREV_OFFSET
|
(package private) static int |
HEADER_SIZE_OFFSET
|
(package private) static int |
HEADER_VERSION_OFFSET
|
protected LogBufferPool |
logBufferPool
|
protected Latch |
logWriteLatch
|
(package private) static int |
PREV_BYTES
|
Constructor Summary | |
---|---|
LogManager(EnvironmentImpl envImpl,
boolean readOnly)
There is a single log manager per database environment. |
Method Summary | |
---|---|
abstract void |
countObsoleteINs(List lsnList)
Counts the given obsolete IN LSNs under the log write latch. |
protected void |
countObsoleteINsInternal(List lsnList)
|
abstract void |
countObsoleteNode(long lsn,
LogEntryType type)
Count node as obsolete under the log write latch. |
protected void |
countObsoleteNodeInternal(UtilizationTracker tracker,
long lsn,
LogEntryType type)
|
abstract void |
countObsoleteNodes(TrackedFileSummary[] summaries)
Counts file summary info under the log write latch. |
protected void |
countObsoleteNodesInternal(UtilizationTracker tracker,
TrackedFileSummary[] summaries)
|
void |
flush()
Flush all log entries, fsync the log file. |
protected abstract void |
flushInternal()
|
Object |
get(long lsn)
Fault in the first object in the log entry log entry at this LSN. |
long |
getLastLsnAtRecovery()
|
LogEntry |
getLogEntry(long lsn)
Instantiate all the objects in the log entry at this LSN. |
(package private) LogEntry |
getLogEntry(long lsn,
RandomAccessFile file)
|
abstract TrackedFileSummary |
getUnflushableTrackedSummary(long file)
Returns a tracked summary for the given file which will not be flushed. |
protected TrackedFileSummary |
getUnflushableTrackedSummaryInternal(long file)
|
void |
loadStats(StatsConfig config,
EnvironmentStats stats)
|
long |
log(LoggableObject item)
Write a log entry. |
long |
log(LoggableObject item,
boolean isProvisional,
long oldNodeLsn)
Write a log entry. |
long |
logForceFlip(LoggableObject item)
Log this single object and force a flip of the log files. |
long |
logForceFlush(LoggableObject item,
boolean fsyncRequired)
Log this single object and force a write of the log files. |
protected LogManager.LogResult |
logInternal(LoggableObject item,
boolean isProvisional,
boolean flushRequired,
boolean forceNewLogFile,
long oldNodeLsn,
boolean marshallOutsideLatch,
ByteBuffer marshalledBuffer,
UtilizationTracker tracker)
Called within the log write critical section. |
protected abstract LogManager.LogResult |
logItem(LoggableObject item,
boolean isProvisional,
boolean flushRequired,
boolean forceNewLogFile,
long oldNodeLsn,
boolean marshallOutsideLatch,
ByteBuffer marshalledBuffer,
UtilizationTracker tracker)
|
(package private) ByteBuffer |
putIntoBuffer(LoggableObject item,
int itemSize,
long prevLogEntryOffset,
boolean isProvisional,
int entrySize)
Serialize a loggable object into this buffer. |
void |
resetPool(DbConfigManager configManager)
Reset the pool when the cache is resized. |
void |
setLastLsnAtRecovery(long lastLsnAtRecovery)
|
void |
setReadHook(TestHook hook)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int HEADER_BYTES
static final int PREV_BYTES
static final int HEADER_CONTENT_BYTES
static final int HEADER_CHECKSUM_OFFSET
static final int HEADER_ENTRY_TYPE_OFFSET
static final int HEADER_VERSION_OFFSET
static final int HEADER_PREV_OFFSET
static final int HEADER_SIZE_OFFSET
protected LogBufferPool logBufferPool
protected Latch logWriteLatch
protected EnvironmentImpl envImpl
Constructor Detail |
---|
public LogManager(EnvironmentImpl envImpl, boolean readOnly) throws DatabaseException
DatabaseException
Method Detail |
---|
public long getLastLsnAtRecovery()
public void setLastLsnAtRecovery(long lastLsnAtRecovery)
public void resetPool(DbConfigManager configManager) throws DatabaseException
DatabaseException
public long logForceFlush(LoggableObject item, boolean fsyncRequired) throws DatabaseException
item
- object to be loggedfsyncRequired
- if true, log files should also be fsynced.
DatabaseException
public long logForceFlip(LoggableObject item) throws DatabaseException
item
- object to be loggedfsyncRequired
- if true, log files should also be fsynced.
DatabaseException
public long log(LoggableObject item) throws DatabaseException
DatabaseException
public long log(LoggableObject item, boolean isProvisional, long oldNodeLsn) throws DatabaseException
DatabaseException
protected abstract LogManager.LogResult logItem(LoggableObject item, boolean isProvisional, boolean flushRequired, boolean forceNewLogFile, long oldNodeLsn, boolean marshallOutsideLatch, ByteBuffer marshalledBuffer, UtilizationTracker tracker) throws IOException, DatabaseException
IOException
DatabaseException
protected LogManager.LogResult logInternal(LoggableObject item, boolean isProvisional, boolean flushRequired, boolean forceNewLogFile, long oldNodeLsn, boolean marshallOutsideLatch, ByteBuffer marshalledBuffer, UtilizationTracker tracker) throws IOException, DatabaseException
IOException
DatabaseException
ByteBuffer putIntoBuffer(LoggableObject item, int itemSize, long prevLogEntryOffset, boolean isProvisional, int entrySize) throws DatabaseException
DatabaseException
public LogEntry getLogEntry(long lsn) throws DatabaseException
lsn
- location of entry in log.
DatabaseException
LogEntry getLogEntry(long lsn, RandomAccessFile file) throws DatabaseException
DatabaseException
public Object get(long lsn) throws DatabaseException
lsn
- location of object in log
DatabaseException
public void flush() throws DatabaseException
DatabaseException
protected abstract void flushInternal() throws LogException, DatabaseException
LogException
DatabaseException
public void loadStats(StatsConfig config, EnvironmentStats stats) throws DatabaseException
DatabaseException
public abstract TrackedFileSummary getUnflushableTrackedSummary(long file) throws DatabaseException
DatabaseException
protected TrackedFileSummary getUnflushableTrackedSummaryInternal(long file) throws DatabaseException
DatabaseException
public abstract void countObsoleteNode(long lsn, LogEntryType type) throws DatabaseException
DatabaseException
protected void countObsoleteNodeInternal(UtilizationTracker tracker, long lsn, LogEntryType type) throws DatabaseException
DatabaseException
public abstract void countObsoleteNodes(TrackedFileSummary[] summaries) throws DatabaseException
DatabaseException
protected void countObsoleteNodesInternal(UtilizationTracker tracker, TrackedFileSummary[] summaries) throws DatabaseException
DatabaseException
public abstract void countObsoleteINs(List lsnList) throws DatabaseException
DatabaseException
protected void countObsoleteINsInternal(List lsnList) throws DatabaseException
DatabaseException
public void setReadHook(TestHook hook)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |