Class VersionGCOptions


  • public class VersionGCOptions
    extends java.lang.Object
    • Field Detail

      • overflowToDiskThreshold

        public final int overflowToDiskThreshold
      • collectLimit

        public final long collectLimit
      • precisionMs

        public final long precisionMs
      • maxIterations

        public final int maxIterations
      • maxDurationMs

        public final long maxDurationMs
      • delayFactor

        public final double delayFactor
    • Constructor Detail

      • VersionGCOptions

        public VersionGCOptions()
    • 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 than precisionMs, the collection limit will be ignored.
        Parameters:
        limit - the absolute limit of resources collected in one run
      • withPrecisionMs

        public VersionGCOptions withPrecisionMs​(java.util.concurrent.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 that collectLimit will not take effect for runs that query equal or shorter than precision duration.
        Parameters:
        unit - time unit used for duration
        t - the number of units in the duration
      • withMaxDuration

        public VersionGCOptions withMaxDuration​(java.util.concurrent.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. See withMaxIterations(int) on how to control the behaviour.
        Parameters:
        unit - time unit used for duration
        t - 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