DODS 6.5 API

org.enhydra.dods.cache
Class ConfigurationAdministration

java.lang.Object
  extended byorg.enhydra.dods.cache.ConfigurationAdministration
Direct Known Subclasses:
DataStructCache, DOCache

public abstract class ConfigurationAdministration
extends java.lang.Object

This interface contains part of caches' (data object (or DataStruct object) and query) mechanisms needed for cache administration.

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

Constructor Summary
ConfigurationAdministration()
           
 
Method Summary
abstract  void checkFull()
          Returns information if data object (or DataStruct object) cache if "full".
abstract  CacheAdministration getCacheAdministration(int cacheType)
          Returns CacheAdministration for data object (or DataStruct object) cache, simple, or complex query cache.
abstract  double getCachePercentage()
          Read cache configuration from application's configuration file.
abstract  java.lang.String getCacheType()
          Returns data object (or DataStruct object) cache type.
abstract  int getInitialCacheFetchSize()
           
abstract  int getInitialDSCacheSize()
           
abstract  java.lang.String getInitialQueryCache()
          Returns initialQueryCache.
abstract  int getLevelOfCaching()
          Returns caching level.
abstract  double getReserveFactor()
          Returns reserveFactor.
abstract  Statistics getStatistics()
          Returns statistics of used table (and of the caches, if exist).
abstract  TableConfiguration getTableConfiguration()
          Returns object TableConfiguration.
abstract  boolean isDisabled()
          Returns information whether caching is disabled.
abstract  boolean isFull()
          Returns information if data object (or DataStruct object) cache if "full".
abstract  void readConfiguration(com.lutris.util.Config tableConfig, com.lutris.util.Config cacheConfig, java.lang.String dbName)
           
abstract  void refreshStatistics()
          Refreshes statistics.
protected abstract  void setCachePercentage(double cp)
           
abstract  void setInitialCacheFetchSize(int i)
           
abstract  void setInitialDSCacheSize(int i)
           
protected abstract  void setInitialQueryCache(java.lang.String initQ)
          Sets initialQueryCache attribute.
protected abstract  void setReserveFactor(double res)
          Sets reserveFactor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationAdministration

public ConfigurationAdministration()
Method Detail

getCacheAdministration

public abstract 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

Parameters:
cacheType - 0 - for data object (or DataStruct object), 1 for simple query and 2 for complex query cache.

getInitialQueryCache

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

Returns:
Attribute initialQueryCache.

setInitialQueryCache

protected abstract 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.

Parameters:
initQ - New value of initialQueryCache attribute.

getStatistics

public abstract Statistics getStatistics()
Returns statistics of used table (and of the caches, if exist).

Returns:
statistics of used table (and of the caches, if exist).

refreshStatistics

public abstract void refreshStatistics()
Refreshes statistics.


checkFull

public abstract void checkFull()
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, if the cached table is read-only, and if initialQueryCache attribute is set to "*".

Returns:
true if data object (or DataStruct object) cache if "full", otherwise false.

isFull

public abstract 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 "*".

Returns:
true if data object (or DataStruct object) cache if "full", otherwise false.

getCacheType

public abstract 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

Returns:
data object (or DataStruct object) cache type.

getLevelOfCaching

public abstract 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.

Returns:
Caching level (1 or 2).

getTableConfiguration

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

Returns:
TableConfiguration.

getReserveFactor

public abstract double getReserveFactor()
Returns reserveFactor. reserveFactor 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.

Returns:
reserveFactor.

setReserveFactor

protected abstract void setReserveFactor(double res)
Sets reserveFactor. reserveFactor 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.

Parameters:
res - New reserveFactor.

isDisabled

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

Returns:
true is caching is disabled, otherwise false.

getCachePercentage

public abstract double getCachePercentage()
Read cache configuration from application's configuration file.


setCachePercentage

protected abstract void setCachePercentage(double cp)

getInitialCacheFetchSize

public abstract int getInitialCacheFetchSize()
Returns:

getInitialDSCacheSize

public abstract int getInitialDSCacheSize()
Returns:

setInitialCacheFetchSize

public abstract void setInitialCacheFetchSize(int i)
Parameters:
i -

setInitialDSCacheSize

public abstract void setInitialDSCacheSize(int i)
Parameters:
i -

readConfiguration

public abstract void readConfiguration(com.lutris.util.Config tableConfig,
                                       com.lutris.util.Config cacheConfig,
                                       java.lang.String dbName)
                                throws CacheObjectException
Throws:
CacheObjectException

DODS 6.5 API