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 <cassandra.h>
17 #include <database/cassandra/cql/cql_types.h>
25 const std::string &compaction_strategy);
27 const std::string &compaction_strategy,
28 boost::system::error_code *ec);
30 const std::string &column,
const std::string &indexname,
36 boost::system::error_code *ec);
50 const std::string &table,
const std::vector<GenDb::DbDataValueVec> &rkeys,
64 cci_->CassClusterFree(ptr);
76 cci_->CassSslFree(ptr);
88 cci_->CassSessionFree(ptr);
100 cci_->CassFutureFree(ptr);
112 cci_->CassStatementFree(ptr);
124 cci_->CassResultFree(ptr);
136 cci_->CassIteratorFree(ptr);
148 cci_->CassPreparedFree(ptr);
160 cci_->CassSchemaMetaFree(ptr);
170 boost::shared_ptr<T>(ptr,
Deleter<T>(cci)) {}
189 size_t ck_count = 0) :
232 const std::vector<std::string> &cassandra_ips,
234 const std::string &cassandra_user,
235 const std::string &cassandra_password,
237 const std::string &ca_certs_path,
242 const std::string &replication_factor, CassConsistency consistency);
244 CassConsistency consistency);
246 CassConsistency consistency);
249 const std::string &compaction_strategy, CassConsistency consistency);
251 const std::string &column,
const std::string &indexname,
252 CassConsistency consistency,
260 CassConsistency consistency);
283 const std::vector<GenDb::DbDataValueVec> &rkeys,
314 CassConsistency consistency,
bool sync,
321 CassConsistency consistency,
bool sync,
348 typedef boost::unordered_map<std::string, impl::CassPreparedPtr>
357 #endif // DATABASE_CASSANDRA_CQL_CQL_IF_IMPL_H_
CassSharedPtr(T *ptr, interface::CassLibrary *cci)
bool LocatePrepareInsertIntoTable(const GenDb::NewCf &cf)
Deleter(interface::CassLibrary *cci)
void SetRequestTimeout(uint32_t timeout_ms)
bool InsertIntoTablePrepareAsync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, impl::CassAsyncQueryCallback cb)
interface::CassLibrary * cci_
tbb::atomic< SessionState::type > session_state_
std::vector< FieldNamesToReadInfo > FieldNamesToReadVec
CassSharedPtr< CassSsl > CassSslPtr
std::string DynamicCf2CassPrepareInsertIntoTable(const GenDb::NewCf &cf, boost::system::error_code *ec)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
CassSharedPtr< const CassPrepared > CassPreparedPtr
CassSharedPtr< CassIterator > CassIteratorPtr
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
static const char * kTaskName
bool IsTableDynamic(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)
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)
impl::CassClusterPtr cluster_
std::string DynamicCf2CassInsertIntoTable(const GenDb::ColList *v_columns)
static const char * kQCreateKeyspaceIfNotExists
impl::CassSessionPtr session_
CassAsyncQueryContext(const char *query_id, CassAsyncQueryCallback cb, interface::CassLibrary *cci, CassQueryResultContext *rctx=NULL)
boost::unordered_map< std::string, impl::CassPreparedPtr > CassPreparedMapType
void operator()(CassSession *ptr)
std::string PartitionKey2CassSelectFromTable(const std::string &table, const GenDb::DbDataValueVec &rkeys)
void operator()(const CassResult *ptr)
interface::CassLibrary * cci_
static void DynamicCfGetResult(interface::CassLibrary *cci, CassResultPtr *result, const GenDb::FieldNamesToReadVec &read_vec, GenDb::NewColVec *v_columns)
bool SelectFromTableAsync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, CassConsistency consistency, cass::cql::impl::CassAsyncQueryCallback cb)
static const int kTaskInstance
boost::ptr_vector< NewCol > NewColVec
CassSharedPtr< CassSession > CassSessionPtr
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)
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)
CassPreparedMapType insert_prepared_map_
boost::scoped_ptr< CassQueryResultContext > result_ctx_
bool SelectFromTableSync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, CassConsistency consistency, GenDb::NewColVec *out)
bool CreateIndexIfNotExistsSync(const std::string &cfname, const std::string &column, const std::string &indexname, CassConsistency consistency, const GenDb::ColIndexMode::type index_mode)
bool InsertIntoTableSync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency)
static void StaticCfGetResult(interface::CassLibrary *cci, CassResultPtr *result, GenDb::NewColVec *v_columns)
CassSharedPtr< CassStatement > CassStatementPtr
interface::CassLibrary * cci_
interface::CassLibrary * cci_
std::vector< DbDataValue > DbDataValueVec
static const char * kQUseKeyspace
Deleter(interface::CassLibrary *cci)
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)
CassSharedPtr< CassCluster > CassClusterPtr
std::string StaticCf2CassInsertIntoTable(const GenDb::ColList *v_columns)
void operator()(CassFuture *ptr)
std::string StaticCf2CassCreateTableIfNotExists(const GenDb::NewCf &cf, const std::string &compaction_strategy)
std::string CassCreateIndexIfNotExists(const std::string &cfname, const std::string &column, const std::string &indexname, const GenDb::ColIndexMode::type index_mode)
interface::CassLibrary * cci_
bool CreateKeyspaceIfNotExistsSync(const std::string &keyspace, const std::string &replication_factor, CassConsistency consistency)
std::string PartitionKeyAndClusteringKeyRange2CassSelectFromTable(const std::string &table, const GenDb::DbDataValueVec &rkeys, const GenDb::ColumnNameRange &ck_range, const GenDb::FieldNamesToReadVec &read_vec)
std::vector< WhereIndexInfo > WhereIndexInfoVec
bool InsertIntoTablePrepareInternal(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, bool sync, impl::CassAsyncQueryCallback cb)
bool GetMetrics(Metrics *metrics) const
boost::function< void(GenDb::DbOpResult::type, std::auto_ptr< GenDb::ColList >)> CassAsyncQueryCallback
CassSharedPtr< CassFuture > CassFuturePtr
boost::ptr_vector< ColList > ColListVec
void operator()(CassSsl *ptr)
std::string DynamicCf2CassCreateTableIfNotExists(const GenDb::NewCf &cf, const std::string &compaction_strategy, boost::system::error_code *ec)
int IsTableStatic(const std::string &table)
bool IsTablePresent(const std::string &table)
GenDb::DbDataValueVec row_key_
void operator()(CassCluster *ptr)
void operator()(CassIterator *ptr)
std::string CassSelectFromTable(const std::string &table)
std::string StaticCf2CassPrepareInsertIntoTable(const GenDb::NewCf &cf)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
bool GetPrepareInsertIntoTable(const std::string &table_name, impl::CassPreparedPtr *prepared) const
Deleter(interface::CassLibrary *cci)
CassSharedPtr< const CassSchemaMeta > CassSchemaMetaPtr
void operator()(CassStatement *ptr)
bool SelectFromTableClusteringKeyRangeAsync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, CassConsistency consistency, cass::cql::impl::CassAsyncQueryCallback cb)
std::string schema_contact_point_
impl::CassSessionPtr schema_session_
bool InsertIntoTableInternal(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, bool sync, impl::CassAsyncQueryCallback cb)
Deleter(interface::CassLibrary *cci)
CassSharedPtr< const CassResult > CassResultPtr
tbb::atomic< SessionState::type > schema_session_state_
bool InsertIntoTableAsync(std::auto_ptr< GenDb::ColList > v_columns, CassConsistency consistency, impl::CassAsyncQueryCallback cb)
interface::CassLibrary * cci_
Deleter(interface::CassLibrary *cci)
bool PrepareInsertIntoTableSync(const GenDb::NewCf &cf, impl::CassPreparedPtr *prepared)
bool SelectFromTableClusteringKeyRangeSync(const std::string &cfname, const GenDb::DbDataValueVec &rkey, const GenDb::ColumnNameRange &ck_range, CassConsistency consistency, GenDb::NewColVec *out)
bool IsInsertIntoTablePrepareSupported(const std::string &table)
void operator()(const CassPrepared *ptr)
bool UseKeyspaceSync(const std::string &keyspace, CassConsistency consistency)
bool CreateTableIfNotExistsSync(const GenDb::NewCf &cf, const std::string &compaction_strategy, CassConsistency consistency)
bool DisconnectSchemaSync()
bool UseKeyspaceSyncOnSchemaSession(const std::string &keyspace, CassConsistency consistency)
interface::CassLibrary * cci_
CassAsyncQueryCallback cb_