cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: avoid NPE on no-op major compaction
Date Thu, 28 Mar 2013 04:25:17 GMT
Updated Branches:
  refs/heads/trunk d21556f4f -> 55dda732b


avoid NPE on no-op major compaction


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

Branch: refs/heads/trunk
Commit: 55dda732bdafc081addcb2f0280d0f7945343ff6
Parents: d21556f
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Mar 27 23:24:15 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Mar 27 23:24:15 2013 -0500

----------------------------------------------------------------------
 .../compaction/SizeTieredCompactionStrategy.java   |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/55dda732/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index 38314ad..8d990e5 100644
--- a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -151,6 +151,9 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
     public AbstractCompactionTask getMaximalTask(final int gcBefore)
     {
         Collection<SSTableReader> sstables = cfs.markAllCompacting();
+        if (sstables == null)
+            return null;
+
         return new CompactionTask(cfs, sstables, gcBefore);
     }
 


Mime
View raw message