DODS 7.3 API

org.enhydra.dods.cache
Class TransactionCacheImpl

java.lang.Object
  extended by org.enhydra.dods.cache.ConfigurationAdministration
      extended by org.enhydra.dods.cache.DOCache
          extended by org.enhydra.dods.cache.TransactionQueryCache
              extended by org.enhydra.dods.cache.TransactionCacheImpl

public class TransactionCacheImpl
extends TransactionQueryCache

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

Version:
1.0 05.08.2003.
Author:
Tanja Jovanovic, Sinisa Milosevic

Field Summary
protected  DODSHashMap cache
          HashMap for storing data objects.
protected  CacheAdministration[] cacheAdministration
          Attribute cacheAdministration is array of three objects of the class CacheAdministration.
protected  double cachePercentage
           
protected  boolean completeCachingOn
          This attribute is true if the cache is complete, otherwise false.
protected  DODSCache complexQCache
          LRU cache for storing complex queries.
protected  boolean fullCachingOn
          This attribute is true if the cache is full, otherwise false.
protected  java.lang.String initialQueryCache
          Initial query statement.
protected  boolean multi
          This attribute contains information if multi databases are used.
protected  int oldComplexMaxCacheSize
          Old max complex cache size.
protected  int oldSimpleMaxCacheSize
          Old max simple cache size.
protected  double reserveFactor
          This attribute is used in query caching.
protected  DODSCache simpleQCache
          LRU cache for storing simple queries.
protected  Statistics statistics
          Table and cache statictics.
protected  TableConfiguration tableConf
          TableConfiguration attribute handles configuration settings about table of this cache.
 
Constructor Summary
TransactionCacheImpl()
          Constructor().
TransactionCacheImpl(int maxSQSize, int maxCQSize)
          Constructor(int, int).
 
Method Summary
 QueryCacheItem addComplexQuery(QueryCacheItem queryItem)
          Adds complex query to complex query cache.
 GenericDO addDO(GenericDO newDO)
          Adds DO (data object) to the cache.
 QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)
          Adds simple query to simple query cache.
 void checkFull()
          Checks if cache is full or not and updates apropriate internal variables.
 GenericDO deleteDO(GenericDO DO)
          Deletes DO from the cache.
 void emptyEntries(java.lang.Class tableClass)
          Dumps data structs for all instances of tableClass in transaction cache.
 void emptyEntries(java.util.Vector vec, boolean incrementVersion)
           
 int getAsynchLoadPriority()
          Returns priority of asynchronous cache initialization.
 CacheAdministration getCacheAdministration(int cacheType)
          Returns CacheAdministration for data object (or DataStruct object) cache, simple, or complex query cache.
 java.util.Map getCacheContent()
          Returns cache (data or DataStruct) content.
 double getCachePercentage()
          Read cache configuration from application's configuration file.
 java.lang.String getCacheType()
          Returns data object (or DataStruct object) cache type.
 QueryCacheItem getComplexQueryCacheItem(java.lang.String dbName, java.lang.String query)
          Returns QueryCacheItem object for specified database and complex query, if exists, otherwise null.
 QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from complex query cache.
 QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb)
          Returns query results from complex query cache.
 QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb, boolean unique)
          Returns query results from complex query cache.
 GenericDO getDOByHandle(java.lang.String handle)
          Returns data object whose String representation of OID is parameter handle.
 int getInitialCacheFetchSize()
           
 int getInitialDSCacheSize()
           
 java.lang.String getInitialQueryCache()
          Returns initialQueryCache.
 int getLevelOfCaching()
          Returns caching level.
 int getMaxExecuteTimeCacheInit()
          Returns the max time for which the query is not printed in application's log file durung the cache initialization.
 QueryResult getQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from simple or complex query cache.
 int getQueryTimeLimitCacheInit()
          Returns max number of milliseconds for which the query for cache initialization should be executed and the resulset read from ResultSet.
 int getQueryTimeoutCacheInit()
          Returns max number of seconds for which the query for cache initialization should be executed.
 double getReserveFactor()
          Returns reserveFactor.
 int getSimpleCacheRowCountLimit()
          Returns max number of rows in the table for which is simple cache still used.
 QueryCacheItem getSimpleQueryCacheItem(java.lang.String dbName, java.lang.String query)
          Returns QueryCacheItem object for specified database and simple query, if exists, otherwise null.
 QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query)
          Returns query results from simple query cache.
 QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb)
          Returns query results from simple query cache.
 QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query, int limit, int maxdb, boolean unique)
          Returns query results from simple query cache.
 Statistics getStatistics()
          Returns statistics of used table and caches.
 int getSynchLoadRowCountLimit()
          Returns the max number of rows in the table for which the synchronous cache load is performed if defined by configuration.
 TableConfiguration getTableConfiguration()
          Returns object TableConfiguration.
protected  void init()
          Creates array of three CacheAdministration objects.
 boolean isComplete()
          Returns information if data object (or DataStruct object) cache if "complete".
 boolean isDisabled()
          Returns information whether caching is disabled.
 boolean isFull()
          Returns information if data object (or DataStruct object) cache if "full".
 boolean isMulti()
          Returns information if multi databases are supported.
 DOCache newInstance()
          Creates TransactionCacheImpl instance.
 QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)
          Creates new QueryCacheItem instance.
 void readConfiguration(Config tableConfig, Config cacheConfig, java.lang.String dbName)
          Reads table and cache configuration from application's configuration file.
 void refreshStatistics()
          Refreshes statistics.
 QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)
          Removes complex query from complex query cache.
 GenericDO removeDO(GenericDO DO)
          Removes DO (data object) from the cache.
 GenericDO removeDO(java.lang.String handle)
          Removes DO (data object) from the cache.
 void removeEntries(java.lang.Class tableClass)
           
 void removeEntries(java.util.Vector vec)
           
 QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)
          Removes simple query from simple query cache.
protected  void setAsynchLoadPriority(int priority)
          Sets priority of asynchronous cache initialization.
protected  void setCachePercentage(double percent)
           
 void setInitialCacheFetchSize(int i)
           
 void setInitialDSCacheSize(int i)
           
protected  void setInitialQueryCache(java.lang.String initQ)
          Sets initialQueryCache attribute.
protected  void setMaxExecuteTimeCacheInit(int maxExeTime)
          Sets the max time for which the query is not printed in application's log file durung the cache initialization.
protected  void setQueryTimeLimitCacheInit(int timeLimit)
          Sets max number of milliseconds for which the query for cache initialization should be executed and the resulset read from ResultSet.
protected  void setQueryTimeoutCacheInit(int timeout)
          Sets max number of seconds for which the query for cache initialization should be executed.
protected  void setReserveFactor(double res)
          Sets reserveFactor.
protected  void setSimpleCacheRowCountLimit(int rowCount)
          Sets the max number of rows in the table for which is simple cache still used.
protected  void setSynchLoadRowCountLimit(int rowCount)
          Sets the max number of rows in the table for which the synchronous cache load is performed if defined by configuration.
 boolean toReconfigure()
          Checks wheather cache reconfiguration needs to be done.
 java.lang.String toString()
          Shows content of this class.
 GenericDO updateDO(GenericDO DO)
          Updates cached DO, or inserts DO in the cache if it didn't exist in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

protected DODSHashMap cache
HashMap for storing data objects. Cache keys are cache handles (String "."), and cache values are data objects.


simpleQCache

protected DODSCache simpleQCache
LRU cache for storing simple queries. LRU cache keys are Strings in form of ".", and LRU cache values are objects of org.enhydra.dods.cache.QueryCacheItem class. QueryCacheItem class stores one query and its necessary data.


complexQCache

protected DODSCache complexQCache
LRU cache for storing complex queries. LRU cache keys are Strings in form of ".", and LRU cache values are objects of org.enhydra.dods.cache.QueryCacheItem class. QueryCacheItem class stores one query and its necessary data.


cacheAdministration

protected CacheAdministration[] cacheAdministration
Attribute cacheAdministration is array of three objects of the class CacheAdministration. CacheAdministration[0] handles configuration settings about data (or DataStruct object) cache. CacheAdministration[1] handles configuration settings about simple query cache. CacheAdministration[2] handles configuration settings about complex query cache.


tableConf

protected TableConfiguration tableConf
TableConfiguration attribute handles configuration settings about table of this cache.


initialQueryCache

protected java.lang.String initialQueryCache
Initial query statement. This attribute contains "where" clause which is used during data (or DataStruct) object cache initialization. If this attribute is set to "*", all rows from the table (in database) will be put in the cache.


fullCachingOn

protected boolean fullCachingOn
This attribute is true if the cache is full, otherwise false.


completeCachingOn

protected boolean completeCachingOn
This attribute is true if the cache is complete, otherwise false.


multi

protected boolean multi
This attribute contains information if multi databases are used.


statistics

protected Statistics statistics
Table and cache statictics.


oldSimpleMaxCacheSize

protected int oldSimpleMaxCacheSize
Old max simple cache size. When data (or DataStruct) cache's maxCacheSize is set to zero, so is simple query's. This attribute is needed for retrieving max simple cache size after data (or DataStruct) cache's maxCacheSize has been set again to any value different from zero.


oldComplexMaxCacheSize

protected int oldComplexMaxCacheSize
Old max complex cache size. When data (or DataStruct) cache's maxCacheSize is set to zero, so is complex query's. This attribute is needed for retrieving max complex cache size after data (or DataStruct) cache's maxCacheSize has been set again to any value different from zero.


reserveFactor

protected double reserveFactor
This attribute is used in query caching. It is percent of how many more object are taken for evaluation. If num is number of needed results, then it is used num + DEFAULT_RESERVE_FACTOR * num of objects for estimating what is quicker: go to database for all object that are not in the cache, or run again query on database. This value is given in percents, as number between 0 and 1 (0.25 means 25%). For example, if DEFAULT_RESERVE_FACTOR is 0.5, and wanted number of results is 50, the estimation will be done on 75 (50 + 0.5 * 50) objects. The value of CacheConstants.DEFAULT_RESERVE_FACTOR is 0.5.


cachePercentage

protected double cachePercentage
Constructor Detail

TransactionCacheImpl

public TransactionCacheImpl(int maxSQSize,
                            int maxCQSize)
                     throws CacheObjectException
Constructor(int, int). Creates unlimited data object cache. and simple and complex query caches with their default maximal sizes. The value of CacheConstants.DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE is 0. The value of CacheConstants.DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE is 0.

Parameters:
maxSQSize - maximal data (or DataStruct) object cache size.
maxCQSize - maximal data (or DataStruct) object cache size.
Throws:
CacheObjectException

TransactionCacheImpl

public TransactionCacheImpl()
                     throws CacheObjectException
Constructor(). Creates unlimited data object cache. and simple and complex query caches with their default maximal sizes. The value of CacheConstants.DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE is 0. The value of CacheConstants.DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE is 0.

Throws:
CacheObjectException
Method Detail

getCacheAdministration

public CacheAdministration getCacheAdministration(int cacheType)
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.

getInitialQueryCache

public java.lang.String getInitialQueryCache()
Returns initialQueryCache. This attribute contains "where" clause which is used during data object (or DataStruct object) cache initialization.

Specified by:
getInitialQueryCache in class ConfigurationAdministration
Returns:
initialQueryCache.

setInitialQueryCache

protected void setInitialQueryCache(java.lang.String initQ)
Sets initialQueryCache attribute. This attribute contains "where" clause which is used during data object (or DataStruct object) cache initialization.

Specified by:
setInitialQueryCache in class ConfigurationAdministration
Parameters:
initQ - New value of initialQueryCache attribute.

getStatistics

public Statistics getStatistics()
Returns statistics of used table and caches.

Specified by:
getStatistics in class ConfigurationAdministration
Returns:
statistics of used table and caches.

refreshStatistics

public void refreshStatistics()
Refreshes statistics.

Specified by:
refreshStatistics in class ConfigurationAdministration

checkFull

public void checkFull()
Description copied from class: ConfigurationAdministration
Checks if cache is full or not and updates apropriate internal variables.

Specified by:
checkFull in class ConfigurationAdministration

isFull

public boolean isFull()
Returns information if data object (or DataStruct object) cache if "full". "Full" cache contains all data objects (or DataStruct objects) from the table. The cache is "full", if data (or DataStruct) object cache is unbounded, and if initialQueryCache attribute is set to "*".

Specified by:
isFull in class ConfigurationAdministration
Returns:
true if data object (or DataStruct object) cache if "full", otherwise false.

isComplete

public boolean isComplete()
Returns information if data object (or DataStruct object) cache if "complete". "Complete" cache can contain all data objects (or DataStruct objects) from the table. The cache is "complete", if data (or DataStruct) object cache is unbounded. If cache was complete, but not any more, the cache is created again, but as LRU cache.

Specified by:
isComplete in class ConfigurationAdministration
Returns:
true if data object (or DataStruct object) cache if "complete", otherwise false.

getCacheType

public java.lang.String getCacheType()
Returns data object (or DataStruct object) cache type. Possible values are: "none" - no caching available "lru" - cache with LRU (least-recently used) algorithm "full" - special case of LRU cache - the whole table is cached "complete" - special case of cache - the cache is a map in which the whole table can be cached (unbounded cache with initial condition other than "*"

Specified by:
getCacheType in class ConfigurationAdministration
Returns:
data object (or DataStruct object) cache type.

getLevelOfCaching

public int getLevelOfCaching()
Returns caching level. Possible values: org.enhydra.dods.cache.CacheConstants.DATA_CACHING (value 1) for data object (or DataStruct object) caching without query caching, and org.enhydra.dods.cache.CacheConstants.QUERY_CACHING (value 2) for data object (or DataStruct object) caching with query caching.

Specified by:
getLevelOfCaching in class ConfigurationAdministration
Returns:
Value 2 (org.enhydra.dods.cache.CacheConstants.QUERY_CACHING).

getTableConfiguration

public TableConfiguration getTableConfiguration()
Returns object TableConfiguration. TableConfiguration contains parameters (and their set and get methods) for table configuration.

Specified by:
getTableConfiguration in class ConfigurationAdministration
Returns:
TableConfiguration.

getReserveFactor

public double getReserveFactor()
Returns reserveFactor. This attribute is used in query caching. It defines how many more (exept needed) objects are taken for evaluation. If num is number of needed results, then it is used num + DEFAULT_RESERVE_FACTOR * num of objects for estimating what is quicker: go to database for all object that are not in the cache, or run again query on database. This value is given in percents, as number between 0 and 1 (0.25 means 25%). For example, if DEFAULT_RESERVE_FACTOR is 0.5, and wanted number of results is 50, the estimation will be done on 75 (50 + 0.5 * 50) objects.

Specified by:
getReserveFactor in class ConfigurationAdministration
Returns:
reserveFactor.

setReserveFactor

protected void setReserveFactor(double res)
Sets reserveFactor. This attribute is used in query caching. It defines how many more (exept needed) objects are taken for evaluation. If num is number of needed results, then it is used num + DEFAULT_RESERVE_FACTOR * num of objects for estimating what is quicker: go to database for all object that are not in the cache, or run again query on database. This value is given in percents, as number between 0 and 1 (0.25 means 25%). For example, if DEFAULT_RESERVE_FACTOR is 0.5, and wanted number of results is 50, the estimation will be done on 75 (50 + 0.5 * 50) objects.

Specified by:
setReserveFactor in class ConfigurationAdministration
Parameters:
res - New reserveFactor.

setCachePercentage

protected void setCachePercentage(double percent)
Specified by:
setCachePercentage in class ConfigurationAdministration

getCachePercentage

public double getCachePercentage()
Description copied from class: ConfigurationAdministration
Read cache configuration from application's configuration file.

Specified by:
getCachePercentage in class ConfigurationAdministration

isDisabled

public boolean isDisabled()
Returns information whether caching is disabled.

Specified by:
isDisabled in class ConfigurationAdministration
Returns:
true is caching is disabled, otherwise false.

readConfiguration

public void readConfiguration(Config tableConfig,
                              Config cacheConfig,
                              java.lang.String dbName)
                       throws CacheObjectException
Reads table and cache configuration from application's configuration file.

Specified by:
readConfiguration in class ConfigurationAdministration
Parameters:
tableConfig - configuration for table of this cache.
cacheConfig - configuration for this cache.
Throws:
CacheObjectException

newInstance

public DOCache newInstance()
                    throws CacheObjectException
Creates TransactionCacheImpl instance.

Specified by:
newInstance in class DOCache
Returns:
created QueryCacheImpl instance as DataCache.
Throws:
CacheObjectException

init

protected void init()
Creates array of three CacheAdministration objects. CacheAdministration[0] handles configuration settings about data (or DataStruct) object cache. CacheAdministration[1] handles configuration settings about simple query cache. CacheAdministration[2] handles configuration settings about complex query cache.


getCacheContent

public java.util.Map getCacheContent()
Returns cache (data or DataStruct) content.

Specified by:
getCacheContent in class DOCache
Returns:
Cache content as Map of data (or DataStruct) objects.

isMulti

public boolean isMulti()
Returns information if multi databases are supported.

Specified by:
isMulti in class DOCache
Returns:
true if multi databases are used, otherwise false.

toReconfigure

public boolean toReconfigure()
Checks wheather cache reconfiguration needs to be done.

Specified by:
toReconfigure in class DOCache
Returns:
true if cache reconfiguration needs to be done, otherwise false.

addDO

public GenericDO addDO(GenericDO newDO)
Adds DO (data object) to the cache.

Specified by:
addDO in class DOCache
Parameters:
newDO - Data object that will be added to the cache.
Returns:
Added data object.

removeDO

public GenericDO removeDO(GenericDO DO)
Removes DO (data object) from the cache.

Specified by:
removeDO in class DOCache
Parameters:
DO - Data object that will be removed from the cache.
Returns:
Removed data object, or null if there was no object removed from the cache.

removeDO

public GenericDO removeDO(java.lang.String handle)
Removes DO (data object) from the cache.

Specified by:
removeDO in class DOCache
Parameters:
handle - Cache handle of DO (data object) that will be removed from the cache. The form of cache handle is: ".".
Returns:
Removed data object, or null if there was no object removed from the cache.

updateDO

public GenericDO updateDO(GenericDO DO)
Updates cached DO, or inserts DO in the cache if it didn't exist in the cache.

Specified by:
updateDO in class DOCache
Parameters:
DO - Data object that will be updated (or inserted if didn't exist in the cache).
Returns:
Updated or inserted data object.

deleteDO

public GenericDO deleteDO(GenericDO DO)
Deletes DO from the cache.

Specified by:
deleteDO in class DOCache
Parameters:
DO - Data object that will be deleted from the cache.
Returns:
Deleted data object, or null if there was no object deleted from the cache.

getDOByHandle

public GenericDO getDOByHandle(java.lang.String handle)
Returns data object whose String representation of OID is parameter handle.

Specified by:
getDOByHandle in class DOCache
Parameters:
handle - String representation of OID of object that is being searched in the cache.
Returns:
Data object whose String representation of OID is handle.

newQueryCacheItemInstance

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

Specified by:
newQueryCacheItemInstance in class TransactionQueryCache
Parameters:
dbName - Database name.
Returns:
Created QueryCacheItem instance.

getSimpleQueryCacheItem

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

Specified by:
getSimpleQueryCacheItem in class TransactionQueryCache
Parameters:
dbName - Database name.
query - Query in form of String.
Returns:
QueryCacheItem object.

getComplexQueryCacheItem

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

Specified by:
getComplexQueryCacheItem in class TransactionQueryCache
Parameters:
dbName - Database name.
query - Query in form of String.
Returns:
QueryCacheItem object.

addSimpleQuery

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

Specified by:
addSimpleQuery in class TransactionQueryCache
Parameters:
queryItem - Query that will be added to simple query cache.
Returns:
Query added to simple query cache.

removeSimpleQuery

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

Specified by:
removeSimpleQuery in class TransactionQueryCache
Parameters:
queryItem - Query that will be removed from simple query cache.
Returns:
Query removed from simple query cache.

addComplexQuery

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

Specified by:
addComplexQuery in class TransactionQueryCache
Parameters:
queryItem - Query that will be added to complex query cache.
Returns:
Query added to complex query cache.

removeComplexQuery

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

Specified by:
removeComplexQuery in class TransactionQueryCache
Parameters:
queryItem - Query that will be removed from complex query cache.
Returns:
Query removed from complex query cache.

getSimpleQueryResults

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

Specified by:
getSimpleQueryResults in class TransactionQueryCache
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 QueryResult getSimpleQueryResults(java.lang.String dbName,
                                         java.lang.String query,
                                         int limit,
                                         int maxdb)
Returns query results from simple query cache.

Specified by:
getSimpleQueryResults in class TransactionQueryCache
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 QueryResult getSimpleQueryResults(java.lang.String dbName,
                                         java.lang.String query,
                                         int limit,
                                         int maxdb,
                                         boolean unique)
Returns query results from simple query cache.

Specified by:
getSimpleQueryResults in class TransactionQueryCache
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 QueryResult getComplexQueryResults(java.lang.String dbName,
                                          java.lang.String query)
Returns query results from complex query cache.

Specified by:
getComplexQueryResults in class TransactionQueryCache
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 QueryResult getComplexQueryResults(java.lang.String dbName,
                                          java.lang.String query,
                                          int limit,
                                          int maxdb)
Returns query results from complex query cache.

Specified by:
getComplexQueryResults in class TransactionQueryCache
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 QueryResult getComplexQueryResults(java.lang.String dbName,
                                          java.lang.String query,
                                          int limit,
                                          int maxdb,
                                          boolean unique)
Returns query results from complex query cache.

Specified by:
getComplexQueryResults in class TransactionQueryCache
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.

getQueryResults

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

Specified by:
getQueryResults in class TransactionQueryCache
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.

toString

public java.lang.String toString()
Shows content of this class. Can be used for debugging.

Overrides:
toString in class java.lang.Object

removeEntries

public void removeEntries(java.util.Vector vec)
Specified by:
removeEntries in class TransactionQueryCache

removeEntries

public void removeEntries(java.lang.Class tableClass)
Specified by:
removeEntries in class TransactionQueryCache
Parameters:
tableClass - -

emptyEntries

public void emptyEntries(java.util.Vector vec,
                         boolean incrementVersion)
Specified by:
emptyEntries in class TransactionQueryCache

emptyEntries

public void emptyEntries(java.lang.Class tableClass)
Dumps data structs for all instances of tableClass in transaction cache.

Specified by:
emptyEntries in class TransactionQueryCache
Parameters:
tableClass - - Class object whose instances will be emptied

getInitialCacheFetchSize

public int getInitialCacheFetchSize()
Specified by:
getInitialCacheFetchSize in class ConfigurationAdministration

getInitialDSCacheSize

public int getInitialDSCacheSize()
Specified by:
getInitialDSCacheSize in class ConfigurationAdministration

setInitialCacheFetchSize

public void setInitialCacheFetchSize(int i)
Specified by:
setInitialCacheFetchSize in class ConfigurationAdministration
Parameters:
i -

setInitialDSCacheSize

public void setInitialDSCacheSize(int i)
Specified by:
setInitialDSCacheSize in class ConfigurationAdministration
Parameters:
i -

getAsynchLoadPriority

public int getAsynchLoadPriority()
Description copied from class: ConfigurationAdministration
Returns priority of asynchronous cache initialization. The priority can have value 0 or positive value. The lower the value, the higher priority. The default value is -1 (cache initialization is done synchronous).

Specified by:
getAsynchLoadPriority in class ConfigurationAdministration
Returns:
priority of asynchronous cache initialization.

setAsynchLoadPriority

protected void setAsynchLoadPriority(int priority)
Description copied from class: ConfigurationAdministration
Sets priority of asynchronous cache initialization. The priority can have value 0 or positive value. The lower the value, the higher priority. The value -1 means that cache initialization is done synchronous.

Specified by:
setAsynchLoadPriority in class ConfigurationAdministration
Parameters:
priority - priority of asynchronous cache initialization.

getSimpleCacheRowCountLimit

public int getSimpleCacheRowCountLimit()
Description copied from class: ConfigurationAdministration
Returns max number of rows in the table for which is simple cache still used. If the table has more rows, complex cache is used for simple queries. The default value is 0 (simple cache is used for all simple queries).

Specified by:
getSimpleCacheRowCountLimit in class ConfigurationAdministration
Returns:
the max number of rows in the table until which the simple cache is used.

setSimpleCacheRowCountLimit

protected void setSimpleCacheRowCountLimit(int rowCount)
Description copied from class: ConfigurationAdministration
Sets the max number of rows in the table for which is simple cache still used. If the table has more rows, complex cache is used for simple queries.

Specified by:
setSimpleCacheRowCountLimit in class ConfigurationAdministration
Parameters:
rowCount -

getSynchLoadRowCountLimit

public int getSynchLoadRowCountLimit()
Description copied from class: ConfigurationAdministration
Returns the max number of rows in the table for which the synchronous cache load is performed if defined by configuration. The default value is 0 (asynch cache load is not performed if configuration parameters for asynch cache load are not defined).

Specified by:
getSynchLoadRowCountLimit in class ConfigurationAdministration
Returns:
max number of rows in the table above which the asynch cache load is performed.

setSynchLoadRowCountLimit

protected void setSynchLoadRowCountLimit(int rowCount)
Description copied from class: ConfigurationAdministration
Sets the max number of rows in the table for which the synchronous cache load is performed if defined by configuration.

Specified by:
setSynchLoadRowCountLimit in class ConfigurationAdministration
Parameters:
rowCount -

getMaxExecuteTimeCacheInit

public int getMaxExecuteTimeCacheInit()
Description copied from class: ConfigurationAdministration
Returns the max time for which the query is not printed in application's log file durung the cache initialization. If the time is greater, query (SQL statement, execution time and maxExecutionTime) is printed. The default value is 0 (nothing is printed).

Specified by:
getMaxExecuteTimeCacheInit in class ConfigurationAdministration
Returns:
max time for which the query is not printed in application's log file durung the cache initialization.

setMaxExecuteTimeCacheInit

protected void setMaxExecuteTimeCacheInit(int maxExeTime)
Description copied from class: ConfigurationAdministration
Sets the max time for which the query is not printed in application's log file durung the cache initialization. If the time is greater, query (SQL statement, execution time and maxExecutionTime) is printed.

Specified by:
setMaxExecuteTimeCacheInit in class ConfigurationAdministration
Parameters:
maxExeTime -

getQueryTimeLimitCacheInit

public int getQueryTimeLimitCacheInit()
Description copied from class: ConfigurationAdministration
Returns max number of milliseconds for which the query for cache initialization should be executed and the resulset read from ResultSet. If the limit is exceeded, an Exception is thrown. Value 0 means that there is no limit.

Specified by:
getQueryTimeLimitCacheInit in class ConfigurationAdministration
Returns:
max number of milliseconds for which the query for cache initialization should be executed and the resulset read from ResultSet.

setQueryTimeLimitCacheInit

protected void setQueryTimeLimitCacheInit(int timeLimit)
Description copied from class: ConfigurationAdministration
Sets max number of milliseconds for which the query for cache initialization should be executed and the resulset read from ResultSet. If the limit is exceeded, an Exception is thrown.

Specified by:
setQueryTimeLimitCacheInit in class ConfigurationAdministration
Parameters:
timeLimit -

getQueryTimeoutCacheInit

public int getQueryTimeoutCacheInit()
Description copied from class: ConfigurationAdministration
Returns max number of seconds for which the query for cache initialization should be executed. If the limit is exceeded, an exception is thrown. Value 0 means that there is no limit.

Specified by:
getQueryTimeoutCacheInit in class ConfigurationAdministration
Returns:
the number of seconds for which the query for cache initialization should be executed.

setQueryTimeoutCacheInit

protected void setQueryTimeoutCacheInit(int timeout)
Description copied from class: ConfigurationAdministration
Sets max number of seconds for which the query for cache initialization should be executed. If the limit is exceeded, an exception is thrown.

Specified by:
setQueryTimeoutCacheInit in class ConfigurationAdministration
Parameters:
timeout -

DODS 7.3 API