incubator-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 08:37:53 GMT
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

Mime
View raw message