| com.jofti.cache.IBaseAdaptor
All known Subclasses: com.jofti.cache.BaseAdaptor,
IBaseAdaptor | public interface IBaseAdaptor (Code) | | |
acquireQueryLock | abstract public void acquireQueryLock() throws JoftiException(Code) | | Attempts to acquire a query lock for the cache. Multiple queries can run
in parallel as the Index itself is threadsafe and the assumption is that the Cache is also.
However, queries and updates cannot run at the same time to prevent situations where if multiple
nodes in the index are updated by one update then a query which runs at the same time may well misreport
a match that should be returned if they were run in sequence.
throws: JoftiException - |
acquireUpdateLock | abstract public void acquireUpdateLock() throws JoftiException(Code) | | Attempts to acquire an update lock for the cache. Multiple updates can run
in parallel as the Index itself is threadsafe and the assumption is that the Cache is also.
However, queries and updates cannot run at the same time to prevent situations where if multiple
nodes in the index are updated by one update then a query which runs at the same time may well misreport
a match that should be returned if they were run in sequence.
throws: JoftiException - |
decorateKey | abstract public Object decorateKey(Object key)(Code) | | A utility method that decorates a Cache key with a comparable wrapper if the key itself is not Comparable. This wrapper
is not propogated into the Cache, but is used to wrap the key when placed in the Index.
Parameters: key - Either an instance of a NonComparableKeyWrapper if the key is not Comparable or the original key object. |
getCacheLock | abstract public Object getCacheLock(Object key)(Code) | | Gets a cache lock based on the mod of the hashcode of the key
Parameters: key - - a lock Object |
getCacheValues | abstract public Map getCacheValues(Map col, IParsedQuery query, ClassIntrospector introspector) throws JoftiException(Code) | | Takes a map containing the key values returned from the Index for the Query. The keys
are the primary keys in the Cache.
This is the default implementation that loops through the returned keys and extracts the appropriate value
from the Cache. This method is also responsible for checking if the value has changed since it was last
indexed or if the value is no longer in the Cache excluding it from the returned results.
Parameters: col - A Map of result keys A Map of key/value results. throws: JoftiException - Thrown if the retrieval from the cache throws an exception |
getIndex | abstract public InternalIndex getIndex()(Code) | | Returns the Index instance from the adapter.
the internal index implementation |
limitResults | public Map limitResults(Map temp, int startResult, int maxResults)(Code) | | Takes a fully populated result set and applies any of the limiting steps defined in the
maxResults or startResults. 0 for both values is considered a no-op. Negative values throw a runtime exception.
a Start Value larger than the result original size will return no results, a maxResults large than the result size
is reset to temp.size().
Parameters: temp - the original result set Parameters: startResult - an int defining at which record the record set should begin Parameters: maxResults - an int defining the maximum number of records to return. the result set |
processQuery | public IndexQuery processQuery(IndexQuery query, ParserManager manager) throws JoftiException(Code) | | Normalises the query format for convenience queries or processes one the unparsed text query formats
into its parsed form.
Parameters: query - an unparsed query Parameters: manager - the Parser Manager that stores the mappings for the query the parsed query |
releaseQueryLock | abstract public void releaseQueryLock()(Code) | | Releases a query lock.
|
releaseUpdateLock | abstract public void releaseUpdateLock()(Code) | | Releases an update lock.
|
stripKey | abstract public Object stripKey(Object key)(Code) | | A utility method that strips a decorated Cache key of its comparable wrapper if it has been previously decorated by the decorate method.
Parameters: key - The object wrapped in a NonComparableKeyWrapper if wrapped or the original object if not. |
|
|