Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 77135 invoked from network); 7 Sep 2010 08:22:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Sep 2010 08:22:33 -0000 Received: (qmail 223 invoked by uid 500); 7 Sep 2010 08:22:31 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 99789 invoked by uid 500); 7 Sep 2010 08:22:29 -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 99489 invoked by uid 99); 7 Sep 2010 08:22:29 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 08:22:29 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ivytang0812@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-iw0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 08:22:07 +0000 Received: by iwn3 with SMTP id 3so5883416iwn.31 for ; Tue, 07 Sep 2010 01:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=hM4J2Qk4AzG14HKERSn0JCA9qWhl133BYlqMX+aDPBg=; b=j9/WseCGz3nHCXc8r5oC/d0RUX1varRj5+ppvN7FFuZcoVONIkrNygiuM4BSf1LcL6 DTAhwI9lU4X/CXHJnNwisFsocAZWZLZJz0TY6VvpqsDfaARvbYE84LGczDeim/jNdBKo iQo3GRdhV7H1ZTYSblGTcfssMmV28msHSTviE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=HYmTtytQ52SDwUyphqJHCo33RjIUIUxrIatMdeEVESKsSmLHsQMlBx42hN5DjSprrb IiIBr0qMpu5QF91hJeCzXyik5IDPkdxdr98h0bBGlqkLzaa4LJI9ZCTQCu7HqQ14GAZw zyuM4p8FuUric/c7AtfeXuVi9pwkNdV3DsLIc= Received: by 10.231.169.10 with SMTP id w10mr7682710iby.106.1283847706214; Tue, 07 Sep 2010 01:21:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.160.3 with HTTP; Tue, 7 Sep 2010 01:21:26 -0700 (PDT) In-Reply-To: References: From: Ying Tang Date: Tue, 7 Sep 2010 16:21:26 +0800 Message-ID: Subject: Re: timeout when insert an indexed column To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e6d26cc8797f90048fa716fe X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d26cc8797f90048fa716fe Content-Type: text/plain; charset=ISO-8859-1 Before inserting, the Cassandra.client is assined the keyspace . ColumnParent parent = new ColumnParent(); parent.setColumn_family("Standard1"); On Tue, Sep 7, 2010 at 4:19 PM, Viktor Jevdokimov < Viktor.Jevdokimov@adform.com> wrote: > I didn't get which keyspace and column family you trying to insert to? > > > parent.setColumn_family("Standard1"); > > -----Original Message----- > From: Ying Tang [mailto:ivytang0812@gmail.com] > Sent: Tuesday, September 07, 2010 11:10 AM > To: user@cassandra.apache.org > Subject: timeout when insert an indexed column > > Hi all, > I don't know if anyone had post this question , if it is ,plz let > me know the post. > Here is the problem i met: > First , i create the keyspace that contains a columnfamily ,and > the columfamily contains a indexed column . The code is : > ColumnDef clDef = new ColumnDef("name".getBytes("UTF-8"), > "BytesType"); > clDef.setIndex_name("name"); > clDef.setIndex_type(IndexType.KEYS); > > List clList = new ArrayList(); > clList.add(clDef); > > CfDef cfDef = new CfDef(OperationEntry.KEYSPACE, > OperationEntry.COLUMN_FAMILY); > cfDef.setColumn_metadata(clList); > > List cfDefList = new ArrayList(); > cfDefList.add(cfDef); > > KsDef ksDef=new KsDef(OperationEntry.KEYSPACE, > "org.apache.cassandra.locator.RackUnawareStrategy", 1, > cfDefList); > > client.system_add_keyspace(ksDef); > > This works ok. > But when i want to insert a row into this columnfamily , > ColumnParent parent = new ColumnParent(); > parent.setColumn_family("Standard1"); > Column column = new Column(); > column.setName("name".getBytes("UTF-8")); > column.setValue("index".getBytes("UTF-8")); > column.setClock(new Clock()); > client.insert("index".getBytes("UTF-8"), parent, column, > ConsistencyLevel.ONE); > > This insert operation invoke an exception TimedOutException() ,but > insert other noindexed columns works ok. > > Anything wrong with my code ? > > > > -- > Best regards, > > Ivy Tang > > -- Best regards, Ivy Tang --0016e6d26cc8797f90048fa716fe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Before inserting, the Cassandra.client is assined the keyspace .
=A0ColumnParent parent =3D new Colum= nParent();
=A0 =A0 =A0 =A0 =A0 =A0parent.setColumn_family("Standard1");


On Tue, Sep 7, 2010 at 4:19 P= M, Viktor Jevdokimov <Viktor.Jevdokimov@adform.com> wrote:
I didn't get which keyspace and column = family you trying to insert to?

> parent.setColumn_family("Standard1");

-----Original Message-----
From: Ying Tang [mailto:ivytang081= 2@gmail.com]
Sent: Tuesday, September 07, 2010 11:10 AM
To: user@cassandra.apache.org<= /a>
Subject: timeout when insert an indexed column

Hi all,
=A0 =A0I don't know if anyone had post this question , if it is ,plz l= et
me know the post.
=A0 =A0Here is the problem i met:
=A0 =A0First , =A0i create the keyspace that contains a columnfamily ,and<= br> the columfamily contains a indexed column . The code is :
=A0 =A0 =A0 =A0ColumnDef clDef =3D new ColumnDef("name".getBytes= ("UTF-8"), "BytesType");
=A0 =A0 =A0 =A0clDef.setIndex_name("name");
=A0 =A0 =A0 =A0clDef.setIndex_type(IndexType.KEYS);

=A0 =A0 =A0 =A0List<ColumnDef> clList =3D new ArrayList<ColumnDef= >();
=A0 =A0 =A0 =A0clList.add(clDef);

=A0 =A0 =A0 =A0CfDef cfDef =3D new CfDef(OperationEntry.KEYSPACE,
OperationEntry.COLUMN_FAMILY);
=A0 =A0 =A0 =A0cfDef.setColumn_metadata(clList);

=A0 =A0 =A0 =A0List<CfDef> cfDefList =3D new ArrayList<CfDef>(= );
=A0 =A0 =A0 =A0cfDefList.add(cfDef);

=A0 =A0 =A0 =A0KsDef ksDef=3Dnew KsDef(OperationEntry.KEYSPACE,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"org.apache.cassandra.locator.RackUnaw= areStrategy", 1,
cfDefList);

=A0 =A0 =A0 =A0client.system_add_keyspace(ksDef);

=A0 =A0This works ok.
=A0 =A0But when i want to insert a row into this columnfamily ,
=A0 =A0 =A0 =A0 =A0 =A0ColumnParent parent =3D new ColumnParent();
=A0 =A0 =A0 =A0 =A0 =A0parent.setColumn_family("Standard1");
=A0 =A0 =A0 =A0 =A0 =A0Column column =3D new Column();
=A0 =A0 =A0 =A0 =A0 =A0column.setName("name".getBytes("UTF-= 8"));
=A0 =A0 =A0 =A0 =A0 =A0column.setValue("index".getBytes("UT= F-8"));
=A0 =A0 =A0 =A0 =A0 =A0column.setClock(new Clock());
=A0 =A0 =A0 =A0 =A0 =A0client.insert("index".getBytes("UTF-= 8"), parent, column,
ConsistencyLevel.ONE);

This insert operation invoke an exception TimedOutException() ,but
insert other noindexed columns works ok.

=A0 Anything wrong with my code ?



--
Best regards,

Ivy Tang




--
Best r= egards,

Ivy Tang



--0016e6d26cc8797f90048fa716fe--