Class AbstractCachingConfig

java.lang.Object
io.permazen.kv.caching.AbstractCachingConfig
All Implemented Interfaces:
CachingConfig
Direct Known Subclasses:
CachingKVDatabase, CachingKVTransaction

public abstract class AbstractCachingConfig extends Object implements CachingConfig
Support superclass for CachingConfig implementations.
  • Constructor Details

    • AbstractCachingConfig

      protected AbstractCachingConfig()
      Constructor.
  • Method Details

    • getMaxRangeBytes

      public long getMaxRangeBytes()
      Description copied from interface: CachingConfig
      Get the maximum number of bytes to cache in a single contiguous range of key/value pairs.

      Default is 10485760L.

      Specified by:
      getMaxRangeBytes in interface CachingConfig
      Returns:
      maximum bytes in any one range
    • setMaxRangeBytes

      public void setMaxRangeBytes(long maxRangeBytes)
      Description copied from interface: CachingConfig
      Configure the maximum number of bytes to cache in a single contiguous range of key/value pairs.

      Default is 10485760L.

      Specified by:
      setMaxRangeBytes in interface CachingConfig
      Parameters:
      maxRangeBytes - maximum bytes in any one range
    • getMaxTotalBytes

      public long getMaxTotalBytes()
      Description copied from interface: CachingConfig
      Get the total number of bytes to cache. This is an overal maximum incluging all ranges.

      Default is 104857600L.

      Specified by:
      getMaxTotalBytes in interface CachingConfig
      Returns:
      maximum cached ranges
    • setMaxTotalBytes

      public void setMaxTotalBytes(long maxTotalBytes)
      Description copied from interface: CachingConfig
      Configure the total number of bytes to cache. This is an overal maximum incluging all ranges.

      Default is 104857600L.

      Specified by:
      setMaxTotalBytes in interface CachingConfig
      Parameters:
      maxTotalBytes - maximum cached ranges
    • getMaxRanges

      public int getMaxRanges()
      Description copied from interface: CachingConfig
      Get the maximum number of contiguous ranges of key/value pairs to allow before we start purging the least recently used ones.

      Default is 256.

      Specified by:
      getMaxRanges in interface CachingConfig
      Returns:
      maximum cached ranges
    • setMaxRanges

      public void setMaxRanges(int maxRanges)
      Description copied from interface: CachingConfig
      Configure the maximum number of contiguous ranges of key/value pairs to allow before we start purging the least recently used ones.

      Default is 256.

      Specified by:
      setMaxRanges in interface CachingConfig
      Parameters:
      maxRanges - maximum cached ranges
    • getWaitFactor

      public double getWaitFactor()
      Description copied from interface: CachingConfig
      Get the wait factor.

      The wait factor, when multiplied by the estimated amount of time we expect to have to wait for incoming data that's already on its way, is how long we will actually wait for that data before initiating a new query. A value of zero means never wait, i.e., always start a new query immediately; a value of 1.0 would mean to wait up to the estimated amount of time; a very high value would mean wait until the outstanding query either produces the data or completes.

      Default is 1.5.

      Specified by:
      getWaitFactor in interface CachingConfig
      Returns:
      wait factor
    • setWaitFactor

      public void setWaitFactor(double waitFactor)
      Description copied from interface: CachingConfig
      Set the wait factor.

      Default is 1.5.

      Specified by:
      setWaitFactor in interface CachingConfig
      Parameters:
      waitFactor - wait factor
    • isReadAhead

      public boolean isReadAhead()
      Description copied from interface: CachingConfig
      Get whether this instance is configured to perform read-ahead.

      Default is true.

      Specified by:
      isReadAhead in interface CachingConfig
      Returns:
      true if read-ahead is enabled, otherwise false
    • setReadAhead

      public void setReadAhead(boolean readAhead)
      Description copied from interface: CachingConfig
      Configure whether read-ahead is enabled.

      Default is true.

      Specified by:
      setReadAhead in interface CachingConfig
      Parameters:
      readAhead - true to enable read-ahead, false to disable