cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blam...@apache.org
Subject [1/2] cassandra git commit: Adds the ability to use uncompressed chunks in compressed files
Date Tue, 21 Feb 2017 16:07:22 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0ae0495ea -> f97db26f8


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
new file mode 100644
index 0000000..ae620de
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
@@ -0,0 +1,8 @@
+Summary.db
+Filter.db
+Index.db
+CompressionInfo.db
+Data.db
+TOC.txt
+Statistics.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-CompressionInfo.db
new file mode 100644
index 0000000..0b7faea
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Data.db
new file mode 100644
index 0000000..277996b
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Digest.crc32
new file mode 100644
index 0000000..654f52b
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Digest.crc32
@@ -0,0 +1 @@
+4102718625
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Partitions.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Partitions.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Partitions.db
new file mode 100644
index 0000000..f297888
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Partitions.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Rows.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Rows.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Rows.db
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Statistics.db
new file mode 100644
index 0000000..62b5d3f
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-TOC.txt
new file mode 100644
index 0000000..c20f4a8
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-bti-TOC.txt
@@ -0,0 +1,8 @@
+Data.db
+Filter.db
+Statistics.db
+CompressionInfo.db
+Partitions.db
+TOC.txt
+Rows.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
new file mode 100644
index 0000000..63039e6
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
new file mode 100644
index 0000000..5970d11
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
new file mode 100644
index 0000000..e85ffd9
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
@@ -0,0 +1 @@
+576034138
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Index.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Index.db
new file mode 100644
index 0000000..56f29df
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
new file mode 100644
index 0000000..f63efec
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Summary.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Summary.db
new file mode 100644
index 0000000..9b24e04
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
new file mode 100644
index 0000000..ae620de
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
@@ -0,0 +1,8 @@
+Summary.db
+Filter.db
+Index.db
+CompressionInfo.db
+Data.db
+TOC.txt
+Statistics.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-CompressionInfo.db
new file mode 100644
index 0000000..adb7fc4
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Data.db
new file mode 100644
index 0000000..68f29ba
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Digest.crc32
new file mode 100644
index 0000000..bf77552
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Digest.crc32
@@ -0,0 +1 @@
+380992464
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Partitions.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Partitions.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Partitions.db
new file mode 100644
index 0000000..e4f9ea9
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Partitions.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Rows.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Rows.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Rows.db
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Statistics.db
new file mode 100644
index 0000000..b853cfb
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-TOC.txt
new file mode 100644
index 0000000..c20f4a8
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-bti-TOC.txt
@@ -0,0 +1,8 @@
+Data.db
+Filter.db
+Statistics.db
+CompressionInfo.db
+Partitions.db
+TOC.txt
+Rows.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
new file mode 100644
index 0000000..6726d74
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
new file mode 100644
index 0000000..28234ab
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
new file mode 100644
index 0000000..955bc49
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
@@ -0,0 +1 @@
+381306786
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Index.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Index.db
new file mode 100644
index 0000000..59e65ca
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
new file mode 100644
index 0000000..d65a3a4
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Summary.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Summary.db
new file mode 100644
index 0000000..9b24e04
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
new file mode 100644
index 0000000..ae620de
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
@@ -0,0 +1,8 @@
+Summary.db
+Filter.db
+Index.db
+CompressionInfo.db
+Data.db
+TOC.txt
+Statistics.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-CompressionInfo.db
new file mode 100644
index 0000000..0d9c077
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Data.db
new file mode 100644
index 0000000..1489bab
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Digest.crc32
new file mode 100644
index 0000000..a804901
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Digest.crc32
@@ -0,0 +1 @@
+163579974
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Partitions.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Partitions.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Partitions.db
new file mode 100644
index 0000000..1eed5ad
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Partitions.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Rows.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Rows.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Rows.db
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Statistics.db
new file mode 100644
index 0000000..171655c
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-TOC.txt
new file mode 100644
index 0000000..c20f4a8
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-bti-TOC.txt
@@ -0,0 +1,8 @@
+Data.db
+Filter.db
+Statistics.db
+CompressionInfo.db
+Partitions.db
+TOC.txt
+Rows.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
new file mode 100644
index 0000000..edf78d5
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
new file mode 100644
index 0000000..ce4965c
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
new file mode 100644
index 0000000..06f147f
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
@@ -0,0 +1 @@
+2161889354
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Index.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Index.db
new file mode 100644
index 0000000..d094f73
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
new file mode 100644
index 0000000..6b2d88b
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Summary.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Summary.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Summary.db
new file mode 100644
index 0000000..9b24e04
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Summary.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
new file mode 100644
index 0000000..ae620de
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
@@ -0,0 +1,8 @@
+Summary.db
+Filter.db
+Index.db
+CompressionInfo.db
+Data.db
+TOC.txt
+Statistics.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-CompressionInfo.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-CompressionInfo.db
new file mode 100644
index 0000000..56c95a8
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-CompressionInfo.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Data.db
new file mode 100644
index 0000000..2977f11
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Digest.crc32 b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Digest.crc32
new file mode 100644
index 0000000..02bf600
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Digest.crc32
@@ -0,0 +1 @@
+1528982319
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Filter.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Filter.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Filter.db
new file mode 100644
index 0000000..2e1d5d2
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Filter.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Partitions.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Partitions.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Partitions.db
new file mode 100644
index 0000000..05e27b4
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Partitions.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Rows.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Rows.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Rows.db
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Statistics.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Statistics.db
new file mode 100644
index 0000000..08d8f3e
Binary files /dev/null and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-TOC.txt
new file mode 100644
index 0000000..c20f4a8
--- /dev/null
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-bti-TOC.txt
@@ -0,0 +1,8 @@
+Data.db
+Filter.db
+Statistics.db
+CompressionInfo.db
+Partitions.db
+TOC.txt
+Rows.db
+Digest.crc32

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/SchemaLoader.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/SchemaLoader.java b/test/unit/org/apache/cassandra/SchemaLoader.java
index c2efb6a..d8f21e8 100644
--- a/test/unit/org/apache/cassandra/SchemaLoader.java
+++ b/test/unit/org/apache/cassandra/SchemaLoader.java
@@ -726,7 +726,7 @@ public static TableMetadata.Builder clusteringSASICFMD(String ksName, String cfN
     public static CompressionParams getCompressionParameters(Integer chunkSize)
     {
         if (Boolean.parseBoolean(System.getProperty("cassandra.test.compression", "false")))
-            return CompressionParams.snappy(chunkSize);
+            return chunkSize != null ? CompressionParams.snappy(chunkSize) : CompressionParams.snappy();
 
         return CompressionParams.noCompression();
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
index 88c6a3f..8dc6fed 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
@@ -328,7 +328,7 @@ public class AlterTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor")));
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor", "min_compress_ratio", "1.1")));
 
         execute("ALTER TABLE %s WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_in_kb' : 32 };");
 
@@ -337,7 +337,7 @@ public class AlterTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor")));
+                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "1.1")));
 
         execute("ALTER TABLE %s WITH compression = { 'sstable_compression' : 'LZ4Compressor', 'chunk_length_kb' : 64 };");
 
@@ -346,7 +346,25 @@ public class AlterTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor")));
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor", "min_compress_ratio", "1.1")));
+
+        execute("ALTER TABLE %s WITH compression = { 'sstable_compression' : 'LZ4Compressor', 'min_compress_ratio' : 2 };");
+
+        assertRows(execute(format("SELECT compression FROM %s.%s WHERE keyspace_name = ? and table_name = ?;",
+                                  SchemaConstants.SCHEMA_KEYSPACE_NAME,
+                                  SchemaKeyspace.TABLES),
+                           KEYSPACE,
+                           currentTable()),
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor", "min_compress_ratio", "2.0")));
+
+        execute("ALTER TABLE %s WITH compression = { 'sstable_compression' : 'LZ4Compressor', 'min_compress_ratio' : 0 };");
+
+        assertRows(execute(format("SELECT compression FROM %s.%s WHERE keyspace_name = ? and table_name = ?;",
+                                  SchemaConstants.SCHEMA_KEYSPACE_NAME,
+                                  SchemaKeyspace.TABLES),
+                           KEYSPACE,
+                           currentTable()),
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor", "min_compress_ratio", "0.0")));
 
         execute("ALTER TABLE %s WITH compression = { 'sstable_compression' : '', 'chunk_length_kb' : 32 };");
 
@@ -381,6 +399,9 @@ public class AlterTest extends CQLTester
 
         assertThrowsConfigurationException("The 'chunk_length_kb' option must not be used if the chunk length is already specified by the 'chunk_length_in_kb' option",
                                            "ALTER TABLE %s WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_kb' : 32 , 'chunk_length_in_kb' : 32 };");
+
+        assertThrowsConfigurationException("Invalid negative min_compress_ratio",
+                                           "ALTER TABLE %s WITH compression = { 'class' : 'SnappyCompressor', 'min_compress_ratio' : -1 };");
     }
 
     private void assertThrowsConfigurationException(String errorMsg, String alterStmt) throws Throwable

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
index 1a8338f..9c8b12a 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
@@ -722,7 +722,7 @@ public class CreateTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor")));
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.LZ4Compressor", "min_compress_ratio", "1.1")));
 
         createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                 + " WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_in_kb' : 32 };");
@@ -732,7 +732,7 @@ public class CreateTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor")));
+                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "1.1")));
 
         createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                 + " WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_in_kb' : 32, 'enabled' : true };");
@@ -742,7 +742,7 @@ public class CreateTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor")));
+                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "1.1")));
 
         createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                 + " WITH compression = { 'sstable_compression' : 'SnappyCompressor', 'chunk_length_kb' : 32 };");
@@ -752,7 +752,27 @@ public class CreateTest extends CQLTester
                                   SchemaKeyspace.TABLES),
                            KEYSPACE,
                            currentTable()),
-                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor")));
+                   row(map("chunk_length_in_kb", "32", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "1.1")));
+
+        createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
+                + " WITH compression = { 'sstable_compression' : 'SnappyCompressor', 'min_compress_ratio' : 2 };");
+
+        assertRows(execute(format("SELECT compression FROM %s.%s WHERE keyspace_name = ? and table_name = ?;",
+                                  SchemaConstants.SCHEMA_KEYSPACE_NAME,
+                                  SchemaKeyspace.TABLES),
+                           KEYSPACE,
+                           currentTable()),
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "2.0")));
+
+        createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
+                + " WITH compression = { 'sstable_compression' : 'SnappyCompressor', 'min_compress_ratio' : 0 };");
+
+        assertRows(execute(format("SELECT compression FROM %s.%s WHERE keyspace_name = ? and table_name = ?;",
+                                  SchemaConstants.SCHEMA_KEYSPACE_NAME,
+                                  SchemaKeyspace.TABLES),
+                           KEYSPACE,
+                           currentTable()),
+                   row(map("chunk_length_in_kb", "64", "class", "org.apache.cassandra.io.compress.SnappyCompressor", "min_compress_ratio", "0.0")));
 
         createTable("CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                 + " WITH compression = { 'sstable_compression' : '', 'chunk_length_kb' : 32 };");
@@ -798,6 +818,18 @@ public class CreateTest extends CQLTester
                                            "CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                                            + " WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_kb' : 32 , 'chunk_length_in_kb' : 32 };");
 
+        assertThrowsConfigurationException("chunk_length_in_kb must be a power of 2",
+                                           "CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
+                                           + " WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_in_kb' : 31 };");
+
+        assertThrowsConfigurationException("Invalid negative or null chunk_length_in_kb",
+                                           "CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
+                                           + " WITH compression = { 'class' : 'SnappyCompressor', 'chunk_length_in_kb' : -1 };");
+
+        assertThrowsConfigurationException("Invalid negative min_compress_ratio",
+                                           "CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
+                                            + " WITH compression = { 'class' : 'SnappyCompressor', 'min_compress_ratio' : -1 };");
+
         assertThrowsConfigurationException("Unknown compression options unknownOption",
                                            "CREATE TABLE %s (a text, b int, c int, primary key (a, b))"
                                             + " WITH compression = { 'class' : 'SnappyCompressor', 'unknownOption' : 32 };");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/db/ColumnFamilyStoreCQLHelperTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreCQLHelperTest.java b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreCQLHelperTest.java
index 59f9db3..6d680ce 100644
--- a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreCQLHelperTest.java
+++ b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreCQLHelperTest.java
@@ -311,7 +311,7 @@ public class ColumnFamilyStoreCQLHelperTest extends CQLTester
                .bloomFilterFpChance(1.0)
                .comment("comment")
                .compaction(CompactionParams.lcs(Collections.singletonMap("sstable_size_in_mb", "1")))
-               .compression(CompressionParams.lz4(1 << 16))
+               .compression(CompressionParams.lz4(1 << 16, 1 << 15))
                .dcLocalReadRepairChance(0.2)
                .crcCheckChance(0.3)
                .defaultTimeToLive(4)
@@ -343,7 +343,7 @@ public class ColumnFamilyStoreCQLHelperTest extends CQLTester
         "\tAND comment = 'comment'\n" +
         "\tAND caching = { 'keys': 'ALL', 'rows_per_partition': 'NONE' }\n" +
         "\tAND compaction = { 'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb': '1' }\n" +
-        "\tAND compression = { 'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor' }\n" +
+        "\tAND compression = { 'chunk_length_in_kb': '64', 'min_compress_ratio': '2.0', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor' }\n" +
         "\tAND cdc = false\n" +
         "\tAND extensions = { 'ext1': 0x76616c31 };"
         ));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java b/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
index ceba912..06dd278 100644
--- a/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/compress/CompressedRandomAccessReaderTest.java
@@ -54,24 +54,40 @@ public class CompressedRandomAccessReaderTest
     public void testResetAndTruncate() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(File.createTempFile("normal", "1"), false, false, 10);
-        testResetAndTruncate(File.createTempFile("normal", "2"), false, false, CompressionParams.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("normal", "1"), false, false, 10, 0);
+        testResetAndTruncate(File.createTempFile("normal", "2"), false, false, CompressionParams.DEFAULT_CHUNK_LENGTH, 0);
     }
 
     @Test
     public void testResetAndTruncateCompressed() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(File.createTempFile("compressed", "1"), true, false, 10);
-        testResetAndTruncate(File.createTempFile("compressed", "2"), true, false, CompressionParams.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("compressed", "1"), true, false, 10, 0);
+        testResetAndTruncate(File.createTempFile("compressed", "2"), true, false, CompressionParams.DEFAULT_CHUNK_LENGTH, 0);
     }
 
     @Test
     public void testResetAndTruncateCompressedMmap() throws IOException
     {
         // test reset in current buffer or previous one
-        testResetAndTruncate(File.createTempFile("compressed_mmap", "1"), true, true, 10);
-        testResetAndTruncate(File.createTempFile("compressed_mmap", "2"), true, true, CompressionParams.DEFAULT_CHUNK_LENGTH);
+        testResetAndTruncate(File.createTempFile("compressed_mmap", "1"), true, true, 10, 0);
+        testResetAndTruncate(File.createTempFile("compressed_mmap", "2"), true, true, CompressionParams.DEFAULT_CHUNK_LENGTH, 0);
+    }
+
+    @Test
+    public void testResetAndTruncateCompressedUncompressedChunks() throws IOException
+    {
+        // test reset in current buffer or previous one
+        testResetAndTruncate(File.createTempFile("compressed_uchunks", "1"), true, false, 10, 3);
+        testResetAndTruncate(File.createTempFile("compressed_uchunks", "2"), true, false, CompressionParams.DEFAULT_CHUNK_LENGTH, 3);
+    }
+
+    @Test
+    public void testResetAndTruncateCompressedUncompressedChunksMmap() throws IOException
+    {
+        // test reset in current buffer or previous one
+        testResetAndTruncate(File.createTempFile("compressed_uchunks_mmap", "1"), true, true, 10, 3);
+        testResetAndTruncate(File.createTempFile("compressed_uchunks_mmap", "2"), true, true, CompressionParams.DEFAULT_CHUNK_LENGTH, 3);
     }
 
     @Test
@@ -102,7 +118,7 @@ public class CompressedRandomAccessReaderTest
         }
 
         try (FileHandle.Builder builder = new FileHandle.Builder(filename)
-                                                              .withCompressionMetadata(new CompressionMetadata(filename + ".metadata", f.length()));
+                                                              .withCompressionMetadata(new CompressionMetadata(filename + ".metadata", f.length(), true));
              FileHandle fh = builder.complete();
              RandomAccessReader reader = fh.createReader())
         {
@@ -120,7 +136,7 @@ public class CompressedRandomAccessReaderTest
         }
     }
 
-    private static void testResetAndTruncate(File f, boolean compressed, boolean usemmap, int junkSize) throws IOException
+    private static void testResetAndTruncate(File f, boolean compressed, boolean usemmap, int junkSize, double minCompressRatio) throws IOException
     {
         final String filename = f.getAbsolutePath();
         MetadataCollector sstableMetadataCollector = new MetadataCollector(new ClusteringComparator(BytesType.instance));
@@ -146,7 +162,7 @@ public class CompressedRandomAccessReaderTest
         }
         assert f.exists();
 
-        CompressionMetadata compressionMetadata = compressed ? new CompressionMetadata(filename + ".metadata", f.length()) : null;
+        CompressionMetadata compressionMetadata = compressed ? new CompressionMetadata(filename + ".metadata", f.length(), true) : null;
         try (FileHandle.Builder builder = new FileHandle.Builder(filename).mmapped(usemmap).withCompressionMetadata(compressionMetadata);
              FileHandle fh = builder.complete();
              RandomAccessReader reader = fh.createReader())
@@ -194,7 +210,7 @@ public class CompressedRandomAccessReaderTest
         }
 
         // open compression metadata and get chunk information
-        CompressionMetadata meta = new CompressionMetadata(metadata.getPath(), file.length());
+        CompressionMetadata meta = new CompressionMetadata(metadata.getPath(), file.length(), true);
         CompressionMetadata.Chunk chunk = meta.chunkFor(0);
 
         try (FileHandle.Builder builder = new FileHandle.Builder(file.getPath()).withCompressionMetadata(meta);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java b/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java
index b5bf161..dab2013 100644
--- a/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java
+++ b/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java
@@ -55,13 +55,23 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
     private void runTests(String testName) throws IOException
     {
         // Test small < 1 chunk data set
-        testWrite(File.createTempFile(testName + "_small", "1"), 25);
+        testWrite(File.createTempFile(testName + "_small", "1"), 25, false);
 
         // Test to confirm pipeline w/chunk-aligned data writes works
-        testWrite(File.createTempFile(testName + "_chunkAligned", "1"), CompressionParams.DEFAULT_CHUNK_LENGTH);
+        testWrite(File.createTempFile(testName + "_chunkAligned", "1"), CompressionParams.DEFAULT_CHUNK_LENGTH, false);
 
         // Test to confirm pipeline on non-chunk boundaries works
-        testWrite(File.createTempFile(testName + "_large", "1"), CompressionParams.DEFAULT_CHUNK_LENGTH * 3 + 100);
+        testWrite(File.createTempFile(testName + "_large", "1"), CompressionParams.DEFAULT_CHUNK_LENGTH * 3 + 100, false);
+
+        // Test small < 1 chunk data set
+        testWrite(File.createTempFile(testName + "_small", "2"), 25, true);
+
+        // Test to confirm pipeline w/chunk-aligned data writes works
+        testWrite(File.createTempFile(testName + "_chunkAligned", "2"), CompressionParams.DEFAULT_CHUNK_LENGTH, true);
+
+        // Test to confirm pipeline on non-chunk boundaries works
+        testWrite(File.createTempFile(testName + "_large", "2"), CompressionParams.DEFAULT_CHUNK_LENGTH * 3 + 100, true);
+
     }
 
     @Test
@@ -85,7 +95,7 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
         runTests("Snappy");
     }
 
-    private void testWrite(File f, int bytesToTest) throws IOException
+    private void testWrite(File f, int bytesToTest, boolean useMemmap) throws IOException
     {
         final String filename = f.getAbsolutePath();
         MetadataCollector sstableMetadataCollector = new MetadataCollector(new ClusteringComparator(Collections.singletonList(BytesType.instance)));
@@ -120,7 +130,7 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
         }
 
         assert f.exists();
-        try (FileHandle.Builder builder = new FileHandle.Builder(filename).withCompressionMetadata(new CompressionMetadata(filename + ".metadata", f.length()));
+        try (FileHandle.Builder builder = new FileHandle.Builder(filename).withCompressionMetadata(new CompressionMetadata(filename + ".metadata", f.length(), true));
              FileHandle fh = builder.complete();
              RandomAccessReader reader = fh.createReader())
         {
@@ -215,6 +225,7 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
     private static class TestableCSW extends TestableSW
     {
         final File offsetsFile;
+        static final int MAX_COMPRESSED = BUFFER_SIZE * 10;     // Always compress for this test.
 
         private TestableCSW() throws IOException
         {
@@ -226,7 +237,7 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
         {
             this(file, offsetsFile, new CompressedSequentialWriter(file, offsetsFile.getPath(),
                                                                    null, SequentialWriterOption.DEFAULT,
-                                                                   CompressionParams.lz4(BUFFER_SIZE),
+                                                                   CompressionParams.lz4(BUFFER_SIZE, MAX_COMPRESSED),
                                                                    new MetadataCollector(new ClusteringComparator(UTF8Type.instance))));
 
         }
@@ -255,6 +266,7 @@ public class CompressedSequentialWriterTest extends SequentialWriterTest
             Assert.assertTrue(offsets.readUTF().endsWith("LZ4Compressor"));
             Assert.assertEquals(0, offsets.readInt());
             Assert.assertEquals(BUFFER_SIZE, offsets.readInt());
+            Assert.assertEquals(MAX_COMPRESSED, offsets.readInt());
             Assert.assertEquals(fullContents.length, offsets.readLong());
             Assert.assertEquals(2, offsets.readInt());
             Assert.assertEquals(0, offsets.readLong());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
index 8996f2a..3a963b1 100644
--- a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
@@ -71,7 +71,7 @@ public class LegacySSTableTest
      * See {@link #testGenerateSstables()} to generate sstables.
      * Take care on commit as you need to add the sstable files using {@code git add -f}
      */
-    public static final String[] legacyVersions = {"mc", "mb", "ma"};
+    public static final String[] legacyVersions = {"na", "mc", "mb", "ma"};
 
     // 1200 chars
     static final String longString = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" +

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/io/util/MmappedRegionsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/util/MmappedRegionsTest.java b/test/unit/org/apache/cassandra/io/util/MmappedRegionsTest.java
index 5051230..cffb49d 100644
--- a/test/unit/org/apache/cassandra/io/util/MmappedRegionsTest.java
+++ b/test/unit/org/apache/cassandra/io/util/MmappedRegionsTest.java
@@ -313,7 +313,7 @@ public class MmappedRegionsTest
             writer.finish();
         }
 
-        CompressionMetadata metadata = new CompressionMetadata(cf.getAbsolutePath(), f.length());
+        CompressionMetadata metadata = new CompressionMetadata(cf.getAbsolutePath(), f.length(), true);
         try(ChannelProxy channel = new ChannelProxy(f);
             MmappedRegions regions = MmappedRegions.map(channel, metadata))
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f97db26f/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java b/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
index f3d0b52..19e28fd 100644
--- a/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
+++ b/test/unit/org/apache/cassandra/streaming/compression/CompressedInputStreamTest.java
@@ -32,6 +32,8 @@ import org.apache.cassandra.io.util.SequentialWriterOption;
 import org.apache.cassandra.schema.CompressionParams;
 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.sstable.format.big.BigFormat;
 import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
 import org.apache.cassandra.streaming.compress.CompressedInputStream;
 import org.apache.cassandra.streaming.compress.CompressionInfo;
@@ -54,17 +56,17 @@ public class CompressedInputStreamTest
     @Test
     public void testCompressedRead() throws Exception
     {
-        testCompressedReadWith(new long[]{0L}, false, false);
-        testCompressedReadWith(new long[]{1L}, false, false);
-        testCompressedReadWith(new long[]{100L}, false, false);
+        testCompressedReadWith(new long[]{0L}, false, false, 0);
+        testCompressedReadWith(new long[]{1L}, false, false, 0);
+        testCompressedReadWith(new long[]{100L}, false, false, 0);
 
-        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, false);
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, false, 0);
     }
 
     @Test(expected = EOFException.class)
     public void testTruncatedRead() throws Exception
     {
-        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, true, false);
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, true, false, 0);
     }
 
     /**
@@ -73,14 +75,36 @@ public class CompressedInputStreamTest
     @Test(timeout = 30000)
     public void testException() throws Exception
     {
-        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, true);
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, true, 0);
+    }
+
+    @Test
+    public void testCompressedReadUncompressedChunks() throws Exception
+    {
+        testCompressedReadWith(new long[]{0L}, false, false, 3);
+        testCompressedReadWith(new long[]{1L}, false, false, 3);
+        testCompressedReadWith(new long[]{100L}, false, false, 3);
+
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, false, 3);
+    }
+
+    @Test(expected = EOFException.class)
+    public void testTruncatedReadUncompressedChunks() throws Exception
+    {
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, true, false, 3);
+    }
+
+    @Test(timeout = 30000)
+    public void testCorruptedReadUncompressedChunks() throws Exception
+    {
+        testCompressedReadWith(new long[]{1L, 122L, 123L, 124L, 456L}, false, true, 3);
     }
 
     /**
      * @param valuesToCheck array of longs of range(0-999)
      * @throws Exception
      */
-    private void testCompressedReadWith(long[] valuesToCheck, boolean testTruncate, boolean testException) throws Exception
+    private void testCompressedReadWith(long[] valuesToCheck, boolean testTruncate, boolean testException, double minCompressRatio) throws Exception
     {
         assert valuesToCheck != null && valuesToCheck.length > 0;
 
@@ -89,7 +113,7 @@ public class CompressedInputStreamTest
         Descriptor desc = new Descriptor(parentDir, "ks", "cf", 1);
         File tmp = new File(desc.filenameFor(Component.DATA));
         MetadataCollector collector = new MetadataCollector(new ClusteringComparator(BytesType.instance));
-        CompressionParams param = CompressionParams.snappy(32);
+        CompressionParams param = CompressionParams.snappy(32, minCompressRatio);
         Map<Long, Long> index = new HashMap<Long, Long>();
         try (CompressedSequentialWriter writer = new CompressedSequentialWriter(tmp,
                                                                                 desc.filenameFor(Component.COMPRESSION_INFO),


Mime
View raw message