@Tags(value={"distributed","client","cluster","map","cache"}) @CapabilityDescription(value="Provides the ability to communicate with a DistributedMapCacheServer. This allows multiple nodes to coordinate state with a single remote entity.") public interface AtomicDistributedMapCacheClient extends DistributedMapCacheClient
This interface defines an API that can be used for interacting with a
Distributed Cache that functions similarly to a Map
.
In addition to the API defined in DistributedMapCacheClient
super class,
this class provides methods for concurrent atomic updates those are added since Map Cache protocol version 2.
If a remote cache server doesn't support Map Cache protocol version 2, these methods throw UnsupportedOperationException.
Modifier and Type | Interface and Description |
---|---|
static interface |
AtomicDistributedMapCacheClient.CacheEntry<K,V> |
Modifier and Type | Method and Description |
---|---|
<K,V> AtomicDistributedMapCacheClient.CacheEntry<K,V> |
fetch(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
Fetch a CacheEntry with a key.
|
<K,V> boolean |
replace(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer,
long revision)
Replace an existing key with new value.
|
close, containsKey, get, getAndPutIfAbsent, put, putIfAbsent, remove, removeByPattern
initialize
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
<K,V> AtomicDistributedMapCacheClient.CacheEntry<K,V> fetch(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException
K
- the key typeV
- the value typekey
- the key to lookup in the mapkeySerializer
- key serializervalueDeserializer
- value deserializerIOException
- if unable to communicate with the remote instance<K,V> boolean replace(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer, long revision) throws IOException
K
- the key typeV
- the value typekey
- the key to replacevalue
- the new value for the keykeySerializer
- key serializervalueSerializer
- value serializerrevision
- a revision that was retrieved by a preceding fetch operation, if the key is already updated by other client,
this doesn't match with the one on server, therefore the replace operation will not be performed.
If there's no existing entry for the key, any revision can replace the key.IOException
- if unable to communicate with the remote instanceCopyright © 2017 Apache NiFi Project. All rights reserved.