|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ehcache.store.AbstractStore
net.sf.ehcache.transaction.AbstractTransactionStore
public abstract class AbstractTransactionStore
Abstract transactional store which provides implementation of all non-transactional methods
| Field Summary | |
|---|---|
protected ReadWriteCopyStrategy<Element> |
copyStrategy
The copy strategy for this store |
protected Store |
underlyingStore
The underlying store wrapped by this store |
| Fields inherited from class net.sf.ehcache.store.AbstractStore |
|---|
attributeExtractors |
| Fields inherited from interface net.sf.ehcache.store.Store |
|---|
CLUSTER_COHERENT, NODE_COHERENT |
| Constructor Summary | |
|---|---|
protected |
AbstractTransactionStore(Store underlyingStore,
ReadWriteCopyStrategy<Element> copyStrategy)
Constructor |
| Method Summary | ||
|---|---|---|
boolean |
bufferFull()
Some store types, such as the disk stores can fill their write buffers if puts come in too fast. |
|
boolean |
containsKeyInMemory(Object key)
A check to see if a key is in the Store and is currently held in memory. |
|
boolean |
containsKeyOffHeap(Object key)
A check to see if a key is in the Store and is currently held off-heap. |
|
boolean |
containsKeyOnDisk(Object key)
A check to see if a key is in the Store and is currently held on disk. |
|
protected Element |
copyElementForRead(Element element)
Copy element for read operation |
|
protected Element |
copyElementForWrite(Element element)
Copy element for write operation |
|
void |
dispose()
Prepares for shutdown. |
|
Results |
executeQuery(StoreQuery query)
Execute the given query on this store |
|
void |
expireElements()
Expire all elements. |
|
void |
flush()
Flush elements to persistent store. |
|
Policy |
getInMemoryEvictionPolicy()
|
|
int |
getInMemorySize()
Returns the current local in-memory store size |
|
long |
getInMemorySizeInBytes()
Gets the size of the in-memory portion of the store, in bytes. |
|
Object |
getInternalContext()
This should not be used, and will generally return null |
|
Set |
getLocalKeys()
Returns set of keys from the cache which are present in the node locally. |
|
Object |
getMBean()
Optional implementation specific MBean exposed by the store. |
|
int |
getOffHeapSize()
Returns the current local off-heap store size |
|
long |
getOffHeapSizeInBytes()
Gets the size of the off-heap portion of the store, in bytes. |
|
int |
getOnDiskSize()
Returns the current local on-disk store size |
|
long |
getOnDiskSizeInBytes()
Gets the size of the on-disk portion of the store, in bytes. |
|
|
getSearchAttribute(String attributeName)
Retrieve the given named search attribute |
|
Status |
getStatus()
Returns the cache status. |
|
CacheConfiguration.TransactionalMode |
getTransactionalMode()
Get the transactional mode of this store. |
|
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. |
|
boolean |
isPinned(Object key)
Check if the key is pinned |
|
void |
setAttributeExtractors(Map<String,AttributeExtractor> extractors)
Inform this store of the configured attribute extractors. |
|
void |
setInMemoryEvictionPolicy(Policy policy)
Sets the eviction policy strategy. |
|
void |
setNodeCoherent(boolean coherent)
Sets the cache in coherent or incoherent mode for the current node depending on the parameter. |
|
void |
setPinned(Object key,
boolean pinned)
Mark the key as pinned or not |
|
Element |
unlockedGet(Object key)
Gets the value associated with the key without acquiring any locks. |
|
Element |
unlockedGetQuiet(Object key)
Same as TerracottaStore.unlockedGet(Object) but does not update statistics |
|
void |
unpinAll()
unpin all pinned keys |
|
Element |
unsafeGet(Object key)
Returns the local value associated with the key. |
|
Element |
unsafeGetQuiet(Object key)
Same as TerracottaStore.unsafeGet(Object) but does not update last usage statistics |
|
void |
waitUntilClusterCoherent()
This method waits until the cache is in coherent mode in all the connected nodes. |
|
| Methods inherited from class net.sf.ehcache.store.AbstractStore |
|---|
addStoreListener, getAll, getAllQuiet, getEventListenerList, putAll, recalculateSize, removeAll, removeStoreListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.ehcache.store.Store |
|---|
addStoreListener, containsKey, get, getAll, getAllQuiet, getKeys, getQuiet, getSize, getTerracottaClusteredSize, put, putAll, putIfAbsent, putWithWriter, recalculateSize, remove, removeAll, removeAll, removeElement, removeStoreListener, removeWithWriter, replace, replace |
| Field Detail |
|---|
protected final Store underlyingStore
protected final ReadWriteCopyStrategy<Element> copyStrategy
| Constructor Detail |
|---|
protected AbstractTransactionStore(Store underlyingStore,
ReadWriteCopyStrategy<Element> copyStrategy)
underlyingStore - the underlying store| Method Detail |
|---|
public void unpinAll()
unpinAll in interface Storepublic boolean isPinned(Object key)
isPinned in interface Storekey - the key to be checked
true if the element is pinned
public void setPinned(Object key,
boolean pinned)
setPinned in interface Storekey - the key to be pinned or notpinned - true if the key should be pinned, false otherwiseprotected Element copyElementForRead(Element element)
element -
protected Element copyElementForWrite(Element element)
element -
public Results executeQuery(StoreQuery query)
executeQuery in interface StoreexecuteQuery in class AbstractStorequery - query to execute
public int getInMemorySize()
getInMemorySize in interface Storepublic int getOffHeapSize()
getOffHeapSize in interface Storepublic int getOnDiskSize()
getOnDiskSize in interface Storepublic long getInMemorySizeInBytes()
getInMemorySizeInBytes in interface Storepublic long getOffHeapSizeInBytes()
getOffHeapSizeInBytes in interface Storepublic long getOnDiskSizeInBytes()
getOnDiskSizeInBytes in interface Storepublic boolean containsKeyOnDisk(Object key)
containsKeyOnDisk in interface Storekey - The Element key
public boolean containsKeyOffHeap(Object key)
containsKeyOffHeap in interface Storekey - The Element key
public boolean containsKeyInMemory(Object key)
containsKeyInMemory in interface Storekey - The Element key
public void dispose()
dispose in interface Storepublic Status getStatus()
getStatus in interface Storepublic void expireElements()
expireElements in interface Store
public void flush()
throws IOException
flush in interface StoreIOException - if any IO error occurspublic boolean bufferFull()
bufferFull in interface Storepublic Policy getInMemoryEvictionPolicy()
getInMemoryEvictionPolicy in interface StoreStore.setInMemoryEvictionPolicy(Policy)public void setInMemoryEvictionPolicy(Policy policy)
setInMemoryEvictionPolicy in interface Storepolicy - the new policypublic Object getInternalContext()
getInternalContext in interface Storepublic Object getMBean()
getMBean in interface Storepublic void setNodeCoherent(boolean coherent)
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. Terracotta
setNodeCoherent in interface StoresetNodeCoherent in class AbstractStorecoherent - true transitions to coherent mode, false to incoherent modeStore.setNodeCoherent(boolean)public boolean isNodeCoherent()
isNodeCoherent in interface StoreisNodeCoherent in class AbstractStoreStore.isNodeCoherent()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 cluster
isCacheCoherent in interface StoreisCacheCoherent in class AbstractStoretrue 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 StoreisClusterCoherent in class AbstractStoreStore.isClusterCoherent()
public void waitUntilClusterCoherent()
throws TerracottaNotRunningException,
UnsupportedOperationException,
InterruptedException
waitUntilClusterCoherent in interface StorewaitUntilClusterCoherent in class AbstractStoreInterruptedException
UnsupportedOperationException
TerracottaNotRunningExceptionStore.waitUntilClusterCoherent()public void setAttributeExtractors(Map<String,AttributeExtractor> extractors)
setAttributeExtractors in interface StoresetAttributeExtractors in class AbstractStore
public <T> Attribute<T> getSearchAttribute(String attributeName)
throws CacheException
getSearchAttribute in interface StoregetSearchAttribute in class AbstractStoreT - type of the attributeattributeName - the name of the attribute to retrieve
CacheExceptionpublic boolean hasAbortedSizeOf()
hasAbortedSizeOf in interface StorehasAbortedSizeOf in class AbstractStorepublic Element unsafeGet(Object key)
unsafeGet in interface TerracottaStorekey - the key
public Element unsafeGetQuiet(Object key)
TerracottaStore.unsafeGet(Object) but does not update last usage statistics
unsafeGetQuiet in interface TerracottaStorekey - the key
public Element unlockedGet(Object key)
unlockedGet in interface TerracottaStorepublic Element unlockedGetQuiet(Object key)
TerracottaStore.unlockedGet(Object) but does not update statistics
unlockedGetQuiet in interface TerracottaStorepublic Set getLocalKeys()
getLocalKeys in interface TerracottaStorepublic CacheConfiguration.TransactionalMode getTransactionalMode()
getTransactionalMode in interface TerracottaStoreCacheConfiguration.TransactionalMode
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||