public class ReportAggregationOptions
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.
|
| Constructor and Description |
|---|
ReportAggregationOptions()
No-arg constructor
Creates an instance initialized with the default values.
|
ReportAggregationOptions(int numEntries,
int flushCacheEntryIntervalMillis)
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 |
getFlushCacheEntryIntervalMillis() |
int |
getNumEntries() |
public static final int DEFAULT_NUM_ENTRIES
public static final int DEFAULT_FLUSH_CACHE_ENTRY_INTERVAL_MILLIS
public ReportAggregationOptions(int numEntries,
int flushCacheEntryIntervalMillis)
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 aggregated report requests are
flushed to the server. The cache entry is deleted after the
flushpublic ReportAggregationOptions()
public int getNumEntries()
public int 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 object cachedout - a concurrent Deque to which previously cached values
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 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.