K
- the key type for the recordpublic interface DatasetReader<K extends java.lang.Comparable<K>>
Modifier and Type | Method and Description |
---|---|
default AsyncDatasetReader<K> |
async()
Returns an asynchronous version of this reader using the
ForkJoinPool.commonPool() as an executor. |
AsyncDatasetReader<K> |
async(java.util.concurrent.Executor executor)
Returns an asynchronous version of this reader.
|
void |
deregisterChangeListener(ChangeListener<K> listener)
Deregisters a listener so that it no longer receives events
|
java.util.Optional<Record<K>> |
get(K key)
Retrieves the record for the specified key.
|
Type<K> |
getKeyType()
Return the key type of underlying
Dataset . |
ReadRecordAccessor<K> |
on(K key)
Returns a ReadRecordAccessor which can be used to for fine-control of
read operations on the record held against the specified key.
|
RecordStream<K> |
records()
Returns a
Stream of the records in this dataset. |
void |
registerChangeListener(ChangeListener<K> listener)
Registers a listener that will receive an event for changes to a key.
|
java.util.Optional<Record<K>> get(K key)
key
- key for the recordReadRecordAccessor<K> on(K key)
key
- key for the recordRecordStream<K> records()
Stream
of the records in this dataset.default AsyncDatasetReader<K> async()
ForkJoinPool.commonPool()
as an executor.AsyncDatasetReader<K> async(java.util.concurrent.Executor executor)
Any asynchronous tasks associated with operations run through the returned reader will be submitted to the given executor.
executor
- executor for asynchronous tasksvoid registerChangeListener(ChangeListener<K> listener)
The order of events that would be received for changes to a particular key will be same as the order in which the server has made those changes on that key. Note: This ordering of events is guaranteed only for changes to a key and not across the keys.
listener
- the user provided object to which events will be sentvoid deregisterChangeListener(ChangeListener<K> listener)
listener
- the listener to be deregistered