|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.cleaner.BaseUtilizationTracker
com.sleepycat.je.cleaner.UtilizationTracker
public class UtilizationTracker
Tracks changes to the utilization profile since the last checkpoint. This is the "global" tracker for an environment that tracks changes as they occur in live operations. Other "local" tracker classes are used to count utilization locally and then later transfer the information to the global tracker, this tracker.
All changes to this object occur must under the log write latch. It is possible to read tracked info without holding the latch. This is done by the cleaner when selecting a file and by the checkpointer when determining what FileSummaryLNs need to be written. To read tracked info outside the log write latch, call getTrackedFile or getTrackedFiles. activateCleaner can also be called outside the latch.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.cleaner.BaseUtilizationTracker |
---|
bytesSinceActivate, cleaner, env |
Constructor Summary | |
---|---|
UtilizationTracker(EnvironmentImpl env)
Creates an empty tracker. |
|
UtilizationTracker(EnvironmentImpl env,
Cleaner cleaner)
Constructor used by the cleaner constructor, prior to setting the cleaner field of the environment. |
Method Summary | |
---|---|
void |
activateCleaner()
Wakeup the cleaner thread and reset the log byte counter. |
boolean |
countNewLogEntry(long lsn,
LogEntryType type,
int size,
DatabaseImpl db)
Counts the addition of all new log entries including LNs, and returns whether the cleaner should be woken. |
void |
countObsoleteNode(long lsn,
LogEntryType type,
int size,
DatabaseImpl db)
Counts a node that has become obsolete and tracks the LSN offset, if non-zero, to avoid a lookup during cleaning. |
void |
countObsoleteNodeDupsAllowed(long lsn,
LogEntryType type,
int size,
DatabaseImpl db)
Counts as countObsoleteNode does, tracks the obsolete LSN offset, but does not fire an assert if the offset has already been counted. |
void |
countObsoleteNodeInexact(long lsn,
LogEntryType type,
int size,
DatabaseImpl db)
Counts as countObsoleteNode does, but since the LSN may be inexact, does not track the obsolete LSN offset. |
long |
evictMemory()
Evicts tracked detail if the budget for the tracker is exceeded. |
(package private) DbFileSummary |
getDbFileSummary(Object databaseKey,
long fileNum)
Allocates DbFileSummary information in the DatabaseImpl, which is the database key. |
EnvironmentImpl |
getEnvironment()
|
TrackedFileSummary |
getUnflushableTrackedSummary(long fileNum)
Returns a tracked summary for the given file which will not be flushed. |
Methods inherited from class com.sleepycat.je.cleaner.BaseUtilizationTracker |
---|
close, countNew, countObsolete, countObsoleteDb, getFileSummary, getTrackedFile, getTrackedFiles, isFileUncounted, isLNType, resetFile, trackObsoleteInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UtilizationTracker(EnvironmentImpl env)
UtilizationTracker(EnvironmentImpl env, Cleaner cleaner)
Method Detail |
---|
public EnvironmentImpl getEnvironment()
getEnvironment
in class BaseUtilizationTracker
public long evictMemory() throws DatabaseException
When flushFileSummary is called, the TrackedFileSummary is cleared via its reset method, which is called by FileSummaryLN.writeToLog. This is how memory is subtracted from the budget.
DatabaseException
public void activateCleaner()
public boolean countNewLogEntry(long lsn, LogEntryType type, int size, DatabaseImpl db)
Must be called under the log write latch.
public void countObsoleteNode(long lsn, LogEntryType type, int size, DatabaseImpl db)
A zero LSN offset is used as a special value when obsolete offset tracking is not desired. [#15365] The file header entry (at offset zero) is never counted as obsolete, it is assumed to be obsolete by the cleaner.
This method should only be called for LNs and INs (i.e, only for nodes). If type is null we assume it is an LN.
Must be called under the log write latch.
public void countObsoleteNodeInexact(long lsn, LogEntryType type, int size, DatabaseImpl db)
This method should only be called for LNs and INs (i.e, only for nodes). If type is null we assume it is an LN.
Must be called under the log write latch.
public void countObsoleteNodeDupsAllowed(long lsn, LogEntryType type, int size, DatabaseImpl db)
This method should only be called for LNs and INs (i.e, only for nodes). If type is null we assume it is an LN.
Must be called under the log write latch.
public TrackedFileSummary getUnflushableTrackedSummary(long fileNum)
DbFileSummary getDbFileSummary(Object databaseKey, long fileNum)
Must be called under the log write latch.
getDbFileSummary
in class BaseUtilizationTracker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |