Module: sip-router
Branch: master
Commit: 512013f324dd6faa37e26302a267afb07252812a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=512013f…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Thu Aug 30 12:24:24 2012 +0300
modules/db_cassandra: Updated replace function to the new signature
---
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,