开发者

Getting Error when Calling method "addEqualsExpression" in Hector,Cassandra

Hello fellow developer,iam getting error when running code above:

public void getConditioningQuery(String columnName,String value){
        QueryResult<OrderedRows<String, String, String>> result =
        (QueryResult<OrderedRows<String, String, String>>) new IndexedSlicesQuery<String, String, String>(keyspace, serializer, serializer, serializer)
        .addEqualsExpression("state", "TI")
        .setReturnKeysOnly()
        .setColumnFamily(CF_NAME)
        .setStartKey("")
        .execute();
        System.out.println("Result="+result.get().getList());
    }

this method is to find row where state=TI. i've added index in my column family and if i manual query in cassandra-cli,the data is show,but if im using the code using hector,im getting this error:

in my IDE=

345 [main] INFO me.prettyprint.cassandra.service.JmxMonitor - Registering JMX me.prettyprint.cassandra.service_MyCluster:ServiceType=hector,MonitorType=hector
867 [main] INFO me.prettyprint.cassandra.hector.TimingLogger - start[1306754734185] time[91] tag[WRITE.success_]
10926 [main] INFO me.prettyprint.cassandra.hector.TimingLogger - start[1306754734314] time[10021] tag[READ.fail_]
me.prettyprint.hector.api.exceptions.HTimedOutException: TimedOutException()
        at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:32)

and in cassandra log=

ERROR 18:25:34,326 Fatal exception in thread Thread[ReadStage:102,5,main]
java.lang.AssertionError: No data found for NamesQueryFilter(columns=) in DecoratedKey(165611378069681836494944905825187619237, 73616e6a6f7578):QueryPath(columnFamilyName='user', superColumnName='null', columnName='null') (original filter NamesQueryFilter(columns=)) from expression 'user.state EQ TI'
        at org.apache.cassandra.db.ColumnFamilyStore.scan(ColumnFamilyStore.java:1603)
        at org.apache.cassandra.service.IndexScanVerbHandler.doVerb(IndexScanVerbHandler.java:42)
        at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:72)
        at java.util.c开发者_如何学Pythononcurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)

im so confuse because the error is tell if the data in column in column family user is not found,but if im using cassandra-cli,the data is shows..

im so confuse and still stuck here..maybe my method is wrong?somebody can help me telling me what is wrong?im still google to solve this problem..thanks for your attention and sorry for my bad english :D..


It looks like you're hitting CASSANDRA-2653 if you're using 0.8-rc1 or similar. This should be fixed in the current 0.8 branch.


You can't use setReturnKeysOnly with index queries, yet. This will be fixed in a future release (see the ticket Tyler linked); in the meantime, simply let it return one or more columns as a workaround.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜