|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
com.tangosol.util.SafeHashMap
com.tangosol.net.cache.OldCache
com.tangosol.net.cache.LocalCache
com.jivesoftware.util.CoherenceCache
com.jivesoftware.forum.database.ShortTermQueryCache
public class ShortTermQueryCache
An extension of the default cache to temporarily store query results before they are reloaded from the databases. Objects are automatically moved from a long-term cache into a short-term cache (instance of this class). When accessed for the first time, a query update task is scheduled to reload the data from the database and then move the cache entry from the short-term cache to the long-term cache. This system guarantees that threads are never blocked on trying to read data from query results after cache entry invalidations. This is important for sites with extreme performance needs. The consequence is that query results are not always "fresh". For example, a new thread may not appear in the list of threads in a forum until a short amount of time has passed.
Nested Class Summary | |
---|---|
class |
ShortTermQueryCache.Entry
|
static class |
ShortTermQueryCache.ValueWrapper
Wraps an items going into the Short-term query cache and includes the ID of the cluster member that put the value into cache. |
Nested classes/interfaces inherited from class com.tangosol.net.cache.LocalCache |
---|
com.tangosol.net.cache.LocalCache.InternalListener, com.tangosol.net.cache.LocalCache.KeyMask |
Nested classes/interfaces inherited from class com.tangosol.net.cache.OldCache |
---|
com.tangosol.net.cache.OldCache.EntrySet, com.tangosol.net.cache.OldCache.EvictionPolicy, com.tangosol.net.cache.OldCache.KeySet, com.tangosol.net.cache.OldCache.UnitCalculator, com.tangosol.net.cache.OldCache.ValuesCollection |
Field Summary |
---|
Fields inherited from class com.tangosol.net.cache.LocalCache |
---|
DEFAULT_EXPIRE, DEFAULT_KEY_MASK, DEFAULT_UNITS |
Fields inherited from class com.tangosol.net.cache.OldCache |
---|
DEFAULT_FLUSH, DEFAULT_PRUNE, EVICTION_POLICY_EXTERNAL, EVICTION_POLICY_HYBRID, EVICTION_POLICY_LFU, EVICTION_POLICY_LRU, m_calculator, m_cCurUnits, m_cExpiryDelay, m_cFlushDelay, m_cMaxUnits, m_cPruneUnits, m_listenerSupport, m_lNextFlush, m_nCalculatorType, m_nEvictionType, m_policy, m_stats, UNIT_CALCULATOR_BINARY, UNIT_CALCULATOR_EXTERNAL, UNIT_CALCULATOR_FIXED |
Fields inherited from class com.tangosol.util.SafeHashMap |
---|
BIGGEST_MODULO, DEFAULT_GROWTHRATE, DEFAULT_INITIALSIZE, DEFAULT_LOADFACTOR, m_aeBucket, m_cCapacity, m_cEntries, m_colValues, m_flGrowthRate, m_flLoadFactor, m_oIterActive, m_setEntries, m_setKeys, PRIME_MODULO, RESIZING |
Fields inherited from interface com.tangosol.net.cache.CacheMap |
---|
EXPIRY_DEFAULT, EXPIRY_NEVER |
Constructor Summary | |
---|---|
ShortTermQueryCache()
Default constructor for coherence to create instances. |
|
ShortTermQueryCache(int maxSize)
|
|
ShortTermQueryCache(int maxSize,
int maxLifetime)
|
|
ShortTermQueryCache(int maxSize,
int maxLifetime,
com.tangosol.net.cache.CacheLoader loader)
|
|
ShortTermQueryCache(java.lang.String name,
int maxSize,
long maxLifetime)
Create a new cache and specify the maximum size of for the cache in bytes, and the maximum lifetime of objects. |
Method Summary | |
---|---|
com.tangosol.util.SafeHashMap.Entry |
getEntry(java.lang.Object key)
|
edu.emory.mathcs.backport.java.util.concurrent.Executor |
getExecutor()
Returns the executor used to process background updates of cache items. |
protected static int |
getMemberID()
Returns the cluster member ID, or 1 if clustering isn't enabled. |
protected com.tangosol.util.SafeHashMap.Entry |
instantiateEntry()
|
Methods inherited from class com.jivesoftware.util.CoherenceCache |
---|
getCacheSize, getMaxCacheSize, getMaxLifetime, getName, put, setMaxCacheSize, setMaxLifetime, setName |
Methods inherited from class com.tangosol.net.cache.LocalCache |
---|
clear, get, getAll, getCacheLoader, getCacheStore, getKeyMask, instantiateInternalListener, instantiateMapEvent, load, loadAll, loadAll, peek, peekAll, remove, removeExpired, setCacheLoader, setKeyMask |
Methods inherited from class com.tangosol.net.cache.OldCache |
---|
addMapListener, addMapListener, addMapListener, adjustUnits, checkFlush, checkSize, configureEviction, configureUnitCalculator, containsKey, deferFlush, dispatchEvent, evict, evict, evictAll, getCacheHits, getCacheMisses, getCacheStatistics, getEntryInternal, getEvictionPolicy, getEvictionType, getExpiryDelay, getFlushDelay, getFlushTime, getHighUnits, getHitProbability, getLowUnits, getMapListenerSupport, getUnitCalculator, getUnitCalculatorType, getUnits, hasListeners, instantiateEntrySet, instantiateKeySet, instantiateValuesCollection, prune, put, removeMapListener, removeMapListener, removeMapListener, resetHitStatistics, scheduleFlush, setEvictionPolicy, setEvictionType, setExpiryDelay, setFlushDelay, setFlushTime, setHighUnits, setLowUnits, setUnitCalculator, setUnitCalculatorType, size, toString |
Methods inherited from class com.tangosol.util.SafeHashMap |
---|
clone, cloneEntryList, entrySet, getBucketIndex, getStableBucketArray, grow, isActiveIterator, isEmpty, iteratorActivated, iteratorDeactivated, keySet, removeEntryInternal, values |
Methods inherited from class java.util.AbstractMap |
---|
containsValue, equals, hashCode, putAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jivesoftware.util.Cache |
---|
getCacheHits, getCacheMisses |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from interface com.tangosol.net.cache.CacheMap |
---|
put |
Methods inherited from interface com.tangosol.util.ObservableMap |
---|
addMapListener, addMapListener, addMapListener, removeMapListener, removeMapListener, removeMapListener |
Constructor Detail |
---|
public ShortTermQueryCache()
public ShortTermQueryCache(int maxSize)
public ShortTermQueryCache(int maxSize, int maxLifetime)
public ShortTermQueryCache(int maxSize, int maxLifetime, com.tangosol.net.cache.CacheLoader loader)
public ShortTermQueryCache(java.lang.String name, int maxSize, long maxLifetime)
name
- a name for the cache.maxSize
- the maximum size of the cache in bytes.maxLifetime
- the maximum amount of time objects can exist in
cache before being deleted. -1 means objects never expire.Method Detail |
---|
public edu.emory.mathcs.backport.java.util.concurrent.Executor getExecutor()
public com.tangosol.util.SafeHashMap.Entry getEntry(java.lang.Object key)
getEntry
in class com.tangosol.net.cache.LocalCache
protected static int getMemberID()
protected com.tangosol.util.SafeHashMap.Entry instantiateEntry()
instantiateEntry
in class CoherenceCache
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |