cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manfred Muench <>
Subject Java-Client returns empty data sets after Cassandra sits for a while
Date Fri, 18 Jun 2010 09:05:15 GMT

I have noticed the following behaviour (bug?) which I don't completely
1. start Cassandra (I'm using 0.6.2, but it also appears in 0.6.1)
2. work with it (I'm using Java thrift API)
3. let it sit for a long time (in my case: a day or more) without
issuing any command
4. go back to (2) -- but now Cassandra always returns empty data sets to
queries in Java. The command line interface works, no matter if left
open or started newly.

Here's how I connect to Cassandra (leaving exception handling out for 
better readability):

import org.apache.cassandra.thrift.Cassandra;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;

TTransport transport = new TSocket(cassandraHost, cassandraPort);
TProtocol protocol = new TBinaryProtocol(transport);
Cassandra.Client client = new Cassandra.Client(protocol);;
List<KeySlice> keySlices = client.get_range_slices(...);

This code usually works, but after leaving Cassandra running unused for 
a couple of hours (days), this code connects fine to Cassandra, but the 
client.get_range_slices returns an empty result set.

I am not very sure, but I believe it happens after compacting. Need to 
do more tests on this one.

Does anybody know what I'm doing wrong here? Is there any kind of 
"initialisation step" that I should have taken before running queries?

If you need more (debug) information on this matter, please let me know 
how I can provide you with it. The log files didn't show anything while 
running the query. The last log message was:

  INFO [COMPACTION-POOL:1] 2010-06-18 14:07:45,882 (line 246) Compacting []

I ran the query at around 14:20, no other message after this one.

Thanks for your help in advance!


Dr. Manfred Muench
Nanjing Imperiosus Technology Co. Ltd.
Wu Xing Nian Hua Da Sha, Room 1004
134 Hanzhong Lu, Nanjing, P.R. China

View raw message