|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.cleaner.UtilizationTracker
Tracks changes to the utilization profile since that last checkpoint.
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. getLogSizeDelta and activateCleaner can also be called outside the latch.
Constructor Summary | |
UtilizationTracker(EnvironmentImpl env)
Creates an empty tracker. |
Method Summary | |
void |
activateCleaner()
|
void |
addSummary(long fileNumber,
FileSummary other)
Adds changes from a given FileSummary. |
boolean |
countNewLogEntry(long lsn,
LogEntryType type,
int size)
Counts the addition of all new log entries including LNs, and returns whether the cleaner should be woken. |
void |
countObsoleteNode(long lsn,
LogEntryType type,
boolean obsolete)
Counts a change in the obsolete status of an node, incrementing the obsolete count if obsolete is true and decrementing it if obsolete is false. |
(package private) long |
getLogSizeDelta()
Returns the number of bytes added to the log since the last checkpoint. |
TrackedFileSummary |
getTrackedFile(long fileNum)
Returns one file from the snapshot of tracked files, or null if the given file number is not in the snapshot array. |
TrackedFileSummary[] |
getTrackedFiles()
Returns a snapshot of the files being tracked as of the last time a log entry was added. |
(package private) void |
resetFile(TrackedFileSummary file)
Called after the FileSummaryLN is written to the log during checkpoint. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UtilizationTracker(EnvironmentImpl env) throws DatabaseException
Method Detail |
public void activateCleaner()
public TrackedFileSummary[] getTrackedFiles()
If files are added or removed from the list of tracked files in real time, the returned array will not be changed since it is a snapshot. But the objects contained in the array are live and will be updated in real time under the log write latch. The array and the objects in the array should not be modified by the caller.
public TrackedFileSummary getTrackedFile(long fileNum)
getTrackedFiles()
long getLogSizeDelta()
public boolean countNewLogEntry(long lsn, LogEntryType type, int size)
Must be called under the log write latch.
public void countObsoleteNode(long lsn, LogEntryType type, boolean obsolete)
Must be called under the log write latch.
public void addSummary(long fileNumber, FileSummary other)
Must be called under the log write latch.
void resetFile(TrackedFileSummary file)
We keep the active file summary in the tracked file list, but we remove older files to prevent unbounded growth of the list.
Must be called under the log write latch.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |