@Tags(value={"distributed","cache","state","map","cluster"}) @SeeAlso(classNames={"org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer","org.apache.nifi.ssl.StandardSSLContextService"}) @CapabilityDescription(value="Provides the ability to communicate with a DistributedMapCacheServer. This can be used in order to share a Map between nodes in a NiFi cluster") public class DistributedMapCacheClientService extends AbstractControllerService implements AtomicDistributedMapCacheClient<Long>
| Modifier and Type | Field and Description |
|---|---|
private NettyDistributedMapCacheClient |
cacheClient
The implementation of the business logic for
DistributedMapCacheClientService. |
static PropertyDescriptor |
COMMUNICATIONS_TIMEOUT |
private static long |
DEFAULT_CACHE_REVISION |
static PropertyDescriptor |
HOSTNAME |
static PropertyDescriptor |
PORT |
static PropertyDescriptor |
SSL_CONTEXT_SERVICE |
private VersionNegotiatorFactory |
versionNegotiatorFactory
Creator of object used to broker the version of the distributed cache protocol with the service.
|
| Constructor and Description |
|---|
DistributedMapCacheClientService() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<K> boolean |
containsKey(K key,
Serializer<K> keySerializer) |
<K,V> AtomicCacheEntry<K,V,Long> |
fetch(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer) |
<K,V> V |
get(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer) |
<K,V> V |
getAndPutIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer,
Deserializer<V> valueDeserializer) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
<K> Set<K> |
keySet(Deserializer<K> keyDeserializer) |
void |
onDisabled() |
void |
onEnabled(ConfigurationContext context) |
void |
onStopped() |
<K,V> void |
put(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer) |
<K,V> boolean |
putIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer) |
<K> boolean |
remove(K key,
Serializer<K> serializer) |
<K,V> V |
removeAndGet(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer) |
long |
removeByPattern(String regex) |
<K,V> Map<K,V> |
removeByPatternAndGet(String regex,
Deserializer<K> keyDeserializer,
Deserializer<V> valueDeserializer) |
<K,V> boolean |
replace(AtomicCacheEntry<K,V,Long> entry,
Serializer<K> keySerializer,
Serializer<V> valueSerializer) |
<K,V> Map<K,V> |
subMap(Set<K> keys,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer) |
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledcustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitputAllinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate static final long DEFAULT_CACHE_REVISION
public static final PropertyDescriptor HOSTNAME
public static final PropertyDescriptor PORT
public static final PropertyDescriptor SSL_CONTEXT_SERVICE
public static final PropertyDescriptor COMMUNICATIONS_TIMEOUT
private volatile NettyDistributedMapCacheClient cacheClient
DistributedMapCacheClientService.private volatile VersionNegotiatorFactory versionNegotiatorFactory
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnEnabled public void onEnabled(ConfigurationContext context)
@OnDisabled public void onDisabled() throws IOException
IOException@OnStopped public void onStopped() throws IOException
IOExceptionpublic <K,V> boolean putIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
putIfAbsent in interface DistributedMapCacheClientIOExceptionpublic <K,V> void put(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
put in interface DistributedMapCacheClientIOExceptionpublic <K> boolean containsKey(K key,
Serializer<K> keySerializer)
throws IOException
containsKey in interface DistributedMapCacheClientIOExceptionpublic <K,V> V getAndPutIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer,
Deserializer<V> valueDeserializer)
throws IOException
getAndPutIfAbsent in interface DistributedMapCacheClientIOExceptionpublic <K,V> V get(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
throws IOException
get in interface DistributedMapCacheClientIOExceptionpublic <K,V> Map<K,V> subMap(Set<K> keys, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException
subMap in interface DistributedMapCacheClientIOExceptionpublic <K> boolean remove(K key,
Serializer<K> serializer)
throws IOException
remove in interface DistributedMapCacheClientIOExceptionpublic <K,V> V removeAndGet(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
throws IOException
removeAndGet in interface DistributedMapCacheClientIOExceptionpublic long removeByPattern(String regex) throws IOException
removeByPattern in interface DistributedMapCacheClientIOExceptionpublic <K,V> Map<K,V> removeByPatternAndGet(String regex, Deserializer<K> keyDeserializer, Deserializer<V> valueDeserializer) throws IOException
removeByPatternAndGet in interface DistributedMapCacheClientIOExceptionpublic <K,V> AtomicCacheEntry<K,V,Long> fetch(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException
fetch in interface AtomicDistributedMapCacheClient<Long>IOExceptionpublic <K,V> boolean replace(AtomicCacheEntry<K,V,Long> entry, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException
replace in interface AtomicDistributedMapCacheClient<Long>IOExceptionpublic <K> Set<K> keySet(Deserializer<K> keyDeserializer) throws IOException
keySet in interface DistributedMapCacheClientIOExceptionpublic void close()
throws IOException
close in interface DistributedMapCacheClientIOExceptionCopyright © 2022 Apache NiFi Project. All rights reserved.