@Tags(value={"distributed","cache","map","cluster","couchbase"}) @CapabilityDescription(value="Provides the ability to communicate with a Couchbase Server cluster as a DistributedMapCacheServer. This can be used in order to share a Map between nodes in a NiFi cluster. Couchbase Server cluster can provide a high available and persistent cache storage.") public class CouchbaseMapCacheClient extends AbstractControllerService implements AtomicDistributedMapCacheClient<Long>
| Modifier and Type | Field and Description |
|---|---|
private com.couchbase.client.java.Bucket |
bucket |
private CouchbaseClusterControllerService |
clusterService |
private static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
CouchbaseMapCacheClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(ConfigurationContext context) |
<K> boolean |
containsKey(K key,
Serializer<K> keySerializer) |
private <V> V |
deserialize(com.couchbase.client.java.document.BinaryDocument doc,
Deserializer<V> valueDeserializer) |
<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,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) |
long |
removeByPattern(String regex) |
<K,V> boolean |
replace(AtomicCacheEntry<K,V,Long> entry,
Serializer<K> keySerializer,
Serializer<V> valueSerializer) |
private <V> com.couchbase.client.java.document.Document |
toDocument(String docId,
V value,
Serializer<V> valueSerializer) |
private <V> com.couchbase.client.java.document.Document |
toDocument(String docId,
V value,
Serializer<V> valueSerializer,
long revision) |
private <K> String |
toDocumentId(K key,
Serializer<K> keySerializer) |
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, waitkeySet, putAll, removeAndGet, removeByPatternAndGet, subMapinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate static final org.slf4j.Logger logger
private CouchbaseClusterControllerService clusterService
private com.couchbase.client.java.Bucket bucket
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnEnabled public void configure(ConfigurationContext context)
private <V> com.couchbase.client.java.document.Document toDocument(String docId, V value, Serializer<V> valueSerializer) throws IOException
IOExceptionprivate <V> com.couchbase.client.java.document.Document toDocument(String docId, V value, Serializer<V> valueSerializer, long revision) throws IOException
IOExceptionprivate <K> String toDocumentId(K key, Serializer<K> keySerializer) 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> AtomicCacheEntry<K,V,Long> fetch(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException
fetch in interface AtomicDistributedMapCacheClient<Long>IOExceptionpublic <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> boolean replace(AtomicCacheEntry<K,V,Long> entry, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException
replace in interface AtomicDistributedMapCacheClient<Long>IOExceptionpublic <K> boolean containsKey(K key,
Serializer<K> keySerializer)
throws IOException
containsKey in interface DistributedMapCacheClientIOExceptionpublic <K,V> void put(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
put in interface DistributedMapCacheClientIOExceptionpublic <K,V> V get(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
throws IOException
get in interface DistributedMapCacheClientIOExceptionprivate <V> V deserialize(com.couchbase.client.java.document.BinaryDocument doc,
Deserializer<V> valueDeserializer)
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface DistributedMapCacheClientIOExceptionpublic <K> boolean remove(K key,
Serializer<K> serializer)
throws IOException
remove in interface DistributedMapCacheClientIOExceptionpublic long removeByPattern(String regex) throws IOException
removeByPattern in interface DistributedMapCacheClientIOExceptionCopyright © 2024 Apache NiFi Project. All rights reserved.