@Tags(value={"map","cache","distributed","cassandra"}) @CapabilityDescription(value="Provides a DistributedMapCache client that is based on Apache Cassandra.") public class CassandraDistributedMapCache extends AbstractControllerService implements DistributedMapCacheClient
| Modifier and Type | Field and Description |
|---|---|
private com.datastax.driver.core.PreparedStatement |
deleteStatement |
static List<PropertyDescriptor> |
DESCRIPTORS |
private com.datastax.driver.core.PreparedStatement |
existsStatement |
private com.datastax.driver.core.PreparedStatement |
fetchStatement |
private com.datastax.driver.core.PreparedStatement |
insertStatement |
static PropertyDescriptor |
KEY_FIELD_NAME |
private String |
keyField |
private com.datastax.driver.core.Session |
session |
static PropertyDescriptor |
SESSION_PROVIDER |
private CassandraSessionProviderService |
sessionProviderService |
static PropertyDescriptor |
TABLE_NAME |
private String |
tableName |
private Long |
ttl |
static PropertyDescriptor |
TTL |
static PropertyDescriptor |
VALUE_FIELD_NAME |
private String |
valueField |
| Constructor and Description |
|---|
CassandraDistributedMapCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<K> boolean |
containsKey(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> |
getSupportedPropertyDescriptors() |
void |
onDisabled() |
void |
onEnabled(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> boolean |
remove(K k,
Serializer<K> serializer) |
long |
removeByPattern(String s) |
private <K> byte[] |
serializeKey(K k,
Serializer<K> keySerializer) |
private <V> byte[] |
serializeValue(V v,
Serializer<V> valueSerializer) |
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, subMapinitializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor SESSION_PROVIDER
public static final PropertyDescriptor TABLE_NAME
public static final PropertyDescriptor KEY_FIELD_NAME
public static final PropertyDescriptor VALUE_FIELD_NAME
public static final PropertyDescriptor TTL
public static final List<PropertyDescriptor> DESCRIPTORS
private CassandraSessionProviderService sessionProviderService
private String tableName
private String keyField
private String valueField
private Long ttl
private com.datastax.driver.core.Session session
private com.datastax.driver.core.PreparedStatement deleteStatement
private com.datastax.driver.core.PreparedStatement existsStatement
private com.datastax.driver.core.PreparedStatement fetchStatement
private com.datastax.driver.core.PreparedStatement insertStatement
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnEnabled public void onEnabled(ConfigurationContext context)
@OnDisabled public void onDisabled()
public <K,V> boolean putIfAbsent(K k,
V v,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
putIfAbsent in interface DistributedMapCacheClientIOExceptionpublic <K,V> V getAndPutIfAbsent(K k,
V v,
Serializer<K> keySerializer,
Serializer<V> valueSerializer,
Deserializer<V> deserializer)
throws IOException
getAndPutIfAbsent in interface DistributedMapCacheClientIOExceptionpublic <K> boolean containsKey(K k,
Serializer<K> serializer)
throws IOException
containsKey in interface DistributedMapCacheClientIOExceptionpublic <K,V> void put(K k,
V v,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
put in interface DistributedMapCacheClientIOExceptionpublic <K,V> V get(K k,
Serializer<K> serializer,
Deserializer<V> deserializer)
throws IOException
get in interface DistributedMapCacheClientIOExceptionpublic void close()
throws IOException
close in interface DistributedMapCacheClientIOExceptionpublic <K> boolean remove(K k,
Serializer<K> serializer)
throws IOException
remove in interface DistributedMapCacheClientIOExceptionpublic long removeByPattern(String s) throws IOException
removeByPattern in interface DistributedMapCacheClientIOExceptionprivate <K> byte[] serializeKey(K k,
Serializer<K> keySerializer)
throws IOException
IOExceptionprivate <V> byte[] serializeValue(V v,
Serializer<V> valueSerializer)
throws IOException
IOExceptionCopyright © 2021 Apache NiFi Project. All rights reserved.