mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 13:06:57 +00:00
test/sstable::test_env: Add dir-less sstables making helpers
Lots of (most of) test cases out there generate sstables inside env's temporary directory. This patch adds some sugar to env that will allow test cases omit explicit env.tempdir() call. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
@@ -77,6 +77,12 @@ public:
|
||||
return _impl->mgr.make_sstable(std::move(schema), dir, generation_from_value(generation), v, f, now, default_io_error_handler_gen(), buffer_size);
|
||||
}
|
||||
|
||||
shared_sstable make_sstable(schema_ptr schema, unsigned long generation,
|
||||
sstable::version_types v = sstables::get_highest_sstable_version(), sstable::format_types f = sstable::format_types::big,
|
||||
size_t buffer_size = default_sstable_buffer_size, gc_clock::time_point now = gc_clock::now()) {
|
||||
return make_sstable(std::move(schema), _impl->dir.path().native(), generation, std::move(v), std::move(f), buffer_size, now);
|
||||
}
|
||||
|
||||
struct sst_not_found : public std::runtime_error {
|
||||
sst_not_found(const sstring& dir, unsigned long generation)
|
||||
: std::runtime_error(format("no versions of sstable generation {} found in {}", generation, dir))
|
||||
@@ -92,9 +98,18 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
future<shared_sstable> reusable_sst(schema_ptr schema, unsigned long generation,
|
||||
sstable::version_types version, sstable::format_types f = sstable::format_types::big) {
|
||||
return reusable_sst(std::move(schema), _impl->dir.path().native(), std::move(generation), std::move(version), std::move(f));
|
||||
}
|
||||
|
||||
// looks up the sstable in the given dir
|
||||
future<shared_sstable> reusable_sst(schema_ptr schema, sstring dir, unsigned long generation);
|
||||
|
||||
future<shared_sstable> reusable_sst(schema_ptr schema, unsigned long generation) {
|
||||
return reusable_sst(std::move(schema), _impl->dir.path().native(), generation);
|
||||
}
|
||||
|
||||
test_env_sstables_manager& manager() { return _impl->mgr; }
|
||||
reader_concurrency_semaphore& semaphore() { return _impl->semaphore; }
|
||||
db::config& db_config() { return *_impl->db_config; }
|
||||
|
||||
Reference in New Issue
Block a user