public class ClusteredStore extends Object implements TerracottaStore, StoreListener
| Modifier and Type | Field and Description |
|---|---|
protected org.terracotta.toolkit.internal.cache.ToolkitCacheInternal<String,Serializable> |
backend |
protected Ehcache |
cache |
protected String |
fullyQualifiedCacheName |
protected static String |
LEADER_NODE_ID |
protected ToolkitInstanceFactory |
toolkitInstanceFactory |
protected ValueModeHandler |
valueModeHandler |
CLUSTER_COHERENT, NODE_COHERENT| Constructor and Description |
|---|
ClusteredStore(ToolkitInstanceFactory toolkitInstanceFactory,
Ehcache cache,
CacheCluster topology) |
protected static final String LEADER_NODE_ID
protected final org.terracotta.toolkit.internal.cache.ToolkitCacheInternal<String,Serializable> backend
protected final ValueModeHandler valueModeHandler
protected final ToolkitInstanceFactory toolkitInstanceFactory
protected final Ehcache cache
protected final String fullyQualifiedCacheName
public ClusteredStore(ToolkitInstanceFactory toolkitInstanceFactory, Ehcache cache, CacheCluster topology)
public String getFullyQualifiedCacheName()
public void recalculateSize(Object key)
recalculateSize in interface Storepublic void addStoreListener(StoreListener listener)
addStoreListener in interface Storepublic void removeStoreListener(StoreListener listener)
removeStoreListener in interface Storepublic void clusterCoherent(boolean clusterCoherent)
clusterCoherent in interface StoreListenerpublic boolean put(Element element) throws CacheException
put in interface StoreCacheExceptionpublic boolean putWithWriter(Element element, CacheWriterManager writerManager) throws CacheException
putWithWriter in interface StoreCacheExceptionpublic void putAll(Collection<Element> elements) throws CacheException
putAll in interface StoreCacheExceptionpublic void removeAll(Collection<?> keys)
public Element removeWithWriter(Object key, CacheWriterManager writerManager) throws CacheException
removeWithWriter in interface StoreCacheExceptionpublic void removeAll()
throws CacheException
removeAll in interface StoreCacheExceptionpublic Element putIfAbsent(Element element) throws NullPointerException
putIfAbsent in interface StoreNullPointerExceptionpublic Element removeElement(Element element, ElementValueComparator comparator) throws NullPointerException
removeElement in interface StoreNullPointerExceptionpublic boolean replace(Element old, Element element, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException
replace in interface StoreNullPointerExceptionIllegalArgumentExceptionpublic Element replace(Element element) throws NullPointerException
replace in interface StoreNullPointerExceptionpublic int getInMemorySize()
getInMemorySize in interface Storepublic int getOffHeapSize()
getOffHeapSize in interface Storepublic int getOnDiskSize()
getOnDiskSize in interface Storepublic void quickClear()
quickClear in interface TerracottaStorepublic int quickSize()
quickSize in interface TerracottaStorepublic int getTerracottaClusteredSize()
getTerracottaClusteredSize in interface Storepublic long getInMemorySizeInBytes()
getInMemorySizeInBytes in interface Storepublic long getOffHeapSizeInBytes()
getOffHeapSizeInBytes in interface Storepublic long getOnDiskSizeInBytes()
getOnDiskSizeInBytes in interface Storepublic boolean hasAbortedSizeOf()
hasAbortedSizeOf in interface Storepublic boolean containsKey(Object key)
containsKey in interface Storepublic boolean containsKeyOnDisk(Object key)
containsKeyOnDisk in interface Storepublic boolean containsKeyOffHeap(Object key)
containsKeyOffHeap in interface Storepublic boolean containsKeyInMemory(Object key)
containsKeyInMemory in interface Storepublic void expireElements()
This is a default implementation which does nothing. Expiration on demand is only implemented for disk stores.
expireElements in interface Storepublic boolean bufferFull()
bufferFull in interface Storepublic Policy getInMemoryEvictionPolicy()
getInMemoryEvictionPolicy in interface Storepublic void setInMemoryEvictionPolicy(Policy policy)
setInMemoryEvictionPolicy in interface Storepublic Object getInternalContext()
getInternalContext in interface Storepublic boolean isCacheCoherent()
isCacheCoherent in interface Storepublic boolean isClusterCoherent()
throws TerracottaNotRunningException
isClusterCoherent in interface StoreTerracottaNotRunningExceptionpublic boolean isNodeCoherent()
throws TerracottaNotRunningException
isNodeCoherent in interface StoreTerracottaNotRunningExceptionpublic void setNodeCoherent(boolean coherent)
throws UnsupportedOperationException,
TerracottaNotRunningException
setNodeCoherent in interface StoreUnsupportedOperationExceptionTerracottaNotRunningExceptionpublic void waitUntilClusterCoherent()
throws UnsupportedOperationException,
TerracottaNotRunningException,
InterruptedException
waitUntilClusterCoherent in interface StoreUnsupportedOperationExceptionTerracottaNotRunningExceptionInterruptedExceptionpublic void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
setAttributeExtractors in interface Storepublic Results executeQuery(StoreQuery query) throws SearchException
executeQuery in interface StoreSearchExceptionpublic Set<Attribute> getSearchAttributes()
getSearchAttributes in interface Storepublic <T> Attribute<T> getSearchAttribute(String attributeName)
getSearchAttribute in interface Storepublic Map<Object,Element> getAllQuiet(Collection<?> keys)
getAllQuiet in interface Storepublic Map<Object,Element> getAll(Collection<?> keys)
public String generatePortableKeyFor(Object obj)
public Element unsafeGet(Object key)
unsafeGet in interface TerracottaStorepublic Set getLocalKeys()
getLocalKeys in interface TerracottaStorepublic CacheConfiguration.TransactionalMode getTransactionalMode()
getTransactionalMode in interface TerracottaStorepublic boolean isSearchable()
public String getLeader()
public WriteBehind createWriteBehind()
createWriteBehind in interface TerracottaStorepublic void notifyCacheEventListenersChanged()
notifyCacheEventListenersChanged in interface TerracottaStoreCopyright © 2003–2024 Terracotta, Inc.. All rights reserved.