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