|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.AbstractIndexCache<T>
T - public abstract class AbstractIndexCache<T extends IRangeQuery>
Abstract base class providing caching for IIndex like objects. A
canonicalizing cache is used with weak references to the IIndexs
back by a hard reference LRU cache. This tends to keep around views that
are reused while letting references for unused views be cleared by the
garbage collector in a timely manner.
| Field Summary | |
|---|---|
protected static boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
protected |
AbstractIndexCache(int capacity,
long timeout)
|
| Method Summary | |
|---|---|
protected void |
dropIndexFromCache(String name)
Drop the ITx.UNISOLATED and ITx.READ_COMMITTED
entries for the named index from the cache. |
T |
getIndex(String name,
long timestamp)
Request a view of an index. |
protected abstract T |
newView(String name,
long timestamp)
Method is invoked on a cache miss and returns a view of the described index. |
protected void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
| Constructor Detail |
|---|
protected AbstractIndexCache(int capacity,
long timeout)
capacity - The capacity of the backing LRU hard reference cache.timeout - The timeout in milliseconds for stale entries in the cache.IBigdataClient.Options.CLIENT_INDEX_CACHE_CAPACITY,
IBigdataClient.Options.CLIENT_INDEX_CACHE_TIMEOUT| Method Detail |
|---|
protected abstract T newView(String name,
long timestamp)
name - timestamp -
null if the described index
does not exist.
public T getIndex(String name,
long timestamp)
Note: ITx.READ_COMMITTED views are cached. Read-committed
semantics are obtained by the indirection imposed by the
IClientIndex, which converts a request by the client into a
request against the appropriate IDataServices via task(s)
submitted against those services.
name - The index name.timestamp - The timestamp of the view.
null if the described index
does not exist.protected void dropIndexFromCache(String name)
ITx.UNISOLATED and ITx.READ_COMMITTED
entries for the named index from the cache.
Historical and transactional reads are still allowed, but we remove the read-committed or unisolated views from the cache once the index has been dropped. If a client wants them, it needs to re-request. If they have been re-registered on the metadata service then they will become available again.
Note: Operations against unisolated or read-committed indices will throw exceptions if they execute after the index was dropped.
protected void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||