Package org.apache.spark.sql.streaming
Interface MapState<K,V>
- All Superinterfaces:
Serializable
Interface used for arbitrary stateful operations with the v2 API to capture
map value state.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Remove this state.booleancontainsKey(K key) Check if the user key is contained in the mapbooleanexists()Whether state exists or not.Get the state value if it existsiterator()Get the map associated with grouping keyscala.collection.Iterator<K>keys()Get the list of keys present in map associated with grouping keyvoidRemove user key from map statevoidupdateValue(K key, V value) Update value for given user keyscala.collection.Iterator<V>values()Get the list of values present in map associated with grouping key
-
Method Details
-
clear
void clear()Remove this state. -
containsKey
Check if the user key is contained in the map -
exists
boolean exists()Whether state exists or not. -
getValue
Get the state value if it exists -
iterator
Get the map associated with grouping key -
keys
scala.collection.Iterator<K> keys()Get the list of keys present in map associated with grouping key -
removeKey
Remove user key from map state -
updateValue
Update value for given user key -
values
scala.collection.Iterator<V> values()Get the list of values present in map associated with grouping key
-