|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.cleaner.UtilizationProfile
public class UtilizationProfile
The UP tracks utilization summary information for all log files.
Unlike the UtilizationTracker, the UP is not accessed under the log write latch and is instead synchronized on itself. It is accessed by four other entities: the cleaner, the checkpointer, the compressor, and the recovery manager. It is not accessed during the primary data access path, except for when committing the Database truncate and remove operations.
The cleaner will ask the UP to populate its cache in order to determine the total log size or to select the best file for cleaning. The UP will then read all records in the UP database that are not already cached. The checkpointer calls putFileSummary to write file summary LNs to the log.
Because this object is synchronized it is possible that the cleaner will hold up the checkpointer if the cleaner is populating its cache or calculating the best file, and the checkpointer tries to write the file summary LNs to the log. This blocking is acceptable. Deadlocks will not occur since calls are always from the checkpointer or cleaner to the UP, and not in the other direction.
Constructor Summary | |
---|---|
UtilizationProfile(EnvironmentImpl env,
UtilizationTracker tracker)
Creates an empty UP. |
Method Summary | |
---|---|
void |
clearCache()
Clears the cache of file summary info. |
void |
countAndLogSummaries(TrackedFileSummary[] summaries)
Count the given tracked info as obsolete and then log the summaries. |
void |
flushFileSummary(TrackedFileSummary tfs)
Updates and stores the FileSummary for a given tracked file, if flushing of the summary is allowed. |
(package private) Long |
getBestFileForCleaning(FileSelector fileSelector,
boolean forceCleaning,
Set lowUtilizationFiles)
Returns the best file that qualifies for cleaning, or null if no file qualifies. |
(package private) Long |
getCheapestFileToClean(List files)
Returns the cheapest file to clean from the given list of files. |
SortedMap |
getFileSummaryMap(boolean includeTrackedFiles)
Returns a copy of the current file summary map, optionally including tracked summary information, for use by the DbSpace utility and by unit tests. |
(package private) int |
getNumberOfFiles()
Returns the number of files in the profile. |
(package private) TrackedFileSummary |
getObsoleteDetail(Long fileNum,
PackedOffsets packedOffsets)
Returns the stored/packed obsolete offsets and the tracked obsolete offsets for the given file. |
boolean |
isRMWFixEnabled()
|
(package private) void |
removeFile(Long fileNum)
Removes a file from the utilization database and the profile, after it has been deleted by the cleaner. |
static int |
utilization(long obsoleteSize,
long totalSize)
Calculate the utilization percentage. |
boolean |
verifyFileSummaryDatabase()
Checks that all FSLN offsets are indeed obsolete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UtilizationProfile(EnvironmentImpl env, UtilizationTracker tracker) throws DatabaseException
DatabaseException
Method Detail |
---|
public boolean isRMWFixEnabled()
EnvironmentParams.CLEANER_RMW_FIX
,
FileSummaryLN.postFetchInit(com.sleepycat.je.dbi.DatabaseImpl, long)
int getNumberOfFiles() throws DatabaseException
DatabaseException
Long getCheapestFileToClean(List files) throws DatabaseException
DatabaseException
Long getBestFileForCleaning(FileSelector fileSelector, boolean forceCleaning, Set lowUtilizationFiles) throws DatabaseException
fileSelector
- is used to determine valid cleaning candidates.forceCleaning
- is true to always select a file, even if its
utilization is above the minimum utilization threshold.lowUtilizationFiles
- is a returned set of files that are below the
minimum utilization threshold.
DatabaseException
public static int utilization(long obsoleteSize, long totalSize)
public void countAndLogSummaries(TrackedFileSummary[] summaries) throws DatabaseException
DatabaseException
public SortedMap getFileSummaryMap(boolean includeTrackedFiles) throws DatabaseException
DatabaseException
public void clearCache()
void removeFile(Long fileNum) throws DatabaseException
DatabaseException
public void flushFileSummary(TrackedFileSummary tfs) throws DatabaseException
DatabaseException
TrackedFileSummary getObsoleteDetail(Long fileNum, PackedOffsets packedOffsets) throws DatabaseException
DatabaseException
public boolean verifyFileSummaryDatabase() throws DatabaseException
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |