public abstract class AbstractStore extends Object implements Store
Modifier and Type | Field and Description |
---|---|
protected Map<String,AttributeExtractor> |
attributeExtractors
search attribute extractors
|
protected SearchManager |
searchManager
search manager
|
CLUSTER_COHERENT, NODE_COHERENT
Modifier | Constructor and Description |
---|---|
protected |
AbstractStore()
Constructor for stores that do not support search
|
protected |
AbstractStore(SearchManager searchManager,
String cacheName)
Constructor for stores that do support search
|
Modifier and Type | Method and Description |
---|---|
void |
addStoreListener(StoreListener listener)
Add a listener to the store.
|
Results |
executeQuery(StoreQuery query)
Execute the given query on this store
|
Map<Object,Element> |
getAll(Collection<?> keys)
Retries the elements associated with a set of keys and update the statistics
Keys which are not present in the cache will have null values associated
with them in the returned map
|
Map<Object,Element> |
getAllQuiet(Collection<?> keys)
Retries the elements associated with a set of keys without updating the statistics
Keys which are not present in the cache will have null values associated
with them in the returned map
|
protected List<StoreListener> |
getEventListenerList()
onLoad initializer
|
<T> Attribute<T> |
getSearchAttribute(String attributeName)
Retrieve the given named search attribute
|
Set<Attribute> |
getSearchAttributes() |
boolean |
hasAbortedSizeOf()
Checks if the cache may contain elements for which the SizeOf engine gave up and only
partially calculated the size.
|
boolean |
isCacheCoherent()
Indicates whether this store provides a coherent view of all the elements
in a cache.
|
boolean |
isClusterCoherent()
Returns true if the cache is in coherent mode cluster-wide.
|
boolean |
isNodeCoherent()
Returns true if the cache is in coherent mode for the current node.
|
void |
putAll(Collection<Element> elements)
Puts a collection of elements into the store.
|
void |
recalculateSize(Object key)
Recalculate size of the element mapped to the key
|
void |
removeAll(Collection<?> keys)
Removes a collection of elements from the cache.
|
void |
removeStoreListener(StoreListener listener)
Remove listener from store.
|
void |
setAttributeExtractors(Map<String,AttributeExtractor> extractors)
Inform this store of the configured attribute extractors.
|
void |
setNodeCoherent(boolean coherent)
Sets the cache in coherent or incoherent mode for the current node depending on the parameter.
|
void |
waitUntilClusterCoherent()
This method waits until the cache is in coherent mode in all the connected nodes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bufferFull, containsKey, containsKeyInMemory, containsKeyOffHeap, containsKeyOnDisk, dispose, expireElements, flush, get, getInMemoryEvictionPolicy, getInMemorySize, getInMemorySizeInBytes, getInternalContext, getKeys, getMBean, getOffHeapSize, getOffHeapSizeInBytes, getOnDiskSize, getOnDiskSizeInBytes, getQuiet, getSize, getStatus, getTerracottaClusteredSize, put, putIfAbsent, putWithWriter, remove, removeAll, removeElement, removeWithWriter, replace, replace, setInMemoryEvictionPolicy
protected final Map<String,AttributeExtractor> attributeExtractors
protected final SearchManager searchManager
protected AbstractStore()
protected AbstractStore(SearchManager searchManager, String cacheName)
searchManager
- the search manager to useprotected List<StoreListener> getEventListenerList()
public boolean isCacheCoherent()
Store.isClusterCoherent()
(introduced since 2.0)
Use Store.isNodeCoherent()
to find out if the cache is coherent in the current node in the clusterisCacheCoherent
in interface Store
true
if the store is coherent; or false
if the
store potentially splits the cache storage with another store or
isn't internally coherentStore.isCacheCoherent()
public boolean isClusterCoherent()
isClusterCoherent
in interface Store
Store.isClusterCoherent()
public boolean isNodeCoherent()
isNodeCoherent
in interface Store
Store.isNodeCoherent()
public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException
setNodeCoherent(true)
when the cache is already in coherent mode or
calling setNodeCoherent(false)
when already in incoherent mode will be a no-op.
It applies to coherent clustering mechanisms only e.g. TerracottasetNodeCoherent
in interface Store
coherent
- true transitions to coherent mode, false to incoherent modeUnsupportedOperationException
- if this store does not support cache coherence, like RMI replicationStore.setNodeCoherent(boolean)
public void waitUntilClusterCoherent() throws UnsupportedOperationException, TerracottaNotRunningException, InterruptedException
waitUntilClusterCoherent
in interface Store
InterruptedException
TerracottaNotRunningException
UnsupportedOperationException
- if this store does not support cache coherence, like RMI replicationStore.waitUntilClusterCoherent()
public void addStoreListener(StoreListener listener)
addStoreListener
in interface Store
Store.addStoreListener(net.sf.ehcache.store.StoreListener)
public void removeStoreListener(StoreListener listener)
removeStoreListener
in interface Store
Store.removeStoreListener(net.sf.ehcache.store.StoreListener)
public void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
setAttributeExtractors
in interface Store
public Results executeQuery(StoreQuery query)
executeQuery
in interface Store
query
- query to executepublic <T> Attribute<T> getSearchAttribute(String attributeName) throws CacheException
getSearchAttribute
in interface Store
T
- type of the attributeattributeName
- the name of the attribute to retrieveCacheException
public Set<Attribute> getSearchAttributes()
getSearchAttributes
in interface Store
public void putAll(Collection<Element> elements) throws CacheException
putAll
in interface Store
elements
- Collection of elements to be put in the storeCacheException
public void removeAll(Collection<?> keys)
public Map<Object,Element> getAllQuiet(Collection<?> keys)
getAllQuiet
in interface Store
keys
- a collection of keys to look forpublic Map<Object,Element> getAll(Collection<?> keys)
public boolean hasAbortedSizeOf()
hasAbortedSizeOf
in interface Store
public void recalculateSize(Object key)
recalculateSize
in interface Store
key
- the keyCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.