|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.helidb.backend.cache.lru.LruCacheBackendFactory<K,V,P>
K - The type of keys in the database.V - The type of values in the database.P - The type used to represent positions in the proxied backend.public class LruCacheBackendFactory<K,V,P>
This is a DatabaseBackendFactory for building LruCacheBackend
objects.
| Field Summary | |
|---|---|
static int |
DEFAULT_CACHE_SIZE
The default cache size is 128 records. |
static int |
DEFAULT_NEGATIVE_CACHE_SIZE
The default negative cache size is 32 keys. |
| Constructor Summary | |
|---|---|
LruCacheBackendFactory()
|
|
| Method Summary | |
|---|---|
DatabaseBackend<K,V,P> |
create(DatabaseFiles files,
boolean readOnly)
Create a new backend for the supplied file. |
LruCacheBackendFactory<K,V,P> |
setMaxCacheSize(int cacheSize)
Set the maximum size for the database record cache. |
LruCacheBackendFactory<K,V,P> |
setMaxNegativeCacheSize(int negativeCacheSize)
Set the maximum size for the cache for failed search results. |
LruCacheBackendFactory<K,V,P> |
setProxiedBackendFactory(DatabaseBackendFactory<K,V,P> factory)
Set the factory for the proxied backend. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_CACHE_SIZE
public static final int DEFAULT_NEGATIVE_CACHE_SIZE
| Constructor Detail |
|---|
public LruCacheBackendFactory()
| Method Detail |
|---|
public LruCacheBackendFactory<K,V,P> setProxiedBackendFactory(DatabaseBackendFactory<K,V,P> factory)
factory - The factory for the proxied backend.
this.
public LruCacheBackendFactory<K,V,P> setMaxCacheSize(int cacheSize)
throws IllegalArgumentException
cacheSize - The maximum record cache size.
this
IllegalArgumentException - If the cache size is < 0.
public LruCacheBackendFactory<K,V,P> setMaxNegativeCacheSize(int negativeCacheSize)
throws IllegalArgumentException
negativeCacheSize - The maximum size for the negative cache.
this
IllegalArgumentException - If the cache size is < 0.
public DatabaseBackend<K,V,P> create(DatabaseFiles files,
boolean readOnly)
DatabaseBackendFactory
create in interface DatabaseBackendFactory<K,V,P>files - The file(s) containing the database data. The implementation of
this method should be able to assume a specific DatabaseFiles
implementation. Which depends on the implementation of the database
backend to create.readOnly - Should the backend object be created read only?
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||