Package be.bagofwords.db.cached
Class CachedDataInterface<T>
- java.lang.Object
-
- be.bagofwords.db.impl.BaseDataInterface<T>
-
- be.bagofwords.db.LayeredDataInterface<T>
-
- be.bagofwords.db.cached.CachedDataInterface<T>
-
- All Implemented Interfaces:
DataInterface<T>,be.bagofwords.iterator.DataIterable<be.bagofwords.util.KeyValue<T>>,be.bagofwords.memory.MemoryGobbler,Iterable<be.bagofwords.util.KeyValue<T>>
public class CachedDataInterface<T> extends LayeredDataInterface<T> implements be.bagofwords.memory.MemoryGobbler
-
-
Field Summary
-
Fields inherited from class be.bagofwords.db.LayeredDataInterface
baseInterface
-
Fields inherited from class be.bagofwords.db.impl.BaseDataInterface
combinator, isTemporaryDataInterface, name, objectClass, objectSerializer
-
-
Constructor Summary
Constructors Constructor Description CachedDataInterface(be.bagofwords.memory.MemoryManager memoryManager, be.bagofwords.cache.CachesManager cachesManager, DataInterface<T> baseInterface, be.bagofwords.jobs.AsyncJobService asyncJobService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>cachedValueIterator()voiddoCloseImpl()voiddropAllData()voidflush()longfreeMemory()longgetMemoryUsage()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(KeyFilter keyFilter)be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)booleanmightContain(long key)Tread(long key)be.bagofwords.iterator.CloseableIterator<T>valueIterator(KeyFilter keyFilter)be.bagofwords.iterator.CloseableIterator<T>valueIterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)voidwrite(long key, T value)voidwrite(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)-
Methods inherited from class be.bagofwords.db.LayeredDataInterface
apprSize, doClose, getCoreDataInterface, iterator, iterator, keyIterator, optimizeForReading, registerUpdateListener, streamValues, streamValues, valueIterator
-
Methods inherited from class be.bagofwords.db.impl.BaseDataInterface
apprDataChecksum, close, exactSize, finalize, getCombinator, getName, getObjectClass, getObjectSerializer, ifNotClosed, isTemporaryDataInterface, wasClosed
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface be.bagofwords.db.DataInterface
increaseCount, increaseCount, increaseCount, increaseCount, iterator, mightContain, read, read, readCount, readCount, readCount, remove, remove, stream, stream, stream, stream, streamKeys, streamValues, streamValues, streamValues, valueIterator, valueIterator, write, write, write
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CachedDataInterface
public CachedDataInterface(be.bagofwords.memory.MemoryManager memoryManager, be.bagofwords.cache.CachesManager cachesManager, DataInterface<T> baseInterface, be.bagofwords.jobs.AsyncJobService asyncJobService)
-
-
Method Detail
-
read
public T read(long key)
- Specified by:
readin interfaceDataInterface<T>- Overrides:
readin classLayeredDataInterface<T>
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(KeyFilter keyFilter)
- Specified by:
iteratorin interfaceDataInterface<T>- Overrides:
iteratorin classLayeredDataInterface<T>
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(KeyFilter keyFilter)
- Specified by:
valueIteratorin interfaceDataInterface<T>- Overrides:
valueIteratorin classLayeredDataInterface<T>
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)
- Specified by:
iteratorin interfaceDataInterface<T>- Overrides:
iteratorin classLayeredDataInterface<T>
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)
- Specified by:
valueIteratorin interfaceDataInterface<T>- Overrides:
valueIteratorin classLayeredDataInterface<T>
-
mightContain
public boolean mightContain(long key)
- Specified by:
mightContainin interfaceDataInterface<T>- Overrides:
mightContainin classLayeredDataInterface<T>
-
write
public void write(long key, T value)- Specified by:
writein interfaceDataInterface<T>- Overrides:
writein classLayeredDataInterface<T>
-
cachedValueIterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> cachedValueIterator()
- Specified by:
cachedValueIteratorin interfaceDataInterface<T>- Overrides:
cachedValueIteratorin classLayeredDataInterface<T>
-
write
public void write(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)
- Specified by:
writein interfaceDataInterface<T>- Overrides:
writein classLayeredDataInterface<T>
-
doCloseImpl
public void doCloseImpl()
- Specified by:
doCloseImplin classLayeredDataInterface<T>
-
flush
public void flush()
- Specified by:
flushin interfaceDataInterface<T>- Overrides:
flushin classLayeredDataInterface<T>
-
dropAllData
public void dropAllData()
- Specified by:
dropAllDatain interfaceDataInterface<T>- Overrides:
dropAllDatain classLayeredDataInterface<T>
-
freeMemory
public long freeMemory()
- Specified by:
freeMemoryin interfacebe.bagofwords.memory.MemoryGobbler
-
getMemoryUsage
public long getMemoryUsage()
- Specified by:
getMemoryUsagein interfacebe.bagofwords.memory.MemoryGobbler
-
-