Class CassandraDistributedMapCache
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
org.apache.nifi.controller.cassandra.CassandraDistributedMapCache
- All Implemented Interfaces:
ConfigurableComponent,ControllerService,DistributedMapCacheClient
@Tags({"map","cache","distributed","cassandra"})
@CapabilityDescription("Provides a DistributedMapCache client that is based on Apache Cassandra.")
public class CassandraDistributedMapCache
extends AbstractControllerService
implements DistributedMapCacheClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.datastax.driver.core.PreparedStatementstatic final List<PropertyDescriptor> private com.datastax.driver.core.PreparedStatementprivate com.datastax.driver.core.PreparedStatementprivate com.datastax.driver.core.PreparedStatementstatic final PropertyDescriptorprivate Stringprivate com.datastax.driver.core.Sessionstatic final PropertyDescriptorprivate CassandraSessionProviderServicestatic final PropertyDescriptorprivate Stringprivate Longstatic final PropertyDescriptorstatic final PropertyDescriptorprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<K> booleancontainsKey(K k, Serializer<K> serializer) <K,V> V get(K k, Serializer<K> serializer, Deserializer<V> deserializer) <K,V> V getAndPutIfAbsent(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> deserializer) protected List<PropertyDescriptor> voidvoidonEnabled(ConfigurationContext context) <K,V> void put(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer) <K,V> boolean putIfAbsent(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer) <K> booleanremove(K k, Serializer<K> serializer) longprivate <K> byte[]serializeKey(K k, Serializer<K> keySerializer) private <V> byte[]serializeValue(V v, Serializer<V> valueSerializer) Methods inherited from class org.apache.nifi.controller.AbstractControllerService
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful, migratePropertiesMethods inherited from interface org.apache.nifi.distributed.cache.client.DistributedMapCacheClient
keySet, putAll, removeAndGet, removeByPatternAndGet, subMap
-
Field Details
-
SESSION_PROVIDER
-
TABLE_NAME
-
KEY_FIELD_NAME
-
VALUE_FIELD_NAME
-
TTL
-
DESCRIPTORS
-
sessionProviderService
-
tableName
-
keyField
-
valueField
-
ttl
-
session
private com.datastax.driver.core.Session session -
deleteStatement
private com.datastax.driver.core.PreparedStatement deleteStatement -
existsStatement
private com.datastax.driver.core.PreparedStatement existsStatement -
fetchStatement
private com.datastax.driver.core.PreparedStatement fetchStatement -
insertStatement
private com.datastax.driver.core.PreparedStatement insertStatement
-
-
Constructor Details
-
CassandraDistributedMapCache
public CassandraDistributedMapCache()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classAbstractConfigurableComponent
-
onEnabled
-
onDisabled
-
putIfAbsent
public <K,V> boolean putIfAbsent(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException - Specified by:
putIfAbsentin interfaceDistributedMapCacheClient- Throws:
IOException
-
getAndPutIfAbsent
public <K,V> V getAndPutIfAbsent(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> deserializer) throws IOException - Specified by:
getAndPutIfAbsentin interfaceDistributedMapCacheClient- Throws:
IOException
-
containsKey
- Specified by:
containsKeyin interfaceDistributedMapCacheClient- Throws:
IOException
-
put
public <K,V> void put(K k, V v, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException - Specified by:
putin interfaceDistributedMapCacheClient- Throws:
IOException
-
get
- Specified by:
getin interfaceDistributedMapCacheClient- Throws:
IOException
-
close
- Specified by:
closein interfaceDistributedMapCacheClient- Throws:
IOException
-
remove
- Specified by:
removein interfaceDistributedMapCacheClient- Throws:
IOException
-
removeByPattern
- Specified by:
removeByPatternin interfaceDistributedMapCacheClient- Throws:
IOException
-
serializeKey
- Throws:
IOException
-
serializeValue
- Throws:
IOException
-