| com.versant.core.storagemanager.StorageCache
All known Subclasses: com.versant.core.storagemanager.LRUStorageCache, com.versant.core.storagemanager.NOPStorageCache,
StorageCache | public interface StorageCache (Code) | | Cache of State's and query results shared by multiple StorageManager's.
A single class is used to cache both State's and query results so that
query results can be efficiently evicted when States of classes they
depend on are evicted. Only data read in a committed database transaction
may be added to the cache.
|
Method Summary | |
public void | add(Object tx, StatesReturned container) Add all the states in the container to the cache. | public void | add(Object tx, CompiledQuery cq, Object[] params, CachedQueryResult queryData) Add query results to the cache. | public void | add(Object tx, CompiledQuery cq, Object[] params, int count) Add query result count to the cache. | public Object | beginTx() Begin a cache transaction and return an identifier for it. | public boolean | contains(OID oid) Does the cache contain any data for the oid? Note that the data could
be evicted at any time. | public void | endTx(Object tx) End a cache transaction. | public void | evict(Object tx, OID[] oids, int offset, int length, int expected) Evict length OIDs from oids starting at offset. | public void | evict(Object tx, ClassMetaData[] classes, int classCount) Evict all data for the classes. | public void | evict(Object tx, CompiledQuery cq, Object[] params) Evict any cached information for the query. | public void | evictAll(Object tx) Evict all data. | public CachedQueryResult | getQueryResult(CompiledQuery cq, Object[] params) Get cached query results or null if there are none. | public int | getQueryResultCount(CompiledQuery cq, Object[] params) Get result count or -1 if there are none. | public State | getState(OID oid, FetchGroup fetchGroup) Get the State for an OID or null if it is not in cache or does not
contain the fields in the fetchGroup. | public boolean | isEnabled() | public boolean | isQueryCacheEnabled() | public void | setJDOMetaData(ModelMetaData jmd) This is invoked when the meta data is available. |
beginTx | public Object beginTx()(Code) | | Begin a cache transaction and return an identifier for it. This
must be called before a new database transaction is started.
|
contains | public boolean contains(OID oid)(Code) | | Does the cache contain any data for the oid? Note that the data could
be evicted at any time.
|
endTx | public void endTx(Object tx)(Code) | | End a cache transaction.
|
evict | public void evict(Object tx, OID[] oids, int offset, int length, int expected)(Code) | | Evict length OIDs from oids starting at offset. Expected is the total
number of OIDs we expect to evict in the transaction or 0 if this is
not known. This may be used to optimize cache storage allocation.
|
evictAll | public void evictAll(Object tx)(Code) | | Evict all data.
|
getQueryResultCount | public int getQueryResultCount(CompiledQuery cq, Object[] params)(Code) | | Get result count or -1 if there are none.
Parameters: cq - Parameters: params - |
getState | public State getState(OID oid, FetchGroup fetchGroup)(Code) | | Get the State for an OID or null if it is not in cache or does not
contain the fields in the fetchGroup. This returns a copy of the
data in the cache. If fetchGroup is null then if any state is
present it is returned.
|
isEnabled | public boolean isEnabled()(Code) | | Is the cache enabled?
|
isQueryCacheEnabled | public boolean isQueryCacheEnabled()(Code) | | Is query caching enabled?
|
setJDOMetaData | public void setJDOMetaData(ModelMetaData jmd)(Code) | | This is invoked when the meta data is available.
|
|
|