public interface CachingConfig
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_RANGE_BYTES
Default maximum number of bytes to cache in a single contiguous range of key/value pairs
(10485760L).
|
static int |
DEFAULT_MAX_RANGES
Default maximum number of contiguous ranges of key/value pairs to allow before we start purging the
least recently used ones (256).
|
static long |
DEFAULT_MAX_TOTAL_BYTES
Default maximum total number of bytes to cache including all ranges (104857600L).
|
static boolean |
DEFAULT_READ_AHEAD
Default for whether read-ahead is enabled.
|
static double |
DEFAULT_WAIT_FACTOR
Default wait factor (1.5).
|
Modifier and Type | Method and Description |
---|---|
default void |
copyCachingConfigTo(CachingConfig dest)
Copy config parameters.
|
long |
getMaxRangeBytes()
Get the maximum number of bytes to cache in a single contiguous range of key/value pairs.
|
int |
getMaxRanges()
Get the maximum number of contiguous ranges of key/value pairs to allow before we start purging the
least recently used ones.
|
long |
getMaxTotalBytes()
Get the total number of bytes to cache.
|
double |
getWaitFactor()
Get the wait factor.
|
boolean |
isReadAhead()
Get whether this instance is configured to perform read-ahead.
|
void |
setMaxRangeBytes(long maxRangeBytes)
Configure the maximum number of bytes to cache in a single contiguous range of key/value pairs.
|
void |
setMaxRanges(int maxRanges)
Configure the maximum number of contiguous ranges of key/value pairs to allow before we start purging the
least recently used ones.
|
void |
setMaxTotalBytes(long maxTotalBytes)
Configure the total number of bytes to cache.
|
void |
setReadAhead(boolean readAhead)
Configure whether read-ahead is enabled.
|
void |
setWaitFactor(double waitFactor)
Set the wait factor.
|
static final int DEFAULT_MAX_RANGES
getMaxRanges()
,
Constant Field Valuesstatic final long DEFAULT_MAX_RANGE_BYTES
getMaxRangeBytes()
,
Constant Field Valuesstatic final long DEFAULT_MAX_TOTAL_BYTES
getMaxTotalBytes()
,
Constant Field Valuesstatic final double DEFAULT_WAIT_FACTOR
getWaitFactor()
,
Constant Field Valuesstatic final boolean DEFAULT_READ_AHEAD
isReadAhead()
,
Constant Field Valueslong getMaxRangeBytes()
Default is 10485760L.
void setMaxRangeBytes(long maxRangeBytes)
Default is 10485760L.
maxRangeBytes
- maximum bytes in any one rangeIllegalArgumentException
- if maxRangeBytes <= 0
long getMaxTotalBytes()
Default is 104857600L.
void setMaxTotalBytes(long maxTotalBytes)
Default is 104857600L.
maxTotalBytes
- maximum cached rangesIllegalArgumentException
- if maxTotalBytes <= 0
int getMaxRanges()
Default is 256.
void setMaxRanges(int maxRanges)
Default is 256.
maxRanges
- maximum cached rangesIllegalArgumentException
- if maxRanges <= 0
double getWaitFactor()
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.
void setWaitFactor(double waitFactor)
Default is 1.5.
waitFactor
- wait factorIllegalArgumentException
- if waitFactor
is negative or not finiteboolean isReadAhead()
Default is true.
void setReadAhead(boolean readAhead)
Default is true.
readAhead
- true to enable read-ahead, false to disabledefault void copyCachingConfigTo(CachingConfig dest)
dest
- destination for copied caching parametersIllegalArgumentException
- if dest
is nullCopyright © 2022. All rights reserved.