From cassandra-user-return-350-apmail-incubator-cassandra-user-archive=incubator.apache.org@incubator.apache.org Fri Jul 24 05:50:59 2009 Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 54495 invoked from network); 24 Jul 2009 05:50:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jul 2009 05:50:59 -0000 Received: (qmail 25453 invoked by uid 500); 24 Jul 2009 05:52:04 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 25408 invoked by uid 500); 24 Jul 2009 05:52:04 -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 25399 invoked by uid 99); 24 Jul 2009 05:52:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2009 05:52:04 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of goffinet@digg.com designates 64.191.203.36 as permitted sender) Received: from [64.191.203.36] (HELO mail.digg.com) (64.191.203.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2009 05:51:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id D11BDA8551B for ; Thu, 23 Jul 2009 22:51:32 -0700 (PDT) X-Virus-Scanned: amavisd-new at d242.digg.internal Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dzp5-987zBeb for ; Thu, 23 Jul 2009 22:51:30 -0700 (PDT) Received: from [10.2.16.222] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id 6DC32A85258 for ; Thu, 23 Jul 2009 22:51:30 -0700 (PDT) Message-Id: From: Chris Goffinet To: cassandra-user@incubator.apache.org In-Reply-To: <6ff75cf20907232244v5928c9d0k492f0aad5b61ccb7@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-3--475449654 Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: how to add table in storage-conf.xml Date: Thu, 23 Jul 2009 22:51:29 -0700 References: <6ff75cf20907230218o2efc35e5j9b82deaf1c199462@mail.gmail.com> <70254fc70907230359p5c8b19f7v86f7186ab2f09e1b@mail.gmail.com> <6ff75cf20907231854g4d9bc267q82fb770d7696762a@mail.gmail.com> <6ff75cf20907231913j43a30f14v8a3c5eee9c193f17@mail.gmail.com> <6ff75cf20907232244v5928c9d0k492f0aad5b61ccb7@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-3--475449654 Content-Type: text/plain; charset=GB2312; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable 0.3 only supported 1 table. Trunk and upcoming 0.4 has multi-table =20 support. On Jul 23, 2009, at 10:44 PM, =C0=EE=E9=AA wrote: > firstly thanks Gasol and Michael, my problem solved. > sencedly how to i solved? > i find in default storage-conf.xml has a Name=3D"Table1"> tag,and i add a new
tag,then i = =20 > invoke with below program > > client.insert("users", key_user_id, "content:name", "Chris =20 > Goffinet".getBytes("UTF-8"), timestamp, false); > > and then throws exception: > > InvalidRequestException(why:Column Family content is invalid.) > at org.apache.cassandra.service.Cassandra=20 > $insert_result.read(Cassandra.java:5072) > at org.apache.cassandra.service.Cassandra=20 > $Client.recv_insert(Cassandra.java:303) > at org.apache.cassandra.service.Cassandra=20 > $Client.insert(Cassandra.java:276) > at com.chinaren.alumni4.cassandra.CClient.main(CClient.java:33) > > and then i delete
tag in storage-conf.xml, =20 > then i invoke with up program is ok. cassandra prohibit more than =20 > one
tag? > > 2009/7/24 Michael Greene > columnPath in 0.3 used to be defined as a composite string > "columnFamilyName:columnName" or =20 > "columnFamilyName:superColumnName:columnName" > > Now in trunk/0.4 it is defined as a ColumnPath struct/object that can > be instanced as Gasol has written below. > > Michael > > 2009/7/23 =C0=EE=E9=AA : > > and > > > > package org.apache.cassandra.service; > > > > public void insert(String tablename, String key, String =20 > columnPath, byte[] > > cellData, long timestamp, boolean block) throws =20 > InvalidRequestException, > > UnavailableException, TException; > > > > columnPath type is String not ColumnPath class and i do not know =20 > how to do. > > > > thanks > > > > 2009/7/24 =C0=EE=E9=AA > >> > >> i use apache-cassandra-incubating-0.3.0.jar and not find =20 > ColumnPath > >> class. > >> > >> 2009/7/23 Gasol Wu > >>> > >>> ColumnPath cp =3D new ColumnPath("content", null, "name"); > >>> client.insert("users", key_user_id, cp, "Chris > >>> Goffinet".getBytes("UTF-8"), timestamp, false); > >>> > >>> don't use trunk,unless you know what you are doing. > >>> > >>> > >>> = http://mail-archives.apache.org/mod_mbox/incubator-cassandra-dev/200907.mb= ox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E > >>> > >>> On Thu, Jul 23, 2009 at 5:18 PM, =C0=EE=E9=AA = =20 > wrote: > >>>> > >>>> i add table tag in storage-conf.xml: > >>>>
> >>>> > >>>>
> >>>> and then invoke by below program: > >>>> client.insert("users", key_user_id, "content:name", "Chris > >>>> Goffinet".getBytes("UTF-8"), timestamp, false); > >>>> and then throws exception: > >>>> InvalidRequestException(why:Column Family content is invalid.) > >>>> at > >>>> org.apache.cassandra.service.Cassandra=20 > $insert_result.read(Cassandra.java:5072) > >>>> at > >>>> org.apache.cassandra.service.Cassandra=20 > $Client.recv_insert(Cassandra.java:303) > >>>> at > >>>> org.apache.cassandra.service.Cassandra=20 > $Client.insert(Cassandra.java:276) > >>>> at com.chinaren.alumni4.cassandra.CClient.main(CClient.java:33) > >>>> please tell me why and how modify am i,thanks a lot. > >> > > > > > --Apple-Mail-3--475449654 Content-Type: text/html; charset=GB2312 Content-Transfer-Encoding: quoted-printable 0.3 only supported 1 table. = Trunk and upcoming 0.4 has multi-table support.

On Jul = 23, 2009, at 10:44 PM, =C0=EE=E9=AA wrote:

firstly = thanks Gasol and Michael, my problem solved.
sencedly how to i = solved?
i find in default storage-conf.xml <Tables> has a = <Table Name=3D"Table1"> tag,and i add a new <Table = Name=3D"users"> tag,then i invoke with below program
=
client.insert("users", key_user_id, "content:name", "Chris = Goffinet".getBytes("UTF-8"), timestamp, false);
=

and then throws = exception:

InvalidRequestException(why:Column = Family content is invalid.)
= at = org.apache.cassandra.service.Cassandra$insert_result.read(Cassandra.java:5= 072)
at = org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:3= 03)
at = org.apache.cassandra.service.Cassandra$Client.insert(Cassandra.java:276)
at = com.chinaren.alumni4.cassandra.CClient.main(CClient.java:33)

and = then i delete <Table Name=3D"Table1"> tag in storage-conf.xml, = then i invoke with up program is ok. cassandra prohibit more than one = <Table> tag?

2009/7/24 Michael = Greene <michael.greene@gmail.com><= /span>
columnPath in 0.3 used to be defined as a composite string
= "columnFamilyName:columnName" or = "columnFamilyName:superColumnName:columnName"

Now in trunk/0.4 = it is defined as a ColumnPath struct/object that can
be instanced as = Gasol has written below.

Michael

2009/7/23 =C0=EE=E9=AA = <qingnan.li@gmail.com>:
=
> and
>
> package = org.apache.cassandra.service;
>
> public void = insert(String tablename, String key, String columnPath, byte[]
> = cellData, long timestamp, boolean block) throws = InvalidRequestException,
> UnavailableException, TException;
= >
> columnPath type is String not ColumnPath class and i do = not know how to do.
>
> thanks
>
> 2009/7/24 = =C0=EE=E9=AA <qingnan.li@gmail.com>
>>
>> i use = apache-cassandra-incubating-0.3.0.jar and not find  ColumnPath
= >> class.
>>
>> 2009/7/23 Gasol Wu <gasol.wu@gmail.com>
= >>>
>>> ColumnPath cp =3D new = ColumnPath("content", null, "name");
>>> = client.insert("users", key_user_id, cp, "Chris
>>> = Goffinet".getBytes("UTF-8"), timestamp, false);
>>>
= >>> don't use trunk,unless you know what you are doing.
= >>>
>>>
>>> http://mail-archives.apache.org/mod_mbox/incubator-cassa= ndra-dev/200907.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.= gmail.com%3E
>>>
>>> On Thu, Jul 23, 2009 = at 5:18 PM, =C0=EE=E9=AA <qingnan.li@gmail.com> wrote:
>>>>
= >>>> i add table tag in storage-conf.xml:
= >>>>  <Table Name=3D"users">
>>>> =      <ColumnFamily ColumnSort=3D"Name" = Name=3D"content"/>
>>>>  </Table>
= >>>> and then invoke by below program:
>>>> = client.insert("users", key_user_id, "content:name", "Chris
= >>>> Goffinet".getBytes("UTF-8"), timestamp, false);
= >>>> and then throws exception:
>>>> = InvalidRequestException(why:Column Family content is invalid.)
= >>>> at
>>>> = org.apache.cassandra.service.Cassandra$insert_result.read(Cassandra.java:5= 072)
>>>> at
>>>> = org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:3= 03)
>>>> at
>>>> = org.apache.cassandra.service.Cassandra$Client.insert(Cassandra.java:276) >>>> at = com.chinaren.alumni4.cassandra.CClient.main(CClient.java:33)
= >>>> please tell me why and how modify am i,thanks a = lot.
>>
>
>
=


= --Apple-Mail-3--475449654--