public class CheckAggregationOptions
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FLUSH_CACHE_ENTRY_INTERVAL_MILLIS
The default flush cache entry interval.
|
static int |
DEFAULT_NUM_ENTRIES
The default aggregation cache size.
|
static int |
DEFAULT_RESPONSE_EXPIRATION_MILLIS
The default response expiration interval.
|
| Constructor and Description |
|---|
CheckAggregationOptions()
No-arg constructor
Creates an instance initialized with the default values.
|
CheckAggregationOptions(int numEntries,
int flushCacheEntryIntervalMillis,
int expirationMillis)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> com.google.common.cache.Cache<java.lang.String,T> |
createCache(java.util.concurrent.ConcurrentLinkedDeque<T> out)
Creates a
Cache configured by this instance. |
<T> com.google.common.cache.Cache<java.lang.String,T> |
createCache(java.util.concurrent.ConcurrentLinkedDeque<T> out,
com.google.common.base.Ticker ticker)
Creates a
Cache configured by this instance. |
int |
getExpirationMillis() |
int |
getFlushCacheEntryIntervalMillis() |
int |
getNumEntries() |
public static final int DEFAULT_NUM_ENTRIES
public static final int DEFAULT_RESPONSE_EXPIRATION_MILLIS
public static final int DEFAULT_FLUSH_CACHE_ENTRY_INTERVAL_MILLIS
public CheckAggregationOptions(int numEntries,
int flushCacheEntryIntervalMillis,
int expirationMillis)
numEntries - is the maximum number of cache entries that can be kept in the
aggregation cache. The cache is disabled if this value is
negative.flushCacheEntryIntervalMillis - the maximum interval before an aggregated check request is
flushed to the server. The cache entry is deleted after the
flushexpirationMillis - is the maximum interval in milliseconds before a cached check
response is invalidated. This value should be greater than
flushCacheEntryIntervalMillis. If not, it is ignored,
and a value of flushCacheEntryIntervalMillis is used
instead.public CheckAggregationOptions()
public int getNumEntries()
public int getFlushCacheEntryIntervalMillis()
public int getExpirationMillis()
getFlushCacheEntryIntervalMillis()@Nullable public <T> com.google.common.cache.Cache<java.lang.String,T> createCache(java.util.concurrent.ConcurrentLinkedDeque<T> out)
Cache configured by this instance.T - the type of the instance being cachedout - a concurrent Deque to which previously cached items
are added as they expireCache corresponding to this instance's values or
null unless numEntries is positive.@Nullable
public <T> com.google.common.cache.Cache<java.lang.String,T> createCache(java.util.concurrent.ConcurrentLinkedDeque<T> out,
com.google.common.base.Ticker ticker)
Cache configured by this instance.T - the type of the value stored in the Cacheout - a concurrent Deque to which the cached values are
added as they are removed from the cacheticker - the time source used to determine expirationCache corresponding to this instance's values or
null unless #numEntries is positive.