|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdods.servers.agg.CacheDataset
public class CacheDataset
This keeps a cache of Datasets, up to maxCached, and closes old ones based on a simple LRU algorithm. Supposed to be thread safe. The dataset mutex lock is acquired if successful.
Constructor Summary | |
---|---|
CacheDataset(DatasetFactory factory,
String cacheName,
int maxCached)
|
Method Summary | |
---|---|
Dataset |
acquire(String extPath,
String intPath,
InvCatalog.Dataset invDS)
This finds the named dataset and gets a lock on it. |
Iterator |
getCache()
FOR DEBUGUGGING ONLY |
int |
getCacheSize()
get current size of the cache. |
void |
setCacheMax(int maxCached)
set maximum size of cache. |
void |
setWaitTime(long wait)
set maximum time to wait before opening another copy of the dataset. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheDataset(DatasetFactory factory, String cacheName, int maxCached)
cacheName
- name of cache (for debug messages)maxCached
- maximum number to cache (<= 0 means unlimited)Method Detail |
---|
public void setCacheMax(int maxCached)
public void setWaitTime(long wait)
wait
- : time in msecpublic int getCacheSize()
public Iterator getCache()
public Dataset acquire(String extPath, String intPath, InvCatalog.Dataset invDS) throws IOException
extPath
- : external URL of datasetintPath
- : internal URL of datasetinvDS
- : InvCatalog.Dataset object
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |