You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/09/11 10:51:02 UTC
[2/3] cassandra git commit: CFS.loadNewSSTables() broken for pre-3.0
sstables
CFS.loadNewSSTables() broken for pre-3.0 sstables
patch by Robert Stupp; reviewed by Blake Eggleston for CASSANDRA-10237
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0600d7dc
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0600d7dc
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0600d7dc
Branch: refs/heads/trunk
Commit: 0600d7dc03bcf3ce1d881d608afeaa29066fd052
Parents: 8439e74
Author: Robert Stupp <sn...@snazy.de>
Authored: Fri Sep 11 10:49:56 2015 +0200
Committer: Robert Stupp <sn...@snazy.de>
Committed: Fri Sep 11 10:49:56 2015 +0200
----------------------------------------------------------------------
.../apache/cassandra/db/ColumnFamilyStore.java | 7 +-
.../org/apache/cassandra/db/Directories.java | 18 ++
.../cassandra/db/SerializationHeader.java | 4 +-
.../cassandra/db/compaction/Verifier.java | 5 +-
.../apache/cassandra/io/sstable/Component.java | 37 ++-
.../apache/cassandra/io/sstable/Descriptor.java | 44 ++--
.../apache/cassandra/io/sstable/SSTable.java | 15 +-
.../io/sstable/format/SSTableWriter.java | 3 +-
.../io/sstable/format/big/BigFormat.java | 4 +-
.../io/sstable/format/big/BigTableWriter.java | 2 +-
.../io/sstable/metadata/CompactionMetadata.java | 4 +-
.../metadata/IMetadataComponentSerializer.java | 9 +-
.../sstable/metadata/IMetadataSerializer.java | 4 +-
.../metadata/LegacyMetadataSerializer.java | 3 +-
.../io/sstable/metadata/MetadataSerializer.java | 14 +-
.../io/sstable/metadata/StatsMetadata.java | 29 ++-
.../io/sstable/metadata/ValidationMetadata.java | 4 +-
.../io/util/DataIntegrityMetadata.java | 6 +-
.../streaming/messages/FileMessageHeader.java | 5 +-
...bles-legacy_jb_clust-jb-1-CompressionInfo.db | Bin 0 -> 115 bytes
.../legacy_tables-legacy_jb_clust-jb-1-Data.db | Bin 0 -> 12006 bytes
...legacy_tables-legacy_jb_clust-jb-1-Filter.db | Bin 0 -> 24 bytes
.../legacy_tables-legacy_jb_clust-jb-1-Index.db | Bin 0 -> 1219455 bytes
...cy_tables-legacy_jb_clust-jb-1-Statistics.db | Bin 0 -> 6798 bytes
...egacy_tables-legacy_jb_clust-jb-1-Summary.db | Bin 0 -> 71 bytes
.../legacy_tables-legacy_jb_clust-jb-1-TOC.txt | 7 +
...acy_jb_clust_counter-jb-1-CompressionInfo.db | Bin 0 -> 75 bytes
..._tables-legacy_jb_clust_counter-jb-1-Data.db | Bin 0 -> 4276 bytes
...ables-legacy_jb_clust_counter-jb-1-Filter.db | Bin 0 -> 24 bytes
...tables-legacy_jb_clust_counter-jb-1-Index.db | Bin 0 -> 610555 bytes
...s-legacy_jb_clust_counter-jb-1-Statistics.db | Bin 0 -> 6801 bytes
...bles-legacy_jb_clust_counter-jb-1-Summary.db | Bin 0 -> 71 bytes
..._tables-legacy_jb_clust_counter-jb-1-TOC.txt | 7 +
...les-legacy_jb_simple-jb-1-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_tables-legacy_jb_simple-jb-1-Data.db | Bin 0 -> 134 bytes
...egacy_tables-legacy_jb_simple-jb-1-Filter.db | Bin 0 -> 24 bytes
...legacy_tables-legacy_jb_simple-jb-1-Index.db | Bin 0 -> 75 bytes
...y_tables-legacy_jb_simple-jb-1-Statistics.db | Bin 0 -> 4392 bytes
...gacy_tables-legacy_jb_simple-jb-1-Summary.db | Bin 0 -> 71 bytes
.../legacy_tables-legacy_jb_simple-jb-1-TOC.txt | 7 +
...cy_jb_simple_counter-jb-1-CompressionInfo.db | Bin 0 -> 43 bytes
...tables-legacy_jb_simple_counter-jb-1-Data.db | Bin 0 -> 118 bytes
...bles-legacy_jb_simple_counter-jb-1-Filter.db | Bin 0 -> 24 bytes
...ables-legacy_jb_simple_counter-jb-1-Index.db | Bin 0 -> 75 bytes
...-legacy_jb_simple_counter-jb-1-Statistics.db | Bin 0 -> 4395 bytes
...les-legacy_jb_simple_counter-jb-1-Summary.db | Bin 0 -> 71 bytes
...tables-legacy_jb_simple_counter-jb-1-TOC.txt | 7 +
...bles-legacy_ka_clust-ka-1-CompressionInfo.db | Bin 0 -> 115 bytes
.../legacy_tables-legacy_ka_clust-ka-1-Data.db | Bin 0 -> 12144 bytes
...gacy_tables-legacy_ka_clust-ka-1-Digest.sha1 | 1 +
...legacy_tables-legacy_ka_clust-ka-1-Filter.db | Bin 0 -> 24 bytes
.../legacy_tables-legacy_ka_clust-ka-1-Index.db | Bin 0 -> 1219455 bytes
...cy_tables-legacy_ka_clust-ka-1-Statistics.db | Bin 0 -> 6859 bytes
...egacy_tables-legacy_ka_clust-ka-1-Summary.db | Bin 0 -> 71 bytes
.../legacy_tables-legacy_ka_clust-ka-1-TOC.txt | 8 +
...acy_ka_clust_counter-ka-1-CompressionInfo.db | Bin 0 -> 75 bytes
..._tables-legacy_ka_clust_counter-ka-1-Data.db | Bin 0 -> 4635 bytes
...les-legacy_ka_clust_counter-ka-1-Digest.sha1 | 1 +
...ables-legacy_ka_clust_counter-ka-1-Filter.db | Bin 0 -> 24 bytes
...tables-legacy_ka_clust_counter-ka-1-Index.db | Bin 0 -> 610555 bytes
...s-legacy_ka_clust_counter-ka-1-Statistics.db | Bin 0 -> 6859 bytes
...bles-legacy_ka_clust_counter-ka-1-Summary.db | Bin 0 -> 71 bytes
..._tables-legacy_ka_clust_counter-ka-1-TOC.txt | 8 +
...les-legacy_ka_simple-ka-1-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_tables-legacy_ka_simple-ka-1-Data.db | Bin 0 -> 134 bytes
...acy_tables-legacy_ka_simple-ka-1-Digest.sha1 | 1 +
...egacy_tables-legacy_ka_simple-ka-1-Filter.db | Bin 0 -> 24 bytes
...legacy_tables-legacy_ka_simple-ka-1-Index.db | Bin 0 -> 75 bytes
...y_tables-legacy_ka_simple-ka-1-Statistics.db | Bin 0 -> 4453 bytes
...gacy_tables-legacy_ka_simple-ka-1-Summary.db | Bin 0 -> 71 bytes
.../legacy_tables-legacy_ka_simple-ka-1-TOC.txt | 8 +
...cy_ka_simple_counter-ka-1-CompressionInfo.db | Bin 0 -> 43 bytes
...tables-legacy_ka_simple_counter-ka-1-Data.db | Bin 0 -> 125 bytes
...es-legacy_ka_simple_counter-ka-1-Digest.sha1 | 1 +
...bles-legacy_ka_simple_counter-ka-1-Filter.db | Bin 0 -> 24 bytes
...ables-legacy_ka_simple_counter-ka-1-Index.db | Bin 0 -> 75 bytes
...-legacy_ka_simple_counter-ka-1-Statistics.db | Bin 0 -> 4453 bytes
...les-legacy_ka_simple_counter-ka-1-Summary.db | Bin 0 -> 71 bytes
...tables-legacy_ka_simple_counter-ka-1-TOC.txt | 8 +
.../legacy_la_clust/la-1-big-CompressionInfo.db | Bin 0 -> 115 bytes
.../legacy_la_clust/la-1-big-Data.db | Bin 0 -> 12082 bytes
.../legacy_la_clust/la-1-big-Digest.adler32 | 1 +
.../legacy_la_clust/la-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_la_clust/la-1-big-Index.db | Bin 0 -> 1219455 bytes
.../legacy_la_clust/la-1-big-Statistics.db | Bin 0 -> 6859 bytes
.../legacy_la_clust/la-1-big-Summary.db | Bin 0 -> 71 bytes
.../legacy_la_clust/la-1-big-TOC.txt | 8 +
.../la-1-big-CompressionInfo.db | Bin 0 -> 75 bytes
.../legacy_la_clust_counter/la-1-big-Data.db | Bin 0 -> 4623 bytes
.../la-1-big-Digest.adler32 | 1 +
.../legacy_la_clust_counter/la-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_la_clust_counter/la-1-big-Index.db | Bin 0 -> 610555 bytes
.../la-1-big-Statistics.db | Bin 0 -> 6859 bytes
.../legacy_la_clust_counter/la-1-big-Summary.db | Bin 0 -> 71 bytes
.../legacy_la_clust_counter/la-1-big-TOC.txt | 8 +
.../la-1-big-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_la_simple/la-1-big-Data.db | Bin 0 -> 139 bytes
.../legacy_la_simple/la-1-big-Digest.adler32 | 1 +
.../legacy_la_simple/la-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_la_simple/la-1-big-Index.db | Bin 0 -> 75 bytes
.../legacy_la_simple/la-1-big-Statistics.db | Bin 0 -> 4453 bytes
.../legacy_la_simple/la-1-big-Summary.db | Bin 0 -> 71 bytes
.../legacy_la_simple/la-1-big-TOC.txt | 8 +
.../la-1-big-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_la_simple_counter/la-1-big-Data.db | Bin 0 -> 123 bytes
.../la-1-big-Digest.adler32 | 1 +
.../legacy_la_simple_counter/la-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_la_simple_counter/la-1-big-Index.db | Bin 0 -> 75 bytes
.../la-1-big-Statistics.db | Bin 0 -> 4453 bytes
.../la-1-big-Summary.db | Bin 0 -> 71 bytes
.../legacy_la_simple_counter/la-1-big-TOC.txt | 8 +
.../legacy_ma_clust/ma-1-big-CompressionInfo.db | Bin 0 -> 83 bytes
.../legacy_ma_clust/ma-1-big-Data.db | Bin 0 -> 5032 bytes
.../legacy_ma_clust/ma-1-big-Digest.crc32 | 1 +
.../legacy_ma_clust/ma-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_ma_clust/ma-1-big-Index.db | Bin 0 -> 157123 bytes
.../legacy_ma_clust/ma-1-big-Statistics.db | Bin 0 -> 7045 bytes
.../legacy_ma_clust/ma-1-big-Summary.db | Bin 0 -> 47 bytes
.../legacy_ma_clust/ma-1-big-TOC.txt | 8 +
.../ma-1-big-CompressionInfo.db | Bin 0 -> 75 bytes
.../legacy_ma_clust_counter/ma-1-big-Data.db | Bin 0 -> 4427 bytes
.../ma-1-big-Digest.crc32 | 1 +
.../legacy_ma_clust_counter/ma-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_ma_clust_counter/ma-1-big-Index.db | Bin 0 -> 157123 bytes
.../ma-1-big-Statistics.db | Bin 0 -> 7054 bytes
.../legacy_ma_clust_counter/ma-1-big-Summary.db | Bin 0 -> 47 bytes
.../legacy_ma_clust_counter/ma-1-big-TOC.txt | 8 +
.../ma-1-big-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_ma_simple/ma-1-big-Data.db | Bin 0 -> 85 bytes
.../legacy_ma_simple/ma-1-big-Digest.crc32 | 1 +
.../legacy_ma_simple/ma-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_ma_simple/ma-1-big-Index.db | Bin 0 -> 26 bytes
.../legacy_ma_simple/ma-1-big-Statistics.db | Bin 0 -> 4598 bytes
.../legacy_ma_simple/ma-1-big-Summary.db | Bin 0 -> 47 bytes
.../legacy_ma_simple/ma-1-big-TOC.txt | 8 +
.../ma-1-big-CompressionInfo.db | Bin 0 -> 43 bytes
.../legacy_ma_simple_counter/ma-1-big-Data.db | Bin 0 -> 106 bytes
.../ma-1-big-Digest.crc32 | 1 +
.../legacy_ma_simple_counter/ma-1-big-Filter.db | Bin 0 -> 24 bytes
.../legacy_ma_simple_counter/ma-1-big-Index.db | Bin 0 -> 27 bytes
.../ma-1-big-Statistics.db | Bin 0 -> 4607 bytes
.../ma-1-big-Summary.db | Bin 0 -> 47 bytes
.../legacy_ma_simple_counter/ma-1-big-TOC.txt | 8 +
.../org/apache/cassandra/db/VerifyTest.java | 6 +-
.../cassandra/io/sstable/LegacySSTableTest.java | 250 +++++++++++++++++--
.../cassandra/io/sstable/SSTableUtils.java | 2 +-
.../metadata/MetadataSerializerTest.java | 6 +-
147 files changed, 526 insertions(+), 91 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 979e8ba..c7d8926 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -64,6 +64,7 @@ import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.Descriptor;
import org.apache.cassandra.io.sstable.SSTableMultiWriter;
import org.apache.cassandra.io.sstable.format.*;
+import org.apache.cassandra.io.sstable.format.big.BigFormat;
import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
import org.apache.cassandra.io.util.FileUtils;
import org.apache.cassandra.metrics.TableMetrics;
@@ -724,7 +725,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
descriptor.ksname,
descriptor.cfname,
fileIndexGenerator.incrementAndGet(),
- descriptor.formatType);
+ descriptor.formatType,
+ descriptor.digestComponent);
}
while (new File(newDescriptor.filenameFor(Component.DATA)).exists());
@@ -808,7 +810,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
keyspace.getName(),
name,
fileIndexGenerator.incrementAndGet(),
- format);
+ format,
+ Component.digestFor(BigFormat.latestVersion.uncompressedChecksumType()));
return desc.filenameFor(Component.DATA);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Directories.java b/src/java/org/apache/cassandra/db/Directories.java
index c801952..8aa9494 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -695,6 +695,24 @@ public class Directories
previous = new HashSet<>();
components.put(pair.left, previous);
}
+ else if (pair.right.type == Component.Type.DIGEST)
+ {
+ if (pair.right != pair.left.digestComponent)
+ {
+ // Need to update the DIGEST component as it might be set to another
+ // digest type as a guess. This may happen if the first component is
+ // not the DIGEST (but the Data component for example), so the digest
+ // type is _guessed_ from the Version.
+ // Although the Version explicitly defines the digest type, it doesn't
+ // seem to be true under all circumstances. Generated sstables from a
+ // post 2.1.8 snapshot produced Digest.sha1 files although Version
+ // defines Adler32.
+ // TL;DR this piece of code updates the digest component to be "correct".
+ components.remove(pair.left);
+ Descriptor updated = pair.left.withDigestComponent(pair.right);
+ components.put(updated, previous);
+ }
+ }
previous.add(pair.right);
nbFiles++;
return false;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/db/SerializationHeader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SerializationHeader.java b/src/java/org/apache/cassandra/db/SerializationHeader.java
index 582a6af..70c5401 100644
--- a/src/java/org/apache/cassandra/db/SerializationHeader.java
+++ b/src/java/org/apache/cassandra/db/SerializationHeader.java
@@ -413,7 +413,7 @@ public class SerializationHeader
}
// For SSTables
- public void serialize(Component header, DataOutputPlus out) throws IOException
+ public void serialize(Version version, Component header, DataOutputPlus out) throws IOException
{
EncodingStats.serializer.serialize(header.stats, out);
@@ -447,7 +447,7 @@ public class SerializationHeader
}
// For SSTables
- public int serializedSize(Component header)
+ public int serializedSize(Version version, Component header)
{
int size = EncodingStats.serializer.serializedSize(header.stats);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/db/compaction/Verifier.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/Verifier.java b/src/java/org/apache/cassandra/db/compaction/Verifier.java
index ae4e966..ce04ad3 100644
--- a/src/java/org/apache/cassandra/db/compaction/Verifier.java
+++ b/src/java/org/apache/cassandra/db/compaction/Verifier.java
@@ -91,12 +91,13 @@ public class Verifier implements Closeable
outputHandler.output(String.format("Checking computed hash of %s ", sstable));
- // Verify will use the adler32 Digest files, which works for both compressed and uncompressed sstables
+ // Verify will use the Digest files, which works for both compressed and uncompressed sstables
try
{
validator = null;
- if (new File(sstable.descriptor.filenameFor(Component.DIGEST)).exists())
+ if (sstable.descriptor.digestComponent != null &&
+ new File(sstable.descriptor.filenameFor(sstable.descriptor.digestComponent)).exists())
{
validator = DataIntegrityMetadata.fileDigestValidator(sstable.descriptor);
validator.validate();
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/Component.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/Component.java b/src/java/org/apache/cassandra/io/sstable/Component.java
index 54dd35b..9454882 100644
--- a/src/java/org/apache/cassandra/io/sstable/Component.java
+++ b/src/java/org/apache/cassandra/io/sstable/Component.java
@@ -22,6 +22,7 @@ import java.util.EnumSet;
import com.google.common.base.Objects;
+import org.apache.cassandra.utils.ChecksumType;
import org.apache.cassandra.utils.Pair;
/**
@@ -34,6 +35,7 @@ public class Component
public static final char separator = '-';
final static EnumSet<Type> TYPES = EnumSet.allOf(Type.class);
+
public enum Type
{
// the base data for an sstable: the remaining components can be regenerated
@@ -48,7 +50,7 @@ public class Component
// statistical metadata about the content of the sstable
STATS("Statistics.db"),
// holds adler32 checksum of the data file
- DIGEST(new String[] { "Digest.crc32", "Digest.adler32" }),
+ DIGEST("Digest.crc32", "Digest.adler32", "Digest.sha1"),
// holds the CRC32 for chunks in an a uncompressed file.
CRC("CRC.db"),
// holds SSTable Index Summary (sampling of Index component)
@@ -57,14 +59,14 @@ public class Component
TOC("TOC.txt"),
// custom component, used by e.g. custom compaction strategy
CUSTOM(new String[] { null });
-
+
final String[] repr;
Type(String repr)
{
this(new String[] { repr });
}
- Type(String[] repr)
+ Type(String... repr)
{
this.repr = repr;
}
@@ -85,11 +87,28 @@ public class Component
public final static Component FILTER = new Component(Type.FILTER);
public final static Component COMPRESSION_INFO = new Component(Type.COMPRESSION_INFO);
public final static Component STATS = new Component(Type.STATS);
- public final static Component DIGEST = new Component(Type.DIGEST);
+ private static final String digestCrc32 = "Digest.crc32";
+ private static final String digestAdler32 = "Digest.adler32";
+ private static final String digestSha1 = "Digest.sha1";
+ public final static Component DIGEST_CRC32 = new Component(Type.DIGEST, digestCrc32);
+ public final static Component DIGEST_ADLER32 = new Component(Type.DIGEST, digestAdler32);
+ public final static Component DIGEST_SHA1 = new Component(Type.DIGEST, digestSha1);
public final static Component CRC = new Component(Type.CRC);
public final static Component SUMMARY = new Component(Type.SUMMARY);
public final static Component TOC = new Component(Type.TOC);
+ public static Component digestFor(ChecksumType checksumType)
+ {
+ switch (checksumType)
+ {
+ case Adler32:
+ return DIGEST_ADLER32;
+ case CRC32:
+ return DIGEST_CRC32;
+ }
+ throw new AssertionError();
+ }
+
public final Type type;
public final String name;
public final int hashCode;
@@ -97,6 +116,7 @@ public class Component
public Component(Type type)
{
this(type, type.repr[0]);
+ assert type.repr.length == 1;
assert type != Type.CUSTOM;
}
@@ -138,7 +158,14 @@ public class Component
case FILTER: component = Component.FILTER; break;
case COMPRESSION_INFO: component = Component.COMPRESSION_INFO; break;
case STATS: component = Component.STATS; break;
- case DIGEST: component = Component.DIGEST; break;
+ case DIGEST: switch (path.right)
+ {
+ case digestCrc32: component = Component.DIGEST_CRC32; break;
+ case digestAdler32: component = Component.DIGEST_ADLER32; break;
+ case digestSha1: component = Component.DIGEST_SHA1; break;
+ default: throw new IllegalArgumentException("Invalid digest component " + path.right);
+ }
+ break;
case CRC: component = Component.CRC; break;
case SUMMARY: component = Component.SUMMARY; break;
case TOC: component = Component.TOC; break;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/Descriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/Descriptor.java b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
index 38829df..dbce56c 100644
--- a/src/java/org/apache/cassandra/io/sstable/Descriptor.java
+++ b/src/java/org/apache/cassandra/io/sstable/Descriptor.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.util.*;
import java.util.regex.Pattern;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.CharMatcher;
import com.google.common.base.Objects;
@@ -28,6 +29,7 @@ import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.Directories;
import org.apache.cassandra.io.sstable.format.SSTableFormat;
import org.apache.cassandra.io.sstable.format.Version;
+import org.apache.cassandra.io.sstable.format.big.BigFormat;
import org.apache.cassandra.io.sstable.metadata.IMetadataSerializer;
import org.apache.cassandra.io.sstable.metadata.LegacyMetadataSerializer;
import org.apache.cassandra.io.sstable.metadata.MetadataSerializer;
@@ -52,27 +54,34 @@ public class Descriptor
public final String cfname;
public final int generation;
public final SSTableFormat.Type formatType;
+ /** digest component - might be {@code null} for old, legacy sstables */
+ public final Component digestComponent;
private final int hashCode;
/**
* A descriptor that assumes CURRENT_VERSION.
*/
+ @VisibleForTesting
public Descriptor(File directory, String ksname, String cfname, int generation)
{
- this(DatabaseDescriptor.getSSTableFormat().info.getLatestVersion(), directory, ksname, cfname, generation, DatabaseDescriptor.getSSTableFormat());
+ this(DatabaseDescriptor.getSSTableFormat().info.getLatestVersion(), directory, ksname, cfname, generation, DatabaseDescriptor.getSSTableFormat(), null);
}
+ /**
+ * Constructor for sstable writers only.
+ */
public Descriptor(File directory, String ksname, String cfname, int generation, SSTableFormat.Type formatType)
{
- this(formatType.info.getLatestVersion(), directory, ksname, cfname, generation, formatType);
+ this(formatType.info.getLatestVersion(), directory, ksname, cfname, generation, formatType, Component.digestFor(BigFormat.latestVersion.uncompressedChecksumType()));
}
+ @VisibleForTesting
public Descriptor(String version, File directory, String ksname, String cfname, int generation, SSTableFormat.Type formatType)
{
- this(formatType.info.getVersion(version), directory, ksname, cfname, generation, formatType);
+ this(formatType.info.getVersion(version), directory, ksname, cfname, generation, formatType, Component.digestFor(BigFormat.latestVersion.uncompressedChecksumType()));
}
- public Descriptor(Version version, File directory, String ksname, String cfname, int generation, SSTableFormat.Type formatType)
+ public Descriptor(Version version, File directory, String ksname, String cfname, int generation, SSTableFormat.Type formatType, Component digestComponent)
{
assert version != null && directory != null && ksname != null && cfname != null && formatType.info.getLatestVersion().getClass().equals(version.getClass());
this.version = version;
@@ -81,18 +90,24 @@ public class Descriptor
this.cfname = cfname;
this.generation = generation;
this.formatType = formatType;
+ this.digestComponent = digestComponent;
hashCode = Objects.hashCode(version, directory, generation, ksname, cfname, formatType);
}
public Descriptor withGeneration(int newGeneration)
{
- return new Descriptor(version, directory, ksname, cfname, newGeneration, formatType);
+ return new Descriptor(version, directory, ksname, cfname, newGeneration, formatType, digestComponent);
}
public Descriptor withFormatType(SSTableFormat.Type newType)
{
- return new Descriptor(newType.info.getLatestVersion(), directory, ksname, cfname, generation, newType);
+ return new Descriptor(newType.info.getLatestVersion(), directory, ksname, cfname, generation, newType, digestComponent);
+ }
+
+ public Descriptor withDigestComponent(Component newDigestComponent)
+ {
+ return new Descriptor(version, directory, ksname, cfname, generation, formatType, newDigestComponent);
}
public String tmpFilenameFor(Component component)
@@ -102,7 +117,7 @@ public class Descriptor
public String filenameFor(Component component)
{
- return filenameFor(component.name());
+ return baseFilename() + separator + component.name();
}
public String baseFilename()
@@ -139,16 +154,6 @@ public class Descriptor
return formatType.info;
}
- /**
- * @param suffix A component suffix, such as 'Data.db'/'Index.db'/etc
- * @return A filename for this descriptor with the given suffix.
- */
- public String filenameFor(String suffix)
- {
- return baseFilename() + separator + suffix;
- }
-
-
/** Return any temporary files found in the directory */
public List<File> getTemporaryFiles()
{
@@ -299,7 +304,10 @@ public class Descriptor
}
assert tokenStack.isEmpty() : "Invalid file name " + name + " in " + directory;
- return Pair.create(new Descriptor(version, parentDirectory, ksname, cfname, generation, fmt), component);
+ return Pair.create(new Descriptor(version, parentDirectory, ksname, cfname, generation, fmt,
+ // _assume_ version from version
+ Component.digestFor(version.uncompressedChecksumType())),
+ component);
}
public IMetadataSerializer getMetadataSerializer()
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/SSTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTable.java b/src/java/org/apache/cassandra/io/sstable/SSTable.java
index 811f4ef..d66638e 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTable.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTable.java
@@ -23,7 +23,6 @@ import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
-import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
import com.google.common.collect.Sets;
@@ -220,9 +219,17 @@ public abstract class SSTable
Set<Component> components = Sets.newHashSetWithExpectedSize(knownTypes.size());
for (Component.Type componentType : knownTypes)
{
- Component component = new Component(componentType);
- if (new File(desc.filenameFor(component)).exists())
- components.add(component);
+ if (componentType == Component.Type.DIGEST)
+ {
+ if (desc.digestComponent != null && new File(desc.filenameFor(desc.digestComponent)).exists())
+ components.add(desc.digestComponent);
+ }
+ else
+ {
+ Component component = new Component(componentType);
+ if (new File(desc.filenameFor(component)).exists())
+ components.add(component);
+ }
}
return components;
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java
index 1a3f796..4cbbd70 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java
@@ -35,6 +35,7 @@ import org.apache.cassandra.db.rows.UnfilteredRowIterator;
import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.Descriptor;
import org.apache.cassandra.io.sstable.SSTable;
+import org.apache.cassandra.io.sstable.format.big.BigFormat;
import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
import org.apache.cassandra.io.sstable.metadata.MetadataComponent;
import org.apache.cassandra.io.sstable.metadata.MetadataType;
@@ -131,7 +132,7 @@ public abstract class SSTableWriter extends SSTable implements Transactional
Component.STATS,
Component.SUMMARY,
Component.TOC,
- Component.DIGEST));
+ Component.digestFor(BigFormat.latestVersion.uncompressedChecksumType())));
if (metadata.params.bloomFilterFpChance < 1.0)
components.add(Component.FILTER);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
index cbc2c39..1f2a98f 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
@@ -40,7 +40,7 @@ import org.apache.cassandra.utils.ChecksumType;
public class BigFormat implements SSTableFormat
{
public static final BigFormat instance = new BigFormat();
- public static final BigVersion latestVersion = new BigVersion(BigVersion.current_version);
+ public static final Version latestVersion = new BigVersion(BigVersion.current_version);
private static final SSTableReader.Factory readerFactory = new ReaderFactory();
private static final SSTableWriter.Factory writerFactory = new WriterFactory();
@@ -123,6 +123,8 @@ public class BigFormat implements SSTableFormat
// la (2.2.0): new file name format
// ma (3.0.0): swap bf hash order
// store rows natively
+ //
+ // NOTE: when adding a new version, please add that to LegacySSTableTest, too.
private final boolean isLatestVersion;
private final boolean hasSamplingLevel;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
index 38dab9a..089ae6f 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
@@ -341,7 +341,7 @@ public class BigTableWriter extends SSTableWriter
File file = new File(desc.filenameFor(Component.STATS));
try (SequentialWriter out = SequentialWriter.open(file))
{
- desc.getMetadataSerializer().serialize(components, out);
+ desc.getMetadataSerializer().serialize(components, out, desc.version);
out.setDescriptor(desc).finish();
}
catch (IOException e)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/CompactionMetadata.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/CompactionMetadata.java b/src/java/org/apache/cassandra/io/sstable/metadata/CompactionMetadata.java
index fa94ead..4f4c04b 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/CompactionMetadata.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/CompactionMetadata.java
@@ -72,13 +72,13 @@ public class CompactionMetadata extends MetadataComponent
public static class CompactionMetadataSerializer implements IMetadataComponentSerializer<CompactionMetadata>
{
- public int serializedSize(CompactionMetadata component) throws IOException
+ public int serializedSize(Version version, CompactionMetadata component) throws IOException
{
byte[] serializedCardinality = component.cardinalityEstimator.getBytes();
return TypeSizes.sizeof(serializedCardinality.length) + serializedCardinality.length;
}
- public void serialize(CompactionMetadata component, DataOutputPlus out) throws IOException
+ public void serialize(Version version, CompactionMetadata component, DataOutputPlus out) throws IOException
{
ByteBufferUtil.writeWithLength(component.cardinalityEstimator.getBytes(), out);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataComponentSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataComponentSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataComponentSerializer.java
index 046e290..7c03f54 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataComponentSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataComponentSerializer.java
@@ -31,21 +31,26 @@ public interface IMetadataComponentSerializer<T extends MetadataComponent>
/**
* Calculate and return serialized size.
*
+ *
+ *
+ * @param version
* @param component MetadataComponent to calculate serialized size
* @return serialized size of this component
* @throws IOException
*/
- int serializedSize(T component) throws IOException;
+ int serializedSize(Version version, T component) throws IOException;
/**
* Serialize metadata component to given output.
*
*
+ *
+ * @param version
* @param component MetadataComponent to serialize
* @param out serialize destination
* @throws IOException
*/
- void serialize(T component, DataOutputPlus out) throws IOException;
+ void serialize(Version version, T component, DataOutputPlus out) throws IOException;
/**
* Deserialize metadata component from given input.
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataSerializer.java
index df577df..100cfdb 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/IMetadataSerializer.java
@@ -22,6 +22,7 @@ import java.util.EnumSet;
import java.util.Map;
import org.apache.cassandra.io.sstable.Descriptor;
+import org.apache.cassandra.io.sstable.format.Version;
import org.apache.cassandra.io.util.DataOutputPlus;
/**
@@ -35,9 +36,10 @@ public interface IMetadataSerializer
*
* @param components Metadata components to serialize
* @param out
+ * @param version
* @throws IOException
*/
- void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out) throws IOException;
+ void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out, Version version) throws IOException;
/**
* Deserialize specified metadata components from given descriptor.
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/LegacyMetadataSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/LegacyMetadataSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/LegacyMetadataSerializer.java
index 53ba922..2ed845c 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/LegacyMetadataSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/LegacyMetadataSerializer.java
@@ -27,6 +27,7 @@ import org.apache.cassandra.db.TypeSizes;
import org.apache.cassandra.db.commitlog.ReplayPosition;
import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.Descriptor;
+import org.apache.cassandra.io.sstable.format.Version;
import org.apache.cassandra.io.util.DataInputPlus.DataInputStreamPlus;
import org.apache.cassandra.io.util.DataOutputPlus;
import org.apache.cassandra.service.ActiveRepairService;
@@ -44,7 +45,7 @@ public class LegacyMetadataSerializer extends MetadataSerializer
* Legacy serialization is only used for SSTable level reset.
*/
@Override
- public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out) throws IOException
+ public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out, Version version) throws IOException
{
ValidationMetadata validation = (ValidationMetadata) components.get(MetadataType.VALIDATION);
StatsMetadata stats = (StatsMetadata) components.get(MetadataType.STATS);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
index 9a5eae8..9197b7a 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.Descriptor;
+import org.apache.cassandra.io.sstable.format.Version;
import org.apache.cassandra.io.util.DataOutputPlus;
import org.apache.cassandra.io.util.DataOutputStreamPlus;
import org.apache.cassandra.io.util.FileDataInput;
@@ -49,7 +50,7 @@ public class MetadataSerializer implements IMetadataSerializer
{
private static final Logger logger = LoggerFactory.getLogger(MetadataSerializer.class);
- public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out) throws IOException
+ public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out, Version version) throws IOException
{
// sort components by type
List<MetadataComponent> sortedComponents = Lists.newArrayList(components.values());
@@ -66,12 +67,12 @@ public class MetadataSerializer implements IMetadataSerializer
out.writeInt(type.ordinal());
// serialize position
out.writeInt(lastPosition);
- lastPosition += type.serializer.serializedSize(component);
+ lastPosition += type.serializer.serializedSize(version, component);
}
// serialize components
for (MetadataComponent component : sortedComponents)
{
- component.getType().serializer.serialize(component, out);
+ component.getType().serializer.serialize(version, component, out);
}
}
@@ -115,14 +116,13 @@ public class MetadataSerializer implements IMetadataSerializer
}
for (MetadataType type : types)
{
- MetadataComponent component = null;
Integer offset = toc.get(type);
if (offset != null)
{
in.seek(offset);
- component = type.serializer.deserialize(descriptor.version, in);
+ MetadataComponent component = type.serializer.deserialize(descriptor.version, in);
+ components.put(type, component);
}
- components.put(type, component);
}
return components;
}
@@ -152,7 +152,7 @@ public class MetadataSerializer implements IMetadataSerializer
String filePath = descriptor.tmpFilenameFor(Component.STATS);
try (DataOutputStreamPlus out = new BufferedDataOutputStreamPlus(new FileOutputStream(filePath)))
{
- serialize(currentComponents, out);
+ serialize(currentComponents, out, descriptor.version);
out.flush();
}
// we cant move a file on top of another file in windows:
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java b/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
index 8153533..824bf8b 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java
@@ -227,13 +227,16 @@ public class StatsMetadata extends MetadataComponent
public static class StatsMetadataSerializer implements IMetadataComponentSerializer<StatsMetadata>
{
- public int serializedSize(StatsMetadata component) throws IOException
+ public int serializedSize(Version version, StatsMetadata component) throws IOException
{
int size = 0;
size += EstimatedHistogram.serializer.serializedSize(component.estimatedPartitionSize);
size += EstimatedHistogram.serializer.serializedSize(component.estimatedColumnCount);
size += ReplayPosition.serializer.serializedSize(component.replayPosition);
- size += 8 + 8 + 4 + 4 + 4 + 4 + 8 + 8; // mix/max timestamp(long), min/maxLocalDeletionTime(int), min/max TTL, compressionRatio(double), repairedAt (long)
+ if (version.storeRows())
+ size += 8 + 8 + 4 + 4 + 4 + 4 + 8 + 8; // mix/max timestamp(long), min/maxLocalDeletionTime(int), min/max TTL, compressionRatio(double), repairedAt (long)
+ else
+ size += 8 + 8 + 4 + 8 + 8; // mix/max timestamp(long), maxLocalDeletionTime(int), compressionRatio(double), repairedAt (long)
size += StreamingHistogram.serializer.serializedSize(component.estimatedTombstoneDropTime);
size += TypeSizes.sizeof(component.sstableLevel);
// min column names
@@ -245,21 +248,26 @@ public class StatsMetadata extends MetadataComponent
for (ByteBuffer value : component.maxClusteringValues)
size += 2 + value.remaining(); // with short length
size += TypeSizes.sizeof(component.hasLegacyCounterShards);
- size += 8 + 8; // totalColumnsSet, totalRows
+ if (version.storeRows())
+ size += 8 + 8; // totalColumnsSet, totalRows
return size;
}
- public void serialize(StatsMetadata component, DataOutputPlus out) throws IOException
+ public void serialize(Version version, StatsMetadata component, DataOutputPlus out) throws IOException
{
EstimatedHistogram.serializer.serialize(component.estimatedPartitionSize, out);
EstimatedHistogram.serializer.serialize(component.estimatedColumnCount, out);
ReplayPosition.serializer.serialize(component.replayPosition, out);
out.writeLong(component.minTimestamp);
out.writeLong(component.maxTimestamp);
- out.writeInt(component.minLocalDeletionTime);
+ if (version.storeRows())
+ out.writeInt(component.minLocalDeletionTime);
out.writeInt(component.maxLocalDeletionTime);
- out.writeInt(component.minTTL);
- out.writeInt(component.maxTTL);
+ if (version.storeRows())
+ {
+ out.writeInt(component.minTTL);
+ out.writeInt(component.maxTTL);
+ }
out.writeDouble(component.compressionRatio);
StreamingHistogram.serializer.serialize(component.estimatedTombstoneDropTime, out);
out.writeInt(component.sstableLevel);
@@ -272,8 +280,11 @@ public class StatsMetadata extends MetadataComponent
ByteBufferUtil.writeWithShortLength(value, out);
out.writeBoolean(component.hasLegacyCounterShards);
- out.writeLong(component.totalColumnsSet);
- out.writeLong(component.totalRows);
+ if (version.storeRows())
+ {
+ out.writeLong(component.totalColumnsSet);
+ out.writeLong(component.totalRows);
+ }
}
public StatsMetadata deserialize(Version version, DataInputPlus in) throws IOException
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/sstable/metadata/ValidationMetadata.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/ValidationMetadata.java b/src/java/org/apache/cassandra/io/sstable/metadata/ValidationMetadata.java
index 72bfdcb..0eda8eb 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/ValidationMetadata.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/ValidationMetadata.java
@@ -71,12 +71,12 @@ public class ValidationMetadata extends MetadataComponent
public static class ValidationMetadataSerializer implements IMetadataComponentSerializer<ValidationMetadata>
{
- public int serializedSize(ValidationMetadata component) throws IOException
+ public int serializedSize(Version version, ValidationMetadata component) throws IOException
{
return TypeSizes.sizeof(component.partitioner) + 8;
}
- public void serialize(ValidationMetadata component, DataOutputPlus out) throws IOException
+ public void serialize(Version version, ValidationMetadata component, DataOutputPlus out) throws IOException
{
out.writeUTF(component.partitioner);
out.writeDouble(component.bloomFilterFPChance);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
index 01c0049..0a89d74 100644
--- a/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
+++ b/src/java/org/apache/cassandra/io/util/DataIntegrityMetadata.java
@@ -110,7 +110,7 @@ public class DataIntegrityMetadata
{
this.descriptor = descriptor;
checksum = descriptor.version.uncompressedChecksumType().newInstance();
- digestReader = RandomAccessReader.open(new File(descriptor.filenameFor(Component.DIGEST)));
+ digestReader = RandomAccessReader.open(new File(descriptor.filenameFor(Component.digestFor(descriptor.version.uncompressedChecksumType()))));
dataReader = RandomAccessReader.open(new File(descriptor.filenameFor(Component.DATA)));
try
{
@@ -206,7 +206,9 @@ public class DataIntegrityMetadata
public void writeFullChecksum(Descriptor descriptor)
{
- File outFile = new File(descriptor.filenameFor(Component.DIGEST));
+ if (descriptor.digestComponent == null)
+ throw new NullPointerException("Null digest component for " + descriptor.ksname + '.' + descriptor.cfname + " file " + descriptor.baseFilename());
+ File outFile = new File(descriptor.filenameFor(descriptor.digestComponent));
try (BufferedWriter out =Files.newBufferedWriter(outFile.toPath(), Charsets.UTF_8))
{
out.write(String.valueOf(fullChecksum.getValue()));
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java b/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java
index 04d65d7..123b983 100644
--- a/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java
+++ b/src/java/org/apache/cassandra/streaming/messages/FileMessageHeader.java
@@ -23,7 +23,6 @@ import java.util.List;
import java.util.UUID;
import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.Schema;
import org.apache.cassandra.db.SerializationHeader;
import org.apache.cassandra.db.TypeSizes;
import org.apache.cassandra.io.IVersionedSerializer;
@@ -162,7 +161,7 @@ public class FileMessageHeader
out.writeInt(header.sstableLevel);
if (version >= StreamMessage.VERSION_30)
- SerializationHeader.serializer.serialize(header.header, out);
+ SerializationHeader.serializer.serialize(header.version, header.header, out);
}
public FileMessageHeader deserialize(DataInputPlus in, int version) throws IOException
@@ -211,7 +210,7 @@ public class FileMessageHeader
size += TypeSizes.sizeof(header.sstableLevel);
if (version >= StreamMessage.VERSION_30)
- size += SerializationHeader.serializer.serializedSize(header.header);
+ size += SerializationHeader.serializer.serializedSize(header.version, header.header);
return size;
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-CompressionInfo.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-CompressionInfo.db
new file mode 100644
index 0000000..6d49922
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Data.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Data.db
new file mode 100644
index 0000000..326498b
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Filter.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Index.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Index.db
new file mode 100644
index 0000000..44b89c4
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Statistics.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Statistics.db
new file mode 100644
index 0000000..a9a404a
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Summary.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Summary.db
new file mode 100644
index 0000000..266c494
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-TOC.txt b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-TOC.txt
new file mode 100644
index 0000000..abc3147
--- /dev/null
+++ b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust/legacy_tables-legacy_jb_clust-jb-1-TOC.txt
@@ -0,0 +1,7 @@
+CompressionInfo.db
+Statistics.db
+Filter.db
+Data.db
+TOC.txt
+Index.db
+Summary.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-CompressionInfo.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-CompressionInfo.db
new file mode 100644
index 0000000..fe2e257
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Data.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Data.db
new file mode 100644
index 0000000..12c8fdc
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Filter.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Index.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Index.db
new file mode 100644
index 0000000..51ddf91
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Statistics.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Statistics.db
new file mode 100644
index 0000000..a5eff40
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Summary.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Summary.db
new file mode 100644
index 0000000..750a780
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-TOC.txt b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-TOC.txt
new file mode 100644
index 0000000..abc3147
--- /dev/null
+++ b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_clust_counter/legacy_tables-legacy_jb_clust_counter-jb-1-TOC.txt
@@ -0,0 +1,7 @@
+CompressionInfo.db
+Statistics.db
+Filter.db
+Data.db
+TOC.txt
+Index.db
+Summary.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-CompressionInfo.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-CompressionInfo.db
new file mode 100644
index 0000000..c80e64c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Data.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Data.db
new file mode 100644
index 0000000..401fe93
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Filter.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Index.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Index.db
new file mode 100644
index 0000000..f0717e0
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Statistics.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Statistics.db
new file mode 100644
index 0000000..a2bcfaf
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Summary.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Summary.db
new file mode 100644
index 0000000..af5e781
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-TOC.txt b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-TOC.txt
new file mode 100644
index 0000000..abc3147
--- /dev/null
+++ b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple/legacy_tables-legacy_jb_simple-jb-1-TOC.txt
@@ -0,0 +1,7 @@
+CompressionInfo.db
+Statistics.db
+Filter.db
+Data.db
+TOC.txt
+Index.db
+Summary.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-CompressionInfo.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-CompressionInfo.db
new file mode 100644
index 0000000..9c3416e
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Data.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Data.db
new file mode 100644
index 0000000..b72f790
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Filter.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Index.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Index.db
new file mode 100644
index 0000000..932936c
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Statistics.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Statistics.db
new file mode 100644
index 0000000..6baf1de
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Summary.db b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Summary.db
new file mode 100644
index 0000000..af5e781
Binary files /dev/null and b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-TOC.txt b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-TOC.txt
new file mode 100644
index 0000000..abc3147
--- /dev/null
+++ b/test/data/legacy-sstables/jb/legacy_tables/legacy_jb_simple_counter/legacy_tables-legacy_jb_simple_counter-jb-1-TOC.txt
@@ -0,0 +1,7 @@
+CompressionInfo.db
+Statistics.db
+Filter.db
+Data.db
+TOC.txt
+Index.db
+Summary.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-CompressionInfo.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-CompressionInfo.db
new file mode 100644
index 0000000..69a8355
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Data.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Data.db
new file mode 100644
index 0000000..7acbf92
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Digest.sha1
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Digest.sha1 b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Digest.sha1
new file mode 100644
index 0000000..fef7106
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Digest.sha1
@@ -0,0 +1 @@
+4293822635
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Filter.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Index.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Index.db
new file mode 100644
index 0000000..44b89c4
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Statistics.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Statistics.db
new file mode 100644
index 0000000..5f07da5
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Summary.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Summary.db
new file mode 100644
index 0000000..35b5e22
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-TOC.txt b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-TOC.txt
new file mode 100644
index 0000000..7be41d8
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust/legacy_tables-legacy_ka_clust-ka-1-TOC.txt
@@ -0,0 +1,8 @@
+Index.db
+Digest.sha1
+CompressionInfo.db
+Data.db
+Statistics.db
+Summary.db
+TOC.txt
+Filter.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-CompressionInfo.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-CompressionInfo.db
new file mode 100644
index 0000000..3c7291c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Data.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Data.db
new file mode 100644
index 0000000..3566e5a
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Digest.sha1
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Digest.sha1 b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Digest.sha1
new file mode 100644
index 0000000..a679541
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Digest.sha1
@@ -0,0 +1 @@
+2539906592
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Filter.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Index.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Index.db
new file mode 100644
index 0000000..51ddf91
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Statistics.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Statistics.db
new file mode 100644
index 0000000..36e9dc2
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Summary.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Summary.db
new file mode 100644
index 0000000..35b5e22
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-TOC.txt b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-TOC.txt
new file mode 100644
index 0000000..7be41d8
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_clust_counter/legacy_tables-legacy_ka_clust_counter-ka-1-TOC.txt
@@ -0,0 +1,8 @@
+Index.db
+Digest.sha1
+CompressionInfo.db
+Data.db
+Statistics.db
+Summary.db
+TOC.txt
+Filter.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-CompressionInfo.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-CompressionInfo.db
new file mode 100644
index 0000000..c80e64c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Data.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Data.db
new file mode 100644
index 0000000..b29a26a
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Data.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Digest.sha1
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Digest.sha1 b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Digest.sha1
new file mode 100644
index 0000000..c889c8d
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Digest.sha1
@@ -0,0 +1 @@
+2802392853
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Filter.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Filter.db
new file mode 100644
index 0000000..c3cb27c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Filter.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Index.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Index.db
new file mode 100644
index 0000000..f0717e0
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Index.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Statistics.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Statistics.db
new file mode 100644
index 0000000..2af5467
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Statistics.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Summary.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Summary.db
new file mode 100644
index 0000000..35b5e22
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-Summary.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-TOC.txt b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-TOC.txt
new file mode 100644
index 0000000..7be41d8
--- /dev/null
+++ b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple/legacy_tables-legacy_ka_simple-ka-1-TOC.txt
@@ -0,0 +1,8 @@
+Index.db
+Digest.sha1
+CompressionInfo.db
+Data.db
+Statistics.db
+Summary.db
+TOC.txt
+Filter.db
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-CompressionInfo.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-CompressionInfo.db
new file mode 100644
index 0000000..9c3416e
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-CompressionInfo.db differ
http://git-wip-us.apache.org/repos/asf/cassandra/blob/0600d7dc/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-Data.db b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-Data.db
new file mode 100644
index 0000000..1aee64c
Binary files /dev/null and b/test/data/legacy-sstables/ka/legacy_tables/legacy_ka_simple_counter/legacy_tables-legacy_ka_simple_counter-ka-1-Data.db differ