cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: Fix IllegalStateException in CqlPagingRecordReader for inputPageRowSize
Date Fri, 09 May 2014 23:47:42 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 7484bd419 -> 453a07430


Fix IllegalStateException in CqlPagingRecordReader for inputPageRowSize

patch by btheisen reviewed by dbrosius for cassandra-7198


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/453a0743
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/453a0743
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/453a0743

Branch: refs/heads/cassandra-2.0
Commit: 453a07430c3ebce938047f9d5d0339ff90c6bfcc
Parents: 7484bd4
Author: Brent Theisen <brent@bantamlabs.com>
Authored: Fri May 9 19:45:53 2014 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri May 9 19:45:53 2014 -0400

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../cassandra/hadoop/cql3/CqlPagingRecordReader.java    | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/453a0743/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9e6f173..32bd539 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@
  * Fix potential NumberFormatException when deserializing IntegerType (CASSANDRA-7088)
  * cqlsh can't tab-complete disabling compaction (CASSANDRA-7185)
  * cqlsh: Accept and execute CQL statement(s) from command-line parameter (CASSANDRA-7172)
+ * Fix IllegalStateException in CqlPagingRecordReader (CASSANDRA-7198)
 
 
 2.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/453a0743/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
index b692280..1492ce0 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
 import java.util.*;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.AbstractIterator;
 import com.google.common.collect.Iterables;
 import org.apache.cassandra.hadoop.HadoopCompat;
@@ -115,13 +116,14 @@ public class CqlPagingRecordReader extends RecordReader<Map<String,
ByteBuffer>,
         columns = CqlConfigHelper.getInputcolumns(conf);
         userDefinedWhereClauses = CqlConfigHelper.getInputWhereClauses(conf);
 
-        try
+        Optional<Integer> pageRowSizeOptional = CqlConfigHelper.getInputPageRowSize(conf);
+        try 
         {
-            pageRowSize = CqlConfigHelper.getInputPageRowSize(conf).get();
-        }
-        catch (NumberFormatException e)
+        	pageRowSize = pageRowSizeOptional.isPresent() ? pageRowSizeOptional.get() : DEFAULT_CQL_PAGE_LIMIT;
+        } 
+        catch(NumberFormatException e) 
         {
-            pageRowSize = DEFAULT_CQL_PAGE_LIMIT;
+        	pageRowSize = DEFAULT_CQL_PAGE_LIMIT;
         }
 
         partitioner = ConfigHelper.getInputPartitioner(HadoopCompat.getConfiguration(context));


Mime
View raw message