5 #ifndef DATABASE_CASSANDRA_CQL_CQL_IF_IMPL_H_
6 #define DATABASE_CASSANDRA_CQL_CQL_IF_IMPL_H_
10 #include <boost/unordered_map.hpp>
12 #include <linux/version.h>
13 #if defined(RHEL_MAJOR) && (RHEL_MAJOR >= 9)
14 #include <cassandra/cassandra.h>
16 #include <cassandra.h>
22 #include <database/cassandra/cql/cql_types.h>
30 const std::string &compaction_strategy);
32 const std::string &compaction_strategy,
33 boost::system::error_code *ec);
35 const std::string &column,
const std::string &indexname,
41 boost::system::error_code *ec);
55 const std::string &table,
const std::vector<GenDb::DbDataValueVec> &rkeys,
69 cci_->CassClusterFree(ptr);
81 cci_->CassSslFree(ptr);
93 cci_->CassSessionFree(ptr);
105 cci_->CassFutureFree(ptr);
117 cci_->CassStatementFree(ptr);
129 cci_->CassResultFree(ptr);
141 cci_->CassIteratorFree(ptr);
153 cci_->CassPreparedFree(ptr);
165 cci_->CassSchemaMetaFree(ptr);
194 size_t ck_count = 0) :
237 const std::vector<std::string> &cassandra_ips,
239 const std::string &cassandra_user,
240 const std::string &cassandra_password,
242 const std::string &ca_certs_path,
247 const std::string &replication_factor, CassConsistency consistency);
249 CassConsistency consistency);
251 CassConsistency consistency);
254 const std::string &compaction_strategy, CassConsistency consistency);
256 const std::string &column,
const std::string &indexname,
257 CassConsistency consistency,
265 CassConsistency consistency);
288 const std::vector<GenDb::DbDataValueVec> &rkeys,
319 CassConsistency consistency,
bool sync,
326 CassConsistency consistency,
bool sync,
353 typedef boost::unordered_map<std::string, impl::CassPreparedPtr>
impl::CassSessionPtr session_
bool SelectFromTableClusteringKeyRangeSync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, CassConsistency consistency, GenDb::NewColVec *out)
bool InsertIntoTableAsync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, impl::CassAsyncQueryCallback cb)
bool DisconnectSchemaSync()
impl::CassClusterPtr cluster_
bool CreateKeyspaceIfNotExistsSync(const std::string &keyspace, const std::string &replication_factor, CassConsistency consistency)
bool IsTableDynamic(const std::string &table)
bool PrepareInsertIntoTableSync(const GenDb::NewCf &cf, impl::CassPreparedPtr *prepared)
bool CreateIndexIfNotExistsSync(const std::string &cfname, const std::string &column, const std::string &indexname, CassConsistency consistency, const GenDb::ColIndexMode::type index_mode)
impl::CassSessionPtr schema_session_
bool InsertIntoTableInternal(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, bool sync, impl::CassAsyncQueryCallback cb)
static const char * kTaskName
bool InsertIntoTablePrepareAsync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, impl::CassAsyncQueryCallback cb)
bool GetPrepareInsertIntoTable(const std::string &table_name, impl::CassPreparedPtr *prepared) const
bool SelectFromTableAsync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, CassConsistency consistency, cass::cql::impl::CassAsyncQueryCallback cb)
bool SelectFromTableClusteringKeyRangeFieldNamesSync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, CassConsistency consistency, const GenDb::FieldNamesToReadVec &read_vec, GenDb::NewColVec *out)
bool GetMetrics(Metrics *metrics) const
tbb::atomic< SessionState::type > schema_session_state_
void SetRequestTimeout(uint32_t timeout_ms)
tbb::atomic< SessionState::type > session_state_
bool InsertIntoTablePrepareInternal(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, bool sync, impl::CassAsyncQueryCallback cb)
CassPreparedMapType insert_prepared_map_
bool CreateTableIfNotExistsSync(const GenDb::NewCf &cf, const std::string &compaction_strategy, CassConsistency consistency)
bool UseKeyspaceSyncOnSchemaSession(const std::string &keyspace, CassConsistency consistency)
static const char * kQCreateKeyspaceIfNotExists
bool IsTablePresent(const std::string &table)
CqlIfImpl(EventManager *evm, const std::vector< std::string > &cassandra_ips, int cassandra_port, const std::string &cassandra_user, const std::string &cassandra_password, bool use_ssl, const std::string &ca_certs_path, interface::CassLibrary *cci)
std::string schema_contact_point_
boost::unordered_map< std::string, impl::CassPreparedPtr > CassPreparedMapType
interface::CassLibrary * cci_
bool UseKeyspaceSync(const std::string &keyspace, CassConsistency consistency)
bool LocatePrepareInsertIntoTable(const GenDb::NewCf &cf)
bool SelectFromTableClusteringKeyRangeAndIndexValueAsync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, const GenDb::WhereIndexInfoVec &where_vec, const GenDb::FieldNamesToReadVec &read_vec, CassConsistency consistency, cass::cql::impl::CassAsyncQueryCallback cb)
bool IsInsertIntoTablePrepareSupported(const std::string &table)
bool SelectFromTableSync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, CassConsistency consistency, GenDb::NewColVec *out)
static const char * kQUseKeyspace
static const int kTaskInstance
int IsTableStatic(const std::string &table)
bool InsertIntoTableSync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency)
bool SelectFromTableClusteringKeyRangeAsync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, CassConsistency consistency, cass::cql::impl::CassAsyncQueryCallback cb)
CassSharedPtr(T *ptr, interface::CassLibrary *cci)
std::vector< DbDataValue > DbDataValueVec
std::vector< FieldNamesToReadInfo > FieldNamesToReadVec
std::vector< WhereIndexInfo > WhereIndexInfoVec
boost::ptr_vector< ColList > ColListVec
boost::ptr_vector< NewCol > NewColVec
std::string StaticCf2CassInsertIntoTable(const GenDb::ColList *v_columns)
static void DynamicCfGetResult(interface::CassLibrary *cci, CassResultPtr *result, const GenDb::FieldNamesToReadVec &read_vec, GenDb::NewColVec *v_columns)
std::string StaticCf2CassPrepareInsertIntoTable(const GenDb::NewCf &cf)
std::string PartitionKeyAndClusteringKeyRange2CassSelectFromTable(const std::string &table, const GenDb::DbDataValueVec &rkeys, const GenDb::ColumnNameRange &ck_range, const GenDb::FieldNamesToReadVec &read_vec)
CassSharedPtr< const CassSchemaMeta > CassSchemaMetaPtr
CassSharedPtr< CassSsl > CassSslPtr
std::string DynamicCf2CassPrepareInsertIntoTable(const GenDb::NewCf &cf, boost::system::error_code *ec)
CassSharedPtr< CassSession > CassSessionPtr
CassSharedPtr< const CassPrepared > CassPreparedPtr
CassSharedPtr< CassIterator > CassIteratorPtr
std::string DynamicCf2CassCreateTableIfNotExists(const GenDb::NewCf &cf, const std::string &compaction_strategy, boost::system::error_code *ec)
CassSharedPtr< const CassResult > CassResultPtr
CassSharedPtr< CassCluster > CassClusterPtr
std::string CassCreateIndexIfNotExists(const std::string &cfname, const std::string &column, const std::string &indexname, const GenDb::ColIndexMode::type index_mode)
std::string CassSelectFromTable(const std::string &table)
static void StaticCfGetResult(interface::CassLibrary *cci, CassResultPtr *result, GenDb::NewColVec *v_columns)
std::string ClusteringKeyRangeAndIndexValue2CassSelectFromTable(const std::string &table, const GenDb::DbDataValueVec &rkeys, const GenDb::ColumnNameRange &ck_range, const GenDb::WhereIndexInfoVec &where_vec, const GenDb::FieldNamesToReadVec &read_vec)
std::string DynamicCf2CassInsertIntoTable(const GenDb::ColList *v_columns)
boost::function< void(GenDb::DbOpResult::type, std::auto_ptr< GenDb::ColList >)> CassAsyncQueryCallback
CassSharedPtr< CassStatement > CassStatementPtr
std::string StaticCf2CassCreateTableIfNotExists(const GenDb::NewCf &cf, const std::string &compaction_strategy)
CassSharedPtr< CassFuture > CassFuturePtr
std::string PartitionKey2CassSelectFromTable(const std::string &table, const GenDb::DbDataValueVec &rkeys)
interface::CassLibrary * cci_
CassAsyncQueryCallback cb_
boost::scoped_ptr< CassQueryResultContext > result_ctx_
CassAsyncQueryContext(const char *query_id, CassAsyncQueryCallback cb, interface::CassLibrary *cci, CassQueryResultContext *rctx=NULL)
GenDb::DbDataValueVec row_key_
CassQueryResultContext(const std::string &cf_name, bool is_dynamic_cf, const GenDb::DbDataValueVec &row_key, size_t rk_count=0, size_t ck_count=0)
interface::CassLibrary * cci_
void operator()(CassCluster *ptr)
Deleter(interface::CassLibrary *cci)
void operator()(CassFuture *ptr)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
Deleter(interface::CassLibrary *cci)
void operator()(CassIterator *ptr)
interface::CassLibrary * cci_
void operator()(CassSession *ptr)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
Deleter(interface::CassLibrary *cci)
interface::CassLibrary * cci_
void operator()(CassSsl *ptr)
Deleter(interface::CassLibrary *cci)
interface::CassLibrary * cci_
void operator()(CassStatement *ptr)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
void operator()(const CassPrepared *ptr)
Deleter(interface::CassLibrary *cci)
void operator()(const CassResult *ptr)
interface::CassLibrary * cci_