public class CachingStorage extends StorageDecorator
Bin is instructed to flush its
data when Bin.sync() is called.newCache() method if you want to
work with a different caching strategy._storage| Constructor and Description |
|---|
CachingStorage(Storage storage)
default constructor to create a Caching storage with the default
page count of 64 and the default page size of 1024.
|
CachingStorage(Storage storage,
int pageCount,
int pageSize)
constructor to set up a CachingStorage with a configured page count
and page size
|
| Modifier and Type | Method and Description |
|---|---|
protected Cache4<java.lang.Long,java.lang.Object> |
newCache()
override this method if you want to work with a different caching
strategy than the default LRU2Q cache.
|
Bin |
open(BinConfiguration config)
opens a Bin for the given URI.
|
decorate, delete, exists, renamepublic CachingStorage(Storage storage)
storage - the Storage to be cached.public CachingStorage(Storage storage, int pageCount, int pageSize)
storage - the Storage to be cached.pageCount - the number of pages the cache should use.pageSize - the size of the pages the cache should use.public Bin open(BinConfiguration config) throws Db4oIOException
open in interface Storageopen in class StorageDecoratorDb4oIOExceptionprotected Cache4<java.lang.Long,java.lang.Object> newCache()