|
DODS 6.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
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 |
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. |
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. |
double |
getReserveFactor()
Returns reserveFactor. |
Statistics |
getStatistics()
Returns statistics of used table and cache. |
TableConfiguration |
getTableConfiguration()
Returns TableConfiguration. |
protected void |
init()
Creates cacheAdministration object for data (or DataStruct) object cache. |
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(com.lutris.util.Config tableConfig,
com.lutris.util.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 |
setCachePercentage(double percent)
|
void |
setInitialCacheFetchSize(int i)
|
void |
setInitialDSCacheSize(int i)
|
protected void |
setInitialQueryCache(java.lang.String initQ)
Sets initialQueryCache attribute. |
protected void |
setReserveFactor(double res)
Sets reserveFactor. |
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 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.public DataStructCacheImpl() throws CacheObjectException
Method Detail |
public CacheAdministration getCacheAdministration(int cacheType)
getCacheAdministration
in class ConfigurationAdministration
cacheType
- 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 ConfigurationAdministration
protected void setInitialQueryCache(java.lang.String initQ)
setInitialQueryCache
in class ConfigurationAdministration
initQ
- 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 ConfigurationAdministration
public void refreshStatistics()
refreshStatistics
in class ConfigurationAdministration
public void checkFull()
checkFull
in class ConfigurationAdministration
public boolean isFull()
isFull
in class ConfigurationAdministration
public java.lang.String getCacheType()
getCacheType
in class ConfigurationAdministration
public int getLevelOfCaching()
getLevelOfCaching
in class ConfigurationAdministration
public TableConfiguration getTableConfiguration()
getTableConfiguration
in class ConfigurationAdministration
public double getReserveFactor()
getReserveFactor
in class ConfigurationAdministration
protected void setReserveFactor(double res)
setReserveFactor
in class ConfigurationAdministration
res
- New reserveFactor.protected void setCachePercentage(double percent)
setCachePercentage
in class ConfigurationAdministration
public double getCachePercentage()
ConfigurationAdministration
getCachePercentage
in class ConfigurationAdministration
public boolean isDisabled()
isDisabled
in class ConfigurationAdministration
public void readConfiguration(com.lutris.util.Config tableConfig, com.lutris.util.Config cacheConfig, java.lang.String dbName) throws CacheObjectException
readConfiguration
in class ConfigurationAdministration
tableConfig
- configuration for table of this cache.cacheConfig
- configuration for this cache.
CacheObjectException
public DataStructCache newInstance() throws CacheObjectException
newInstance
in class DataStructCache
CacheObjectException
protected void init()
public java.util.Map getCacheContent()
getCacheContent
in class DataStructCache
Map
of data (or DataStruct) object.public boolean isMulti()
isMulti
in class DataStructCache
public boolean toReconfigure()
toReconfigure
in class DataStructCache
public CoreDataStruct addDataStruct(CoreDataStruct newDS)
addDataStruct
in class DataStructCache
newDS
- DataStruct object that will be added to the cache.
public CoreDataStruct removeDataStruct(CoreDataStruct data)
removeDataStruct
in class DataStructCache
data
- DataStruct object that will be removed from the cache.
public CoreDataStruct removeDataStruct(java.lang.String handle)
removeDataStruct
in class DataStructCache
handle
- 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 DataStructCache
data
- DataStruct object that will be updated (or inserted if didn't
exist in the cache).
public CoreDataStruct deleteDataStruct(CoreDataStruct data)
deleteDataStruct
in class DataStructCache
data
- DataStruct object that will be deleted from the cache.
public CoreDataStruct getDataStructByHandle(java.lang.String handle)
getDataStructByHandle
in class DataStructCache
handle
- String representation of OID of DataStruct object that is
being searched in the cache.
public void show()
public java.lang.String toString()
public int getInitialCacheFetchSize()
getInitialCacheFetchSize
in class ConfigurationAdministration
public int getInitialDSCacheSize()
getInitialDSCacheSize
in class ConfigurationAdministration
public void setInitialCacheFetchSize(int i)
setInitialCacheFetchSize
in class ConfigurationAdministration
i
- public void setInitialDSCacheSize(int i)
setInitialDSCacheSize
in class ConfigurationAdministration
i
-
|
DODS 6.5 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |