Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C58D2F19F for ; Thu, 21 Mar 2013 07:28:20 +0000 (UTC) Received: (qmail 35957 invoked by uid 500); 21 Mar 2013 07:28:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 35436 invoked by uid 500); 21 Mar 2013 07:28:17 -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 35280 invoked by uid 99); 21 Mar 2013 07:28:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Mar 2013 07:28:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lccalicia@gmail.com designates 74.125.83.51 as permitted sender) Received: from [74.125.83.51] (HELO mail-ee0-f51.google.com) (74.125.83.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Mar 2013 07:28:06 +0000 Received: by mail-ee0-f51.google.com with SMTP id d17so1543654eek.10 for ; Thu, 21 Mar 2013 00:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=h3xYmZiCzLGL4tG6AN/kbmBCNr953etFIoriXAz4mNA=; b=kNcyXyPtpWbc9ja0ZIoGqo9t7VTqbBZdNXwf+hwzs1LryHv74SrOMu5OETDzs3aAwm 5hEKDQyjDViAbcLriH/J57geQRTyci4QoZ9kl3Fcv5SGdf+N/uB9Ha/bdcVKRfuGO8yv PcxmeLBP722NnRBq576iJigHiiZvml1me8JtPbtRHwsKRPmY3d5biZqH5xtiBwUYoV3o sJEpMHBv4h19z60MONkAfeh5QC8gU0Pxbo1FKKJuSK4SjnsIxQWyHuzXtKsouCcGILpU 4AAHYpRSuG79lJboUydMGXTGNc97XDpcTAfmjul4QtRoh1IPTUJnhaRnWvmOUrpVI/OV zbXQ== MIME-Version: 1.0 X-Received: by 10.14.223.69 with SMTP id u45mr79455801eep.23.1363850865327; Thu, 21 Mar 2013 00:27:45 -0700 (PDT) Received: by 10.223.78.142 with HTTP; Thu, 21 Mar 2013 00:27:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Mar 2013 15:27:45 +0800 Message-ID: Subject: Re: Java client options for C* v1.2 From: Alicia Leong To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b604fba5aedb604d86a464f X-Virus-Checked: Checked by ClamAV on apache.org --047d7b604fba5aedb604d86a464f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried https://github.com/datastax/java-driver with below CQL3. It works well. CREATE TABLE my_columnfamily ( printer varchar, computer varchar, snapshot int, xml text, status varchar, PRIMARY KEY ((printer, computer), snapshot) ) WITH CLUSTERING ORDER BY (snapshot DESC); CREATE INDEX my_columnfamily_status ON payloads (status); Cluster cluster =3D Cluster.builder().addContactPoint("localhost").withPort(9160).build(); Session session =3D cluster.connect("my_keyspace"); for (Row row : session.execute("select * from my_columnfamily where status =3D 'N'")) { System.out.println("pinter :" + row.getString(0)); System.out.println("computer :" + row.getString(1)); System.out.println("snapshot :" + row.getInt(2)); System.out.println("status :" + row.getString(3)); System.out.println("xml :" + row.getString(4)); System.out.println("------------------------------------------------"); } On Thu, Mar 21, 2013 at 3:10 PM, Marko Asplund wro= te: > V=EDctor Hugo Oliveira Molinar wrote: > > I guess Hector fits your requirements. The last release is pretty new. > > But i'd suggest you to take a look at astyanax too. > > thanks. > > C* versions 1.1 and 1.2 seem to have been released after the latest > Hector release. > Does Hector support al the newer C* features (such as CQL3)? > > > marko > --047d7b604fba5aedb604d86a464f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

with below CQL3. It works well.

CREATE TABLE=A0my_columnfamily<= /span>=A0(
=A0 printer varchar,
=A0 computer varcha= r,
=A0 snapshot int,
=A0 xml text,
=A0 status varchar= ,
=A0 PRIMARY KEY ((printer, computer), snapshot)
)
WITH CLUSTERING ORDER BY (snapshot DESC);

<= pre style=3D"font-family:monospace,serif;font-size:13px;white-space:pre-wra= p;word-wrap:break-word;background-image:none;color:rgb(75,75,75);line-heigh= t:13px"> CREATE INDEX my_columnfamily_status
ON payload= s=A0(status);

Cluster cluster =
=3D Cluster.builder().addContactPoint("localhost").withPort(9160)=
.build();
Session session =3D cluster.connect("my_keyspace");
=
for (Row row : ses=
sion.execute("select * from my_columnfamily where status =3D 'N=
9;")) {
	System.out.println("pinter :" + row.getString(0));
	System.out.println("computer :" + row.getString(1));
	System.out.println("snapshot :" + row.getInt(2));
	System.out.println("status :" + row.getString(3));
	System.out.println("xml :" + row.getString(4));
	System.out.println("------------------------------------------------&=
quot;);
}





On Thu, Mar 21, 2013 at= 3:10 PM, Marko Asplund <marko.asplund@gmail.com> wrot= e:
V=EDctor Hugo Oliveira Mol= inar wrote:
> I guess Hector fits your requirements. The last release is pretty new.=
> But i'd suggest you to take a look at astyanax too.

thanks.

C* versions 1.1 and 1.2 seem to have been released after the latest
Hector release.
Does Hector support al the newer C* features (such as CQL3)?


marko

--047d7b604fba5aedb604d86a464f--