gpt4 book ai didi

java - datastax java中的setfetchsize : when fetchSize == rowcount then it fails with exception DriverInternalError

转载 作者:行者123 更新时间:2023-11-30 07:08:06 24 4
gpt4 key购买 nike

我使用的版本是:datastax java driver 2.0.1 & 2.0.2

cassandra version : [cqlsh 4.1.0 | Cassandra 2.0.4 | CQL spec 3.1.1 | Thrift protocol 19.39.0]

代码部分:

    Statement stmt = new SimpleStatement("SELECT id FROM accounts;"); 
stmt.setFetchSize(5);
session.execute(stmt);
for (Row r:result.all()){
System.out.println(r.toString());
}

   for (Row r:result){
System.out.println(r.toString());
}

异常发生在

for (Row r:result)

Exception in thread "main" com.datastax.driver.core.exceptions.DriverInternalError: An unexpected error occurred server side on /122.248.212.139:9042: java.lang.IllegalArgumentException: Illegal Capacity: -1
at com.datastax.driver.core.exceptions.DriverInternalError.copy(DriverInternalError.java:42)
at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256)
at com.datastax.driver.core.ArrayBackedResultSet$MultiPage.prepareNextRow(ArrayBackedResultSet.java:259)
at com.datastax.driver.core.ArrayBackedResultSet$MultiPage.isExhausted(ArrayBackedResultSet.java:222)
at com.datastax.driver.core.ArrayBackedResultSet$1.hasNext(ArrayBackedResultSet.java:115)
at com.datastax.driver.core.ArrayBackedResultSet.all(ArrayBackedResultSet.java:104)
at com.minjar.simplifyit.cost.data.cassandra.DataStaxCassandraHandler.main(DataStaxCassandraHandler.java:407)
Caused by: com.datastax.driver.core.exceptions.DriverInternalError: An unexpected error occurred server side on /122.248.212.139:9042: java.lang.IllegalArgumentException: Illegal Capacity: -1
at com.datastax.driver.core.Responses$Error.asException(Responses.java:86)
at com.datastax.driver.core.ArrayBackedResultSet$MultiPage$1.onSet(ArrayBackedResultSet.java:329)
at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:235)
at com.datastax.driver.core.RequestHandler.onSet(RequestHandler.java:367)
at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:571)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

最佳答案

我可以使用 Cassandra 2.0.4 重现您的问题,但不能使用 2.0.5。我猜你遇到了 CASSANDRA-6555 .

我建议将您的集群升级到最新的稳定版本 2.0.8。

关于java - datastax java中的setfetchsize : when fetchSize == rowcount then it fails with exception DriverInternalError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24305296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com