|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.orm.hibernate.support.HibernateDaoSupport
ca.uhn.cache.internal.impl.HibernateChunkStore
Hibernate-based implementation of IChunkStore
| Field Summary |
| Fields inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
logger |
| Constructor Summary | |
HibernateChunkStore(IStaleChunkRule theStaleChunkRule)
Constructor. |
|
| Method Summary | |
IChunk |
get(IQuery theQuery)
|
long |
getLowestVogueness()
|
int |
getNumCachedItems()
|
IStaleChunkRule |
getStaleChunkRule()
|
IChunkIterator |
getStaleChunks()
Implementation hint: to avoid doing a calculation during the query, store chunk with its expiry time, not its max age, and implement this method as "select chunks where expiry time earlier than now". |
IChunkIterator |
getUnusedChunks(long theVoguenessThreshold)
Returns chunks that have not been accessed recently. Specifically, those for which vogueness < theVoguenessThreshold. Recall from IUnusedChunkRule that vogueness = last access time + modifier. Implementation hint: to avoid doing a calculation during the query, store the modified version of last access time, and implement this method as "select chunks where mod_last_access earlier than theMaxAccessTime". |
IChunk |
put(IQuery theQuery,
VolatilityEnum theVolatility,
CacheReasonEnum[] theReasons)
Places a IChunk corresponding to the specified IQuery
in this IChunkStore. |
IChunk |
remove(IQuery theQuery)
Removes the mapping for this query from this IChunkStore if it is present |
| Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
afterPropertiesSet, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, initDao, setHibernateTemplate, setSessionFactory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.beans.factory.InitializingBean |
afterPropertiesSet |
| Constructor Detail |
public HibernateChunkStore(IStaleChunkRule theStaleChunkRule)
theStaleChunkRule - The rule to decide when the chunks will become stale.| Method Detail |
public IChunk get(IQuery theQuery)
get in interface IChunkStoretheQuery - The specified query.
IChunkStore maps the specified query, or
null if the IChunkStore contains no mapping for the query.
public IChunk put(IQuery theQuery,
VolatilityEnum theVolatility,
CacheReasonEnum[] theReasons)
IChunk corresponding to the specified IQuery
in this IChunkStore. If the IChunkStore previously contained
a mapping for this query, the value is replaced by a new IChunk with the new volatility
and reasons.
put in interface IChunkStoretheQuery - Query with which the chunk is to be associated.theVolatility - The volatility that will decide the length of stay in the cache. If there
is a mapping for this query currently in the cache, this will replace the old value.theReasons - The reasons that this chunk was cached. If there is a mapping for this query
currently in the cache, this will be appended to the old value.
public IChunk remove(IQuery theQuery)
IChunkStore if it is present
remove in interface IChunkStoretheQuery - Query whose mapping is to be removed from the IChunkStore.
public IChunkIterator getUnusedChunks(long theVoguenessThreshold)
getUnusedChunks in interface IChunkPurgertheVoguenessThreshold - chunks that have not been accessed since this time
(accounting for modifier) are to be returned
public IChunkIterator getStaleChunks()
getStaleChunks in interface IChunkPurgerpublic long getLowestVogueness()
getLowestVogueness in interface IChunkPurgerpublic int getNumCachedItems()
getNumCachedItems in interface IChunkPurgerpublic IStaleChunkRule getStaleChunkRule()
getStaleChunkRule in interface IChunkStore
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||