public static interface InternalKvState.StateIncrementalVisitor<K,N,V>
The visitor should tolerate concurrent modifications.
It might trade this tolerance for consistency
and return duplicates or not all values (created while visiting)
but always state values which exist and up-to-date at the moment of calling nextEntries()
.
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Whether the visitor potentially has some next entries to return from
nextEntries() . |
Collection<StateEntry<K,N,V>> |
nextEntries()
Return some next entries which are available at the moment.
|
void |
remove(StateEntry<K,N,V> stateEntry) |
void |
update(StateEntry<K,N,V> stateEntry,
V newValue)
Update the value of the last returned entry from the
next() method. |
boolean hasNext()
nextEntries()
.Collection<StateEntry<K,N,V>> nextEntries()
If empty collection is returned, it does not mean that the visitor is exhausted but
it means that the visitor has done some incremental work advancing and checking internal data structures.
The finished state of the visitor has to be checked by hasNext()
method.
The returned collection and state values must not be changed internally
(there might be no defensive copies in nextEntries()
for performance).
It has to be deeply copied if it is to modify, e.g. with the update()
method.
void remove(StateEntry<K,N,V> stateEntry)
void update(StateEntry<K,N,V> stateEntry, V newValue)
next()
method.IllegalStateException
- if next() has never been called yet or iteration is over.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.