public class FeatureStoreCassandra extends AbstractFeatureStore implements FF4jCassandraSchema
FeatureStore to work with Cassandra Storage.
Minimize the Number of Writes :
Writes in Cassandra aren’t free, but they’re awfully cheap. Cassandra is optimized for high write throughput,
and almost all writes are equally efficient [1]. If you can perform extra writes to improve the efficiency of
your read queries, it’s almost always a good tradeoff. Reads tend to be more expensive and are much more
difficult to tune.
Minimize Data Duplication
Denormalization and duplication of data is a fact of life with Cassandra. Don’t be afraid of it. Disk space
is generally the cheapest resource (compared to CPU, memory, disk IOPs, or network), and Cassandra is
architected around that fact. In order to get the most efficient reads, you often need to duplicate data.AUDIT_ATT_ACTION, AUDIT_ATT_CUSTOM, AUDIT_ATT_DURATION, AUDIT_ATT_HOSTNAME, AUDIT_ATT_NAME, AUDIT_ATT_SOURCE, AUDIT_ATT_TIME, AUDIT_ATT_TYPE, AUDIT_ATT_UID, AUDIT_ATT_USER, AUDIT_ATT_VALUE, AUDIT_HITCOUNT_TABLE, AUDIT_TABLE, DEFAULT_KEYSPACE, FEATURES_ATT_DESCRIPTION, FEATURES_ATT_ENABLED, FEATURES_ATT_GROUPNAME, FEATURES_ATT_PROPERTIES, FEATURES_ATT_ROLES, FEATURES_ATT_STRATEGY, FEATURES_ATT_UID, FEATURES_INDEX_GROUPNAME, FEATURES_TABLE, PROPERTIES_ATT_CLASS, PROPERTIES_ATT_DESCRIPTION, PROPERTIES_ATT_FIXEDVALUES, PROPERTIES_ATT_UID, PROPERTIES_ATT_VALUE, PROPERTIES_TABLE, STMT_AUDIT_INSERT, STMT_AUDIT_INSERT_HITCOUNT, STMT_AUDIT_READ_BY_ID, STMT_CREATE_INDEX_FEATUREGROUP, STMT_CREATE_TABLE_AUDIT, STMT_CREATE_TABLE_AUDITHITCOUNT, STMT_CREATE_TABLE_FEATURE, STMT_CREATE_TABLE_PROPERTY, STMT_CREATE_UDT_PROPERTY, STMT_CREATE_UDT_STRATEGY, STMT_FEATURE_ADDTOGROUP, STMT_FEATURE_DELETE, STMT_FEATURE_EXIST, STMT_FEATURE_INSERT, STMT_FEATURE_READ, STMT_FEATURE_READ_ALL, STMT_FEATURE_REMOVEGROUP, STMT_FEATURE_TOGGLE, STMT_FEATUREGROUP_LIST, STMT_FEATUREGROUP_READ, STMT_PROPERTY_DELETE, STMT_PROPERTY_EXIST, STMT_PROPERTY_INSERT, STMT_PROPERTY_LISTNAMES, STMT_PROPERTY_READ, STMT_PROPERTY_READ_ALL, UDT_PROPERTY, UDT_PROPERTY_CLASS, UDT_PROPERTY_DESCRIPTION, UDT_PROPERTY_FIXEDVALUES, UDT_PROPERTY_UID, UDT_PROPERTY_VALUE, UDT_STRATEGY, UDT_STRATEGY_CLASS, UDT_STRATEGY_PARAMS| Constructor and Description |
|---|
FeatureStoreCassandra()
Default constructor.
|
FeatureStoreCassandra(com.datastax.oss.driver.api.core.CqlSession cqlSession)
Connector with running session
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToGroup(String uid,
String groupName) |
void |
clear() |
void |
create(Feature fp) |
void |
createSchema() |
void |
delete(String uid) |
void |
disable(String uid) |
void |
disableGroup(String groupName) |
void |
enable(String uid) |
void |
enableGroup(String groupName) |
boolean |
exist(String uid) |
boolean |
existGroup(String groupName) |
void |
grantRoleOnFeature(String uid,
String roleName) |
protected Feature |
mapFeatureRow(com.datastax.oss.driver.api.core.cql.Row row) |
protected void |
prepareStatements()
Prepared once, run many.
|
Feature |
read(String uid) |
Map<String,Feature> |
readAll() |
Set<String> |
readAllGroups() |
Map<String,Feature> |
readGroup(String groupName) |
void |
removeFromGroup(String uid,
String groupName) |
void |
removeRoleFromFeature(String uid,
String roleName) |
void |
update(Feature fp) |
assertFeatureExist, assertFeatureNotExist, assertFeatureNotNull, assertGroupExist, importFeatures, importFeaturesFromXmlFile, toJson, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdropTableIfExists, dropTypeIffExists, isTableExist, truncateTablepublic FeatureStoreCassandra()
public FeatureStoreCassandra(com.datastax.oss.driver.api.core.CqlSession cqlSession)
public void createSchema()
createSchema in interface FeatureStorecreateSchema in class AbstractFeatureStorepublic boolean exist(String uid)
exist in interface FeatureStorepublic void enable(String uid)
enable in interface FeatureStoreenable in class AbstractFeatureStorepublic void disable(String uid)
disable in interface FeatureStoredisable in class AbstractFeatureStorepublic void create(Feature fp)
create in interface FeatureStorepublic void delete(String uid)
delete in interface FeatureStorepublic Feature read(String uid)
read in interface FeatureStorepublic Map<String,Feature> readAll()
readAll in interface FeatureStorepublic void update(Feature fp)
update in interface FeatureStorepublic void grantRoleOnFeature(String uid, String roleName)
grantRoleOnFeature in interface FeatureStoregrantRoleOnFeature in class AbstractFeatureStorepublic void removeRoleFromFeature(String uid, String roleName)
removeRoleFromFeature in interface FeatureStoreremoveRoleFromFeature in class AbstractFeatureStorepublic void enableGroup(String groupName)
enableGroup in interface FeatureStoreenableGroup in class AbstractFeatureStorepublic void disableGroup(String groupName)
disableGroup in interface FeatureStoredisableGroup in class AbstractFeatureStorepublic boolean existGroup(String groupName)
existGroup in interface FeatureStoreexistGroup in class AbstractFeatureStorepublic Map<String,Feature> readGroup(String groupName)
readGroup in interface FeatureStorereadGroup in class AbstractFeatureStorepublic void addToGroup(String uid, String groupName)
addToGroup in interface FeatureStoreaddToGroup in class AbstractFeatureStorepublic void removeFromGroup(String uid, String groupName)
removeFromGroup in interface FeatureStoreremoveFromGroup in class AbstractFeatureStorepublic Set<String> readAllGroups()
readAllGroups in interface FeatureStorereadAllGroups in class AbstractFeatureStorepublic void clear()
clear in interface FeatureStoreprotected void prepareStatements()
protected Feature mapFeatureRow(com.datastax.oss.driver.api.core.cql.Row row)
Copyright © 2013–2022 FF4J. All rights reserved.