incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Is the remove api working ??
Date Mon, 16 Nov 2009 17:24:50 GMT
I don't see where you define columnPath.  that's an important part :)

get_key_range will include a key if there is _any_ undeleted data in its row.

On Mon, Nov 16, 2009 at 11:19 AM, Richard grossman <richiesgr@gmail.com> wrote:
> Hi
>
> I try to delete a CF from List of keys that I get from get_key_range.
> Because I don't want to get all the key I just build bunch of 1000 key and
> delete them.
> All seems but the column are never removed If I run exactly the same code
> twice I get the key like never deleted.
>
> Could you help me ??
>
> here is the code I use:
>         List<String> keys = cassandraClient.get_key_range("Keyspace1",
> "channelShow", String.valueOf(start.getTimeInMillis()), stopKey, 1,
> ConsistencyLevel.ONE);
>         if (keys != null && keys.size() == 1) {
>             String startKey = keys.get(0);
>             do {
>                 keys = cassandraClient.get_key_range("Keyspace1",
> "channelShow", startKey, stopKey, 1000, ConsistencyLevel.ONE);
>
>                 long time = System.currentTimeMillis();
>                 for (String key : keys) {
>                     long timestamp = System.currentTimeMillis();
>                     cassandraClient.remove("Keyspace1", key, columnPath,
> timestamp, ConsistencyLevel.ONE);
>                 }
>
>                 if (keys.size() < 1000) {
>                     keys = null;
>                 } else {
>                     startKey = keys.get(keys.size() - 1);
>                 }
>             } while (keys != null && keys.size() > 0);
>         }
>
> All
>

Mime
View raw message