|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IQueryCache
IQueryCache.java A public interface for query cache. It serves as the actual interface to query cache implementation by other projects.
| Method Summary | |
|---|---|
java.lang.String |
addQuery(java.lang.String query,
java.lang.Object metadata)
Store reference to the AbstractQueryProcessor object that processes this queryso that we can in a later stage use the query analysis with query result to build a semantic cache entry for the query . |
void |
addQueryResult(java.lang.String queryID,
java.lang.Object resultObj)
Add a new query to cache. |
int |
addSubQueryResult(java.lang.String queryID,
java.lang.String subQuery,
java.lang.Object resultObj)
Add result of a sub-query of a query in the cache. |
java.util.List |
getCachedQueries()
Return external queries of all cached items |
ASG |
getExactQuery(java.lang.String query)
Check in the cache for an exact query match. |
ASG |
getExactSubQuery(java.lang.String subQuery)
Check sub-query existence in the whole cache. |
ASG |
getExactSubQuery(java.lang.String queryID,
java.lang.String subQuery)
Check if result of the sub-query of a query already exists in the cache. |
ASG[] |
getQuery(java.lang.String query)
Check in the cache for a similar query match. |
java.lang.Object[] |
getQueryMetadataObjects()
Return an array of metadata objects associated to the query objects |
| Methods inherited from interface uk.ac.ic.doc.automed.util.cache.Cacheable |
|---|
addListener, clear, getContentObject, notifyListeners, refresh |
| Methods inherited from interface java.util.Iterator |
|---|
hasNext, next, remove |
| Methods inherited from interface uk.ac.ic.doc.rodex.qproc.QueryRewritable |
|---|
rewrite |
| Method Detail |
|---|
void addQueryResult(java.lang.String queryID,
java.lang.Object resultObj)
throws CacheIntegrityException
AbstractQueryProcessor whose result was added to this cache.
Query result is often retrieved and later added to the cache at the execution phase
queryID - the unique query identifier (generated by #addQuery(String query, String fQuery, String sQuery,
String iQuery, Object metadata, Object qproc) methodresultObj - the result object from query execution
CacheIntegrityException
int addSubQueryResult(java.lang.String queryID,
java.lang.String subQuery,
java.lang.Object resultObj)
throws CacheIntegrityException
List object)
of the query cache item.
Each query's sub result is represented as a two-dimensional array as follows:
Object[] subResult = new Object[] {subQuery, subQueryResult}
queryID - the id of the parent querysubQuery - sub-query stringresultObj - sub-query result object
CacheIntegrityException
java.lang.String addQuery(java.lang.String query,
java.lang.Object metadata)
throws CacheIntegrityException
AbstractQueryProcessor object that processes this query
query - the original (external) IQL query posed by userfQuery - the formulated querysQuery - the executional representation of the queryiQuery - the internal representation of the query. This is the primary query id.metadata - the metadata object of the query (e.g. QueryAnalyser)qproc - the AbstractQueryProcessor object
CacheIntegrityExceptionASG getExactQuery(java.lang.String query)
ASGs.
query - the query string must be in internal format
ASG getExactSubQuery(java.lang.String queryID,
java.lang.String subQuery)
throws CacheIntegrityException
queryID - the ID of query to which the sub-query is associatedsubQuery - sub-query to search for
null if sub-query is not found
CacheIntegrityExceptionASG getExactSubQuery(java.lang.String subQuery)
throws CacheIntegrityException
subQuery - sub-query to search for
null if sub-query is not foundASG[] getQuery(java.lang.String query)
ASGs.
query - the query string must be in external format
java.util.List getCachedQueries()
List a list of all metadata objects in the cache OR null java.lang.Object[] getQueryMetadataObjects()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||