incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard grossman <richie...@gmail.com>
Subject Re: Is the remove api working ??
Date Mon, 16 Nov 2009 17:36:59 GMT
Thanks

The QUORUM params do the job as expected.

But If I've multiple servers and have inserted the data with ONE then what
it's means I need to use only QUORUM instead ?

Thanks

On Mon, Nov 16, 2009 at 7:27 PM, Freeman, Tim <tim.freeman@hp.com> wrote:

>  You might want to try ConsistencyLevel.QUORUM instead of
> ConsistencyLevel.ONE if you're having issues with consistency.
>
>
>
> If you're running only one node, that shouldn't matter.
>
>
>
> Tim Freeman
> Email: tim.freeman@hp.com
> Desk in Palo Alto: (650) 857-2581
> Home: (408) 774-1298
> Cell: (408) 348-7536 (No reception business hours Monday, Tuesday, and
> Thursday; call my desk instead.)
>
>
>
> *From:* Richard grossman [mailto:richiesgr@gmail.com]
> *Sent:* Monday, November 16, 2009 9:19 AM
> *To:* cassandra-user@incubator.apache.org
> *Subject:* Is the remove api working ??
>
>
>
> 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