Class VersionGCOptions
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.VersionGCOptions
-
public class VersionGCOptions extends Object
-
-
Field Summary
Fields Modifier and Type Field Description longcollectLimitdoubledelayFactorlongmaxDurationMsintmaxIterationsintoverflowToDiskThresholdlongprecisionMs
-
Constructor Summary
Constructors Constructor Description VersionGCOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionGCOptionswithCollectLimit(long limit)Sets the absolute limit on number of resource ids collected in one run.VersionGCOptionswithDelayFactor(double f)Set a delay factor between batched database modifications.VersionGCOptionswithMaxDuration(TimeUnit unit, long t)Set the maximum duration in elapsed time that the garbage collection shall take.VersionGCOptionswithMaxIterations(int max)Set the maximum number of iterations that shall be attempted in a single run.VersionGCOptionswithOverflowToDiskThreshold(int overflowToDiskThreshold)Set the limit of number of resource id+_modified strings (not length) held in memory during a collection run.VersionGCOptionswithPrecisionMs(TimeUnit unit, long t)Set the minimum duration that is used for time based searches.
-
-
-
Method Detail
-
withOverflowToDiskThreshold
public VersionGCOptions withOverflowToDiskThreshold(int overflowToDiskThreshold)
Set the limit of number of resource id+_modified strings (not length) held in memory during a collection run. Any more will be stored and sorted in a temporary file.- Parameters:
overflowToDiskThreshold- limit after which to use file based storage for candidate ids
-
withCollectLimit
public VersionGCOptions withCollectLimit(long limit)
Sets the absolute limit on number of resource ids collected in one run. This does not count nodes which can be deleted immediately. When this limit is exceeded, the run either fails or is attempted with different parameters, depending on other settings. Note that if the inspected time interval is equal or less thanprecisionMs, the collection limit will be ignored.- Parameters:
limit- the absolute limit of resources collected in one run
-
withPrecisionMs
public VersionGCOptions withPrecisionMs(TimeUnit unit, long t)
Set the minimum duration that is used for time based searches. This should at minimum be the precision available on modification dates of documents, but can be set larger to avoid querying the database too often. Note however thatcollectLimitwill not take effect for runs that query equal or shorter than precision duration.- Parameters:
unit- time unit used for durationt- the number of units in the duration
-
withMaxDuration
public VersionGCOptions withMaxDuration(TimeUnit unit, long t)
Set the maximum duration in elapsed time that the garbage collection shall take. Setting this to 0 means that there is no limit imposed. A positive duration will impose a soft limit, e.g. the collection might take longer, but no next iteration will be attempted afterwards. SeewithMaxIterations(int)on how to control the behaviour.- Parameters:
unit- time unit used for durationt- the number of units in the duration
-
withMaxIterations
public VersionGCOptions withMaxIterations(int max)
Set the maximum number of iterations that shall be attempted in a single run. A value of 0 means that there is no limit. Since the garbage collector uses iterations to find suitable time intervals and set sizes for cleanups, limiting the iterations is only recommended for setups where the collector is called often.- Parameters:
max- the maximum number of iterations allowed
-
withDelayFactor
public VersionGCOptions withDelayFactor(double f)
Set a delay factor between batched database modifications. This rate limits the writes to the database by a garbage collector. 0, e.g. no delay, is the default. This is recommended when garbage collection is done during a maintenance time when other system load is low.For factory > 0, the actual delay is the duration of the last batch modification times the factor. Example: 0.25 would result in a 25% delay, e.g. a batch modification running 10 seconds would be followed by a sleep of 2.5 seconds.
- Parameters:
f- the factor used to calculate batch modification delays
-
-