sstable_test_env: Coroutinize and move to .cc test_env::stop()
It's going to get larger, so better to move. Also when coroutinized it's goind to be easier to extend. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
@@ -79,11 +79,7 @@ public:
|
||||
|
||||
explicit test_env(test_env_config cfg = {}, sstables::storage_manager* sstm = nullptr) : _impl(std::make_unique<impl>(std::move(cfg), sstm)) { }
|
||||
|
||||
future<> stop() {
|
||||
return _impl->mgr.close().finally([this] {
|
||||
return _impl->semaphore.stop();
|
||||
});
|
||||
}
|
||||
future<> stop();
|
||||
|
||||
sstables::generation_type new_generation() noexcept {
|
||||
return _impl->new_generation();
|
||||
|
||||
@@ -215,6 +215,11 @@ test_env::impl::impl(test_env_config cfg, sstables::storage_manager* sstm)
|
||||
}
|
||||
}
|
||||
|
||||
future<> test_env::stop() {
|
||||
co_await _impl->mgr.close();
|
||||
co_await _impl->semaphore.stop();
|
||||
}
|
||||
|
||||
future<> test_env::do_with_async(noncopyable_function<void (test_env&)> func, test_env_config cfg) {
|
||||
if (!cfg.storage.is_local_type()) {
|
||||
struct test_env_with_cql {
|
||||
|
||||
Reference in New Issue
Block a user