public class HBaseCacheStore extends AbstractCacheStore
multiThreadedPurge, purgerService
cache, marshaller
Constructor and Description |
---|
HBaseCacheStore() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from the cache.
|
void |
fromStream(ObjectInput in)
Stores an object that has been unmarshalled to a stream into the cache.
|
Class<? extends CacheLoaderConfig> |
getConfigurationClass()
Returns the class that represents this cache store's configuration.
|
void |
init(CacheLoaderConfig clc,
Cache<?,?> cache,
StreamingMarshaller m)
Used to initialize a cache loader.
|
Set<InternalCacheEntry> |
load(int numEntries)
Loads entries from the cache up to a certain number.
|
InternalCacheEntry |
load(Object key)
Loads an entry from the cache, given its key.
|
Set<InternalCacheEntry> |
loadAll()
Loads all entries from the cache.
|
Set<Object> |
loadAllKeys(Set<Object> keysToExclude)
Loads all keys from the cache, optionally excluding some.
|
protected void |
purgeInternal()
Purges any expired entries from the cache.
|
boolean |
remove(Object key)
Removes an entry from the cache, given its key.
|
void |
start() |
void |
store(InternalCacheEntry entry)
Stores an entry into the cache.
|
void |
toStream(ObjectOutput out)
Loads all entries from the cache and marshalls them to an object stream.
|
String |
toString() |
applyModifications, commit, getCacheStoreConfig, getConcurrencyLevel, getMarshaller, prepare, purgeExpired, removeAll, rollback, safeClose, safeClose, stop, supportsMultiThreadedPurge
containsKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsKey
public void init(CacheLoaderConfig clc, Cache<?,?> cache, StreamingMarshaller m) throws CacheLoaderException
CacheLoader
CacheLoaderManager
when setting up cache loaders.init
in interface CacheLoader
init
in class AbstractCacheStore
clc
- the cache loader configuration beancache
- cache associated with this cache loader. Implementations may use this to determine cache name when
selecting where refer to state in storage, for example, a different database table name.m
- marshaller to use when loading state from a stream, if supported by the implementation.CacheLoaderException
public void start() throws CacheLoaderException
start
in interface CacheLoader
start
in class AbstractCacheStore
CacheLoaderException
public void store(InternalCacheEntry entry) throws CacheLoaderException
entry
- the object to store in the cacheCacheLoaderException
- in the event of problems writing to the storepublic void fromStream(ObjectInput in) throws CacheLoaderException
in
- the object input streamCacheLoaderException
- in the event of problems writing to the storepublic void toStream(ObjectOutput out) throws CacheLoaderException
out
- the output stream to marshall the entries toCacheLoaderException
- in the event of problems reading from the storepublic void clear() throws CacheLoaderException
CacheLoaderException
- in the event of problems writing to the storepublic boolean remove(Object key) throws CacheLoaderException
key
- the key for the entry to remove.CacheLoaderException
- in the event of problems writing to the storepublic InternalCacheEntry load(Object key) throws CacheLoaderException
key
- the key for the entry to load.CacheLoaderException
- in the event of problems reading from sourcepublic Set<InternalCacheEntry> loadAll() throws CacheLoaderException
CacheLoaderException
- in the event of problems reading from sourcepublic Set<InternalCacheEntry> load(int numEntries) throws CacheLoaderException
numEntries
- the max number of entries to load.CacheLoaderException
public Set<Object> loadAllKeys(Set<Object> keysToExclude) throws CacheLoaderException
keysToExclude
- a set of keys that should not be returned.CacheLoaderException
public Class<? extends CacheLoaderConfig> getConfigurationClass()
CacheLoaderConfig
bean used to configure this
implementation of CacheLoader
.protected void purgeInternal() throws CacheLoaderException
purgeInternal
in class AbstractCacheStore
CacheLoaderException
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.