K
- The type of partitioned key the state is associated to.UK
- The type of user key of this state.V
- The type of values kept internally in state.public class InternalMapState<K,UK,V> extends InternalKeyedState<K,V> implements MapState<UK,V>
MapState
which delegates all async requests to StateRequestHandler
.Constructor and Description |
---|
InternalMapState(StateRequestHandler stateRequestHandler,
MapStateDescriptor<UK,V> stateDescriptor) |
Modifier and Type | Method and Description |
---|---|
StateFuture<Boolean> |
asyncContains(UK key)
Returns whether there exists the given mapping asynchronously.
|
StateFuture<StateIterator<Map.Entry<UK,V>>> |
asyncEntries()
Returns the current iterator for all the mappings of this state asynchronously.
|
StateFuture<V> |
asyncGet(UK key)
Returns the current value associated with the given key asynchronously.
|
StateFuture<Boolean> |
asyncIsEmpty()
Returns whether this state contains no key-value mappings asynchronously.
|
StateFuture<StateIterator<UK>> |
asyncKeys()
Returns the current iterator for all the keys of this state asynchronously.
|
StateFuture<Void> |
asyncPut(UK key,
V value)
Update the current value associated with the given key asynchronously.
|
StateFuture<Void> |
asyncPutAll(Map<UK,V> map)
Update all of the mappings from the given map into the state asynchronously.
|
StateFuture<Void> |
asyncRemove(UK key)
Delete the mapping of the given key from the state asynchronously.
|
StateFuture<StateIterator<V>> |
asyncValues()
Returns the current iterator for all the values of this state asynchronously.
|
asyncClear, getStateDescriptor, getValueSerializer, handleRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncClear
public InternalMapState(StateRequestHandler stateRequestHandler, MapStateDescriptor<UK,V> stateDescriptor)
public StateFuture<V> asyncGet(UK key)
MapState
asyncGet
in interface MapState<UK,V>
StateFuture
that will return value corresponding to the current input.
When no corresponding value for this key, the future will return null
.public StateFuture<Void> asyncPut(UK key, V value)
MapState
null
value is
provided, the state for the given key will be removed.asyncPut
in interface MapState<UK,V>
key
- The key that will be updated.value
- The new value for the key.StateFuture
that will trigger the callback when update finishes.public StateFuture<Void> asyncPutAll(Map<UK,V> map)
MapState
null
value is
provided within the map, the state for the corresponding key will be removed.
If an empty map is passed in, the state value remains unchanged.
Null map pointer is not allowed.
asyncPutAll
in interface MapState<UK,V>
map
- The mappings to be stored in this state.StateFuture
that will trigger the callback when update finishes.public StateFuture<Void> asyncRemove(UK key)
MapState
asyncRemove
in interface MapState<UK,V>
key
- The key of the mapping.StateFuture
that will trigger the callback when update finishes.public StateFuture<Boolean> asyncContains(UK key)
MapState
asyncContains
in interface MapState<UK,V>
key
- The key of the mapping.StateFuture
that will return true if there exists a mapping whose key
equals to the given key.public StateFuture<StateIterator<Map.Entry<UK,V>>> asyncEntries()
MapState
asyncEntries
in interface MapState<UK,V>
StateFuture
that will return mapping iterator corresponding to the
current input.public StateFuture<StateIterator<UK>> asyncKeys()
MapState
asyncKeys
in interface MapState<UK,V>
StateFuture
that will return key iterator corresponding to the current
input.public StateFuture<StateIterator<V>> asyncValues()
MapState
asyncValues
in interface MapState<UK,V>
StateFuture
that will return value iterator corresponding to the current
input.public StateFuture<Boolean> asyncIsEmpty()
MapState
asyncIsEmpty
in interface MapState<UK,V>
StateFuture
that will return true if there is no key-value mapping,
otherwise false.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.