K
- The key type of the elements in the ReadOnlyBroadcastState
.V
- The value type of the elements in the ReadOnlyBroadcastState
.@PublicEvolving public interface ReadOnlyBroadcastState<K,V> extends State
BroadcastState
.
Although read-only, the user code should not modify the value returned by the get(Object)
or the entries of the immutable iterator returned by the immutableEntries()
, as this can lead to inconsistent states. The reason for this is that we do
not create extra copies of the elements for performance reasons.
Modifier and Type | Method and Description |
---|---|
boolean |
contains(K key)
Returns whether there exists the given mapping.
|
V |
get(K key)
Returns the current value associated with the given key.
|
Iterable<Map.Entry<K,V>> |
immutableEntries()
Returns an immutable
Iterable over the entries in the state. |
V get(K key) throws Exception
The user code must not modify the value returned, as this can lead to inconsistent states.
key
- The key of the mappingException
- Thrown if the system cannot access the state.boolean contains(K key) throws Exception
key
- The key of the mappingException
- Thrown if the system cannot access the state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.