cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [1/3] git commit: Fix sstableloader NPE
Date Sat, 12 Apr 2014 20:24:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7232783bc -> 6658a6e03
  refs/heads/trunk f04b775dc -> 6e97178a5


Fix sstableloader NPE

patch by benedict; reviewed by yukim for CASSANDRA7015


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

Branch: refs/heads/cassandra-2.1
Commit: 6658a6e03cb4062036f84e78aba6fc3114499c80
Parents: 7232783
Author: belliottsmith <github@sub.laerad.com>
Authored: Sat Apr 12 15:20:15 2014 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Sat Apr 12 15:22:40 2014 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/io/sstable/SSTableReader.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6658a6e0/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 47d31b6..e70fd60 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@ -89,6 +89,8 @@ import org.apache.cassandra.io.sstable.metadata.MetadataComponent;
 import org.apache.cassandra.io.sstable.metadata.MetadataType;
 import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
 import org.apache.cassandra.io.sstable.metadata.ValidationMetadata;
+import org.apache.cassandra.io.util.BufferedSegmentedFile;
+import org.apache.cassandra.io.util.CompressedSegmentedFile;
 import org.apache.cassandra.io.util.DataOutputStreamAndChannel;
 import org.apache.cassandra.io.util.FileDataInput;
 import org.apache.cassandra.io.util.FileUtils;
@@ -335,10 +337,10 @@ public class SSTableReader extends SSTable
                                                   statsMetadata);
 
         // special implementation of load to use non-pooled SegmentedFile builders
-        SegmentedFile.Builder ibuilder = SegmentedFile.getBuilder(DatabaseDescriptor.getIndexAccessMode());
+        SegmentedFile.Builder ibuilder = new BufferedSegmentedFile.Builder();
         SegmentedFile.Builder dbuilder = sstable.compression
-                                       ? SegmentedFile.getCompressedBuilder()
-                                       : SegmentedFile.getBuilder(DatabaseDescriptor.getDiskAccessMode());
+                                       ? new CompressedSegmentedFile.Builder()
+                                       : new BufferedSegmentedFile.Builder();
         if (!sstable.loadSummary(ibuilder, dbuilder))
             sstable.buildSummary(false, ibuilder, dbuilder, false, Downsampling.BASE_SAMPLING_LEVEL);
         sstable.ifile = ibuilder.complete(sstable.descriptor.filenameFor(Component.PRIMARY_INDEX));
@@ -796,7 +798,7 @@ public class SSTableReader extends SSTable
         }
         catch (IOException e)
         {
-            logger.debug("Cannot deserialize SSTable {} Summary: {}", toString(), e.getMessage());
+            logger.debug("Cannot deserialize SSTable Summary File {}: {}", summariesFile.getPath(),
e.getMessage());
             // corrupted; delete it and fall back to creating a new summary
             FileUtils.closeQuietly(iStream);
             // delete it and fall back to creating a new summary


Mime
View raw message