|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.dataengine.cache.CacheManager
Manages all of the DataEngine's caches.
Field Summary | |
static int |
CACHING_OFF
Completely disables caching. |
static short |
CLEAR_ON_UPDATES
An update, delete, or insert will remove all RowCollections retrieved from the affected table from the cache. |
static boolean |
cTrackCache
Flag to indicate if cache tracking should be done. |
static boolean |
cWriteCacheToFile
Flag to indicate if cache tracking should be written to a file. |
static short |
IGNORE_UPDATES
Updates, inserts, and deletes do not affect the cache |
static byte |
SMART_CACHING_COMPLETE
Enable smart caching across all aliases |
static byte |
SMART_CACHING_OFF
Don't use smart caching |
static byte |
SMART_CACHING_PER_ALIAS
Enable smart caching only within the same alias |
static int |
SYSTEM_LEVEL_CACHE
Uses a single cache for each system |
Method Summary | |
void |
clearAll()
Removes all entries from all caches. |
RowCollection |
get(SQLContext key)
Gets a RowCollection out of the cache, based on the SQLContext. |
Map |
getAllCaches()
Returns a Map containing all the caches being managed. |
DataEngineCache |
getCache(SQLContext context)
Gets the appropriate cache for the SQLContext. |
int |
getCachingLevel()
Gets the caching level. |
long |
getEstimatedSize()
Gets the estimated number of bytes of all field values take up in every RowCollection in cache. |
int |
getGlobalTimeout()
Gets the timeout value (in seconds) for all caches. |
static CacheManager |
getInstance()
Gets the CacheManager instance. |
byte |
getSmartCachingLevel()
Gets the smart caching level |
short |
getUpdatePolicy()
Gets the update policy. |
static boolean |
isCacheTrackingOn()
Check to see if caching should be tracked. |
static boolean |
isCacheTrackingWrittenToFile()
Check to see if cache tracking should be written to a file. |
void |
put(SQLContext key,
RowCollection results)
Puts a RowCollection in the cache, keyed by the SQLContext. |
RowCollection |
remove(SQLContext key)
Removes a RowCollection from the cache, based on the SQLContext. |
void |
rowAltered(SQLContext context,
ExecutingContext ec,
long timestamp)
This method is invoked when a single row is deleted, inserted, or updated. |
static void |
setCacheTrackingOff()
Turn cache tracking off. |
static void |
setCacheTrackingOn()
Turn cache tracking on. |
static void |
setCacheTrackingTime(long period)
Set the time period to which cache tracking is to be run |
static void |
setCacheTrackingWrittenToFileOff()
Turn cache tracking written to file off. |
static void |
setCacheTrackingWrittenToFileOn()
Turn cache tracking written to file on. |
void |
setCachingLevel(int cacheLevel)
Sets the caching level. |
void |
setGlobalTimeout(int seconds)
Sets the timeout value (in seconds) for all caches. |
static void |
setInstance(CacheManager instance)
Sets the CacheManager instance. |
void |
setSmartCachingLevel(byte smartCaching)
Sets the smart caching level |
void |
setUpdatePolicy(short pUpdatePolicy)
Sets the update policy. |
static CacheManager |
singleton()
Gets the CacheManager instance. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CACHING_OFF
public static boolean cTrackCache
public static boolean cWriteCacheToFile
public static final int SYSTEM_LEVEL_CACHE
public static final short IGNORE_UPDATES
public static final short CLEAR_ON_UPDATES
public static final byte SMART_CACHING_OFF
public static final byte SMART_CACHING_PER_ALIAS
public static final byte SMART_CACHING_COMPLETE
Method Detail |
public void clearAll()
public RowCollection get(SQLContext key) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
public Map getAllCaches()
public DataEngineCache getCache(SQLContext context) throws DataEngineException
DataEngineException
public final int getCachingLevel()
CACHING_OFF
or
SINGLE_CACHE
describing what level of caching will be used.public long getEstimatedSize()
public int getGlobalTimeout()
public static final CacheManager getInstance()
public byte getSmartCachingLevel()
public final short getUpdatePolicy()
IGNORE_UPDATES
or
CLEAR_ON_UPDATES
(the default) describing what the update policy will bepublic static boolean isCacheTrackingOn()
public static boolean isCacheTrackingWrittenToFile()
public void put(SQLContext key, RowCollection results) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
public RowCollection remove(SQLContext key) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
public void rowAltered(SQLContext context, ExecutingContext ec, long timestamp) throws CMException
context
- The SQLContext containing the alteration informationec
- The current executing contexttimestamp
- The time associated with the alteration
CMException
public void setCachingLevel(int cacheLevel)
cacheLevel
- One of the constants such as CACHING_OFF
or
SYSTEM_LEVEL_CACHE
describing what level of caching will be used.public static void setCacheTrackingOff()
public static void setCacheTrackingOn()
public static void setCacheTrackingTime(long period)
public static void setCacheTrackingWrittenToFileOn()
public static void setCacheTrackingWrittenToFileOff()
public void setGlobalTimeout(int seconds)
public static void setInstance(CacheManager instance)
public void setSmartCachingLevel(byte smartCaching)
public void setUpdatePolicy(short pUpdatePolicy)
pUpdatePolicy
- One of the constants such as IGNORE_UPDATES
(the default) or
CLEAR_ON_UPDATES
describing what the update policy will bepublic static final CacheManager singleton()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |