cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/6] cassandra git commit: initialize IndexBuilder before updating digest to avoid NPE (follow up CASSANDRA-8979)
Date Tue, 07 Apr 2015 18:14:24 GMT
initialize IndexBuilder before updating digest to avoid NPE (follow up CASSANDRA-8979)


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

Branch: refs/heads/cassandra-2.1
Commit: 59ba098d29fd492a715b7b5c13e6be17cebd33d9
Parents: 922a2c4
Author: Yuki Morishita <yukim@apache.org>
Authored: Tue Apr 7 13:01:23 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Tue Apr 7 13:01:46 2015 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/db/compaction/LazilyCompactedRow.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59ba098d/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index 9962d3f..f61cc2b 100644
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@ -141,6 +141,9 @@ public class LazilyCompactedRow extends AbstractCompactedRow implements
Iterable
         // blindly updating everything wouldn't be correct
         DataOutputBuffer out = new DataOutputBuffer();
 
+        // initialize indexBuilder for the benefit of its tombstoneTracker, used by our reducing
iterator
+        indexBuilder = new ColumnIndex.Builder(emptyColumnFamily, key.key, out);
+
         try
         {
             DeletionTime.serializer.serialize(emptyColumnFamily.deletionInfo().getTopLevelDeletion(),
out);
@@ -158,8 +161,6 @@ public class LazilyCompactedRow extends AbstractCompactedRow implements
Iterable
             throw new AssertionError(e);
         }
 
-        // initialize indexBuilder for the benefit of its tombstoneTracker, used by our reducing
iterator
-        indexBuilder = new ColumnIndex.Builder(emptyColumnFamily, key.key, out);
         while (iter.hasNext())
             iter.next().updateDigest(digest);
         close();


Mime
View raw message