diff --git a/tests/urchin/sstable_mutation_test.cc b/tests/urchin/sstable_mutation_test.cc index cf933b6be2..88a30d672f 100644 --- a/tests/urchin/sstable_mutation_test.cc +++ b/tests/urchin/sstable_mutation_test.cc @@ -462,3 +462,39 @@ SEASTAR_TEST_CASE(compact_storage_sparse_read) { }); }); } + +SEASTAR_TEST_CASE(compact_storage_simple_dense_read) { + return reusable_sst("tests/urchin/sstables/compact_simple_dense", 1).then([] (auto sstp) { + return do_with(sstables::key("first_row"), [sstp] (auto& key) { + auto s = compact_simple_dense_schema(); + return sstp->read_row(s, key).then([sstp, s, &key] (auto mutation) { + auto& mp = mutation->partition(); + + auto exploded = exploded_clustering_prefix({"cl1"}); + auto clustering = clustering_key::from_clustering_prefix(*s, exploded); + + auto row = mp.clustered_row(clustering); + match_live_cell(row.cells(), *s, "cl2", boost::any(to_bytes("cl2"))); + return make_ready_future<>(); + }); + }); + }); +} + +SEASTAR_TEST_CASE(compact_storage_dense_read) { + return reusable_sst("tests/urchin/sstables/compact_dense", 1).then([] (auto sstp) { + return do_with(sstables::key("first_row"), [sstp] (auto& key) { + auto s = compact_dense_schema(); + return sstp->read_row(s, key).then([sstp, s, &key] (auto mutation) { + auto& mp = mutation->partition(); + + auto exploded = exploded_clustering_prefix({"cl1", "cl2"}); + auto clustering = clustering_key::from_clustering_prefix(*s, exploded); + + auto row = mp.clustered_row(clustering); + match_live_cell(row.cells(), *s, "cl3", boost::any(to_bytes("cl3"))); + return make_ready_future<>(); + }); + }); + }); +} diff --git a/tests/urchin/sstable_test.hh b/tests/urchin/sstable_test.hh index e9a6cc608c..9351f147ca 100644 --- a/tests/urchin/sstable_test.hh +++ b/tests/urchin/sstable_test.hh @@ -249,6 +249,48 @@ inline schema_ptr columns_schema() { return columns; } +inline schema_ptr compact_simple_dense_schema() { + static thread_local auto s = [] { + schema_builder builder(make_lw_shared(schema({}, "tests", "compact_simple_dense", + // partition key + {{"ks", bytes_type}}, + // clustering key + {{"cl1", bytes_type}}, + // regular columns + {{"cl2", bytes_type}}, + // static columns + {}, + // regular column name type + utf8_type, + // comment + "Table with a compact storage, and a single clustering key" + ))); + return builder.build(schema_builder::compact_storage::yes); + }(); + return s; +} + +inline schema_ptr compact_dense_schema() { + static thread_local auto s = [] { + schema_builder builder(make_lw_shared(schema({}, "tests", "compact_simple_dense", + // partition key + {{"ks", bytes_type}}, + // clustering key + {{"cl1", bytes_type}, {"cl2", bytes_type}}, + // regular columns + {{"cl3", bytes_type}}, + // static columns + {}, + // regular column name type + utf8_type, + // comment + "Table with a compact storage, and a compound clustering key" + ))); + return builder.build(schema_builder::compact_storage::yes); + }(); + return s; +} + inline schema_ptr compact_sparse_schema() { static thread_local auto s = [] { schema_builder builder(make_lw_shared(schema({}, "tests", "compact_sparse", diff --git a/tests/urchin/sstables/compact_dense/la-1-big-CRC.db b/tests/urchin/sstables/compact_dense/la-1-big-CRC.db new file mode 100644 index 0000000000..9a21e47ca5 Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-CRC.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Data.db b/tests/urchin/sstables/compact_dense/la-1-big-Data.db new file mode 100644 index 0000000000..2ad85e1c3f Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-Data.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Digest.sha1 b/tests/urchin/sstables/compact_dense/la-1-big-Digest.sha1 new file mode 100644 index 0000000000..b22a62c0d7 --- /dev/null +++ b/tests/urchin/sstables/compact_dense/la-1-big-Digest.sha1 @@ -0,0 +1 @@ +3216903601 \ No newline at end of file diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Filter.db b/tests/urchin/sstables/compact_dense/la-1-big-Filter.db new file mode 100644 index 0000000000..0756b98a89 Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-Filter.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Index.db b/tests/urchin/sstables/compact_dense/la-1-big-Index.db new file mode 100644 index 0000000000..ac02d0a126 Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-Index.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Statistics.db b/tests/urchin/sstables/compact_dense/la-1-big-Statistics.db new file mode 100644 index 0000000000..0318feb4ff Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-Statistics.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-Summary.db b/tests/urchin/sstables/compact_dense/la-1-big-Summary.db new file mode 100644 index 0000000000..5254bc69d3 Binary files /dev/null and b/tests/urchin/sstables/compact_dense/la-1-big-Summary.db differ diff --git a/tests/urchin/sstables/compact_dense/la-1-big-TOC.txt b/tests/urchin/sstables/compact_dense/la-1-big-TOC.txt new file mode 100644 index 0000000000..0780736668 --- /dev/null +++ b/tests/urchin/sstables/compact_dense/la-1-big-TOC.txt @@ -0,0 +1,8 @@ +Summary.db +Index.db +TOC.txt +Data.db +CRC.db +Filter.db +Statistics.db +Digest.sha1 diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-CRC.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-CRC.db new file mode 100644 index 0000000000..e32cffb0fb Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-CRC.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Data.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-Data.db new file mode 100644 index 0000000000..c8cab6bf3c Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-Data.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Digest.sha1 b/tests/urchin/sstables/compact_simple_dense/la-1-big-Digest.sha1 new file mode 100644 index 0000000000..1a0a9ce927 --- /dev/null +++ b/tests/urchin/sstables/compact_simple_dense/la-1-big-Digest.sha1 @@ -0,0 +1 @@ +1513167530 \ No newline at end of file diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Filter.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-Filter.db new file mode 100644 index 0000000000..6128dab857 Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-Filter.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Index.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-Index.db new file mode 100644 index 0000000000..e2a70ec653 Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-Index.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Statistics.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-Statistics.db new file mode 100644 index 0000000000..8fc07cb609 Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-Statistics.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-Summary.db b/tests/urchin/sstables/compact_simple_dense/la-1-big-Summary.db new file mode 100644 index 0000000000..169ec57b6d Binary files /dev/null and b/tests/urchin/sstables/compact_simple_dense/la-1-big-Summary.db differ diff --git a/tests/urchin/sstables/compact_simple_dense/la-1-big-TOC.txt b/tests/urchin/sstables/compact_simple_dense/la-1-big-TOC.txt new file mode 100644 index 0000000000..0780736668 --- /dev/null +++ b/tests/urchin/sstables/compact_simple_dense/la-1-big-TOC.txt @@ -0,0 +1,8 @@ +Summary.db +Index.db +TOC.txt +Data.db +CRC.db +Filter.db +Statistics.db +Digest.sha1