This class defines the minimal functionnalities that a request cache must
provide.
Only read requests (SELECTs) can be cached, there is no
sense to cache writes as they do not provide any result to cache. However,
the cache must be notified of the write queries in order to maintain cache
coherency.
author: Emmanuel Cecchet author: Nicolas Modrzyk version: 1.0
Add precise management and configuration of the cache behavior. A cache
rule contains information on a query pattern and how to act if that pattern
was matched.
Parameters: rule - of action for the cache See Also:org.continuent.sequoia.controller.cache.result.ResultCacheRule
Adds an entry request/reply to the cache. Note that if the request was
already in the cache, its result must be updated in any case but the
request must never appear twice in the cache.
Parameters: request - the request Parameters: result - the result corresponding to the request exception: CacheException - if an error occurs
Gets the result to the given request from the cache.
The returned AbstractResultCacheEntry is null
if the request is not present in the cache.
An invalid CacheEntry may be returned (it means that the
result is null) but the already parsed query can be
retrieved from the cache entry.
Parameters: request - an SQL select request Parameters: addToPendingQueries - true if the request must be added to the pendingquery list on a cache miss the AbstractResultCacheEntry if found, else null
Returns true if the cache does not contain the values that are given in the
update statement.
Parameters: request - the update request that needs to be executed false if the request shouldn't be executed, true otherwise. exception: CacheException - if an error occurs
Removes an entry from the cache (both request and reply are dropped). The
request is NOT removed from the pending query list, but it shouldn't be in
this list.
Parameters: request - a SelectRequest
Notifies the cache that the given write request has been issued, so that
cache coherency can be maintained. If the cache is distributed, this method
is reponsible for broadcasting this information to other caches.
Parameters: request - an AbstractWriteRequest value exception: CacheException - if an error occurs