sstables: add tests for dense tables
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -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<>();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
BIN
tests/urchin/sstables/compact_dense/la-1-big-CRC.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-CRC.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_dense/la-1-big-Data.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-Data.db
Normal file
Binary file not shown.
1
tests/urchin/sstables/compact_dense/la-1-big-Digest.sha1
Normal file
1
tests/urchin/sstables/compact_dense/la-1-big-Digest.sha1
Normal file
@@ -0,0 +1 @@
|
||||
3216903601
|
||||
BIN
tests/urchin/sstables/compact_dense/la-1-big-Filter.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-Filter.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_dense/la-1-big-Index.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-Index.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_dense/la-1-big-Statistics.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-Statistics.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_dense/la-1-big-Summary.db
Normal file
BIN
tests/urchin/sstables/compact_dense/la-1-big-Summary.db
Normal file
Binary file not shown.
8
tests/urchin/sstables/compact_dense/la-1-big-TOC.txt
Normal file
8
tests/urchin/sstables/compact_dense/la-1-big-TOC.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Summary.db
|
||||
Index.db
|
||||
TOC.txt
|
||||
Data.db
|
||||
CRC.db
|
||||
Filter.db
|
||||
Statistics.db
|
||||
Digest.sha1
|
||||
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-CRC.db
Normal file
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-CRC.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Data.db
Normal file
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Data.db
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
1513167530
|
||||
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Filter.db
Normal file
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Filter.db
Normal file
Binary file not shown.
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Index.db
Normal file
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Index.db
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Summary.db
Normal file
BIN
tests/urchin/sstables/compact_simple_dense/la-1-big-Summary.db
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
Summary.db
|
||||
Index.db
|
||||
TOC.txt
|
||||
Data.db
|
||||
CRC.db
|
||||
Filter.db
|
||||
Statistics.db
|
||||
Digest.sha1
|
||||
Reference in New Issue
Block a user