public class UpdateTimestampsCache extends Object
Tracks the timestamps of the most recent updates to particular tables. It is important that the cache timeout of the underlying cache implementation be set to a higher value than the timeouts of any of the query caches. In fact, we recommend that the the underlying cache not be configured for expiry at all. Note, in particular, that an LRU cache expiry policy is never appropriate.
Modifier and Type | Field and Description |
---|---|
static String |
REGION_NAME
The region name of the update-timestamps cache.
|
Constructor and Description |
---|
UpdateTimestampsCache(SessionFactoryImplementor sessionFactory,
TimestampsRegion region)
Constructs an UpdateTimestampsCache.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the update-timestamps data.
|
void |
destroy()
Destroys the cache.
|
TimestampsRegion |
getRegion()
Get the underlying cache region where data is stored..
|
void |
invalidate(Serializable[] spaces,
SharedSessionContractImplementor session)
Perform invalidation.
|
boolean |
isUpToDate(Set<Serializable> spaces,
Long timestamp,
SharedSessionContractImplementor session)
Perform an up-to-date check for the given set of query spaces.
|
void |
preInvalidate(Serializable[] spaces,
SharedSessionContractImplementor session)
Perform pre-invalidation.
|
String |
toString() |
public static final String REGION_NAME
The region name of the update-timestamps cache.
public UpdateTimestampsCache(SessionFactoryImplementor sessionFactory, TimestampsRegion region)
Constructs an UpdateTimestampsCache.
sessionFactory
- The SessionFactoryregion
- The underlying second level cache region to use.public void preInvalidate(Serializable[] spaces, SharedSessionContractImplementor session) throws CacheException
Perform pre-invalidation.
spaces
- The spaces to pre-invalidatesession
- CacheException
- Indicated problem delegating to underlying region.public void invalidate(Serializable[] spaces, SharedSessionContractImplementor session) throws CacheException
Perform invalidation.
spaces
- The spaces to invalidate.session
- CacheException
- Indicated problem delegating to underlying region.public boolean isUpToDate(Set<Serializable> spaces, Long timestamp, SharedSessionContractImplementor session) throws CacheException
Perform an up-to-date check for the given set of query spaces.
spaces
- The spaces to checktimestamp
- The timestamp against which to check.session
- CacheException
- Indicated problem delegating to underlying region.public void clear() throws CacheException
Clear the update-timestamps data.
CacheException
- Indicates problem delegating call to underlying region.public void destroy()
Destroys the cache.
CacheException
- Indicates problem delegating call to underlying region.public TimestampsRegion getRegion()
Get the underlying cache region where data is stored..
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.