public class CachedStore extends DelegatingStore
| Constructor and Description |
|---|
CachedStore(Store actualStore)
{
createCache() must be overridden to use this constructor. |
CachedStore(Store actualStore,
ICache cache) |
| Modifier and Type | Method and Description |
|---|---|
protected ICache |
createCache()
Called at store {
startup when constructor {CachedStore(Store) was invoked. |
void |
delete(MetaInformation meta,
String table,
String id)
Deletes a particular element.
|
boolean |
exists(MetaInformation meta,
String table,
String row)
Tests for a row.
|
boolean |
exists(MetaInformation meta,
String table,
String row,
String family)
check if an element exist in the cache
|
Row.ColumnFamilyData |
get(MetaInformation meta,
String table,
String id,
Set<String> families)
Returns all elements in families ; no side-effect.
|
Map<String,byte[]> |
get(MetaInformation meta,
String table,
String id,
String family)
Returns all elements in a family ; no side-effect.
|
ICache |
getCache()
The actual cache used
|
boolean |
isEnabledByDefault()
Whether read cache is enabled by default for thread that did not call
setEnabledForCurrentThread(boolean). |
static boolean |
isEnabledForCurrentThread()
Whether read cache should be enabled for this thread even for
de-activated read cache stores. |
void |
setEnabledByDefault(boolean enabled)
Whether read cache is enabled by default for thread that did not call
setEnabledForCurrentThread(boolean). |
static void |
setEnabledForCurrentThread(boolean enabled)
Whether cache should be enabled for this thread even for
de-activated write-retention stores. |
void |
start()
Called once the store is created ; only one store is instanciated with
the same properties.
|
count, get, get, get, getActualStore, getActualStore, getDeepActualStore, hasTable, storeChangespublic CachedStore(Store actualStore)
createCache() must be overridden to use this constructor.actualStore - public static boolean isEnabledForCurrentThread()
de-activated read cache stores.public static void setEnabledForCurrentThread(boolean enabled)
de-activated write-retention stores.public ICache getCache()
protected ICache createCache()
startup when constructor {CachedStore(Store) was invoked.
Does not need to be thread safe.public void start()
throws DatabaseNotReachedException
Storestart in interface Storestart in class DelegatingStoreDatabaseNotReachedExceptionpublic boolean isEnabledByDefault()
setEnabledForCurrentThread(boolean).public void setEnabledByDefault(boolean enabled)
setEnabledForCurrentThread(boolean).public void delete(MetaInformation meta, String table, String id) throws DatabaseNotReachedException
Storedelete in interface Storedelete in class DelegatingStoreDatabaseNotReachedExceptionpublic boolean exists(MetaInformation meta, String table, String row, String family) throws DatabaseNotReachedException
exists in interface Storeexists in class DelegatingStoreDatabaseNotReachedExceptionpublic Map<String,byte[]> get(MetaInformation meta, String table, String id, String family) throws DatabaseNotReachedException
Storeget in interface Storeget in class DelegatingStoreDatabaseNotReachedExceptionpublic boolean exists(MetaInformation meta, String table, String row) throws DatabaseNotReachedException
Storeexists in interface Storeexists in class DelegatingStoreDatabaseNotReachedExceptionpublic Row.ColumnFamilyData get(MetaInformation meta, String table, String id, Set<String> families) throws DatabaseNotReachedException
Storeget in interface Storeget in class DelegatingStoretable - the table from which to find the elementid - the unique identifier (i.e. the key) with which the element
was storedfamilies - the set of column families to be activated ; should never be
null or emptyDatabaseNotReachedExceptionCopyright © 2016. All Rights Reserved.