cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [16/16] git commit: Fix intermittent NPE in get_slice
Date Fri, 30 Mar 2012 16:24:54 GMT
Fix intermittent NPE in get_slice

patch by jbellis; reviewed by vijay for CASSANDRA-4095


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

Branch: refs/heads/cassandra-1.1
Commit: 5cde93d9607ddbdb5316afaa2be9b9132d1bec3f
Parents: 3931ee7
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Mar 30 17:22:59 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Mar 30 17:22:59 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |    3 ++-
 src/java/org/apache/cassandra/db/Row.java          |    5 +++++
 .../apache/cassandra/db/SliceFromReadCommand.java  |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cde93d9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 438bc91..bf1a34f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -15,7 +15,8 @@
    tasks and upgradesstables (CASSANDRA-3985)
  * fix NPE on invalid CQL delete command (CASSANDRA-3755)
  * allow custom types in CLI's assume command (CASSANDRA-4081)
- * Fix totalBytes count for parallel compactions (CASSANDRA-3758)
+ * fix totalBytes count for parallel compactions (CASSANDRA-3758)
+ * fix intermittent NPE in get_slice (CASSANDRA-4095)
 
 
 1.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cde93d9/src/java/org/apache/cassandra/db/Row.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Row.java b/src/java/org/apache/cassandra/db/Row.java
index 523f501..71a7332 100644
--- a/src/java/org/apache/cassandra/db/Row.java
+++ b/src/java/org/apache/cassandra/db/Row.java
@@ -45,6 +45,11 @@ public class Row
         this.cf = cf;
     }
 
+    public int getLiveColumnCount()
+    {
+        return cf == null ? 0 : cf.getLiveColumnCount();
+    }
+
     @Override
     public String toString()
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cde93d9/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SliceFromReadCommand.java b/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
index 4ea89b6..be73472 100644
--- a/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
+++ b/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
@@ -73,7 +73,7 @@ public class SliceFromReadCommand extends ReadCommand
     public ReadCommand maybeGenerateRetryCommand(RepairCallback handler, Row row)
     {
         int maxLiveColumns = handler.getMaxLiveColumns();
-        int liveColumnsInRow = row != null ? row.cf.getLiveColumnCount() : 0;
+        int liveColumnsInRow = row != null ? row.getLiveColumnCount() : 0;
 
         assert maxLiveColumns <= count;
         // We generate a retry if at least one node reply with count live columns but after
merge we have less


Mime
View raw message