|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.cleaner.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 recovery manager calls cacheFileSummary when it reads a file summary LN. 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. |
(package private) Long |
getBestFileForCleaning(Set excludeFiles,
boolean aggressive)
Returns the best file that qualifies for cleaning, or null if no file qualifies. |
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) int |
getObsoleteAge()
Returns the IN obsolete age config setting. |
long |
getTotalLogSize(boolean calcIfNecessary)
Returns the total byte size of all log files in the environment, or -1 if the size is not available and calcIfNecessary is false. |
FileSummary |
putFileSummary(TrackedFileSummary trackedSummary)
Updates and stores the FileSummary for a given tracked file and returns the updated summary. |
(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. |
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
Method Detail |
final int getObsoleteAge()
int getNumberOfFiles() throws DatabaseException
DatabaseException
Long getBestFileForCleaning(Set excludeFiles, boolean aggressive) throws DatabaseException
DatabaseException
public static int utilization(long obsoleteSize, long totalSize)
public long getTotalLogSize(boolean calcIfNecessary) throws DatabaseException
DatabaseException
public SortedMap getFileSummaryMap(boolean includeTrackedFiles) throws DatabaseException
DatabaseException
public void clearCache()
void removeFile(Long fileNum) throws DatabaseException
DatabaseException
public FileSummary putFileSummary(TrackedFileSummary trackedSummary) throws DatabaseException
DatabaseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |