public class RecoveryUtilizationTracker extends BaseUtilizationTracker
Per-database information is keyed by DatabaseId because the DatabaseImpl is not always available during recovery. In fact this is the only reason that a "local" tracker is used during recovery -- to avoid requiring that the DatabaseImpl is available, which is necessary to use the "global" UtilizationTracker. There is no requirement to accumulate totals locally, since recovery is single threaded.
When finished with this object, its information should be added to the Environment's UtilizationTracker and DatabaseImpl objects by calling transferToUtilizationTracker. This is done at the end of recovery, just prior to the checkpoint. It does not have to be done under the log write latch, since recovery is single threaded.
Constructor and Description |
---|
RecoveryUtilizationTracker(EnvironmentImpl env) |
Modifier and Type | Method and Description |
---|---|
void |
countNewLogEntry(long lsn,
LogEntryType type,
int size,
DatabaseId dbId)
Counts the addition of all new log entries including LNs.
|
boolean |
countObsoleteIfUncounted(long oldLsn,
long newLsn,
LogEntryType type,
int size,
DatabaseId dbId,
boolean countExact)
Counts the oldLsn of a node obsolete if it has not already been counted
at the point of newLsn in the log.
|
void |
countObsoleteUnconditional(long lsn,
LogEntryType type,
int size,
DatabaseId dbId,
boolean countExact)
Counts the LSN of a node obsolete unconditionally.
|
int |
fetchLNSize(int size,
long lsn)
Fetches the LN to get its size only if necessary and so configured.
|
void |
resetDbInfo(DatabaseId dbId)
Clears all accmulated utilization info for the given database.
|
void |
resetFileInfo(long fileNum)
Clears all accmulated utilization info for the given file.
|
void |
saveLastLoggedFileSummaryLN(long fileNum,
long lsn)
Saves the LSN of the last logged FileSummaryLN.
|
void |
saveLastLoggedMapLN(DatabaseId dbId,
long lsn)
Saves the LSN of the last logged MapLN.
|
void |
transferToUtilizationTracker(UtilizationTracker tracker)
Transfers counts and offsets from this local tracker to the given
(global) UtilizationTracker and to the live DatabaseImpl objects.
|
countObsoleteDb, getEnvironment, getTrackedFile, getTrackedFiles
public RecoveryUtilizationTracker(EnvironmentImpl env) throws DatabaseException
DatabaseException
public void saveLastLoggedFileSummaryLN(long fileNum, long lsn)
public void saveLastLoggedMapLN(DatabaseId dbId, long lsn)
public void countNewLogEntry(long lsn, LogEntryType type, int size, DatabaseId dbId)
public void countObsoleteUnconditional(long lsn, LogEntryType type, int size, DatabaseId dbId, boolean countExact)
public boolean countObsoleteIfUncounted(long oldLsn, long newLsn, LogEntryType type, int size, DatabaseId dbId, boolean countExact)
public int fetchLNSize(int size, long lsn) throws DatabaseException
DatabaseException
public void resetFileInfo(long fileNum)
public void resetDbInfo(DatabaseId dbId)
public void transferToUtilizationTracker(UtilizationTracker tracker) throws DatabaseException
When called after recovery has finished, must be called under the log write latch.
DatabaseException