OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cass::cql::CqlIf Class Reference

#include <cql_if.h>

Inheritance diagram for cass::cql::CqlIf:
Collaboration diagram for cass::cql::CqlIf:

Public Member Functions

 CqlIf (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, bool create_schema=false)
 
 CqlIf ()
 
virtual ~CqlIf ()
 
virtual bool Db_Init ()
 
virtual void Db_Uninit ()
 
virtual void Db_SetInitDone (bool)
 
virtual bool Db_SetTablespace (const std::string &tablespace)
 
virtual bool Db_AddSetTablespace (const std::string &tablespace, const std::string &replication_factor="1")
 
virtual bool Db_AddColumnfamily (const GenDb::NewCf &cf, const std::string &compaction_strategy)
 
virtual bool Db_UseColumnfamily (const GenDb::NewCf &cf)
 
virtual bool Db_UseColumnfamily (const std::string &cfname)
 
virtual bool Db_CreateIndex (const std::string &cfname, const std::string &column, const std::string &indexname, const GenDb::ColIndexMode::type index_mode=GenDb::ColIndexMode::NONE)
 
virtual bool Db_AddColumn (std::auto_ptr< GenDb::ColList > cl, GenDb::DbConsistency::type dconsistency, GenDb::GenDbIf::DbAddColumnCb cb)
 
virtual bool Db_AddColumnSync (std::auto_ptr< GenDb::ColList > cl, GenDb::DbConsistency::type dconsistency)
 
virtual bool Db_GetRow (GenDb::ColList *out, const std::string &cfname, const GenDb::DbDataValueVec &rowkey, GenDb::DbConsistency::type dconsistency)
 
virtual bool Db_GetRow (GenDb::ColList *out, const std::string &cfname, const GenDb::DbDataValueVec &rowkey, GenDb::DbConsistency::type dconsistency, const GenDb::ColumnNameRange &crange, const GenDb::FieldNamesToReadVec &read_vec)
 
virtual bool Db_GetMultiRow (GenDb::ColListVec *out, const std::string &cfname, const std::vector< GenDb::DbDataValueVec > &v_rowkey)
 
virtual bool Db_GetMultiRow (GenDb::ColListVec *out, const std::string &cfname, const std::vector< GenDb::DbDataValueVec > &v_rowkey, const GenDb::ColumnNameRange &crange)
 
virtual bool Db_GetMultiRow (GenDb::ColListVec *out, const std::string &cfname, const std::vector< GenDb::DbDataValueVec > &v_rowkey, const GenDb::ColumnNameRange &crange, const GenDb::FieldNamesToReadVec &read_vec, GenDb::DbConsistency::type dconsistency=GenDb::DbConsistency::ONE)
 
virtual bool Db_GetRowAsync (const std::string &cfname, const GenDb::DbDataValueVec &rowkey, GenDb::DbConsistency::type dconsistency, GenDb::GenDbIf::DbGetRowCb cb)
 
virtual bool Db_GetRowAsync (const std::string &cfname, const GenDb::DbDataValueVec &rowkey, GenDb::DbConsistency::type dconsistency, int task_id, int task_instance, GenDb::GenDbIf::DbGetRowCb cb)
 
virtual bool Db_GetRowAsync (const std::string &cfname, const GenDb::DbDataValueVec &rowkey, const GenDb::ColumnNameRange &crange, GenDb::DbConsistency::type dconsistency, GenDb::GenDbIf::DbGetRowCb cb)
 
virtual bool Db_GetRowAsync (const std::string &cfname, const GenDb::DbDataValueVec &rowkey, const GenDb::ColumnNameRange &crange, GenDb::DbConsistency::type dconsistency, int task_id, int task_instance, GenDb::GenDbIf::DbGetRowCb cb)
 
virtual bool Db_GetRowAsync (const std::string &cfname, const GenDb::DbDataValueVec &rowkey, const GenDb::ColumnNameRange &crange, const GenDb::WhereIndexInfoVec &where_vec, GenDb::DbConsistency::type dconsistency, GenDb::GenDbIf::DbGetRowCb cb)
 
virtual bool Db_GetAllRows (GenDb::ColListVec *out, const std::string &cfname, GenDb::DbConsistency::type dconsistency)
 
virtual bool Db_GetQueueStats (uint64_t *queue_count, uint64_t *enqueues) const
 
virtual void Db_SetQueueWaterMark (bool high, size_t queue_count, DbQueueWaterMarkCb cb)
 
virtual void Db_ResetQueueWaterMarks ()
 
virtual bool Db_GetStats (std::vector< GenDb::DbTableInfo > *vdbti, GenDb::DbErrors *dbe)
 
virtual bool Db_GetCumulativeStats (std::vector< GenDb::DbTableInfo > *vdbti, GenDb::DbErrors *dbe) const
 
virtual bool Db_GetCqlMetrics (Metrics *metrics) const
 
virtual bool Db_GetCqlStats (DbStats *db_stats) const
 
virtual std::vector
< GenDb::Endpoint
Db_GetEndpoints () const
 
- Public Member Functions inherited from GenDb::GenDbIf
 GenDbIf ()
 
virtual ~GenDbIf ()
 
virtual bool Db_GetMultiRow (ColListVec *ret, const std::string &cfname, const std::vector< DbDataValueVec > &key)=0
 
virtual bool Db_GetMultiRow (ColListVec *ret, const std::string &cfname, const std::vector< DbDataValueVec > &key, const ColumnNameRange &crange)=0
 
virtual bool Db_GetMultiRow (ColListVec *ret, const std::string &cfname, const std::vector< DbDataValueVec > &key, const ColumnNameRange &crange, const FieldNamesToReadVec &read_vec, DbConsistency::type dconsistency=DbConsistency::ONE)=0
 
virtual bool Db_GetStats (std::vector< DbTableInfo > *vdbti, DbErrors *dbe)=0
 
virtual bool Db_GetCumulativeStats (std::vector< DbTableInfo > *vdbti, DbErrors *dbe) const =0
 

Private Member Functions

void OnAsyncColumnAddCompletion (GenDb::DbOpResult::type drc, std::auto_ptr< GenDb::ColList > row, std::string cfname, GenDb::GenDbIf::DbAddColumnCb cb)
 
void OnAsyncRowGetCompletion (GenDb::DbOpResult::type drc, std::auto_ptr< GenDb::ColList > row, std::string cfname, GenDb::GenDbIf::DbGetRowCb cb)
 
void OnAsyncRowGetCompletion (GenDb::DbOpResult::type drc, std::auto_ptr< GenDb::ColList > row, std::string cfname, GenDb::GenDbIf::DbGetRowCb cb, bool use_worker, int task_id, int task_instance)
 
void IncrementTableWriteStats (const std::string &table_name)
 
void IncrementTableWriteStats (const std::string &table_name, uint64_t num_writes)
 
void IncrementTableWriteFailStats (const std::string &table_name)
 
void IncrementTableWriteFailStats (const std::string &table_name, uint64_t num_writes)
 
void IncrementTableWriteBackPressureFailStats (const std::string &table_name)
 
void IncrementTableReadStats (const std::string &table_name)
 
void IncrementTableReadStats (const std::string &table_name, uint64_t num_reads)
 
void IncrementTableReadFailStats (const std::string &table_name)
 
void IncrementTableReadFailStats (const std::string &table_name, uint64_t num_reads)
 
void IncrementTableReadBackPressureFailStats (const std::string &table_name)
 
void IncrementErrors (GenDb::IfErrors::Type err_type)
 

Private Attributes

boost::scoped_ptr
< interface::CassLibrary
cci_
 
boost::scoped_ptr< CqlIfImplimpl_
 
tbb::atomic< bool > initialized_
 
std::vector< GenDb::Endpointendpoints_
 
tbb::mutex stats_mutex_
 
GenDb::GenDbIfStats stats_
 
bool use_prepared_for_insert_
 
bool create_schema_
 

Additional Inherited Members

- Public Types inherited from GenDb::GenDbIf
typedef boost::function< void(void)> DbErrorHandler
 
typedef boost::function< void(size_t)> DbQueueWaterMarkCb
 
typedef boost::function< void(DbOpResult::type)> DbAddColumnCb
 
typedef boost::function< void(DbOpResult::type,
std::auto_ptr< ColList >)> 
DbGetRowCb
 

Detailed Description

Definition at line 23 of file cql_if.h.

Constructor & Destructor Documentation

cass::cql::CqlIf::CqlIf ( 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,
bool  create_schema = false 
)

Definition at line 2506 of file cql_if.cc.

Here is the call graph for this function:

cass::cql::CqlIf::CqlIf ( )

Definition at line 2534 of file cql_if.cc.

cass::cql::CqlIf::~CqlIf ( )
virtual

Definition at line 2537 of file cql_if.cc.

Member Function Documentation

bool cass::cql::CqlIf::Db_AddColumn ( std::auto_ptr< GenDb::ColList cl,
GenDb::DbConsistency::type  dconsistency,
GenDb::GenDbIf::DbAddColumnCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2720 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_AddColumnfamily ( const GenDb::NewCf cf,
const std::string &  compaction_strategy 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2598 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_AddColumnSync ( std::auto_ptr< GenDb::ColList cl,
GenDb::DbConsistency::type  dconsistency 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2749 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_AddSetTablespace ( const std::string &  tablespace,
const std::string &  replication_factor = "1" 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2571 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_CreateIndex ( const std::string &  cfname,
const std::string &  column,
const std::string &  indexname,
const GenDb::ColIndexMode::type  index_mode = GenDb::ColIndexMode::NONE 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2637 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetAllRows ( GenDb::ColListVec out,
const std::string &  cfname,
GenDb::DbConsistency::type  dconsistency 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2931 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetCqlMetrics ( Metrics *  metrics) const
virtual

Definition at line 2975 of file cql_if.cc.

bool cass::cql::CqlIf::Db_GetCqlStats ( DbStats *  db_stats) const
virtual

Definition at line 2979 of file cql_if.cc.

bool cass::cql::CqlIf::Db_GetCumulativeStats ( std::vector< GenDb::DbTableInfo > *  vdbti,
GenDb::DbErrors *  dbe 
) const
virtual

Definition at line 2968 of file cql_if.cc.

Here is the call graph for this function:

std::vector< GenDb::Endpoint > cass::cql::CqlIf::Db_GetEndpoints ( ) const
virtual

Implements GenDb::GenDbIf.

Definition at line 3053 of file cql_if.cc.

bool cass::cql::CqlIf::Db_GetMultiRow ( GenDb::ColListVec out,
const std::string &  cfname,
const std::vector< GenDb::DbDataValueVec > &  v_rowkey 
)
virtual

Definition at line 2870 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetMultiRow ( GenDb::ColListVec out,
const std::string &  cfname,
const std::vector< GenDb::DbDataValueVec > &  v_rowkey,
const GenDb::ColumnNameRange crange 
)
virtual

Definition at line 2891 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetMultiRow ( GenDb::ColListVec out,
const std::string &  cfname,
const std::vector< GenDb::DbDataValueVec > &  v_rowkey,
const GenDb::ColumnNameRange crange,
const GenDb::FieldNamesToReadVec read_vec,
GenDb::DbConsistency::type  dconsistency = GenDb::DbConsistency::ONE 
)
virtual

Definition at line 2914 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetQueueStats ( uint64_t *  queue_count,
uint64_t *  enqueues 
) const
virtual

Implements GenDb::GenDbIf.

Definition at line 2945 of file cql_if.cc.

bool cass::cql::CqlIf::Db_GetRow ( GenDb::ColList out,
const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
GenDb::DbConsistency::type  dconsistency 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2838 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRow ( GenDb::ColList out,
const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
GenDb::DbConsistency::type  dconsistency,
const GenDb::ColumnNameRange crange,
const GenDb::FieldNamesToReadVec read_vec 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2853 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRowAsync ( const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
GenDb::DbConsistency::type  dconsistency,
GenDb::GenDbIf::DbGetRowCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2793 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRowAsync ( const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
GenDb::DbConsistency::type  dconsistency,
int  task_id,
int  task_instance,
GenDb::GenDbIf::DbGetRowCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2808 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRowAsync ( const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
const GenDb::ColumnNameRange crange,
GenDb::DbConsistency::type  dconsistency,
GenDb::GenDbIf::DbGetRowCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2764 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRowAsync ( const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
const GenDb::ColumnNameRange crange,
GenDb::DbConsistency::type  dconsistency,
int  task_id,
int  task_instance,
GenDb::GenDbIf::DbGetRowCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2778 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetRowAsync ( const std::string &  cfname,
const GenDb::DbDataValueVec rowkey,
const GenDb::ColumnNameRange crange,
const GenDb::WhereIndexInfoVec where_vec,
GenDb::DbConsistency::type  dconsistency,
GenDb::GenDbIf::DbGetRowCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2823 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_GetStats ( std::vector< GenDb::DbTableInfo > *  vdbti,
GenDb::DbErrors *  dbe 
)
virtual

Definition at line 2961 of file cql_if.cc.

Here is the call graph for this function:

bool cass::cql::CqlIf::Db_Init ( )
virtual

Implements GenDb::GenDbIf.

Definition at line 2541 of file cql_if.cc.

void cass::cql::CqlIf::Db_ResetQueueWaterMarks ( )
virtual

Implements GenDb::GenDbIf.

Definition at line 2956 of file cql_if.cc.

void cass::cql::CqlIf::Db_SetInitDone ( bool  init_done)
virtual

Implements GenDb::GenDbIf.

Definition at line 2559 of file cql_if.cc.

void cass::cql::CqlIf::Db_SetQueueWaterMark ( bool  high,
size_t  queue_count,
DbQueueWaterMarkCb  cb 
)
virtual

Implements GenDb::GenDbIf.

Definition at line 2951 of file cql_if.cc.

bool cass::cql::CqlIf::Db_SetTablespace ( const std::string &  tablespace)
virtual

Implements GenDb::GenDbIf.

Definition at line 2588 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::Db_Uninit ( )
virtual

Implements GenDb::GenDbIf.

Definition at line 2552 of file cql_if.cc.

bool cass::cql::CqlIf::Db_UseColumnfamily ( const GenDb::NewCf cf)
virtual

Implements GenDb::GenDbIf.

Definition at line 2619 of file cql_if.cc.

bool cass::cql::CqlIf::Db_UseColumnfamily ( const std::string &  cfname)
virtual

Implements GenDb::GenDbIf.

Definition at line 2624 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementErrors ( GenDb::IfErrors::Type  err_type)
private

Definition at line 3047 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableReadBackPressureFailStats ( const std::string &  table_name)
private

Definition at line 3019 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableReadFailStats ( const std::string &  table_name)
private

Definition at line 3036 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableReadFailStats ( const std::string &  table_name,
uint64_t  num_reads 
)
private

Definition at line 3041 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableReadStats ( const std::string &  table_name)
private

Definition at line 3025 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableReadStats ( const std::string &  table_name,
uint64_t  num_reads 
)
private

Definition at line 3030 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableWriteBackPressureFailStats ( const std::string &  table_name)
private

Definition at line 3013 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableWriteFailStats ( const std::string &  table_name)
private

Definition at line 3002 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableWriteFailStats ( const std::string &  table_name,
uint64_t  num_writes 
)
private

Definition at line 3007 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableWriteStats ( const std::string &  table_name)
private

Definition at line 2991 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::IncrementTableWriteStats ( const std::string &  table_name,
uint64_t  num_writes 
)
private

Definition at line 2996 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::OnAsyncColumnAddCompletion ( GenDb::DbOpResult::type  drc,
std::auto_ptr< GenDb::ColList row,
std::string  cfname,
GenDb::GenDbIf::DbAddColumnCb  cb 
)
private

Definition at line 2651 of file cql_if.cc.

Here is the call graph for this function:

void cass::cql::CqlIf::OnAsyncRowGetCompletion ( GenDb::DbOpResult::type  drc,
std::auto_ptr< GenDb::ColList row,
std::string  cfname,
GenDb::GenDbIf::DbGetRowCb  cb 
)
private

Definition at line 2715 of file cql_if.cc.

void cass::cql::CqlIf::OnAsyncRowGetCompletion ( GenDb::DbOpResult::type  drc,
std::auto_ptr< GenDb::ColList row,
std::string  cfname,
GenDb::GenDbIf::DbGetRowCb  cb,
bool  use_worker,
int  task_id,
int  task_instance 
)
private

Definition at line 2685 of file cql_if.cc.

Here is the call graph for this function:

Member Data Documentation

boost::scoped_ptr<interface::CassLibrary> cass::cql::CqlIf::cci_
private

Definition at line 150 of file cql_if.h.

bool cass::cql::CqlIf::create_schema_
private

Definition at line 157 of file cql_if.h.

std::vector<GenDb::Endpoint> cass::cql::CqlIf::endpoints_
private

Definition at line 153 of file cql_if.h.

boost::scoped_ptr<CqlIfImpl> cass::cql::CqlIf::impl_
private

Definition at line 151 of file cql_if.h.

tbb::atomic<bool> cass::cql::CqlIf::initialized_
private

Definition at line 152 of file cql_if.h.

GenDb::GenDbIfStats cass::cql::CqlIf::stats_
private

Definition at line 155 of file cql_if.h.

tbb::mutex cass::cql::CqlIf::stats_mutex_
mutableprivate

Definition at line 154 of file cql_if.h.

bool cass::cql::CqlIf::use_prepared_for_insert_
private

Definition at line 156 of file cql_if.h.


The documentation for this class was generated from the following files: