public abstract class AbstractTransientStore extends Object implements TransientStore
TransientStore
implementation.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTransientStore.TransientCacheConfig |
Modifier and Type | Field and Description |
---|---|
protected File |
cacheDir |
protected TransientStoreConfig |
config |
protected Cache |
l1Cache |
protected CacheDescriptor |
l1cd |
protected Cache |
l2Cache |
protected CacheDescriptor |
l2cd |
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
AbstractTransientStore() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
decrementStorageSize(long size) |
protected void |
decrementStorageSize(StorageEntry entry) |
void |
doGC()
Runs the Garbage Collecting to delete the Filesystem resources that may correspond to cache entries that were
removed
|
StorageEntry |
get(String key)
Returns a
StorageEntry given its key , or null if not found. |
abstract Class<? extends Cache> |
getCacheImplClass() |
File |
getCachingDirectory(String key) |
protected String |
getCachingDirName(String key) |
protected String |
getKeyCachingDirName(String dir) |
Cache |
getL1Cache() |
protected CacheDescriptor |
getL1CacheConfig() |
Cache |
getL2Cache() |
protected CacheDescriptor |
getL2CacheConfig() |
protected long |
getSize(Path entry) |
abstract long |
getStorageSize() |
int |
getStorageSizeMB()
Returns the size of the disk storage used in MB
|
protected abstract void |
incrementStorageSize(long size) |
protected void |
incrementStorageSize(StorageEntry entry) |
void |
init(TransientStoreConfig config)
Initialize the store from the configuration
|
protected StorageEntry |
persistEntry(StorageEntry entry) |
void |
put(StorageEntry entry)
Adds a new
StorageEntry . |
void |
release(String key)
Informs the Store that the entry can be released if TTL or GC parameters requires to do some cleanup.
|
void |
remove(String key)
Removes a
StorageEntry given its key . |
protected abstract void |
setStorageSize(long newSize) |
void |
shutdown()
Shutdown the store.
|
protected TransientStoreConfig config
protected static final org.apache.commons.logging.Log log
protected CacheDescriptor l1cd
protected CacheDescriptor l2cd
public AbstractTransientStore()
public void init(TransientStoreConfig config)
TransientStore
init
in interface TransientStore
public void shutdown()
TransientStore
shutdown
in interface TransientStore
protected abstract void incrementStorageSize(long size)
protected abstract void decrementStorageSize(long size)
protected void incrementStorageSize(StorageEntry entry)
protected void decrementStorageSize(StorageEntry entry)
public abstract long getStorageSize()
protected abstract void setStorageSize(long newSize)
public Cache getL1Cache()
public Cache getL2Cache()
public void put(StorageEntry entry)
TransientStore
StorageEntry
.put
in interface TransientStore
protected StorageEntry persistEntry(StorageEntry entry)
public StorageEntry get(String key)
TransientStore
StorageEntry
given its key
, or null if not found.get
in interface TransientStore
public void remove(String key)
TransientStore
StorageEntry
given its key
.remove
in interface TransientStore
public void release(String key)
TransientStore
release
in interface TransientStore
public int getStorageSizeMB()
TransientStore
getStorageSizeMB
in interface TransientStore
protected String getCachingDirName(String key)
protected String getKeyCachingDirName(String dir)
public File getCachingDirectory(String key)
public void doGC()
TransientStore
doGC
in interface TransientStore
public abstract Class<? extends Cache> getCacheImplClass()
protected CacheDescriptor getL1CacheConfig()
protected CacheDescriptor getL2CacheConfig()
Copyright © 2015 Nuxeo SA. All rights reserved.