Interface ReadOnlyBroadcastState<K,V>
-
- Type Parameters:
K- The key type of the elements in theReadOnlyBroadcastState.V- The value type of the elements in theReadOnlyBroadcastState.
- All Superinterfaces:
State
- All Known Subinterfaces:
BroadcastState<K,V>
@PublicEvolving public interface ReadOnlyBroadcastState<K,V> extends State
A read-only view of theBroadcastState.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 theimmutableEntries(), 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(K key)Returns whether there exists the given mapping.Vget(K key)Returns the current value associated with the given key.Iterable<Map.Entry<K,V>>immutableEntries()Returns an immutableIterableover the entries in the state.
-
-
-
Method Detail
-
get
V get(K key) throws Exception
Returns the current value associated with the given key.The user code must not modify the value returned, as this can lead to inconsistent states.
- Parameters:
key- The key of the mapping- Returns:
- The value of the mapping with the given key
- Throws:
Exception- Thrown if the system cannot access the state.
-
contains
boolean contains(K key) throws Exception
Returns whether there exists the given mapping.- Parameters:
key- The key of the mapping- Returns:
- True if there exists a mapping whose key equals to the given key
- Throws:
Exception- Thrown if the system cannot access the state.
-
-