cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ying Tang <ivytang0...@gmail.com>
Subject Re: timeout when insert an indexed column
Date Tue, 07 Sep 2010 09:05:28 GMT
Sorry , i didn't put it clearly.
The app throws out the TimeoutException ,
but the cassandra  throws out the ArrayIndexOutOfBoundsException.

And if i shortened this key's length,such as one letter ,  the indexed
column insert is successful.
But if i let the  key be 'index0' ,this insert operation would fail.

On 9/7/10, Carlin Wong <carlin4j@gmail.com> wrote:
> Hi Ivy,
>
>     Are you sure about this.
> One is TimedOutException, and another is ArrayIndexOutOfBoundsException.
> I can't see any connection. Please point out, thank you.
>
> Calin4J
>
> 2010/9/7 Ying Tang <ivytang0812@gmail.com>
>
>> oh ,i've found this   https://issues.apache.org/jira/browse/CASSANDRA-1402
>>
>>
>>
>> On 9/7/10, Ying Tang <ivytang0812@gmail.com> wrote:
>> > 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<ColumnDef> clList = new ArrayList<ColumnDef>();
>> >>        clList.add(clDef);
>> >>
>> >>        CfDef cfDef = new CfDef(OperationEntry.KEYSPACE,
>> >> OperationEntry.COLUMN_FAMILY);
>> >>        cfDef.setColumn_metadata(clList);
>> >>
>> >>        List<CfDef> cfDefList = new ArrayList<CfDef>();
>> >>        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
>> >
>>
>>
>> --
>> Best regards,
>>
>> Ivy Tang
>>
>


-- 
Best regards,

Ivy Tang

Mime
View raw message