[sr-dev] git:3.3: modules/db_cassandra: Updated replace function to the new signature
Anca Vamanu
anca.vamanu at 1and1.ro
Thu Aug 30 11:37:15 CEST 2012
Module: sip-router
Branch: 3.3
Commit: bb0b3b1e3218a2ad919b590ed6961f021fc72857
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bb0b3b1e3218a2ad919b590ed6961f021fc72857
Author: Anca Vamanu <anca.vamanu at 1and1.ro>
Committer: Anca Vamanu <anca.vamanu at 1and1.ro>
Date: Thu Aug 30 12:24:24 2012 +0300
modules/db_cassandra: Updated replace function to the new signature
(cherry picked from commit 512013f324dd6faa37e26302a267afb07252812a)
---
modules/db_cassandra/db_cassandra.c | 2 +-
modules/db_cassandra/dbcassa_base.cpp | 8 +++++++-
modules/db_cassandra/dbcassa_base.h | 6 ++++++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/db_cassandra/db_cassandra.c b/modules/db_cassandra/db_cassandra.c
index 969123f..119ecca 100644
--- a/modules/db_cassandra/db_cassandra.c
+++ b/modules/db_cassandra/db_cassandra.c
@@ -136,7 +136,7 @@ int db_cassa_bind_api(db_func_t *dbb)
dbb->query = db_cassa_query;
dbb->free_result = db_cassa_free_result;
dbb->insert = db_cassa_insert;
- dbb->replace = db_cassa_insert;
+ dbb->replace = db_cassa_replace;
dbb->insert_update = db_cassa_insert;
dbb->delete = db_cassa_delete;
dbb->update = db_cassa_update;
diff --git a/modules/db_cassandra/dbcassa_base.cpp b/modules/db_cassandra/dbcassa_base.cpp
index bd7f057..8a74a96 100644
--- a/modules/db_cassandra/dbcassa_base.cpp
+++ b/modules/db_cassandra/dbcassa_base.cpp
@@ -535,7 +535,7 @@ ColumnVecPtr cassa_translate_query(const db1_con_t* _h, const db_key_t* _k,
while(1) {
CON_CASSA(_h)->con->get_range_slices(key_slice_vect, cparent, sp, keyRange, oac::ConsistencyLevel::ONE);
/* construct cassa_result */
- LM_DBG("Retuned %d key slices\n", key_slice_vect.size());
+ LM_DBG("Retuned %d key slices\n", (int)key_slice_vect.size());
for(unsigned int i = 0; i< key_slice_vect.size(); i++) {
if(key_slice_vect[i].columns.size()==0) {
continue;
@@ -881,6 +881,12 @@ int db_cassa_modify(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
return -1;
}
+int db_cassa_replace(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
+ int _n, const int _un, const int _m)
+{
+ LM_DBG("db_cassa_replace:\n");
+ return db_cassa_modify(_h, _k, _v, _k, _v, _n, _n);
+}
int db_cassa_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
int _n)
diff --git a/modules/db_cassandra/dbcassa_base.h b/modules/db_cassandra/dbcassa_base.h
index 01b2a31..ea7f213 100644
--- a/modules/db_cassandra/dbcassa_base.h
+++ b/modules/db_cassandra/dbcassa_base.h
@@ -72,6 +72,12 @@ int db_cassa_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
/*
+ * Replace a row into table - same as insert for cassandra
+ */
+int db_cassa_replace(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
+ int _n, const int _un, const int _m);
+
+/*
* Delete a row from table
*/
int db_cassa_delete(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
More information about the sr-dev
mailing list