public abstract class AbstractCachingConfig extends Object implements CachingConfig
CachingConfig
implementations.DEFAULT_MAX_RANGE_BYTES, DEFAULT_MAX_RANGES, DEFAULT_MAX_TOTAL_BYTES, DEFAULT_READ_AHEAD, DEFAULT_WAIT_FACTOR
Modifier | Constructor and Description |
---|---|
protected |
AbstractCachingConfig()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copyCachingConfigTo
public long getMaxRangeBytes()
CachingConfig
Default is 10485760L.
getMaxRangeBytes
in interface CachingConfig
public void setMaxRangeBytes(long maxRangeBytes)
CachingConfig
Default is 10485760L.
setMaxRangeBytes
in interface CachingConfig
maxRangeBytes
- maximum bytes in any one rangepublic long getMaxTotalBytes()
CachingConfig
Default is 104857600L.
getMaxTotalBytes
in interface CachingConfig
public void setMaxTotalBytes(long maxTotalBytes)
CachingConfig
Default is 104857600L.
setMaxTotalBytes
in interface CachingConfig
maxTotalBytes
- maximum cached rangespublic int getMaxRanges()
CachingConfig
Default is 256.
getMaxRanges
in interface CachingConfig
public void setMaxRanges(int maxRanges)
CachingConfig
Default is 256.
setMaxRanges
in interface CachingConfig
maxRanges
- maximum cached rangespublic double getWaitFactor()
CachingConfig
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.
getWaitFactor
in interface CachingConfig
public void setWaitFactor(double waitFactor)
CachingConfig
Default is 1.5.
setWaitFactor
in interface CachingConfig
waitFactor
- wait factorpublic boolean isReadAhead()
CachingConfig
Default is true.
isReadAhead
in interface CachingConfig
public void setReadAhead(boolean readAhead)
CachingConfig
Default is true.
setReadAhead
in interface CachingConfig
readAhead
- true to enable read-ahead, false to disableCopyright © 2022. All rights reserved.