|
DODS 7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.enhydra.dods.cache.ConfigurationAdministration
org.enhydra.dods.cache.DataStructCache
org.enhydra.dods.cache.DataStructCacheImpl
public class DataStructCacheImpl
This class contains data and mechanisms needed for caching data objects (or DataStruct objects) by their OIDs and provides cache configuration and administration.
| Field Summary | |
|---|---|
protected DODSCache |
cache
LRU cache for storing data (or DataStruct) objects. |
protected CacheAdministration |
cacheAdministration
cacheAdministration attribute handles configuration settings about data (or DataStruct) object cache. |
protected double |
cachePercentage
|
protected boolean |
completeCachingOn
This attribute is true if the cache is complete, otherwise false. |
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 java.util.HashMap |
nonVisibleList
List of objects that are unvisible in the cache at the moment. |
protected double |
reserveFactor
Reserve factor used in in query caching. |
protected Statistics |
statistics
Table and cache statictics. |
protected TableConfiguration |
tableConf
TableConfiguration attribute handles configuration settings about table of this cache. |
| Constructor Summary | |
|---|---|
DataStructCacheImpl()
Constructor(). |
|
DataStructCacheImpl(int maxCSize)
Constructor(int). |
|
| Method Summary | |
|---|---|
CoreDataStruct |
addDataStruct(CoreDataStruct newDS)
Adds DataStruct object to the cache. |
void |
checkFull()
Returns information if data object (or DataStruct object) cache if "full". |
CoreDataStruct |
deleteDataStruct(CoreDataStruct data)
Deletes DataStruct object from the cache. |
int |
getAsynchLoadPriority()
Returns priority of asynchronous cache initialization. |
CacheAdministration |
getCacheAdministration(int cacheType)
Returns CacheAdministration for data (or DataStruct) object 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. |
CoreDataStruct |
getDataStructByHandle(java.lang.String handle)
Returns DataStruct 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. |
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 simpleCacheRowCountLimit. |
Statistics |
getStatistics()
Returns statistics of used table and cache. |
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 TableConfiguration. |
protected void |
init()
Creates cacheAdministration object for data (or DataStruct) object cache. |
boolean |
isComplete()
Returns information if data object (or DataStruct object) cache if "complete". |
boolean |
isCompleteCachingOn()
Returns information if data object (or DataStruct object) cache was in last check (call of isComplete() method) "complete". |
boolean |
isDisabled()
Returns information whether the cache is disabled. |
boolean |
isFull()
Returns information if data object (or DataStruct object) cache if "full". |
boolean |
isMulti()
Returns information if multi databases are supported. |
void |
makeInvisible(java.lang.String cacheHandle)
|
void |
makeVisible(java.lang.String cacheHandle)
|
DataStructCache |
newInstance()
Creates DataStructCacheImpl 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. |
CoreDataStruct |
removeDataStruct(CoreDataStruct data)
Removes DataStruct object from the cache. |
CoreDataStruct |
removeDataStruct(java.lang.String handle)
Removes DataStruct object from the 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 simpleCacheRowCountLimit. |
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. |
void |
show()
Shows content of this class. |
boolean |
toReconfigure()
Checks wheather cache reconfiguration needs to be done. |
java.lang.String |
toString()
Shows content of this class. |
CoreDataStruct |
updateDataStruct(CoreDataStruct data)
Updates cached DataStruct object, or inserts it in the cache if it didn't exist in the cache. |
| Methods inherited from class org.enhydra.dods.cache.DataStructCache |
|---|
isLocked |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DODSCache cache
protected CacheAdministration cacheAdministration
protected TableConfiguration tableConf
protected java.lang.String initialQueryCache
protected boolean multi
protected boolean fullCachingOn
protected boolean completeCachingOn
protected Statistics statistics
protected java.util.HashMap nonVisibleList
protected double reserveFactor
protected double cachePercentage
| Constructor Detail |
|---|
public DataStructCacheImpl(int maxCSize)
throws CacheObjectException
maxCSize.
maxCSize - maximal data (or DataStruct) object cache size.
CacheObjectException
public DataStructCacheImpl()
throws CacheObjectException
CacheObjectException| Method Detail |
|---|
public CacheAdministration getCacheAdministration(int cacheType)
getCacheAdministration in class ConfigurationAdministrationcacheType - Type of caching. In this case, it is 0, but, since there
is only one cache (data (or DataStruct) object), parameter is not checked,
always is the same CacheAdministration object returned.
public java.lang.String getInitialQueryCache()
getInitialQueryCache in class ConfigurationAdministrationprotected void setInitialQueryCache(java.lang.String initQ)
setInitialQueryCache in class ConfigurationAdministrationinitQ - New value of initialQueryCache attribute.public void makeInvisible(java.lang.String cacheHandle)
public void makeVisible(java.lang.String cacheHandle)
public Statistics getStatistics()
getStatistics in class ConfigurationAdministrationpublic void refreshStatistics()
refreshStatistics in class ConfigurationAdministrationpublic void checkFull()
checkFull in class ConfigurationAdministrationpublic boolean isFull()
isFull in class ConfigurationAdministrationpublic boolean isComplete()
isComplete in class ConfigurationAdministrationpublic boolean isCompleteCachingOn()
public java.lang.String getCacheType()
getCacheType in class ConfigurationAdministrationpublic int getLevelOfCaching()
getLevelOfCaching in class ConfigurationAdministrationpublic TableConfiguration getTableConfiguration()
getTableConfiguration in class ConfigurationAdministrationpublic double getReserveFactor()
getReserveFactor in class ConfigurationAdministrationprotected void setReserveFactor(double res)
setReserveFactor in class ConfigurationAdministrationres - New reserveFactor.protected void setCachePercentage(double percent)
setCachePercentage in class ConfigurationAdministrationpublic double getCachePercentage()
ConfigurationAdministration
getCachePercentage in class ConfigurationAdministrationpublic boolean isDisabled()
isDisabled in class ConfigurationAdministration
public void readConfiguration(Config tableConfig,
Config cacheConfig,
java.lang.String dbName)
throws CacheObjectException
readConfiguration in class ConfigurationAdministrationtableConfig - configuration for table of this cache.cacheConfig - configuration for this cache.
CacheObjectException
public DataStructCache newInstance()
throws CacheObjectException
newInstance in class DataStructCacheCacheObjectExceptionprotected void init()
public java.util.Map getCacheContent()
getCacheContent in class DataStructCacheMap of data (or DataStruct) object.public boolean isMulti()
isMulti in class DataStructCachepublic int getAsynchLoadPriority()
getAsynchLoadPriority in class ConfigurationAdministrationprotected void setAsynchLoadPriority(int priority)
setAsynchLoadPriority in class ConfigurationAdministrationpriority - priority of asynchronous cache initialization.public int getSimpleCacheRowCountLimit()
getSimpleCacheRowCountLimit in class ConfigurationAdministrationprotected void setSimpleCacheRowCountLimit(int rowCount)
setSimpleCacheRowCountLimit in class ConfigurationAdministrationrowCount - max number of rows in the table for which is simple cache still used.public int getSynchLoadRowCountLimit()
getSynchLoadRowCountLimit in class ConfigurationAdministrationprotected void setSynchLoadRowCountLimit(int rowCount)
setSynchLoadRowCountLimit in class ConfigurationAdministrationrowCount - the max number of rows in the table for which the synchronous cache
load is performed if defined by configuration.public int getMaxExecuteTimeCacheInit()
getMaxExecuteTimeCacheInit in class ConfigurationAdministrationprotected void setMaxExecuteTimeCacheInit(int maxExeTime)
setMaxExecuteTimeCacheInit in class ConfigurationAdministrationmaxExeTime - new value for max execution time for the cache
initialization.public int getQueryTimeLimitCacheInit()
getQueryTimeLimitCacheInit in class ConfigurationAdministrationprotected void setQueryTimeLimitCacheInit(int timeLimit)
setQueryTimeLimitCacheInit in class ConfigurationAdministrationtimeLimit - new value for time limit for cache initialization.public int getQueryTimeoutCacheInit()
getQueryTimeoutCacheInit in class ConfigurationAdministrationprotected void setQueryTimeoutCacheInit(int timeout)
setQueryTimeoutCacheInit in class ConfigurationAdministrationtimeout - new value for query timeout for cache initialization.public boolean toReconfigure()
toReconfigure in class DataStructCachepublic CoreDataStruct addDataStruct(CoreDataStruct newDS)
addDataStruct in class DataStructCachenewDS - DataStruct object that will be added to the cache.
public CoreDataStruct removeDataStruct(CoreDataStruct data)
removeDataStruct in class DataStructCachedata - DataStruct object that will be removed from the cache.
public CoreDataStruct removeDataStruct(java.lang.String handle)
removeDataStruct in class DataStructCachehandle - Cache handle of DataStruct object that will be removed from
the cache. The form of cache handle is:
"public CoreDataStruct updateDataStruct(CoreDataStruct data)
updateDataStruct in class DataStructCachedata - DataStruct object that will be updated (or inserted if didn't
exist in the cache).
public CoreDataStruct deleteDataStruct(CoreDataStruct data)
deleteDataStruct in class DataStructCachedata - DataStruct object that will be deleted from the cache.
public CoreDataStruct getDataStructByHandle(java.lang.String handle)
getDataStructByHandle in class DataStructCachehandle - String representation of OID of DataStruct object that is
being searched in the cache.
public void show()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getInitialCacheFetchSize()
getInitialCacheFetchSize in class ConfigurationAdministrationpublic int getInitialDSCacheSize()
getInitialDSCacheSize in class ConfigurationAdministrationpublic void setInitialCacheFetchSize(int i)
setInitialCacheFetchSize in class ConfigurationAdministrationi - public void setInitialDSCacheSize(int i)
setInitialDSCacheSize in class ConfigurationAdministrationi -
|
DODS 7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||