public abstract class BaseStore<K,V> extends java.lang.Object implements Store<K,V>
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseStore.BaseStoreProvider |
Store.Configuration<K,V>, Store.Iterator<T>, Store.Provider, Store.PutStatus, Store.RemoveStatus, Store.ReplaceStatus, Store.ValueHolder<V>
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class<K> |
keyType |
protected boolean |
operationStatisticsEnabled
Tells if this store is by itself or in a tiered setup
|
protected StatisticsService |
statisticsService |
protected java.lang.Class<V> |
valueType |
Constructor and Description |
---|
BaseStore(java.lang.Class<K> keyType,
java.lang.Class<V> valueType,
boolean operationStatisticsEnabled,
StatisticsService statisticsService) |
BaseStore(Store.Configuration<K,V> config,
StatisticsService statisticsService) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkKey(K keyObject) |
protected void |
checkValue(V valueObject) |
protected <T extends java.lang.Enum<T>> |
createObserver(java.lang.String name,
java.lang.Class<T> outcome,
boolean canBeDisabled)
Create an
OperationObserver using this for the context. |
protected abstract java.lang.String |
getStatisticsTag() |
protected <T extends java.io.Serializable> |
registerStatistic(java.lang.String name,
org.terracotta.management.model.stats.StatisticType type,
java.util.Set<java.lang.String> tags,
java.util.function.Supplier<T> valueSupplier) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bulkCompute, bulkCompute, bulkComputeIfAbsent, clear, computeAndGet, computeIfAbsent, containsKey, get, getAndCompute, getStoreEventSource, iterator, put, putIfAbsent, remove, remove, replace, replace
getConfigurationChangeListeners
protected final java.lang.Class<K> keyType
protected final java.lang.Class<V> valueType
protected final boolean operationStatisticsEnabled
protected final StatisticsService statisticsService
public BaseStore(Store.Configuration<K,V> config, StatisticsService statisticsService)
public BaseStore(java.lang.Class<K> keyType, java.lang.Class<V> valueType, boolean operationStatisticsEnabled, StatisticsService statisticsService)
protected void checkKey(K keyObject)
protected void checkValue(V valueObject)
protected <T extends java.lang.Enum<T>> OperationObserver<T> createObserver(java.lang.String name, java.lang.Class<T> outcome, boolean canBeDisabled)
OperationObserver
using this
for the context.T
- type of the outcomename
- name of the statisticoutcome
- class of the possible outcomescanBeDisabled
- if this statistic can be disabled by a StoreStatisticsConfiguration
protected <T extends java.io.Serializable> void registerStatistic(java.lang.String name, org.terracotta.management.model.stats.StatisticType type, java.util.Set<java.lang.String> tags, java.util.function.Supplier<T> valueSupplier)
protected abstract java.lang.String getStatisticsTag()