DODS 6.5 API

org.enhydra.dods.cache
Class QueryCache

java.lang.Object
  extended byorg.enhydra.dods.cache.ConfigurationAdministration
      extended byorg.enhydra.dods.cache.DataStructCache
          extended byorg.enhydra.dods.cache.QueryCache
Direct Known Subclasses:
QueryCacheImpl

public abstract class QueryCache
extends DataStructCache

This abstract class contains data and mechanisms needed for caching data objects (or DataStruct objects) and queries and provides cache configuration and administration.

Version:
2.0 15.06.2003.
Author:
Tanja Jovanovic, Nenad Vico, Zorica Suvajdzin

Constructor Summary
QueryCache()
           
 
Method Summary
abstract  QueryCacheItem addComplexQuery(QueryCacheItem queryItem)
          Adds complex query to complex query cache.
abstract  QueryCacheItem addMultiJoinQuery(QueryCacheItem queryItem)
          Adds multi join query to complex query cache.
abstract  QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)
          Adds simple query to simple query cache.
abstract  void emptyEntries()
           
abstract  void emptyEntries(java.util.Vector vec, boolean incrementVersion)
           
abstract  CacheAdministration getCacheAdministration(int cacheType)
          Returns CacheAdministration for data object (or DataStruct object) cache, simple, or complex query cache.
abstract  QueryCacheItem getComplexQueryCacheItem(java.lang.String dbName, java.lang.String query)
          Returns QueryCacheItem object for specified database and complex query, if exists, otherwise null.
abstract  QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from complex query cache.
abstract  QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb)
          Returns query results from complex query cache.
abstract  QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb, boolean unique)
          Returns query results from complex query cache.
abstract  QueryCacheItem getMultiJoinQueryCacheItem(java.lang.String dbName, java.lang.String query)
          Returns QueryCacheItem object for specified database and multi join query, if exists, otherwise null.
abstract  QueryResult getMultiJoinQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from multi join query cache.
abstract  QueryResult getMultiJoinQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb)
          Returns query results from multi join query cache.
abstract  QueryResult getMultiJoinQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb, boolean unique)
          Returns query results from multi join query cache.
abstract  QueryResult getQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from simple or complex query cache.
abstract  QueryCacheItem getSimpleQueryCacheItem(java.lang.String dbName, java.lang.String query)
          Returns QueryCacheItem object for specified database and simple query, if exists, otherwise null.
abstract  QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from simple query cache.
abstract  QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb)
          Returns query results from simple query cache.
abstract  QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb, boolean unique)
          Returns query results from simple query cache.
protected  boolean isLockedMultiJoinQCache()
           
protected  boolean isLockedSimpleComplexQCache()
           
abstract  void makeInvisible(java.lang.String cacheHandle)
           
abstract  void makeVisible(java.lang.String cacheHandle)
           
abstract  QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)
          Creates new QueryCacheItem instance.
abstract  QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)
          Removes complex query from complex query cache.
abstract  void removeEntries()
           
abstract  void removeEntries(java.util.Vector vec)
           
abstract  QueryCacheItem removeMultiJoinQuery(QueryCacheItem queryItem)
          Removes multi join query from complex query cache.
abstract  QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)
          Removes simple query from simple query cache.
 
Methods inherited from class org.enhydra.dods.cache.DataStructCache
addDataStruct, deleteDataStruct, getCacheContent, getDataStructByHandle, isLocked, isMulti, newInstance, removeDataStruct, removeDataStruct, toReconfigure, updateDataStruct
 
Methods inherited from class org.enhydra.dods.cache.ConfigurationAdministration
checkFull, getCachePercentage, getCacheType, getInitialCacheFetchSize, getInitialDSCacheSize, getInitialQueryCache, getLevelOfCaching, getReserveFactor, getStatistics, getTableConfiguration, isDisabled, isFull, readConfiguration, refreshStatistics, setCachePercentage, setInitialCacheFetchSize, setInitialDSCacheSize, setInitialQueryCache, setReserveFactor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryCache

public QueryCache()
Method Detail

newQueryCacheItemInstance

public abstract QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)
Creates new QueryCacheItem instance.

Parameters:
dbName - Database name.
Returns:
Created QueryCacheItem.

getSimpleQueryCacheItem

public abstract QueryCacheItem getSimpleQueryCacheItem(java.lang.String dbName,
                                                       java.lang.String query)
Returns QueryCacheItem object for specified database and simple query, if exists, otherwise null.

Parameters:
dbName - Database name.
query - Query in form of String.
Returns:
QueryCacheItem object.

getComplexQueryCacheItem

public abstract QueryCacheItem getComplexQueryCacheItem(java.lang.String dbName,
                                                        java.lang.String query)
Returns QueryCacheItem object for specified database and complex query, if exists, otherwise null.

Parameters:
dbName - Database name.
query - Query in form of String.
Returns:
QueryCacheItem object.

getMultiJoinQueryCacheItem

public abstract QueryCacheItem getMultiJoinQueryCacheItem(java.lang.String dbName,
                                                          java.lang.String query)
Returns QueryCacheItem object for specified database and multi join query, if exists, otherwise null.

Parameters:
dbName - Database name.
query - Query in form of String.
Returns:
QueryCacheItem object.

addSimpleQuery

public abstract QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)
Adds simple query to simple query cache.

Parameters:
queryItem - Query that will be added to simple query cache.
Returns:
Query added to simple query cache.

removeSimpleQuery

public abstract QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)
Removes simple query from simple query cache.

Parameters:
queryItem - QueryItem that will be removed from simple query cache.
Returns:
QueryItem removed from simple query cache.

addComplexQuery

public abstract QueryCacheItem addComplexQuery(QueryCacheItem queryItem)
Adds complex query to complex query cache.

Parameters:
queryItem - Query that will be added to complex query cache.
Returns:
Query added to complex query cache.

removeComplexQuery

public abstract QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)
Removes complex query from complex query cache.

Parameters:
queryItem - Query that will be removed from complex query cache.
Returns:
Query removed from complex query cache.

addMultiJoinQuery

public abstract QueryCacheItem addMultiJoinQuery(QueryCacheItem queryItem)
Adds multi join query to complex query cache.

Parameters:
queryItem - Query that will be added to multi join query cache.
Returns:
Query added to multi join query cache.

removeMultiJoinQuery

public abstract QueryCacheItem removeMultiJoinQuery(QueryCacheItem queryItem)
Removes multi join query from complex query cache.

Parameters:
queryItem - Query that will be removed from multi join query cache.
Returns:
Query removed from multi join query cache.

getSimpleQueryResults

public abstract QueryResult getSimpleQueryResults(java.lang.String dbName,
                                                  java.lang.String query)
Returns query results from simple query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in simple query cache.
Returns:
Query results retrieved from simple cache, or null, if there are no results retrieved from simple query cache.

getSimpleQueryResults

public abstract QueryResult getSimpleQueryResults(java.lang.String dbName,
                                                  java.lang.String query,
                                                  int limit,
                                                  int maxdb)
Returns query results from simple query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in simple query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
Returns:
Query results retrieved from simple cache, or null, if there are no results retrieved from simple query cache.

getSimpleQueryResults

public abstract QueryResult getSimpleQueryResults(java.lang.String dbName,
                                                  java.lang.String query,
                                                  int limit,
                                                  int maxdb,
                                                  boolean unique)
Returns query results from simple query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in simple query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
unique - If true, only unique results are returned.
Returns:
Query results retrieved from simple cache, or null, if there are no results retrieved from simple query cache.

getComplexQueryResults

public abstract QueryResult getComplexQueryResults(java.lang.String dbName,
                                                   java.lang.String query)
Returns query results from complex query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in complex query cache.
Returns:
Query results retrieved from complex cache, or null, if there are no results retrieved from complex query cache.

getComplexQueryResults

public abstract QueryResult getComplexQueryResults(java.lang.String dbName,
                                                   java.lang.String query,
                                                   int limit,
                                                   int maxdb)
Returns query results from complex query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in complex query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
Returns:
Query results retrieved from complex cache, or null, if there are no results retrieved from complex query cache.

getComplexQueryResults

public abstract QueryResult getComplexQueryResults(java.lang.String dbName,
                                                   java.lang.String query,
                                                   int limit,
                                                   int maxdb,
                                                   boolean unique)
Returns query results from complex query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in complex query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
unique - If true, only unique results are returned.
Returns:
Query results retrieved from complex cache, or null, if there are no results retrieved from complex query cache.

getMultiJoinQueryResults

public abstract QueryResult getMultiJoinQueryResults(java.lang.String dbName,
                                                     java.lang.String query)
Returns query results from multi join query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in multi join query cache.
Returns:
Query results retrieved from multi join cache, or null, if there are no results retrieved from multi join query cache.

getMultiJoinQueryResults

public abstract QueryResult getMultiJoinQueryResults(java.lang.String dbName,
                                                     java.lang.String query,
                                                     int limit,
                                                     int maxdb)
Returns query results from multi join query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in multi join query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
Returns:
Query results retrieved from multi join cache, or null, if there are no results retrieved from multi join query cache.

getMultiJoinQueryResults

public abstract QueryResult getMultiJoinQueryResults(java.lang.String dbName,
                                                     java.lang.String query,
                                                     int limit,
                                                     int maxdb,
                                                     boolean unique)
Returns query results from multi join query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in multi join query cache.
limit - Specified number of results (database limit and read skip).
maxdb - Number of rows retrieved from database (or cache).
unique - If true, only unique results are returned.
Returns:
Query results retrieved from multi join cache, or null, if there are no results retrieved from multi join query cache.

getQueryResults

public abstract QueryResult getQueryResults(java.lang.String dbName,
                                            java.lang.String query)
Returns query results from simple or complex query cache.

Parameters:
dbName - Database name.
query - Query for which are results searched in simple and complex query cache.
Returns:
Query results retrieved from simple or complex cache, or null, if there are no results retrieved from simple and complex query cache.

isLockedSimpleComplexQCache

protected final boolean isLockedSimpleComplexQCache()

isLockedMultiJoinQCache

protected final boolean isLockedMultiJoinQCache()

removeEntries

public abstract void removeEntries(java.util.Vector vec)

removeEntries

public abstract void removeEntries()

emptyEntries

public abstract void emptyEntries(java.util.Vector vec,
                                  boolean incrementVersion)

emptyEntries

public abstract void emptyEntries()

makeInvisible

public abstract void makeInvisible(java.lang.String cacheHandle)

makeVisible

public abstract void makeVisible(java.lang.String cacheHandle)

getCacheAdministration

public abstract CacheAdministration getCacheAdministration(int cacheType)
Description copied from class: ConfigurationAdministration
Returns CacheAdministration for data object (or DataStruct object) cache, simple, or complex query cache. Object CacheAdministration handles configuration settings about these caches. Parameter cacheType can have one of these values: 0 - for CacheAdministration of data object (or DataStruct object) cache 1 - for CacheAdministration of simple query cache 2 - for CacheAdministration of complex query cache

Specified by:
getCacheAdministration in class ConfigurationAdministration
Parameters:
cacheType - 0 - for data object (or DataStruct object), 1 for simple query and 2 for complex query cache.

DODS 6.5 API