incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ankit tyagi <ankittyagi.mn...@gmail.com>
Subject Exception while iterating over large data
Date Thu, 20 Feb 2014 20:19:49 GMT
Hello guys,
I was going through
http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0,
and it is mentioned that automatically pagination is taken care of.

I am using below code to iterate over large data for particular primary key.

Statement stmt = new SimpleStatement("SELECT * FROM product_state_update
where key ='UID0000007010' and key2='927ead' and key3='Prateek1000'");
stmt.setFetchSize(1000);
ResultSet rs = entityManager.getNativeSession().execute(stmt);
int count=0;
while(!rs.isExhausted()){
 for(Row r:rs.all()){
count++;
System.out.println("row and count" + count);
}
}

but getting below Exception,

*Exception in thread "main"
com.datastax.driver.core.exceptions.DriverInternalError: An unexpected
error occured server side on localhost/127.0.0.1 <http://127.0.0.1/>:
java.lang.IllegalArgumentException: Illegal Capacity: -1*
* at
com.datastax.driver.core.exceptions.DriverInternalError.copy(DriverInternalError.java:42)*
at
com.datastax.driver.core.ResultSetFuture.extractCauseFromExecutionException(ResultSetFuture.java:271)
at
com.datastax.driver.core.ResultSet.fetchMoreResultsBlocking(ResultSet.java:252)
at com.datastax.driver.core.ResultSet.isExhausted(ResultSet.java:147)
at com.datastax.driver.core.ResultSet$1.hasNext(ResultSet.java:206)
at com.datastax.driver.core.ResultSet.all(ResultSet.java:183)
at
com.snapdeal.com.casssandraService.CassandraPersistenceService.sliceQueryIterator(CassandraPersistenceService.java:86)
at
com.snapdeal.com.casssandraService.CassandraService.sliceQueryIterator(CassandraService.java:37)
at
com.snapdeal.com.casssandraService.CassandraService.main(CassandraService.java:64)
Caused by: com.datastax.driver.core.exceptions.DriverInternalError: An
unexpected error occured server side on localhost/127.0.0.1:
java.lang.IllegalArgumentException: Illegal Capacity: -1
at com.datastax.driver.core.Responses$Error.asException(Responses.java:85)
at com.datastax.driver.core.ResultSet$2.onSet(ResultSet.java:341)
at
com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:224)
at com.datastax.driver.core.RequestHandler.onSet(RequestHandler.java:361)
at
com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:510)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

is this a bug or i am missing something?

Regards,
Ankit Tyagi

Mime
View raw message