incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@riptano.com>
Subject Re: Cassandra 0.7 C++ Thrift delete problem
Date Sun, 12 Dec 2010 07:56:45 GMT
I'm not sure why your first one hangs because it looks correct, but it's
possible that you have a timestamp resolution problem for the batch_mutate()
version.  How are you creating the timestamp?  Also, don't forget about
"range ghosts": http://wiki.apache.org/cassandra/FAQ#range_ghosts

- Tyler

On Sun, Dec 12, 2010 at 1:42 AM, Jaydeep Chovatia <
Jaydeep.Chovatia@openwave.com> wrote:

>  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 returns back). Please find my code details here:
>
>
>
>         cassClient->set_keyspace(keySpace);
>
>
>
>         ColumnPath clnPath;
>
>         clnPath.column_family = columnFamily;
>
>         if(columnOrSuperColumnName.size() > 0){
>
>             if(isSuperColumn) {
>
>                 clnPath.__isset.super_column = true;
>
>                 clnPath.super_column = columnOrSuperColumnName;
>
>             } else {
>
>                 clnPath.__isset.column = true;
>
>                 clnPath.column = 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
>    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:
>
>
>
>         map<string, vector<Column> >::iterator iter =
> SCNameAndCols.begin(); //SuperColumn name as key – Vector containing columns
> in each super column
>
>         std::vector<Mutation> mv;
>
>         while(iter != SCNameAndCols.end()) {  //Iterate through each
> SuperColumn one after another
>
>             SuperColumn sc;
>
>             ColumnOrSuperColumn cs;
>
>
>
>             Mutation mu;
>
> `                                           mu.__isset.deletion = true;
>
>
>
>                 mu.deletion.timestamp = delTimeStamp;  //This is latest
> timestamp in miliseconds
>
>                 mu.deletion.__isset.predicate = true;
>
>                 mu.deletion.super_column = (*iter).first;
>
>                 mu.deletion.predicate.__isset.column_names = true;
>
>                 for(int  i = 0; i < (*iter).second.size(); i++) {
>
>
> mu.deletion.predicate.column_names.push_back((*iter).second[i].name);
>
>             }
>
>
>
>             mv.push_back(mu);
>
>             iter++;
>
>         }//End of While loop
>
>         std::map<std::string, std::vector<Mutation> > innMap;
>
>         innMap[CFName] = mv;
>
>
>
>         std::map<std::string, std::map<std::string, std::vector<Mutation>
>
> > outMap;
>
>         outMap[Key] = 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
>
>
>

Mime
View raw message