public class OCommandCacheSoftRefs extends Object implements OCommandCache
Modifier and Type | Class and Description |
---|---|
static class |
OCommandCacheSoftRefs.OCachedResult |
OCommandCache.STRATEGY
Constructor and Description |
---|
OCommandCacheSoftRefs(OStorage storage) |
Modifier and Type | Method and Description |
---|---|
void |
changeConfig(ODocument cfg) |
OCommandCacheSoftRefs |
clear()
Remove all results from the cache.
|
static boolean |
clearFiles(OAbstractPaginatedStorage storage) |
protected void |
configure() |
protected boolean |
deleteFileIfExists() |
OCommandCacheSoftRefs |
disable()
Disables cache.
|
OCommandCacheSoftRefs |
enable()
Enables cache.
|
Set<Map.Entry<String,OCommandCacheSoftRefs.OCachedResult>> |
entrySet() |
Object |
get(OSecurityUser iUser,
String queryText,
int iLimit)
Looks up for query result in cache.
|
OCommandCache.STRATEGY |
getEvictStrategy() |
protected String |
getKey(OSecurityUser iUser,
String queryText,
int iLimit) |
int |
getMaxResultsetSize() |
int |
getMinExecutionTime() |
void |
invalidateResultsOfCluster(String iCluster)
Invalidates results of given cluster.
|
boolean |
isEnabled()
Tells whether cache is enabled.
|
void |
put(OSecurityUser iUser,
String queryText,
Object iResult,
int iLimit,
Set<String> iInvolvedClusters,
long iExecutionTime)
Pushes record to cache.
|
void |
remove(OSecurityUser iUser,
String queryText,
int iLimit)
Removes result of query.
|
OCommandCacheSoftRefs |
setEvictStrategy(OCommandCache.STRATEGY evictStrategy) |
OCommandCacheSoftRefs |
setMaxResultsetSize(int maxResultsetSize) |
OCommandCacheSoftRefs |
setMinExecutionTime(int minExecutionTime) |
void |
shutdown()
All operations running at cache destruction stage.
|
int |
size()
Total number of stored queries.
|
void |
startup()
All operations running at cache initialization stage.
|
public OCommandCacheSoftRefs(OStorage storage)
public void changeConfig(ODocument cfg)
protected void configure()
public void startup()
OCommandCache
startup
in interface OCommandCache
public void shutdown()
OCommandCache
shutdown
in interface OCommandCache
protected boolean deleteFileIfExists()
public boolean isEnabled()
OCommandCache
isEnabled
in interface OCommandCache
true
if cache enabled at call time, otherwise - false
public OCommandCacheSoftRefs enable()
OCommandCache
enable
in interface OCommandCache
public OCommandCacheSoftRefs disable()
OCommandCache
disable
in interface OCommandCache
public Object get(OSecurityUser iUser, String queryText, int iLimit)
OCommandCache
get
in interface OCommandCache
public void put(OSecurityUser iUser, String queryText, Object iResult, int iLimit, Set<String> iInvolvedClusters, long iExecutionTime)
OCommandCache
put
in interface OCommandCache
public void remove(OSecurityUser iUser, String queryText, int iLimit)
OCommandCache
remove
in interface OCommandCache
public OCommandCacheSoftRefs clear()
OCommandCache
clear
in interface OCommandCache
public int size()
OCommandCache
size
in interface OCommandCache
public void invalidateResultsOfCluster(String iCluster)
OCommandCache
invalidateResultsOfCluster
in interface OCommandCache
iCluster
- Cluster namepublic int getMinExecutionTime()
public OCommandCacheSoftRefs setMinExecutionTime(int minExecutionTime)
public int getMaxResultsetSize()
getMaxResultsetSize
in interface OCommandCache
public OCommandCacheSoftRefs setMaxResultsetSize(int maxResultsetSize)
public OCommandCache.STRATEGY getEvictStrategy()
getEvictStrategy
in interface OCommandCache
public OCommandCacheSoftRefs setEvictStrategy(OCommandCache.STRATEGY evictStrategy)
protected String getKey(OSecurityUser iUser, String queryText, int iLimit)
public Set<Map.Entry<String,OCommandCacheSoftRefs.OCachedResult>> entrySet()
public static boolean clearFiles(OAbstractPaginatedStorage storage)
Copyright © 2009–2020 OrientDB. All rights reserved.