Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 6665 invoked from network); 16 Nov 2009 17:37:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Nov 2009 17:37:29 -0000 Received: (qmail 17788 invoked by uid 500); 16 Nov 2009 17:37:28 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 17768 invoked by uid 500); 16 Nov 2009 17:37:28 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 17759 invoked by uid 99); 16 Nov 2009 17:37:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 17:37:28 +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 (nike.apache.org: domain of richiesgr@gmail.com designates 72.14.220.154 as permitted sender) Received: from [72.14.220.154] (HELO fg-out-1718.google.com) (72.14.220.154) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 17:37:20 +0000 Received: by fg-out-1718.google.com with SMTP id l26so336482fgb.0 for ; Mon, 16 Nov 2009 09:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Y4G6fg4lq62737BPDP8z2mPsM2gcgYwHqEugZRpbz/0=; b=Npkj8La5hbWuTyEv2S0Wlw4d4IU8PJyRZU4K1SqddR1kS9nc1qbcaAleF+s26EOENQ /isH3coF16W4DKpdAHCwHAGk/kWXbWJyz1RLIwUNTBy/Wh1ljdM4+oNNFaPFu42cnWaQ jykYgAZYp1AbnM4yd5jL5pFxXxH9bLMAYRJk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GxLlJbisHk6GvbHUQpqu+I0xiLnzcAGBXaTrUEEs4l836vY4rIVxQu6H7Sbh+Q3LtS 0hupc5apQVx9mc+QV5LhS2r4RvchFsOHzBfPAjJgQUjypTL+/M54LOCTMQBNyu4m0UVM DIHbL/z12vxkXbZ5VXEGxCRcWcPyfCnWqdhU4= MIME-Version: 1.0 Received: by 10.86.103.26 with SMTP id a26mr6086773fgc.40.1258393019203; Mon, 16 Nov 2009 09:36:59 -0800 (PST) In-Reply-To: <59DD1BA8FD3C0F4C90771C18F2B5B53A4C842D4DF8@GVW0432EXB.americas.hpqcorp.net> References: <468b21170911160919p79982a9bx682550e57d01427b@mail.gmail.com> <59DD1BA8FD3C0F4C90771C18F2B5B53A4C842D4DF8@GVW0432EXB.americas.hpqcorp.net> Date: Mon, 16 Nov 2009 19:36:59 +0200 Message-ID: <468b21170911160936r56ce1369k5bafbc24239701e9@mail.gmail.com> Subject: Re: Is the remove api working ?? From: Richard grossman To: cassandra-user@incubator.apache.org Content-Type: multipart/alternative; boundary=001636026cf7e5e4590478807461 X-Virus-Checked: Checked by ClamAV on apache.org --001636026cf7e5e4590478807461 Content-Type: text/plain; charset=ISO-8859-1 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 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 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 > --001636026cf7e5e4590478807461 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks

The QUORUM params do the job as expected.
But If I've multiple servers and have inserted the data with ONE t= hen what it's means I need to use only QUORUM instead ?

Thanks
On Mon, Nov 16, 2009 at 7:27 PM, Freeman, Ti= m <tim.freeman@h= p.com> wrote:

You might want to try ConsistencyLevel.QUORUM instead of ConsistencyL= evel.ONE if you're having issues with consistency.

=A0

If you're running only one node, that shouldn't matter.

=A0

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.)

=A0

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 ??

=A0

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 t= wice I get the key like never deleted.

Could you help me ??

here is the code I use:
=A0=A0=A0 =A0=A0=A0 List<String> keys =3D cassandraClient.get_key_range("Keyspace1", "channelShow"= ;, String.valueOf(start.getTimeInMillis()), stopKey, 1, ConsistencyLevel.ONE);=
=A0=A0=A0 =A0=A0=A0 if (keys !=3D null && keys.size() =3D=3D 1) {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 String startKey =3D keys.get(0);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 do {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 keys =3D cassandraClient.get_key_range("Keyspace1", "channelShow", startKey, stopKey, 1000, ConsistencyLevel.ONE);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 long time =3D System.currentTimeMillis();
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 for (String key : keys) {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 long timestamp =3D System.currentTimeMillis();
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 cassandraClient.remove("Keyspace1", key, columnPath, timestamp, ConsistencyLevel.ONE);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 }

=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 if (keys.size() < 1000) {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 keys =3D null;
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 } else {
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 startKey =3D keys.get(keys.size() - 1);
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 }
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 } while (keys !=3D null && keys.size() > 0);
=A0=A0=A0 =A0=A0=A0 }

All


--001636026cf7e5e4590478807461--