Package be.bagofwords.db.remote
Class RemoteDataInterface<T>
- java.lang.Object
-
- be.bagofwords.db.impl.BaseDataInterface<T>
-
- be.bagofwords.db.remote.RemoteDataInterface<T>
-
- All Implemented Interfaces:
DataInterface<T>,be.bagofwords.iterator.DataIterable<be.bagofwords.util.KeyValue<T>>,Iterable<be.bagofwords.util.KeyValue<T>>
public class RemoteDataInterface<T> extends BaseDataInterface<T>
-
-
Field Summary
-
Fields inherited from class be.bagofwords.db.impl.BaseDataInterface
combinator, isTemporaryDataInterface, name, objectClass, objectSerializer
-
-
Constructor Summary
Constructors Constructor Description RemoteDataInterface(String name, Class<T> objectClass, Combinator<T> combinator, ObjectSerializer<T> objectSerializer, String host, int port, boolean isTemporaryDataInterface, be.bagofwords.jobs.AsyncJobService asyncJobService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longapprSize()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>cachedValueIterator()protected voiddoClose()voiddropAllData()longexactSize()You don't want to use this if you could use apprSize()voidflush()DataInterface<T>getCoreDataInterface()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator()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)be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(java.util.function.Predicate<T> valueFilter)be.bagofwords.iterator.CloseableIterator<Long>keyIterator()booleanmightContain(long key)voidoptimizeForReading()Tread(long key)voidregisterUpdateListener(UpdateListener<T> updateListener)be.bagofwords.iterator.CloseableIterator<T>valueIterator(KeyFilter keyFilter)be.bagofwords.iterator.CloseableIterator<T>valueIterator(java.util.function.Predicate<T> valueFilter)voidwrite(long key, T value)voidwrite(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)-
Methods inherited from class be.bagofwords.db.impl.BaseDataInterface
apprDataChecksum, close, 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, streamValues, streamValues, valueIterator, valueIterator, valueIterator, write, write, write
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
RemoteDataInterface
public RemoteDataInterface(String name, Class<T> objectClass, Combinator<T> combinator, ObjectSerializer<T> objectSerializer, String host, int port, boolean isTemporaryDataInterface, be.bagofwords.jobs.AsyncJobService asyncJobService)
-
-
Method Detail
-
read
public T read(long key)
-
mightContain
public boolean mightContain(long key)
-
apprSize
public long apprSize()
-
exactSize
public long exactSize()
Description copied from class:BaseDataInterfaceYou don't want to use this if you could use apprSize()- Specified by:
exactSizein interfaceDataInterface<T>- Overrides:
exactSizein classBaseDataInterface<T>
-
write
public void write(long key, T value)
-
write
public void write(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator()
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(KeyFilter keyFilter)
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(KeyFilter keyFilter)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(java.util.function.Predicate<T> valueFilter)
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(java.util.function.Predicate<T> valueFilter)
-
keyIterator
public be.bagofwords.iterator.CloseableIterator<Long> keyIterator()
-
cachedValueIterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> cachedValueIterator()
-
dropAllData
public void dropAllData()
-
flush
public void flush()
-
optimizeForReading
public void optimizeForReading()
-
doClose
protected void doClose()
- Specified by:
doClosein classBaseDataInterface<T>
-
getCoreDataInterface
public DataInterface<T> getCoreDataInterface()
- Specified by:
getCoreDataInterfacein interfaceDataInterface<T>- Specified by:
getCoreDataInterfacein classBaseDataInterface<T>
-
registerUpdateListener
public void registerUpdateListener(UpdateListener<T> updateListener)
-
-