public class UtilizationCalculator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
UtilizationCalculator.AverageSize
Bundles a count of LNs and their total size, for use in calculating a
running average.
|
(package private) static class |
UtilizationCalculator.TestAdjustment
For passing adjustment information to a test hook.
|
Constructor and Description |
---|
UtilizationCalculator(EnvironmentImpl env,
Cleaner cleaner) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
adjustUtilization(long fileNum,
long endFileNum,
FileSummary estimatedFileSummary,
FileSummary trueFileSummary)
Saves the true average LN size for use in calculating utilization.
|
(package private) java.lang.Long |
getBestFile(java.util.SortedMap<java.lang.Long,FileSummary> fileSummaryMap,
boolean forceCleaning,
java.util.Set<java.lang.Long> lowUtilizationFiles,
boolean isBacklog,
boolean isProbe)
Returns the best file that qualifies for cleaning or probing, or null
if no file qualifies.
|
(package private) java.lang.Long |
getCheapestFileToClean(java.util.SortedMap<java.lang.Long,FileSummary> fileSummaryMap,
java.util.SortedSet<java.lang.Long> candidateFiles)
Returns the cheapest file to clean from the given list of files.
|
float |
getLNSizeCorrectionFactor()
Returns the factor to be multiplied by the average LN size (for LNs with
uncounted sizes) to correct for differences between obsolete and active
LN sizes.
|
CleanerLogSummary |
getLogSummary()
Returns log summary info that should be saved persistently.
|
(package private) boolean |
isCorrectionEstablished()
Returns whether enough adjustments have been made to conclude that the
the LN size correction factor has been established, or at least
unnecessary because very few LN sizes are uncounted.
|
(package private) void |
setAdjustmentHook(TestHook<UtilizationCalculator.TestAdjustment> hook)
See UtilizationCorrectionTest.
|
void |
setLogSummary(CleanerLogSummary logSummary)
Restores log summary info that was read from persistent storage.
|
(package private) void |
setProtectedFiles()
Determine which files are protectd from deletion, which influences which
files are cleaned.
|
(package private) boolean |
shouldPerformProbe(long endFileNum)
Returns whether a correction probe should be attempted, if worst case
utilization also indicates that cleaning may be needed.
|
UtilizationCalculator(EnvironmentImpl env, Cleaner cleaner)
public CleanerLogSummary getLogSummary()
public void setLogSummary(CleanerLogSummary logSummary)
void setAdjustmentHook(TestHook<UtilizationCalculator.TestAdjustment> hook)
void setProtectedFiles()
public float getLNSizeCorrectionFactor()
java.lang.Long getBestFile(java.util.SortedMap<java.lang.Long,FileSummary> fileSummaryMap, boolean forceCleaning, java.util.Set<java.lang.Long> lowUtilizationFiles, boolean isBacklog, boolean isProbe)
fileSummaryMap
- the map containing file summary info.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.isBacklog
- is true if there is currently a backlog, in which case
FilesToMigrate won't be used to return a file.isProbe
- is true to use the maximum LN obsolete size to determine
file utilization. It should be false when selecting a file cleaning a
file normally, to use the average LN size for uncounted sizes along with
correction factor. It should be true when selecting a file to calculate
utilization without cleaning, to determine the worst case (lowest
possible) utilization and to ignore the correction factor.java.lang.Long getCheapestFileToClean(java.util.SortedMap<java.lang.Long,FileSummary> fileSummaryMap, java.util.SortedSet<java.lang.Long> candidateFiles)
void adjustUtilization(long fileNum, long endFileNum, FileSummary estimatedFileSummary, FileSummary trueFileSummary)
boolean isCorrectionEstablished()
boolean shouldPerformProbe(long endFileNum)
Copyright (c) 2004-2012 Oracle. All rights reserved.