|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.dataengine.cache.DataEngineCache
Contains a group of RowCollections that have been retrieved from the database, keyed by SQLContext. By storing results retrieved from the database in the cache, applications may be able to find the results they are looking for in the cache instead of having to fetch them from the database every time.
Constructor Summary | |
DataEngineCache(java.lang.String alias)
Creates a DataEngineCache with a maximum size of 10000 and the specified system alias. |
|
DataEngineCache(java.lang.String alias,
int maxSize)
Creates a new DataEngineCache. |
Method Summary | |
void |
clear()
Clears out the cache, removing all entries. |
void |
clearEstimatedSize()
Clears the estimated size of this cache's estimated RowCollections' size. |
void |
close()
Closes down this cache |
protected RowCollection |
get(SQLContext key)
Gets a RowCollection out of the cache, based on the SQLContext. |
java.lang.String |
getAlias()
Gets the system alias associated with this cache |
java.util.List |
getAllKeys()
Gets all the keys in the cache. |
java.util.List |
getAllValues()
Gets all the values in this cache. |
RowCollection |
getCachedRowCollection(SQLContext context)
Allow Cached RowCollections to decide if they can be used for a query. |
java.lang.String |
getDescription()
Gets a text description of this cache |
long |
getEstimatedSize()
Gets the estimated number of bytes of all field values in this RowCollection take up. |
int |
getMaxSize()
Gets the maximum number of items the cache can hold. |
protected long |
getMillisecondTimeout()
Gets the maximum number of MILLISECONDS which a RowCollection can be stored in the cache and still be condsidered valid. |
int |
getTimeout()
Gets the maximum number of seconds which a RowCollection can be stored in the cache and still be considered valid. |
protected void |
put(SQLContext key,
RowCollection results)
Puts a RowCollection in the cache, keyed by the SQLContext. |
protected RowCollection |
remove(SQLContext key)
Removes a RowCollection from the cache, based on the SQLContext. |
void |
rowAltered(SQLContext context,
ExecutingContext ec,
long timestamp)
This method is invoked when a single row is deleted, inserted, or updated. |
void |
setDescription(java.lang.String newDescription)
Sets a text description of this cache. |
protected void |
setMillisecondTimeout(long millis)
Sets the maximum number of MILLISECONDS which a RowCollection can be stored in the cache and still be condsidered valid. |
void |
setTimeout(int seconds)
Sets the maximum number of seconds which a RowCollection can be stored in the cache and still be considered valid. |
int |
size()
Gets the number of items in the cache |
java.lang.String |
toString()
Returns the description of this cache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DataEngineCache(java.lang.String alias)
public DataEngineCache(java.lang.String alias, int maxSize)
alias
- The system alias to which the cache correspondsmaxSize
- The maximum number of entries the cache can hold.Method Detail |
public void clear()
public void clearEstimatedSize()
public void close()
protected RowCollection get(SQLContext key) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
public java.lang.String getAlias()
public java.util.List getAllKeys()
public java.util.List getAllValues()
public RowCollection getCachedRowCollection(SQLContext context)
context
- The SQLContext containing the alteration informationpublic java.lang.String getDescription()
public long getEstimatedSize()
public final int getMaxSize()
protected final long getMillisecondTimeout()
public int getTimeout()
protected void put(SQLContext key, RowCollection results) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
protected RowCollection remove(SQLContext key) throws DataEngineException
key
- The SQLContext, which is the RowCollection's key
DataEngineException
public void rowAltered(SQLContext context, ExecutingContext ec, long timestamp) throws CMException
context
- The SQLContext containing the alteration informationec
- The current executing contexttimestamp
- The time associated with the alteration
CMException
public void setDescription(java.lang.String newDescription)
protected final void setMillisecondTimeout(long millis)
public void setTimeout(int seconds)
public int size()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |