Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 44003 invoked from network); 12 Dec 2010 07:43:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Dec 2010 07:43:08 -0000 Received: (qmail 27035 invoked by uid 500); 12 Dec 2010 07:43:07 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 26893 invoked by uid 500); 12 Dec 2010 07:43:06 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 26885 invoked by uid 99); 12 Dec 2010 07:43:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Dec 2010 07:43:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Jaydeep.Chovatia@openwave.com designates 199.3.180.4 as permitted sender) Received: from [199.3.180.4] (HELO rwcmail1.openwave.com) (199.3.180.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Dec 2010 07:42:58 +0000 Received: from rwc-evs-prd1.myopwv.com ([fe80::39c8:54c9:c682:cb33]) by RWC-CAS-PRD1.myopwv.com ([10.16.80.98]) with mapi; Sat, 11 Dec 2010 23:42:35 -0800 From: Jaydeep Chovatia To: "user@cassandra.apache.org" CC: Narendra Sharma , Anju Ginjupalli , Utpal Thakrar , Manish Raje Date: Sat, 11 Dec 2010 23:42:33 -0800 Subject: Cassandra 0.7 C++ Thrift delete problem Thread-Topic: Cassandra 0.7 C++ Thrift delete problem Thread-Index: AcuZ0CNHCWz72V4YTsG6yZC6T983ew== Message-ID: <5350ACFB5CE01E4B82AD8E9BF40DEF55AAAC0D72F1@RWC-EVS-PRD1.myopwv.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_5350ACFB5CE01E4B82AD8E9BF40DEF55AAAC0D72F1RWCEVSPRD1myo_" MIME-Version: 1.0 --_000_5350ACFB5CE01E4B82AD8E9BF40DEF55AAAC0D72F1RWCEVSPRD1myo_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am facing some issues with delete operation in Cassandra-0.7.0 using C++ = Thrift API. Please find details here: C++ Thrift Machine: Linux 64-bit 1. I am using remove thrift API to delete either column or column family= . Problem in this is when I call remove then it hangs forever (never return= s back). Please find my code details here: cassClient->set_keyspace(keySpace); ColumnPath clnPath; clnPath.column_family =3D columnFamily; if(columnOrSuperColumnName.size() > 0){ if(isSuperColumn) { clnPath.__isset.super_column =3D true; clnPath.super_column =3D columnOrSuperColumnName; } else { clnPath.__isset.column =3D true; clnPath.column =3D columnOrSuperColumnName; } } //DIAGC("mssRME", 1, "About to run remove..."); cassClient->remove(key, clnPath, delTimeStamp, consisLevel); //DIAGC("mssRME", 1, "Success! remove..."); 1. I have tried with batch_mutate thrift API. With this operations goes s= moothly but I end up getting deleted column/columnfamily/key back when I pe= rform get operation after delete. Looks like delete operation did not work.= Please find sample code here: map >::iterator iter =3D SCNameAndCols.begin= (); //SuperColumn name as key - Vector containing columns in each super col= umn std::vector mv; while(iter !=3D SCNameAndCols.end()) { //Iterate through each Supe= rColumn one after another SuperColumn sc; ColumnOrSuperColumn cs; Mutation mu; ` mu.__isset.deletion =3D true; mu.deletion.timestamp =3D delTimeStamp; //This is latest t= imestamp in miliseconds mu.deletion.__isset.predicate =3D true; mu.deletion.super_column =3D (*iter).first; mu.deletion.predicate.__isset.column_names =3D true; for(int i =3D 0; i < (*iter).second.size(); i++) { mu.deletion.predicate.column_names.push_back((*iter).se= cond[i].name); } mv.push_back(mu); iter++; }//End of While loop std::map > innMap; innMap[CFName] =3D mv; std::map >= > outMap; outMap[Key] =3D innMap; //DIAGC("mssRME", 1, "About to run batch_mutate..."); cassClient->batch_mutate(outMap, consisLevel); //DIAGC("mssRME", 1, "Success! batch_mutate..."); Any help would be appreciated. Thank you, Jaydeep --_000_5350ACFB5CE01E4B82AD8E9BF40DEF55AAAC0D72F1RWCEVSPRD1myo_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am facing some issues with delete operation in Cassandra-0.7.0 using C++ Thrift API. Please find details here:<= /span>

C++ Thrift Machine: Linux 64-bit

 

  1. I am using = remove  thrift API to delete either column or column family. Problem in this is when I call re= move then it hangs forever (never returns back). Please find my code details her= e:

 

    &nbs= p;   cassClient->set_keyspace(keySpace);

 

    &nbs= p;   ColumnPath clnPath;

    &nbs= p;   clnPath.column_family =3D columnFamily;

    &nbs= p;   if(columnOrSuperColumnName.size() > 0){

    &nbs= p;       if(isSuperColumn) {

    &nbs= p;           clnPath.__isset.super_column =3D true;

    &nbs= p;           clnPath.super_column =3D columnOrSuperColumnName;<= /p>

    &nbs= p;       } else {

    &nbs= p;           clnPath.__isset.column =3D true;

    &nbs= p;           clnPath.column =3D columnOrSuperColumnName;

    &nbs= p;       }

    &nbs= p;   }

    &nbs= p;   //DIAGC("mssRME",  1,  "About to run remove...&quo= t;);

    &nbs= p;   cassClient->remove(key, clnPath, delTimeStamp, consisLevel);<= /span>

    &nbs= p;   //DIAGC("mssRME",  1,  "Success! remove...");=

 

 

  1. I have tried with = batch_mutate thrift API. With this operations goes smoothly but I end up getting deleted column/columnfamily/key back when I perform get operation after delete= . Looks like delete operation did not work. Please find sample code here= :

 

    &nbs= p;   map<string, vector<Column> >::iterator iter =3D SCNameAndCols.begin(); //SuperColumn name as key – Vector containing columns in each super column

    &nbs= p;   std::vector<Mutation> mv;

    &nbs= p;   while(iter !=3D SCNameAndCols.end()) {  //Iterate through each SuperCo= lumn one after another

    &nbs= p;       SuperColumn sc;

    &nbs= p;       ColumnOrSuperColumn cs;

 

    &nbs= p;       Mutation mu;

`         = ;            &n= bsp;                     mu.__iss= et.deletion =3D true;

 

    &nbs= p;           mu.deletion.timestamp =3D delTimeStamp;  //This is latest timestamp in miliseconds

    &nbs= p;           mu.deletion.__isset.predicate =3D true;

    &nbs= p;           mu.deletion.super_column =3D (*iter).first;

    &nbs= p;           mu.deletion.predicate.__isset.column_names =3D true;

    &nbs= p;           for(int  i =3D 0; i < (*iter).second.size(); i++) {

    &nbs= p;            &= nbsp;  mu.deletion.predicate.column_names.push_back((*iter).second[i].name);<= /o:p>

    &nbs= p;       }

 

    &nbs= p;       mv.push_back(mu);

    &nbs= p;       iter++;

    &nbs= p;   }//End of While loop

    &nbs= p;   std::map<std::string, std::vector<Mutation> > innMap;

    &nbs= p;   innMap[CFName] =3D mv;

 

    &nbs= p;   std::map<std::string, std::map<std::string, std::vector<Mutation&g= t; > > outMap;

    &nbs= p;   outMap[Key] =3D innMap;

 

    &nbs= p;   //DIAGC("mssRME",  1,  "About to run batch_mutate.= ..");

    &nbs= p;   cassClient->batch_mutate(outMap, consisLevel);<= /p>

    &nbs= p;   //DIAGC("mssRME",  1,  "Success! batch_mutate...");        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;

 

 

Any help would be appreciated.<= /p>

 

Thank you,

Jaydeep

 

--_000_5350ACFB5CE01E4B82AD8E9BF40DEF55AAAC0D72F1RWCEVSPRD1myo_--