Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0CE901086C for ; Thu, 20 Feb 2014 20:20:21 +0000 (UTC) Received: (qmail 54107 invoked by uid 500); 20 Feb 2014 20:20:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 54085 invoked by uid 500); 20 Feb 2014 20:20:17 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 54077 invoked by uid 99); 20 Feb 2014 20:20:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 20:20:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ankittyagi.mnnit@gmail.com designates 209.85.220.54 as permitted sender) Received: from [209.85.220.54] (HELO mail-pa0-f54.google.com) (209.85.220.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 20:20:10 +0000 Received: by mail-pa0-f54.google.com with SMTP id fa1so2381674pad.41 for ; Thu, 20 Feb 2014 12:19:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UTrK7Y1RZ2kTV9P6VLTo0t+OY3ZlUjWeEpkYDvuJKd8=; b=yYEZLElYkPMRvObz0ItjuoaB3AguYY81l3E/eXicRXTm49St2OxGQ75+ESpZFncrMC G6VnRyrIW43AsDllFF05Cpb6hYWVCoQvg0DJ3sdv3tV3i0Ybb0dqlyJeeSzGJbtxgBbc kbUIDyUvddehD7qJpp+YElsouCsQiLGqT3+L51hh0vOsuanPqqKBI44/DpaIokJTpN4J zWMVhnfpZVXblGhOBj3MbS90smDg++lpC/VxaJBKq/qgxR34AAR89CJRk0sHKGmp2l9c eVc1epY3JC1IZE/EDq8E314EqH/BChvbKKlB4kX/PP2lgzcBWJVwWVTQE0HH/TDknJnq J/sA== MIME-Version: 1.0 X-Received: by 10.68.240.36 with SMTP id vx4mr4390953pbc.140.1392927589311; Thu, 20 Feb 2014 12:19:49 -0800 (PST) Received: by 10.68.17.196 with HTTP; Thu, 20 Feb 2014 12:19:49 -0800 (PST) Date: Fri, 21 Feb 2014 01:49:49 +0530 Message-ID: Subject: Exception while iterating over large data From: ankit tyagi To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b339c2728abe504f2dc3a57 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b339c2728abe504f2dc3a57 Content-Type: text/plain; charset=ISO-8859-1 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 : 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 --047d7b339c2728abe504f2dc3a57 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello guys,
I was going through=A0http://www.datastax= .com/dev/blog/client-side-improvements-in-cassandra-2-0, and it is mentioned that auto= matically pagination is taken care of.

<= /div>
I am using = below code to iterate over large data for particular primary key.

S= tatement stmt =3D new SimpleStatement("SELECT * FROM product_state_upd= ate where key =3D'UID0000007010' and key2=3D'927ead' and ke= y3=3D'Prateek1000'");
stmt.setFetchSize(1000);=
ResultSet rs =3D e= ntityManager.getNativeSession().execute(stmt);
int count=3D0;
while(!rs.isExhausted())= {
for(Row r:rs.all()){
count++;
System.out.println(&qu= ot;row and count" + count);
}
}<= /div>

=
but getting belo= w Exception,

<= b>Exception in thread "main" com.datastax.driver.core.exceptions.= DriverInternalError: An unexpected error occured server side on localhost/<= a href=3D"http://127.0.0.1/" target=3D"_blank">127.0.0.1: java.lang.Ill= egalArgumentException: Illegal Capacity: -1
at com.datastax.driver= .core.exceptions.DriverInternalError.copy(DriverInternalError.java:42)<= /div>
at com.datastax.driv= er.core.ResultSetFuture.extractCauseFromExecutionException(ResultSetFuture.= java:271)
at com.datastax.driver.co= re.ResultSet.fetchMoreResultsBlocking(ResultSet.java:252)
at com.datastax.driver.core.ResultSet= .isExhausted(ResultSet.java:147)
at com.datastax.driver.co= re.ResultSet$1.hasNext(ResultSet.java:206)
at com.datastax.driver.core.ResultSet.all(ResultSet.= java:183)
at com.snapdeal.com.casss= andraService.CassandraPersistenceService.sliceQueryIterator(CassandraPersis= tenceService.java:86)
at com.snapdeal.com.casssandraService.CassandraService.sliceQueryIterator= (CassandraService.java:37)
at com.snapdeal.com.casss= andraService.CassandraService.main(CassandraService.java:64)
Caus= ed by: com.datastax.driver.core.exceptions.DriverInternalError: An unexpect= ed error occured server side on localhost/127.0.0.1: java.lang.IllegalArgumentException: Illegal C= apacity: -1
at com.datastax.driver.co= re.Responses$Error.asException(Responses.java:85)
at com.datastax.driver.core.ResultSet$2.onSet= (ResultSet.java:341)
at com.datastax.driver.co= re.RequestHandler.setFinalResult(RequestHandler.java:224)
at com.datastax.driver.core.RequestHa= ndler.onSet(RequestHandler.java:361)
at com.datastax.driver.co= re.Connection$Dispatcher.messageReceived(Connection.java:510)
at org.jboss.netty.channel.Simple= ChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)=

=
is this a bug or= i am missing something?

Regard= s,
Ankit Ty= agi
--047d7b339c2728abe504f2dc3a57--