You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ying Tang <iv...@gmail.com> on 2010/09/07 10:10:18 UTC

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

Re: timeout when insert an indexed column

Posted by Jonathan Ellis <jb...@gmail.com>.
this is fixed in trunk for beta2

On Wed, Sep 8, 2010 at 9:52 PM, welcome <fl...@163.com> wrote:
> Hello!
>
>    I encounter the same problem with you,and I replace
> client.insert("index".getBytes("UTF-8"), parent, column,ConsistencyLevel.ONE);to:
> client.insert("inde".getBytes("UTF-8"), parent, column,ConsistencyLevel.ONE);
> That's right.But when I insert another one letter again,It's wrong as before!
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: timeout when insert an indexed column

Posted by welcome <fl...@163.com>.
Hello!
   
    I encounter the same problem with you,and I replace
client.insert("index".getBytes("UTF-8"), parent, column,ConsistencyLevel.ONE);to:
client.insert("inde".getBytes("UTF-8"), parent, column,ConsistencyLevel.ONE);
That's right.But when I insert another one letter again,It's wrong as before!


Re: timeout when insert an indexed column

Posted by Asif Jan <as...@gmail.com>.
On Sep 7, 2010, at 11:05 AM, Ying Tang wrote:

> 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 <ca...@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 <iv...@gmail.com>
>>
>>> oh ,i've found this   https://issues.apache.org/jira/browse/CASSANDRA-1402
>>>
>>>
>>>
>>> On 9/7/10, Ying Tang <iv...@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


Re: timeout when insert an indexed column

Posted by Ying Tang <iv...@gmail.com>.
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 <ca...@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 <iv...@gmail.com>
>
>> oh ,i've found this   https://issues.apache.org/jira/browse/CASSANDRA-1402
>>
>>
>>
>> On 9/7/10, Ying Tang <iv...@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

Re: timeout when insert an indexed column

Posted by Carlin Wong <ca...@gmail.com>.
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 <iv...@gmail.com>

> oh ,i've found this   https://issues.apache.org/jira/browse/CASSANDRA-1402
>
>
>
> On 9/7/10, Ying Tang <iv...@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
>

Re: timeout when insert an indexed column

Posted by Ying Tang <iv...@gmail.com>.
oh ,i've found this   https://issues.apache.org/jira/browse/CASSANDRA-1402



On 9/7/10, Ying Tang <iv...@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

Re: timeout when insert an indexed column

Posted by Ying Tang <iv...@gmail.com>.
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

RE: timeout when insert an indexed column

Posted by Viktor Jevdokimov <Vi...@adform.com>.
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