You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by 李楠 <qi...@gmail.com> on 2009/07/23 11:18:33 UTC
how to add table in storage-conf.xml
i add table tag in storage-conf.xml:
<Table Name="users">
<ColumnFamily ColumnSort="Name" Name="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:5072)
at
org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
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.
Re: how to add table in storage-conf.xml
Posted by Jonathan Ellis <jb...@gmail.com>.
that's because it doesn't exist. 0.3 uses the old colon-delimited strings.
2009/7/23 李楠 <qi...@gmail.com>:
> i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath class.
>
> 2009/7/23 Gasol Wu <ga...@gmail.com>
>>
>> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
>>
>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
>>>
>>> i add table tag in storage-conf.xml:
>>> <Table Name="users">
>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
>>> at
>>> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
>>> 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.
>
>
Re: how to add table in storage-conf.xml
Posted by 李楠 <qi...@gmail.com>.
what is Trunk? what relation with cassandra?
2009/7/24 Chris Goffinet <go...@digg.com>
> 0.3 only supported 1 table. Trunk and upcoming 0.4 has multi-table support.
>
> On Jul 23, 2009, at 10:44 PM, 李楠 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="Table1">
> tag,and i add a new <Table Name="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:5072)
> at
> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
> 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="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 <mi...@gmail.com>
>
>> 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 李楠 <qi...@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 李楠 <qi...@gmail.com>
>> >>
>> >> i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath
>> >> class.
>> >>
>> >> 2009/7/23 Gasol Wu <ga...@gmail.com>
>> >>>
>> >>> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
>> >>>
>> >>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
>> >>>>
>> >>>> i add table tag in storage-conf.xml:
>> >>>> <Table Name="users">
>> >>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
>> >>>> at
>> >>>>
>> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
>> >>>> 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.
>> >>
>> >
>> >
>>
>
>
>
Re: how to add table in storage-conf.xml
Posted by Chris Goffinet <go...@digg.com>.
0.3 only supported 1 table. Trunk and upcoming 0.4 has multi-table
support.
On Jul 23, 2009, at 10:44 PM, 李楠 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="Table1"> tag,and i add a new <Table Name="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:5072)
> at org.apache.cassandra.service.Cassandra
> $Client.recv_insert(Cassandra.java:303)
> 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="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 <mi...@gmail.com>
> 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 李楠 <qi...@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 李楠 <qi...@gmail.com>
> >>
> >> i use apache-cassandra-incubating-0.3.0.jar and not find
> ColumnPath
> >> class.
> >>
> >> 2009/7/23 Gasol Wu <ga...@gmail.com>
> >>>
> >>> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
> >>>
> >>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com>
> wrote:
> >>>>
> >>>> i add table tag in storage-conf.xml:
> >>>> <Table Name="users">
> >>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
> >>>> at
> >>>> org.apache.cassandra.service.Cassandra
> $Client.recv_insert(Cassandra.java:303)
> >>>> 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.
> >>
> >
> >
>
Re: how to add table in storage-conf.xml
Posted by 李楠 <qi...@gmail.com>.
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="Table1">
tag,and i add a new <Table Name="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:5072)
at
org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
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="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 <mi...@gmail.com>
> 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 李楠 <qi...@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 李楠 <qi...@gmail.com>
> >>
> >> i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath
> >> class.
> >>
> >> 2009/7/23 Gasol Wu <ga...@gmail.com>
> >>>
> >>> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
> >>>
> >>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
> >>>>
> >>>> i add table tag in storage-conf.xml:
> >>>> <Table Name="users">
> >>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
> >>>> at
> >>>>
> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
> >>>> 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.
> >>
> >
> >
>
Re: how to add table in storage-conf.xml
Posted by Michael Greene <mi...@gmail.com>.
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 李楠 <qi...@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 李楠 <qi...@gmail.com>
>>
>> i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath
>> class.
>>
>> 2009/7/23 Gasol Wu <ga...@gmail.com>
>>>
>>> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
>>>
>>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
>>>>
>>>> i add table tag in storage-conf.xml:
>>>> <Table Name="users">
>>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
>>>> at
>>>> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
>>>> 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.
>>
>
>
Re: how to add table in storage-conf.xml
Posted by 李楠 <qi...@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 李楠 <qi...@gmail.com>
> i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath
> class.
>
> 2009/7/23 Gasol Wu <ga...@gmail.com>
>
> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
>>
>>
>> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
>>
>>> i add table tag in storage-conf.xml:
>>> <Table Name="users">
>>> <ColumnFamily ColumnSort="Name" Name="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:5072)
>>> at
>>> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
>>> 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.
>>>
>>
>>
>
Re: how to add table in storage-conf.xml
Posted by 李楠 <qi...@gmail.com>.
i use apache-cassandra-incubating-0.3.0.jar and not find ColumnPath class.
2009/7/23 Gasol Wu <ga...@gmail.com>
> ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
>
>
> On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
>
>> i add table tag in storage-conf.xml:
>> <Table Name="users">
>> <ColumnFamily ColumnSort="Name" Name="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:5072)
>> at
>> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
>> 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.
>>
>
>
Re: how to add table in storage-conf.xml
Posted by Gasol Wu <ga...@gmail.com>.
ColumnPath cp = 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.mbox/%3Ce06563880907081147x57f2e4f2h5ae8f0f96dc81ebd@mail.gmail.com%3E
On Thu, Jul 23, 2009 at 5:18 PM, 李楠 <qi...@gmail.com> wrote:
> i add table tag in storage-conf.xml:
> <Table Name="users">
> <ColumnFamily ColumnSort="Name" Name="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:5072)
> at
> org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:303)
> 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.
>