treewide: replace seastar::future::get0() with seastar::future::get()

get0() dates back from the days where Seastar futures carried tuples, and
get0() was a way to get the first (and usually only) element. Now
it's a distraction, and Seastar is likely to deprecate and remove it.

Replace with seastar::future::get(), which does the same thing.
This commit is contained in:
Avi Kivity
2024-01-28 15:54:33 +02:00
committed by Kefu Chai
parent deef78c796
commit 7cb1c10fed
143 changed files with 1901 additions and 1901 deletions

View File

@@ -73,11 +73,11 @@ future<> controller::start_server() {
// shards - if necessary for LWT.
smp_service_group_config c;
c.max_nonlocal_requests = 5000;
_ssg = create_smp_service_group(c).get0();
_ssg = create_smp_service_group(c).get();
rmw_operation::set_default_write_isolation(_config.alternator_write_isolation());
net::inet_address addr = utils::resolve(_config.alternator_address, family).get0();
net::inet_address addr = utils::resolve(_config.alternator_address, family).get();
auto get_cdc_metadata = [] (cdc::generation_service& svc) { return std::ref(svc.get_cdc_metadata()); };
auto get_timeout_in_ms = [] (const db::config& cfg) -> utils::updateable_value<uint32_t> {

View File

@@ -117,7 +117,7 @@ public:
}
return make_ready_future<std::unique_ptr<reply>>(std::move(rep));
}
auto res = resf.get0();
auto res = resf.get();
std::visit(overloaded_functor {
[&] (const json::json_return_type& json_return_value) {
slogger.trace("api_handler success case");
@@ -574,7 +574,7 @@ future<> server::init(net::inet_address addr, std::optional<uint16_t> port, std:
} else {
slogger.info("Reloaded {}", files);
}
}).get0();
}).get();
_https_server.listen(socket_address{addr, *https_port}, std::move(server_creds)).get();
_enabled_servers.push_back(std::ref(_https_server));
}

View File

@@ -433,7 +433,7 @@ void set_repair(http_context& ctx, routes& r, sharded<repair_service>& repair) {
.then_wrapped([] (future<repair_status>&& fut) {
ss::ns_repair_async_status::return_type_wrapper res;
try {
res = fut.get0();
res = fut.get();
} catch(std::runtime_error& e) {
throw httpd::bad_param_exception(e.what());
}
@@ -466,7 +466,7 @@ void set_repair(http_context& ctx, routes& r, sharded<repair_service>& repair) {
.then_wrapped([] (future<repair_status>&& fut) {
ss::ns_repair_async_status::return_type_wrapper res;
try {
res = fut.get0();
res = fut.get();
} catch (std::exception& e) {
return make_exception_future<json::json_return_type>(httpd::bad_param_exception(e.what()));
}

View File

@@ -125,11 +125,11 @@ future<> default_authorizer::start() {
_migration_manager).then([this] {
_finished = do_after_system_ready(_as, [this] {
return async([this] {
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get0();
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get();
if (legacy_metadata_exists()) {
if (!any_granted().get0()) {
migrate_legacy_metadata().get0();
if (!any_granted().get()) {
migrate_legacy_metadata().get();
return;
}
@@ -268,7 +268,7 @@ future<> default_authorizer::revoke_all(const resource& resource) const {
{resource.name()},
cql3::query_processor::cache_internal::no).then_wrapped([this, resource](future<::shared_ptr<cql3::untyped_result_set>> f) {
try {
auto res = f.get0();
auto res = f.get();
return parallel_for_each(
res->begin(),
res->end(),

View File

@@ -145,9 +145,9 @@ future<> password_authenticator::start() {
_stopped = do_after_system_ready(_as, [this] {
return async([this] {
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get0();
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get();
if (any_nondefault_role_row_satisfies(_qp, &has_salted_hash, _superuser).get0()) {
if (any_nondefault_role_row_satisfies(_qp, &has_salted_hash, _superuser).get()) {
if (legacy_metadata_exists()) {
plogger.warn("Ignoring legacy authentication metadata since nondefault data already exist.");
}
@@ -156,11 +156,11 @@ future<> password_authenticator::start() {
}
if (legacy_metadata_exists()) {
migrate_legacy_metadata().get0();
migrate_legacy_metadata().get();
return;
}
create_default_if_missing().get0();
create_default_if_missing().get();
});
});
@@ -229,7 +229,7 @@ future<authenticated_user> password_authenticator::authenticate(
cql3::query_processor::cache_internal::yes);
}).then_wrapped([=](future<::shared_ptr<cql3::untyped_result_set>> f) {
try {
auto res = f.get0();
auto res = f.get();
auto salted_hash = std::optional<sstring>();
if (!res->empty()) {
salted_hash = res->one().get_opt<sstring>(SALTED_HASH);

View File

@@ -240,9 +240,9 @@ future<> standard_role_manager::start() {
return this->create_metadata_tables_if_missing().then([this] {
_stopped = auth::do_after_system_ready(_as, [this] {
return seastar::async([this] {
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get0();
_migration_manager.wait_for_schema_agreement(_qp.db().real_database(), db::timeout_clock::time_point::max(), &_as).get();
if (any_nondefault_role_row_satisfies(_qp, &has_can_login).get0()) {
if (any_nondefault_role_row_satisfies(_qp, &has_can_login).get()) {
if (this->legacy_metadata_exists()) {
log.warn("Ignoring legacy user metadata since nondefault roles already exist.");
}
@@ -251,11 +251,11 @@ future<> standard_role_manager::start() {
}
if (this->legacy_metadata_exists()) {
this->migrate_legacy_metadata().get0();
this->migrate_legacy_metadata().get();
return;
}
create_default_role_if_missing().get0();
create_default_role_if_missing().get();
});
});
});

View File

@@ -563,7 +563,7 @@ protected:
void finish_new_sstable(compaction_writer* writer) {
writer->writer.consume_end_of_stream();
writer->sst->open_data().get0();
writer->sst->open_data().get();
_end_size += writer->sst->bytes_on_disk();
_new_unused_sstables.push_back(writer->sst);
_new_partial_sstables.erase(writer->sst);
@@ -619,7 +619,7 @@ protected:
void stop_gc_compaction_writer(compaction_writer* c_writer) {
c_writer->writer.consume_end_of_stream();
auto sst = c_writer->sst;
sst->open_data().get0();
sst->open_data().get();
_unused_garbage_collected_sstables.push_back(std::move(sst));
}
@@ -1147,7 +1147,7 @@ private:
if (!enable_garbage_collected_sstable_writer()) {
return;
}
auto permit = seastar::get_units(_replacer_lock, 1).get0();
auto permit = seastar::get_units(_replacer_lock, 1).get();
// Replace exhausted sstable(s), if any, by new one(s) in the column family.
auto not_exhausted = [s = _schema, &dk = sst->get_last_decorated_key()] (shared_sstable& sst) {
return sst->get_last_decorated_key().tri_compare(*s, dk) > 0;

View File

@@ -66,7 +66,7 @@ shared_ptr<function> make_enable_injection_function() {
const bool one_shot = ascii_type->get_string(parameters[1].value()) == "true";
smp::invoke_on_all([injection_name, one_shot] () mutable {
utils::get_local_injector().enable(injection_name, one_shot);
}).get0();
}).get();
return std::nullopt;
});
}
@@ -77,7 +77,7 @@ shared_ptr<function> make_disable_injection_function() {
sstring injection_name = ascii_type->get_string(parameters[0].value());
smp::invoke_on_all([injection_name] () mutable {
utils::get_local_injector().disable(injection_name);
}).get0();
}).get();
return std::nullopt;
});
}
@@ -99,7 +99,7 @@ shared_ptr<function> make_enabled_injections_function() {
}).then([list_type_inst](std::vector<data_value> const& active_injections) {
auto list_val = make_list_value(list_type_inst, active_injections);
return list_type_inst->decompose(list_val);
}).get0();
}).get();
});
}

View File

@@ -55,11 +55,11 @@ bytes_opt user_function::execute(std::span<const bytes_opt> parameters) {
const bytes_opt& bytes = parameters[i];
values.push_back(bytes ? type->deserialize(*bytes) : data_value::make_null(type));
}
return lua::run_script(lua::bitcode_view{ctx.bitcode}, values, return_type(), ctx.cfg).get0();
return lua::run_script(lua::bitcode_view{ctx.bitcode}, values, return_type(), ctx.cfg).get();
},
[&] (wasm::context& ctx) -> bytes_opt {
try {
return wasm::run_script(name(), ctx, arg_types(), parameters, return_type(), _called_on_null_input).get0();
return wasm::run_script(name(), ctx, arg_types(), parameters, return_type(), _called_on_null_input).get();
} catch (const wasm::exception& e) {
throw exceptions::invalid_request_exception(format("UDF error: {}", e.what()));
}

View File

@@ -74,10 +74,10 @@ future<> create_role_statement::check_access(query_processor& qp, const service:
state.ensure_not_anonymous();
return async([this, &state] {
state.ensure_has_permission({auth::permission::CREATE, auth::root_role_resource()}).get0();
state.ensure_has_permission({auth::permission::CREATE, auth::root_role_resource()}).get();
if (*_options.is_superuser) {
if (!auth::has_superuser(*state.get_auth_service(), *state.user()).get0()) {
if (!auth::has_superuser(*state.get_auth_service(), *state.user()).get()) {
throw exceptions::unauthorized_exception("Only superusers can create a role with superuser status.");
}
}
@@ -132,7 +132,7 @@ future<> alter_role_statement::check_access(query_processor& qp, const service::
auto& as = *state.get_auth_service();
const auto& user = *state.user();
const bool user_is_superuser = auth::has_superuser(as, user).get0();
const bool user_is_superuser = auth::has_superuser(as, user).get();
if (_options.is_superuser) {
if (!user_is_superuser) {
@@ -140,7 +140,7 @@ future<> alter_role_statement::check_access(query_processor& qp, const service::
}
try {
if (auth::has_role(as, user, _role).get0()) {
if (auth::has_role(as, user, _role).get()) {
throw exceptions::unauthorized_exception(
"You aren't allowed to alter your own superuser status or that of a role granted to you.");
}
@@ -150,7 +150,7 @@ future<> alter_role_statement::check_access(query_processor& qp, const service::
}
if (*user.name != _role) {
state.ensure_has_permission({auth::permission::ALTER, auth::make_role_resource(_role)}).get0();
state.ensure_has_permission({auth::permission::ALTER, auth::make_role_resource(_role)}).get();
} else {
const auto alterable_options = state.get_auth_service()->underlying_authenticator().alterable_options();
@@ -212,15 +212,15 @@ future<> drop_role_statement::check_access(query_processor& qp, const service::c
state.ensure_not_anonymous();
return async([this, &state] {
state.ensure_has_permission({auth::permission::DROP, auth::make_role_resource(_role)}).get0();
state.ensure_has_permission({auth::permission::DROP, auth::make_role_resource(_role)}).get();
auto& as = *state.get_auth_service();
const bool user_is_superuser = auth::has_superuser(as, *state.user()).get0();
const bool user_is_superuser = auth::has_superuser(as, *state.user()).get();
const bool role_has_superuser = [this, &as] {
try {
return as.has_superuser(_role).get0();
return as.has_superuser(_role).get();
} catch (const auth::nonexistant_role&) {
// Handled as part of `execute`.
return false;
@@ -261,7 +261,7 @@ future<> list_roles_statement::check_access(query_processor& qp, const service::
state.ensure_not_anonymous();
return async([this, &state] {
if (state.check_has_permission({auth::permission::DESCRIBE, auth::root_role_resource()}).get0()) {
if (state.check_has_permission({auth::permission::DESCRIBE, auth::root_role_resource()}).get()) {
return;
}
@@ -271,7 +271,7 @@ future<> list_roles_statement::check_access(query_processor& qp, const service::
const auto user_has_grantee = [this, &state] {
try {
return auth::has_role(*state.get_auth_service(), *state.user(), *_grantee).get0();
return auth::has_role(*state.get_auth_service(), *state.user(), *_grantee).get();
} catch (const auth::nonexistant_role& e) {
throw exceptions::invalid_request_exception(e.what());
}

View File

@@ -442,7 +442,7 @@ void hint_sender::rewind_sent_replay_position_to(db::replay_position rp) {
// runs in a seastar::async context
bool hint_sender::send_one_file(const sstring& fname) {
timespec last_mod = get_last_file_modification(fname).get0();
timespec last_mod = get_last_file_modification(fname).get();
gc_clock::duration secs_since_file_mod = std::chrono::seconds(last_mod.tv_sec);
lw_shared_ptr<send_one_file_ctx> ctx_ptr = make_lw_shared<send_one_file_ctx>(_last_schema_ver_to_column_mapping);
@@ -514,7 +514,7 @@ bool hint_sender::send_one_file(const sstring& fname) {
// If we got here we are done with the current segment and we can remove it.
with_shared(_file_update_mutex, [&fname, this] {
auto p = _ep_manager.get_or_load().get0();
auto p = _ep_manager.get_or_load().get();
return p->delete_segments({ fname });
}).get();

View File

@@ -35,7 +35,7 @@ future<bool> is_mountpoint(const fs::path& path) {
return make_ready_future<bool>(true);
}
return when_all(get_device_id(path), get_device_id(path.parent_path())).then([](std::tuple<future<dev_t>, future<dev_t>> ids) {
return std::get<0>(ids).get0() != std::get<1>(ids).get0();
return std::get<0>(ids).get() != std::get<1>(ids).get();
});
}

View File

@@ -138,10 +138,10 @@ public:
db::schema_tables::legacy::read_table_mutations(_sp, dst.name, cf_name, db::system_keyspace::legacy::column_families()))
.then([&dst, cf_name, timestamp](result_tuple&& t) {
result_set_type tables = std::get<0>(t).get0();
result_set_type columns = std::get<1>(t).get0();
result_set_type triggers = std::get<2>(t).get0();
db::schema_tables::legacy::schema_mutations sm = std::get<3>(t).get0();
result_set_type tables = std::get<0>(t).get();
result_set_type columns = std::get<1>(t).get();
result_set_type triggers = std::get<2>(t).get();
db::schema_tables::legacy::schema_mutations sm = std::get<3>(t).get();
row_type& td = tables->one();

View File

@@ -1191,8 +1191,8 @@ future<> view_update_builder::close() noexcept {
future<stop_iteration> view_update_builder::advance_all() {
auto existings_f = _existings ? (*_existings)() : make_ready_future<mutation_fragment_v2_opt>();
return when_all(_updates(), std::move(existings_f)).then([this] (auto&& fragments) mutable {
_update = std::move(std::get<0>(fragments).get0());
_existing = std::move(std::get<1>(fragments).get0());
_update = std::move(std::get<0>(fragments).get());
_existing = std::move(std::get<1>(fragments).get());
return stop_iteration::no;
});
}
@@ -1819,12 +1819,12 @@ future<> view_builder::start(service::migration_manager& mm) {
// Guard the whole startup routine with a semaphore,
// so that it's not intercepted by `on_drop_view`, `on_create_view`
// or `on_update_view` events.
auto units = get_units(_sem, 1).get0();
auto units = get_units(_sem, 1).get();
// Wait for schema agreement even if we're a seed node.
mm.wait_for_schema_agreement(_db, db::timeout_clock::time_point::max(), &_as).get();
auto built = _sys_ks.load_built_views().get0();
auto in_progress = _sys_ks.load_view_build_progress().get0();
auto built = _sys_ks.load_built_views().get();
auto in_progress = _sys_ks.load_view_build_progress().get();
setup_shard_build_step(vbi, std::move(built), std::move(in_progress));
}).then_wrapped([this] (future<>&& f) {
// All shards need to arrive at the same decisions on whether or not to
@@ -2249,7 +2249,7 @@ future<> view_builder::do_build_step() {
return seastar::async([this] {
exponential_backoff_retry r(1s, 1min);
while (!_base_to_build_step.empty() && !_as.abort_requested()) {
auto units = get_units(_sem, 1).get0();
auto units = get_units(_sem, 1).get();
++_stats.steps_performed;
try {
execute(_current_step->second, exponential_backoff_retry(1s, 1min));
@@ -2701,7 +2701,7 @@ void delete_ghost_rows_visitor::accept_new_row(const clustering_key& ck, const q
_proxy.get_max_result_size(partition_slice), query::tombstone_limit(_proxy.get_tombstone_limit()));
auto timeout = db::timeout_clock::now() + _timeout_duration;
service::storage_proxy::coordinator_query_options opts{timeout, _state.get_permit(), _state.get_client_state(), _state.get_trace_state()};
auto base_qr = _proxy.query(_base_schema, command, std::move(partition_ranges), db::consistency_level::ALL, opts).get0();
auto base_qr = _proxy.query(_base_schema, command, std::move(partition_ranges), db::consistency_level::ALL, opts).get();
query::result& result = *base_qr.query_result;
if (result.row_count().value_or(0) == 0) {
mutation m(_view, *_view_pk);

View File

@@ -147,7 +147,7 @@ future<> view_update_generator::start() {
vug_logger.info("Processing {}.{}: {} in {} sstables",
s->ks_name(), s->cf_name(), utils::pretty_printed_data_size(input_size), sstables.size());
auto permit = _db.obtain_reader_permit(*t, "view_update_generator", db::no_timeout, {}).get0();
auto permit = _db.obtain_reader_permit(*t, "view_update_generator", db::no_timeout, {}).get();
auto ms = mutation_source([this, ssts] (
schema_ptr s,
reader_permit permit,

View File

@@ -82,7 +82,7 @@ std::unordered_map<dht::token_range, std::vector<inet_address>>
range_streamer::get_all_ranges_with_sources_for(const sstring& keyspace_name, locator::vnode_effective_replication_map_ptr erm, dht::token_range_vector desired_ranges) {
logger.debug("{} ks={}", __func__, keyspace_name);
auto range_addresses = erm->get_range_addresses().get0();
auto range_addresses = erm->get_range_addresses().get();
logger.debug("keyspace={}, desired_ranges.size={}, range_addresses.size={}", keyspace_name, desired_ranges.size(), range_addresses.size());
@@ -122,13 +122,13 @@ range_streamer::get_all_ranges_with_strict_sources_for(const sstring& keyspace_n
auto& strat = erm->get_replication_strategy();
//Active ranges
auto metadata_clone = get_token_metadata().clone_only_token_map().get0();
auto range_addresses = strat.get_range_addresses(metadata_clone).get0();
auto metadata_clone = get_token_metadata().clone_only_token_map().get();
auto range_addresses = strat.get_range_addresses(metadata_clone).get();
//Pending ranges
metadata_clone.update_topology(_address, _dr);
metadata_clone.update_normal_tokens(_tokens, _address).get();
auto pending_range_addresses = strat.get_range_addresses(metadata_clone).get0();
auto pending_range_addresses = strat.get_range_addresses(metadata_clone).get();
metadata_clone.clear_gently().get();
//Collects the source that will have its range moved to the new node

View File

@@ -185,7 +185,7 @@ future<> server::do_accepts(int which, bool keepalive, socket_address server_add
maybe_stop();
return stop_iteration::yes;
}
auto cs_sa = f_cs_sa.get0();
auto cs_sa = f_cs_sa.get();
auto fd = std::move(cs_sa.connection);
auto addr = std::move(cs_sa.remote_address);
fd.set_nodelay(true);

View File

@@ -19,7 +19,7 @@ logging::logger startlog("init");
std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg, gms::inet_address broadcast_address) {
auto preferred = cfg.listen_interface_prefer_ipv6() ? std::make_optional(net::inet_address::family::INET6) : std::nullopt;
auto family = cfg.enable_ipv6_dns_lookup() || preferred ? std::nullopt : std::make_optional(net::inet_address::family::INET);
const auto listen = gms::inet_address::lookup(cfg.listen_address(), family).get0();
const auto listen = gms::inet_address::lookup(cfg.listen_address(), family).get();
auto seed_provider = cfg.seed_provider();
std::set<gms::inet_address> seeds;
@@ -30,7 +30,7 @@ std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg, gms:
while (begin < seeds_str.length() && begin != (next=seeds_str.find(",",begin))) {
auto seed = boost::trim_copy(seeds_str.substr(begin,next-begin));
try {
seeds.emplace(gms::inet_address::lookup(seed, family, preferred).get0());
seeds.emplace(gms::inet_address::lookup(seed, family, preferred).get());
} catch (...) {
startlog.error("Bad configuration: invalid value in 'seeds': '{}': {}", seed, std::current_exception());
throw bad_configuration_error();

View File

@@ -333,8 +333,8 @@ seastar::future<bytes_opt> run_script(const db::functions::function_name& name,
std::exception_ptr ex;
bytes_opt ret;
try {
func_inst = ctx.cache.get(name, arg_types, ctx).get0();
ret = wasm::run_script(ctx, *func_inst->instance->store, *func_inst->instance->instance, *func_inst->instance->func, arg_types, params, return_type, allow_null_input).get0();
func_inst = ctx.cache.get(name, arg_types, ctx).get();
ret = wasm::run_script(ctx, *func_inst->instance->store, *func_inst->instance->instance, *func_inst->instance->func, arg_types, params, return_type, allow_null_input).get();
} catch (const wasm::instance_corrupting_exception& e) {
func_inst->instance = std::nullopt;
ex = std::current_exception();

View File

@@ -69,8 +69,8 @@ future<sstring> azure_snitch::azure_api_call(sstring path) {
return seastar::async([path = std::move(path)] () -> sstring {
using namespace boost::algorithm;
net::inet_address a = seastar::net::dns::resolve_name(AZURE_SERVER_ADDR, net::inet_address::family::INET).get0();
connected_socket sd(connect(socket_address(a, 80)).get0());
net::inet_address a = seastar::net::dns::resolve_name(AZURE_SERVER_ADDR, net::inet_address::family::INET).get();
connected_socket sd(connect(socket_address(a, 80)).get());
input_stream<char> in(sd.input());
output_stream<char> out(sd.output());
auto close_in = deferred_close(in);
@@ -102,7 +102,7 @@ future<sstring> azure_snitch::azure_api_call(sstring path) {
auto content_len = std::stoi(it->second);
// Read HTTP response body
temporary_buffer<char> buf = in.read_exactly(content_len).get0();
temporary_buffer<char> buf = in.read_exactly(content_len).get();
return sstring(buf.get(), buf.size());
});

View File

@@ -83,8 +83,8 @@ future<sstring> gce_snitch::gce_api_call(sstring addr, sstring cmd) {
return seastar::async([addr = std::move(addr), cmd = std::move(cmd)] () -> sstring {
using namespace boost::algorithm;
net::inet_address a = seastar::net::dns::resolve_name(addr, net::inet_address::family::INET).get0();
connected_socket sd(connect(socket_address(a, 80)).get0());
net::inet_address a = seastar::net::dns::resolve_name(addr, net::inet_address::family::INET).get();
connected_socket sd(connect(socket_address(a, 80)).get());
input_stream<char> in(sd.input());
output_stream<char> out(sd.output());
auto close_in = deferred_close(in);
@@ -116,7 +116,7 @@ future<sstring> gce_snitch::gce_api_call(sstring addr, sstring cmd) {
auto content_len = std::stoi(it->second);
// Read HTTP response body
temporary_buffer<char> buf = in.read_exactly(content_len).get0();
temporary_buffer<char> buf = in.read_exactly(content_len).get();
sstring res(buf.get(), buf.size());
std::vector<std::string> splits;

View File

@@ -24,7 +24,7 @@ future<bool> gossiping_property_file_snitch::property_file_was_modified() {
});
}).then_wrapped([this] (auto&& f) {
try {
auto st = f.get0();
auto st = f.get();
if (!_last_file_mod ||
_last_file_mod->tv_sec != st.st_mtim.tv_sec) {

40
main.cc
View File

@@ -541,7 +541,7 @@ static locator::host_id initialize_local_info_thread(sharded<db::system_keyspace
gms::inet_address broadcast_address,
gms::inet_address broadcast_rpc_address)
{
auto linfo = sys_ks.local().load_local_info().get0();
auto linfo = sys_ks.local().load_local_info().get();
if (linfo.cluster_name.empty()) {
linfo.cluster_name = cfg.cluster_name();
} else if (linfo.cluster_name != cfg.cluster_name()) {
@@ -717,7 +717,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
#endif
auto notify_set = configurable::init_all(opts, *cfg, *ext, service_set(
db, ss, mm, proxy, feature_service, messaging, qp, bm
)).get0();
)).get();
auto stop_configurables = defer_verbose_shutdown("configurables", [&] {
notify_set.notify_all(configurable::system_state::stopped).get();
@@ -791,7 +791,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
schema::set_default_partitioner(cfg->partitioner(), cfg->murmur3_partitioner_ignore_msb_bits());
auto make_sched_group = [&] (sstring name, sstring short_name, unsigned shares) {
if (cfg->cpu_scheduler()) {
return seastar::create_scheduling_group(name, short_name, shares).get0();
return seastar::create_scheduling_group(name, short_name, shares).get();
} else {
return seastar::scheduling_group();
}
@@ -828,8 +828,8 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
auto preferred = cfg->listen_interface_prefer_ipv6() ? std::make_optional(net::inet_address::family::INET6) : std::nullopt;
auto family = cfg->enable_ipv6_dns_lookup() || preferred ? std::nullopt : std::make_optional(net::inet_address::family::INET);
auto broadcast_addr = utils::resolve(cfg->broadcast_address || cfg->listen_address, family, preferred).get0();
auto broadcast_rpc_addr = utils::resolve(cfg->broadcast_rpc_address || cfg->rpc_address, family, preferred).get0();
auto broadcast_addr = utils::resolve(cfg->broadcast_address || cfg->listen_address, family, preferred).get();
auto broadcast_rpc_addr = utils::resolve(cfg->broadcast_rpc_address || cfg->rpc_address, family, preferred).get();
ctx.api_dir = cfg->api_ui_dir();
if (!ctx.api_dir.empty() && ctx.api_dir.back() != '/') {
@@ -843,7 +843,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
}
const auto hinted_handoff_enabled = cfg->hinted_handoff_enabled();
auto api_addr = utils::resolve(cfg->api_address || cfg->rpc_address, family, preferred).get0();
auto api_addr = utils::resolve(cfg->api_address || cfg->rpc_address, family, preferred).get();
supervisor::notify("starting API server");
ctx.http_server.start("API").get();
auto stop_http_server = defer_verbose_shutdown("API server", [&ctx] {
@@ -859,7 +859,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
prometheus_server.stop().get();
});
auto ip = utils::resolve(cfg->prometheus_address || cfg->listen_address, family, preferred).get0();
auto ip = utils::resolve(cfg->prometheus_address || cfg->listen_address, family, preferred).get();
prometheus::config pctx;
pctx.metric_help = "Scylla server statistics";
@@ -890,7 +890,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
debug::the_snitch = &snitch;
snitch_config snitch_cfg;
snitch_cfg.name = cfg->endpoint_snitch();
snitch_cfg.listen_address = utils::resolve(cfg->listen_address, family).get0();
snitch_cfg.listen_address = utils::resolve(cfg->listen_address, family).get();
snitch_cfg.broadcast_address = broadcast_addr;
snitch.start(snitch_cfg).get();
auto stop_snitch = defer_verbose_shutdown("snitch", [&snitch] {
@@ -1086,11 +1086,11 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
smp_service_group_config storage_proxy_smp_service_group_config;
// Assuming less than 1kB per queued request, this limits storage_proxy submit_to() queues to 5MB or less
storage_proxy_smp_service_group_config.max_nonlocal_requests = 5000;
spcfg.read_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get0();
spcfg.write_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get0();
spcfg.write_mv_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get0();
spcfg.hints_write_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get0();
spcfg.write_ack_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get0();
spcfg.read_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get();
spcfg.write_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get();
spcfg.write_mv_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get();
spcfg.hints_write_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get();
spcfg.write_ack_smp_service_group = create_smp_service_group(storage_proxy_smp_service_group_config).get();
static db::view::node_update_backlog node_backlog(smp::count, 10ms);
scheduling_group_key_config storage_proxy_stats_cfg =
make_scheduling_group_key_config<service::storage_proxy_stats::stats>();
@@ -1104,7 +1104,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
reinterpret_cast<service::storage_proxy_stats::stats*>(ptr)->register_split_metrics_local();
};
proxy.start(std::ref(db), spcfg, std::ref(node_backlog),
scheduling_group_key_create(storage_proxy_stats_cfg).get0(),
scheduling_group_key_create(storage_proxy_stats_cfg).get(),
std::ref(feature_service), std::ref(token_metadata), std::ref(erm_factory)).get();
// #293 - do not stop anything
@@ -1215,7 +1215,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
auto paths = sch_cl->get_segments_to_replay().get();
if (!paths.empty()) {
supervisor::notify("replaying schema commit log");
auto rp = db::commitlog_replayer::create_replayer(db, sys_ks).get0();
auto rp = db::commitlog_replayer::create_replayer(db, sys_ks).get();
rp.recover(paths, db::schema_tables::COMMITLOG_FILENAME_PREFIX).get();
supervisor::notify("replaying schema commit log - flushing memtables");
// The schema commitlog lives only on the null shard.
@@ -1232,7 +1232,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
sys_ks.local().build_bootstrap_info().get();
const auto listen_address = utils::resolve(cfg->listen_address, family).get0();
const auto listen_address = utils::resolve(cfg->listen_address, family).get();
const auto host_id = initialize_local_info_thread(sys_ks, snitch, listen_address, *cfg, broadcast_addr, broadcast_rpc_addr);
shared_token_metadata::mutate_on_all_shards(token_metadata, [host_id, endpoint = broadcast_addr] (locator::token_metadata& tm) {
@@ -1254,7 +1254,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
mscfg.listen_on_broadcast_address = cfg->listen_on_broadcast_address();
mscfg.rpc_memory_limit = std::max<size_t>(0.08 * memory::stats().total_memory(), mscfg.rpc_memory_limit);
if (snitch.local()->prefer_local()) {
mscfg.preferred_ips = sys_ks.local().get_preferred_ips().get0();
mscfg.preferred_ips = sys_ks.local().get_preferred_ips().get();
}
mscfg.maintenance_mode = maintenance_mode_enabled{cfg->maintenance_mode()};
@@ -1518,7 +1518,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
auto paths = cl->get_segments_to_replay().get();
if (!paths.empty()) {
supervisor::notify("replaying commit log");
auto rp = db::commitlog_replayer::create_replayer(db, sys_ks).get0();
auto rp = db::commitlog_replayer::create_replayer(db, sys_ks).get();
rp.recover(paths, db::commitlog::descriptor::FILENAME_PREFIX).get();
supervisor::notify("replaying commit log - flushing memtables");
db.invoke_on_all(&replica::database::flush_all_memtables).get();
@@ -1712,7 +1712,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
scheduling_group_key_config maintenance_cql_sg_stats_cfg =
make_scheduling_group_key_config<cql_transport::cql_sg_stats>(maintenance_socket_enabled::yes);
cql_transport::controller cql_maintenance_server_ctl(maintenance_auth_service, mm_notifier, gossiper, qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg, scheduling_group_key_create(maintenance_cql_sg_stats_cfg).get0(), maintenance_socket_enabled::yes);
cql_transport::controller cql_maintenance_server_ctl(maintenance_auth_service, mm_notifier, gossiper, qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg, scheduling_group_key_create(maintenance_cql_sg_stats_cfg).get(), maintenance_socket_enabled::yes);
std::any stop_maintenance_auth_service;
std::any stop_maintenance_cql;
@@ -1924,7 +1924,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
notify_set.notify_all(configurable::system_state::started).get();
scheduling_group_key_config cql_sg_stats_cfg = make_scheduling_group_key_config<cql_transport::cql_sg_stats>(maintenance_socket_enabled::no);
cql_transport::controller cql_server_ctl(auth_service, mm_notifier, gossiper, qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg, scheduling_group_key_create(cql_sg_stats_cfg).get0(), maintenance_socket_enabled::no);
cql_transport::controller cql_server_ctl(auth_service, mm_notifier, gossiper, qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg, scheduling_group_key_create(cql_sg_stats_cfg).get(), maintenance_socket_enabled::no);
ss.local().register_protocol_server(cql_server_ctl);

View File

@@ -1001,7 +1001,7 @@ messaging_service::make_sink_and_source_for_stream_mutation_fragments(table_sche
auto rpc_handler = rpc()->make_client<rpc::source<int32_t> (streaming::plan_id, table_schema_version, table_id, uint64_t, streaming::stream_reason, service::session_id, rpc::sink<frozen_mutation_fragment, streaming::stream_mutation_fragments_cmd>)>(messaging_verb::STREAM_MUTATION_FRAGMENTS);
return rpc_handler(*rpc_client , plan_id, schema_id, cf_id, estimated_partitions, reason, session, sink).then_wrapped([sink, rpc_client] (future<rpc::source<int32_t>> source) mutable {
return (source.failed() ? sink.close() : make_ready_future<>()).then([sink = std::move(sink), source = std::move(source)] () mutable {
return make_ready_future<value_type>(value_type(std::move(sink), source.get0()));
return make_ready_future<value_type>(value_type(std::move(sink), source.get()));
});
});
});
@@ -1031,7 +1031,7 @@ do_make_sink_source(messaging_verb verb, uint32_t repair_meta_id, shard_id dst_s
}
co_return coroutine::exception(std::move(ex));
}
co_return value_type(std::move(sink), std::move(source_fut.get0()));
co_return value_type(std::move(sink), std::move(source_fut.get()));
}
// Wrapper for REPAIR_GET_ROW_DIFF_WITH_RPC_STREAM

View File

@@ -726,7 +726,7 @@ future<page_consume_result<ResultBuilder>> read_page(
cmd.partition_limit, cmd.timestamp));
if (!f.failed()) {
// no exceptions are thrown in this block
auto result = std::move(f).get0();
auto result = std::move(f).get();
const auto& cstats = compaction_state->stats();
tracing::trace(trace_state, "Page stats: {} partition(s), {} static row(s) ({} live, {} dead), {} clustering row(s) ({} live, {} dead) and {} range tombstone(s)",
cstats.partitions,
@@ -775,7 +775,7 @@ future<typename ResultBuilder::result_type> do_query(
if (f.failed()) {
co_return coroutine::exception(f.get_exception());
}
co_return f.get0();
co_return f.get();
}
template <typename ResultBuilder>

View File

@@ -23,7 +23,7 @@
// T val{};
// using traits = noexcept_movable<T>;
// auto f = make_ready_future<typename traits::type>(traits::wrap(std::move(val)));
// T val2 = traits::unwrap(f.get0());
// T val2 = traits::unwrap(f.get());
//
template<typename T>

View File

@@ -248,7 +248,7 @@ public:
auto do_stop = futurize_invoke([&consumer, mf = std::move(mf)] () mutable {
return consumer(std::move(mf));
});
if (do_stop.get0()) {
if (do_stop.get()) {
return;
}
}

View File

@@ -1545,7 +1545,7 @@ future<> repair_service::bootstrap_with_repair(locator::token_metadata_ptr tmptr
continue;
}
auto& strat = erm->get_replication_strategy();
dht::token_range_vector desired_ranges = strat.get_pending_address_ranges(tmptr, tokens, myid, myloc).get0();
dht::token_range_vector desired_ranges = strat.get_pending_address_ranges(tmptr, tokens, myid, myloc).get();
seastar::thread::maybe_yield();
auto nr_tables = get_nr_tables(db, keyspace_name);
nr_ranges_total += desired_ranges.size() * nr_tables;
@@ -1561,19 +1561,19 @@ future<> repair_service::bootstrap_with_repair(locator::token_metadata_ptr tmptr
continue;
}
auto& strat = erm->get_replication_strategy();
dht::token_range_vector desired_ranges = strat.get_pending_address_ranges(tmptr, tokens, myid, myloc).get0();
dht::token_range_vector desired_ranges = strat.get_pending_address_ranges(tmptr, tokens, myid, myloc).get();
bool find_node_in_local_dc_only = strat.get_type() == locator::replication_strategy_type::network_topology;
bool everywhere_topology = strat.get_type() == locator::replication_strategy_type::everywhere_topology;
auto replication_factor = erm->get_replication_factor();
//Active ranges
auto metadata_clone = tmptr->clone_only_token_map().get0();
auto range_addresses = strat.get_range_addresses(metadata_clone).get0();
auto metadata_clone = tmptr->clone_only_token_map().get();
auto range_addresses = strat.get_range_addresses(metadata_clone).get();
//Pending ranges
metadata_clone.update_topology(myid, myloc, locator::node::state::bootstrapping);
metadata_clone.update_normal_tokens(tokens, myid).get();
auto pending_range_addresses = strat.get_range_addresses(metadata_clone).get0();
auto pending_range_addresses = strat.get_range_addresses(metadata_clone).get();
metadata_clone.clear_gently().get();
//Collects the source that will have its range moved to the new node
@@ -1756,11 +1756,11 @@ future<> repair_service::do_decommission_removenode_with_repair(locator::token_m
// Find (for each range) all nodes that store replicas for these ranges as well
for (auto& r : ranges) {
auto end_token = r.end() ? r.end()->value() : dht::maximum_token();
auto eps = strat.calculate_natural_ips(end_token, *tmptr).get0();
auto eps = strat.calculate_natural_ips(end_token, *tmptr).get();
current_replica_endpoints.emplace(r, std::move(eps));
seastar::thread::maybe_yield();
}
auto temp = tmptr->clone_after_all_left().get0();
auto temp = tmptr->clone_after_all_left().get();
// leaving_node might or might not be 'leaving'. If it was not leaving (that is, removenode
// command was used), it is still present in temp and must be removed.
if (temp.is_normal_token_owner(leaving_node_id)) {
@@ -1775,7 +1775,7 @@ future<> repair_service::do_decommission_removenode_with_repair(locator::token_m
ops->check_abort();
}
auto end_token = r.end() ? r.end()->value() : dht::maximum_token();
const auto new_eps = strat.calculate_natural_ips(end_token, temp).get0();
const auto new_eps = strat.calculate_natural_ips(end_token, temp).get();
const auto& current_eps = current_replica_endpoints[r];
std::unordered_set<inet_address> neighbors_set = new_eps.get_set();
bool skip_this_range = false;
@@ -1934,7 +1934,7 @@ future<> repair_service::do_rebuild_replace_with_repair(locator::token_metadata_
}
auto& strat = erm->get_replication_strategy();
// Okay to yield since tm is immutable
dht::token_range_vector ranges = strat.get_ranges(myid, tmptr).get0();
dht::token_range_vector ranges = strat.get_ranges(myid, tmptr).get();
auto nr_tables = get_nr_tables(db, keyspace_name);
nr_ranges_total += ranges.size() * nr_tables;
@@ -1958,7 +1958,7 @@ future<> repair_service::do_rebuild_replace_with_repair(locator::token_metadata_
continue;
}
auto& strat = erm->get_replication_strategy();
dht::token_range_vector ranges = strat.get_ranges(myid, *tmptr).get0();
dht::token_range_vector ranges = strat.get_ranges(myid, *tmptr).get();
auto& topology = erm->get_token_metadata().get_topology();
std::unordered_map<dht::token_range, repair_neighbors> range_sources;
auto nr_tables = get_nr_tables(db, keyspace_name);
@@ -1967,7 +1967,7 @@ future<> repair_service::do_rebuild_replace_with_repair(locator::token_metadata_
auto& r = *it;
seastar::thread::maybe_yield();
auto end_token = r.end() ? r.end()->value() : dht::maximum_token();
auto neighbors = boost::copy_range<std::vector<gms::inet_address>>(strat.calculate_natural_ips(end_token, *tmptr).get0() |
auto neighbors = boost::copy_range<std::vector<gms::inet_address>>(strat.calculate_natural_ips(end_token, *tmptr).get() |
boost::adaptors::filtered([myip, &source_dc, &topology, &ignore_nodes] (const gms::inet_address& node) {
if (node == myip) {
return false;

View File

@@ -360,7 +360,7 @@ repair_reader::read_mutation_fragment() {
_reader.set_timeout(timeout); // reset to db::no_timeout in pause()
return _reader().then_wrapped([this] (future<mutation_fragment_opt> f) {
try {
auto mfopt = f.get0();
auto mfopt = f.get();
++_reads_finished;
return mfopt;
} catch (seastar::timed_out_error& e) {
@@ -693,7 +693,7 @@ void flush_rows(schema_ptr s, std::list<repair_row>& rows, lw_shared_ptr<repair_
const auto& dk = r.get_dk_with_hash()->dk;
if (do_small_table_optimization) {
// Check if the token is owned by the node
auto eps = strat->calculate_natural_ips(dk.token(), *tm).get0();
auto eps = strat->calculate_natural_ips(dk.token(), *tm).get();
if (!eps.contains(myip)) {
rlogger.trace("master: ignore row, token={}", dk.token());
continue;
@@ -1384,8 +1384,8 @@ private:
if (rows.empty()) {
return;
}
auto row_diff = to_repair_rows_list(std::move(rows), _schema, _seed, _repair_master, _permit, _repair_hasher).get0();
auto sz = get_repair_rows_size(row_diff).get0();
auto row_diff = to_repair_rows_list(std::move(rows), _schema, _seed, _repair_master, _permit, _repair_hasher).get();
auto sz = get_repair_rows_size(row_diff).get();
stats().rx_row_bytes += sz;
stats().rx_row_nr += row_diff.size();
stats().rx_row_nr_peer[from] += row_diff.size();
@@ -1713,7 +1713,7 @@ public:
}
stats().rpc_call_nr++;
repair_rows_on_wire rows = _messaging.send_repair_get_row_diff(msg_addr(remote_node),
_repair_meta_id, std::move(set_diff), bool(needs_all_rows), dst_cpu_id).get0();
_repair_meta_id, std::move(set_diff), bool(needs_all_rows), dst_cpu_id).get();
if (!rows.empty()) {
apply_rows_on_master_in_thread(std::move(rows), remote_node, update_working_row_buf::yes, update_peer_row_hash_sets::no, node_idx);
}
@@ -1727,7 +1727,7 @@ public:
}
stats().rpc_call_nr++;
repair_rows_on_wire rows = _messaging.send_repair_get_row_diff(msg_addr(remote_node),
_repair_meta_id, {}, bool(needs_all_rows_t::yes), dst_cpu_id).get0();
_repair_meta_id, {}, bool(needs_all_rows_t::yes), dst_cpu_id).get();
if (!rows.empty()) {
apply_rows_on_master_in_thread(std::move(rows), remote_node, update_working_row_buf::yes, update_peer_row_hash_sets::yes, node_idx);
}
@@ -1743,7 +1743,7 @@ private:
rpc::source<repair_row_on_wire_with_cmd>& source) {
repair_rows_on_wire current_rows;
for (;;) {
std::optional<std::tuple<repair_row_on_wire_with_cmd>> row_opt = source().get0();
std::optional<std::tuple<repair_row_on_wire_with_cmd>> row_opt = source().get();
if (row_opt) {
if (inject_rpc_stream_error) {
throw std::runtime_error("get_row_diff: Inject sender error in source loop");
@@ -1817,7 +1817,7 @@ public:
_metrics.tx_hashes_nr += set_diff.size();
}
stats().rpc_call_nr++;
auto f = _sink_source_for_get_row_diff.get_sink_source(remote_node, node_idx, dst_cpu_id).get0();
auto f = _sink_source_for_get_row_diff.get_sink_source(remote_node, node_idx, dst_cpu_id).get();
rpc::sink<repair_hash_with_cmd>& sink = std::get<0>(f);
rpc::source<repair_row_on_wire_with_cmd>& source = std::get<1>(f);
auto sink_op = get_row_diff_sink_op(std::move(set_diff), needs_all_rows, sink, remote_node);
@@ -2782,7 +2782,7 @@ private:
// local node and peer node have the same combined hash. This
// means we can set peer_row_hash_sets[n] to local row hashes
// without fetching it from peers to save network traffic.
master.peer_row_hash_sets(node_idx) = master.working_row_hashes().get0();
master.peer_row_hash_sets(node_idx) = master.working_row_hashes().get();
rlogger.debug("Calling optimize master.working_row_hashes for node {}, hash_sets={}",
node, master.peer_row_hash_sets(node_idx).size());
continue;
@@ -2810,11 +2810,11 @@ private:
// Ask the peer to send the full list hashes in the working row buf.
if (master.use_rpc_stream()) {
ns.state = repair_state::get_full_row_hashes_with_rpc_stream_started;
master.peer_row_hash_sets(node_idx) = master.get_full_row_hashes_with_rpc_stream(node, node_idx, dst_cpu_id).get0();
master.peer_row_hash_sets(node_idx) = master.get_full_row_hashes_with_rpc_stream(node, node_idx, dst_cpu_id).get();
ns.state = repair_state::get_full_row_hashes_with_rpc_stream_finished;
} else {
ns.state = repair_state::get_full_row_hashes_started;
master.peer_row_hash_sets(node_idx) = master.get_full_row_hashes(node, dst_cpu_id).get0();
master.peer_row_hash_sets(node_idx) = master.get_full_row_hashes(node, dst_cpu_id).get();
ns.state = repair_state::get_full_row_hashes_finished;
}
rlogger.debug("After master.get_full_row_hashes for node {}, hash_sets={}",
@@ -2827,10 +2827,10 @@ private:
// sequentially because the rows from repair follower 1 to
// repair master might reduce the amount of missing data
// between repair master and repair follower 2.
repair_hash_set set_diff = get_set_diff(master.peer_row_hash_sets(node_idx), master.working_row_hashes().get0());
repair_hash_set set_diff = get_set_diff(master.peer_row_hash_sets(node_idx), master.working_row_hashes().get());
// Request missing sets from peer node
rlogger.debug("Before get_row_diff to node {}, local={}, peer={}, set_diff={}",
node, master.working_row_hashes().get0().size(), master.peer_row_hash_sets(node_idx).size(), set_diff.size());
node, master.working_row_hashes().get().size(), master.peer_row_hash_sets(node_idx).size(), set_diff.size());
// If we need to pull all rows from the peer. We can avoid
// sending the row hashes on wire by setting needs_all_rows flag.
auto needs_all_rows = repair_meta::needs_all_rows_t(set_diff.size() == master.peer_row_hash_sets(node_idx).size());
@@ -2843,7 +2843,7 @@ private:
master.get_row_diff(std::move(set_diff), needs_all_rows, node, node_idx, dst_cpu_id);
ns.state = repair_state::get_row_diff_finished;
}
rlogger.debug("After get_row_diff node {}, hash_sets={}", master.myip(), master.working_row_hashes().get0().size());
rlogger.debug("After get_row_diff node {}, hash_sets={}", master.myip(), master.working_row_hashes().get().size());
} catch (...) {
auto s = _cf.schema();
rlogger.warn("repair[{}]: get_row_diff: got error from node={}, keyspace={}, table={}, range={}, error={}",
@@ -2860,7 +2860,7 @@ private:
// At this time, repair master contains all the rows between (_last_sync_boundary, _current_sync_boundary]
// So we can figure out which rows peer node are missing and send the missing rows to them
_shard_task.check_in_abort_or_shutdown();
repair_hash_set local_row_hash_sets = master.working_row_hashes().get0();
repair_hash_set local_row_hash_sets = master.working_row_hashes().get();
auto sz = _all_live_peer_nodes.size();
std::vector<repair_hash_set> set_diffs(sz);
for (size_t idx : boost::irange(size_t(0), sz)) {
@@ -2949,7 +2949,7 @@ public:
future<> run() {
return seastar::async([this] {
_shard_task.check_in_abort_or_shutdown();
auto repair_meta_id = _shard_task.rs.get_next_repair_meta_id().get0();
auto repair_meta_id = _shard_task.rs.get_next_repair_meta_id().get();
auto algorithm = get_common_diff_detect_algorithm(_shard_task.messaging.local(), _all_live_peer_nodes);
auto max_row_buf_size = get_max_row_buf_size(algorithm);
auto& sharder = _cf.get_effective_replication_map()->get_sharder(*(_cf.schema()));
@@ -2968,11 +2968,11 @@ public:
wanted = std::min(max, wanted);
rlogger.trace("repair[{}]: Started to get memory budget, wanted={}, available={}, max_repair_memory={}",
_shard_task.global_repair_id.uuid(), wanted, mem_sem.current(), max);
auto mem_permit = seastar::get_units(mem_sem, wanted).get0();
auto mem_permit = seastar::get_units(mem_sem, wanted).get();
rlogger.trace("repair[{}]: Finished to get memory budget, wanted={}, available={}, max_repair_memory={}",
_shard_task.global_repair_id.uuid(), wanted, mem_sem.current(), max);
auto permit = _shard_task.db.local().obtain_reader_permit(_cf, "repair-meta", db::no_timeout, {}).get0();
auto permit = _shard_task.db.local().obtain_reader_permit(_cf, "repair-meta", db::no_timeout, {}).get();
auto compaction_time = gc_clock::now();

View File

@@ -823,7 +823,7 @@ void database::init_schema_commitlog() {
c.use_o_dsync = _cfg.commitlog_use_o_dsync();
c.allow_going_over_size_limit = true; // for lower latency
_schema_commitlog = std::make_unique<db::commitlog>(db::commitlog::create_commitlog(std::move(c)).get0());
_schema_commitlog = std::make_unique<db::commitlog>(db::commitlog::create_commitlog(std::move(c)).get());
_schema_commitlog->add_flush_handler([this] (db::cf_id_type id, db::replay_position pos) {
if (!_tables_metadata.contains(id)) {
// the CF has been removed.
@@ -2719,16 +2719,16 @@ future<> database::clear_snapshot(sstring tag, std::vector<sstring> keyspace_nam
auto data_dir_lister = directory_lister(data_dir, lister::dir_entry_types::of<directory_entry_type::directory>(), filter);
auto close_data_dir_lister = deferred_close(data_dir_lister);
dblog.debug("clear_snapshot: listing data dir {} with filter={}", data_dir, ks_names_set.empty() ? "none" : fmt::format("{}", ks_names_set));
while (auto ks_ent = data_dir_lister.get().get0()) {
while (auto ks_ent = data_dir_lister.get().get()) {
auto ks_name = ks_ent->name;
auto ks_dir = data_dir / ks_name;
auto ks_dir_lister = directory_lister(ks_dir, lister::dir_entry_types::of<directory_entry_type::directory>(), table_filter);
auto close_ks_dir_lister = deferred_close(ks_dir_lister);
dblog.debug("clear_snapshot: listing keyspace dir {} with filter={}", ks_dir, table_name_param.empty() ? "none" : fmt::format("{}", table_name_param));
while (auto table_ent = ks_dir_lister.get().get0()) {
while (auto table_ent = ks_dir_lister.get().get()) {
auto table_dir = ks_dir / table_ent->name;
auto snapshots_dir = table_dir / sstables::snapshots_dir;
auto has_snapshots = file_exists(snapshots_dir.native()).get0();
auto has_snapshots = file_exists(snapshots_dir.native()).get();
if (has_snapshots) {
if (tag.empty()) {
dblog.info("Removing {}", snapshots_dir);
@@ -2740,7 +2740,7 @@ future<> database::clear_snapshot(sstring tag, std::vector<sstring> keyspace_nam
auto close_snapshots_dir_lister = deferred_close(snapshots_dir_lister);
dblog.debug("clear_snapshot: listing snapshots dir {} with filter={}", snapshots_dir, tag);
has_snapshots = false; // unless other snapshots are found
while (auto snapshot_ent = snapshots_dir_lister.get().get0()) {
while (auto snapshot_ent = snapshots_dir_lister.get().get()) {
if (snapshot_ent->name == tag) {
auto snapshot_dir = snapshots_dir / snapshot_ent->name;
dblog.info("Removing {}", snapshot_dir);

View File

@@ -181,7 +181,7 @@ distributed_loader::process_upload_dir(distributed<replica::database>& db, distr
}
return seastar::async(std::move(attr), [&db, &view_update_generator, &sys_dist_ks, ks = std::move(ks), cf = std::move(cf)] {
auto global_table = get_table_on_all_shards(db, ks, cf).get0();
auto global_table = get_table_on_all_shards(db, ks, cf).get();
sharded<sstables::sstable_directory> directory;
directory.start(global_table.as_sharded_parameter(),
@@ -199,7 +199,7 @@ distributed_loader::process_upload_dir(distributed<replica::database>& db, distr
process_sstable_dir(directory, flags).get();
sharded<sstables::sstable_generation_generator> sharded_gen;
auto highest_generation = highest_generation_seen(directory).get0();
auto highest_generation = highest_generation_seen(directory).get();
sharded_gen.start(highest_generation ? highest_generation.as_int() : 0).get();
auto stop_generator = deferred_stop(sharded_gen);
@@ -229,11 +229,11 @@ distributed_loader::process_upload_dir(distributed<replica::database>& db, distr
[] (const sstables::shared_sstable&) { return true; }).get();
// Move to staging directory to avoid clashes with future uploads. Unique generation number ensures no collisions.
const bool use_view_update_path = db::view::check_needs_view_update_path(sys_dist_ks.local(), db.local().get_token_metadata(), *global_table, streaming::stream_reason::repair).get0();
const bool use_view_update_path = db::view::check_needs_view_update_path(sys_dist_ks.local(), db.local().get_token_metadata(), *global_table, streaming::stream_reason::repair).get();
size_t loaded = directory.map_reduce0([&db, ks, cf, use_view_update_path, &view_update_generator] (sstables::sstable_directory& dir) {
return make_sstables_available(dir, db, view_update_generator, use_view_update_path, ks, cf);
}, size_t(0), std::plus<size_t>()).get0();
}, size_t(0), std::plus<size_t>()).get();
dblog.info("Loaded {} SSTables", loaded);
});
@@ -242,7 +242,7 @@ distributed_loader::process_upload_dir(distributed<replica::database>& db, distr
future<std::tuple<table_id, std::vector<std::vector<sstables::shared_sstable>>>>
distributed_loader::get_sstables_from_upload_dir(distributed<replica::database>& db, sstring ks, sstring cf, sstables::sstable_open_config cfg) {
return seastar::async([&db, ks = std::move(ks), cf = std::move(cf), cfg] {
auto global_table = get_table_on_all_shards(db, ks, cf).get0();
auto global_table = get_table_on_all_shards(db, ks, cf).get();
sharded<sstables::sstable_directory> directory;
auto table_id = global_table->schema()->id();
@@ -374,7 +374,7 @@ future<> table_populator::populate_subdir(sstables::sstable_state state, allow_o
co_await distributed_loader::reshard(directory, _db, _ks, _cf, [this, state] (shard_id shard) mutable {
auto gen = smp::submit_to(shard, [this] () {
return _global_table->calculate_generation_for_new_table();
}).get0();
}).get();
return make_sstable(*_global_table, state, gen, _highest_version);
});

View File

@@ -2231,7 +2231,7 @@ future<bool> table::snapshot_exists(sstring tag) {
sstring jsondir = _config.datadir + "/snapshots/" + tag;
return open_checked_directory(general_disk_error_handler, std::move(jsondir)).then_wrapped([] (future<file> f) {
try {
f.get0();
f.get();
return make_ready_future<bool>(true);
} catch (std::system_error& e) {
if (e.code() != std::error_code(ENOENT, std::system_category())) {
@@ -2247,7 +2247,7 @@ future<std::unordered_map<sstring, table::snapshot_details>> table::get_snapshot
std::unordered_map<sstring, snapshot_details> all_snapshots;
for (auto& datadir : _config.all_datadirs) {
fs::path snapshots_dir = fs::path(datadir) / sstables::snapshots_dir;
auto file_exists = io_check([&snapshots_dir] { return seastar::file_exists(snapshots_dir.native()); }).get0();
auto file_exists = io_check([&snapshots_dir] { return seastar::file_exists(snapshots_dir.native()); }).get();
if (!file_exists) {
continue;
}
@@ -2273,7 +2273,7 @@ future<std::unordered_map<sstring, table::snapshot_details>> table::get_snapshot
return io_check(file_size, (fs::path(datadir) / name).native()).then_wrapped([&all_snapshots, snapshot_name, size] (auto fut) {
try {
// File exists in the main SSTable directory. Snapshots are not contributing to size
fut.get0();
fut.get();
} catch (std::system_error& e) {
if (e.code() != std::error_code(ENOENT, std::system_category())) {
throw;

View File

@@ -209,7 +209,7 @@ future<schema_ptr> schema_registry_entry::start_loading(async_schema_loader load
}
try {
try {
load(f.get0());
load(f.get());
_registry.attach_table(*this);
} catch (...) {
std::throw_with_nested(schema_version_loading_failed(_version));

View File

@@ -116,7 +116,7 @@ void cache_hitrate_calculator::recalculate_timer() {
if (f.failed()) {
d = std::chrono::milliseconds(2000);
} else {
d = f.get0();
d = f.get();
}
p->run_on((this_shard_id() + 1) % smp::count, d);
});

View File

@@ -92,7 +92,7 @@ future<prepare_response> paxos_state::prepare(storage_proxy& sp, db::system_keys
}
std::optional<std::variant<foreign_ptr<lw_shared_ptr<query::result>>, query::result_digest>> data_or_digest;
if (!f2.failed()) {
auto&& [result, hit_rate] = f2.get0();
auto&& [result, hit_rate] = f2.get();
if (only_digest) {
data_or_digest = *result->digest();
} else {

View File

@@ -119,7 +119,7 @@ future<> service_level_controller::update_service_levels_from_distributed_data()
// to be able to agreggate those failures and only report when it is critical or noteworthy.
// one common reason for failure is because one of the nodes comes down and before this node
// detects it the scan query done inside this call is failing.
service_levels = _sl_data_accessor->get_service_levels().get0();
service_levels = _sl_data_accessor->get_service_levels().get();
service_levels_info service_levels_for_add_or_update;
service_levels_info service_levels_for_delete;
@@ -191,7 +191,7 @@ future<std::optional<service_level_options>> service_level_controller::find_serv
return ::map_reduce(roles.begin(), roles.end(), [&role_manager, include_names, this] (const sstring& role) {
return role_manager.get_attribute(role, "service_level").then_wrapped([include_names, this, role] (future<std::optional<sstring>> sl_name_fut) -> std::optional<service_level_options> {
try {
std::optional<sstring> sl_name = sl_name_fut.get0();
std::optional<sstring> sl_name = sl_name_fut.get();
if (!sl_name) {
return std::nullopt;
}

View File

@@ -4925,7 +4925,7 @@ protected:
std::exception_ptr ex;
try {
if (!f.failed()) {
auto v = f.get0();
auto v = f.get();
_cf->set_hit_rate(ep, std::get<1>(v));
resolver->add_mutate_data(ep, std::get<0>(std::move(v)));
++_proxy->get_stats().mutation_data_read_completed.get_ep_stat(get_topology(), ep);
@@ -4951,7 +4951,7 @@ protected:
std::exception_ptr ex;
try {
if (!f.failed()) {
auto v = f.get0();
auto v = f.get();
_cf->set_hit_rate(ep, std::get<1>(v));
resolver->add_data(ep, std::get<0>(std::move(v)));
++_proxy->get_stats().data_read_completed.get_ep_stat(get_topology(), ep);
@@ -4978,7 +4978,7 @@ protected:
std::exception_ptr ex;
try {
if (!f.failed()) {
auto v = f.get0();
auto v = f.get();
_cf->set_hit_rate(ep, std::get<2>(v));
resolver->add_digest(ep, std::get<0>(v), std::get<1>(v), std::get<3>(std::move(v)));
++_proxy->get_stats().digest_read_completed.get_ep_stat(get_topology(), ep);

View File

@@ -1702,7 +1702,7 @@ future<> storage_service::bootstrap(std::unordered_set<token>& bootstrap_tokens,
// We don't do any other generation switches (unless we crash before complecting bootstrap).
assert(!cdc_gen_id);
cdc_gen_id = _cdc_gens.local().legacy_make_new_generation(bootstrap_tokens, !is_first_node()).get0();
cdc_gen_id = _cdc_gens.local().legacy_make_new_generation(bootstrap_tokens, !is_first_node()).get();
if (!bootstrap_rbno) {
// When is_repair_based_node_ops_enabled is true, the bootstrap node
@@ -2887,7 +2887,7 @@ future<std::unordered_map<sstring, std::vector<sstring>>> storage_service::descr
f.ignore_ready_future();
return std::pair<gms::inet_address, std::optional<table_schema_version>>(host, std::nullopt);
}
return std::pair<gms::inet_address, std::optional<table_schema_version>>(host, f.get0());
return std::pair<gms::inet_address, std::optional<table_schema_version>>(host, f.get());
});
}, std::move(results), [] (auto results, auto host_and_version) {
auto version = host_and_version.second ? host_and_version.second->to_sstring() : UNREACHABLE;
@@ -3057,7 +3057,7 @@ future<> storage_service::decommission() {
// For handling failure scenarios such as a group 0 member that is not a token ring member,
// there's `removenode`.
auto temp = tmptr->clone_after_all_left().get0();
auto temp = tmptr->clone_after_all_left().get();
auto num_tokens_after_all_left = temp.sorted_tokens().size();
temp.clear_gently().get();
if (num_tokens_after_all_left < 2) {

View File

@@ -1140,8 +1140,8 @@ public:
auto rs = abstract_replication_strategy::create_replication_strategy(ksm.strategy_name(), params);
if (auto&& tablet_rs = rs->maybe_as_tablet_aware()) {
auto tm = _db.get_shared_token_metadata().get();
auto map = tablet_rs->allocate_tablets_for_new_table(s.shared_from_this(), tm, _config.initial_tablets_scale).get0();
muts.emplace_back(tablet_map_to_mutation(map, s.id(), s.keypace_name(), s.cf_name(), ts).get0());
auto map = tablet_rs->allocate_tablets_for_new_table(s.shared_from_this(), tm, _config.initial_tablets_scale).get();
muts.emplace_back(tablet_map_to_mutation(map, s.id(), s.keypace_name(), s.cf_name(), ts).get());
}
}

View File

@@ -875,7 +875,7 @@ void writer::maybe_add_pi_block() {
}
void writer::init_file_writers() {
auto out = _sst._storage->make_data_or_index_sink(_sst, component_type::Data).get0();
auto out = _sst._storage->make_data_or_index_sink(_sst, component_type::Data).get();
if (!_compression_enabled) {
_data_writer = std::make_unique<crc32_checksummed_file_writer>(std::move(out), _sst.sstable_buffer_size, _sst.filename(component_type::Data));
@@ -887,7 +887,7 @@ void writer::init_file_writers() {
_schema.get_compressor_params()), _sst.filename(component_type::Data));
}
out = _sst._storage->make_data_or_index_sink(_sst, component_type::Index).get0();
out = _sst._storage->make_data_or_index_sink(_sst, component_type::Index).get();
_index_writer = std::make_unique<file_writer>(output_stream<char>(std::move(out)), _sst.filename(component_type::Index));
}
@@ -967,7 +967,7 @@ void writer::maybe_record_large_partitions(const sstables::sstable& sst, const s
auto& row_count_entry = _rows_in_partition_entry;
size_entry.max_value = std::max(size_entry.max_value, partition_size);
row_count_entry.max_value = std::max(row_count_entry.max_value, rows);
auto ret = _sst.get_large_data_handler().maybe_record_large_partitions(sst, partition_key, partition_size, rows).get0();
auto ret = _sst.get_large_data_handler().maybe_record_large_partitions(sst, partition_key, partition_size, rows).get();
size_entry.above_threshold += unsigned(bool(ret.size));
row_count_entry.above_threshold += unsigned(bool(ret.rows));
}
@@ -978,7 +978,7 @@ void writer::maybe_record_large_rows(const sstables::sstable& sst, const sstable
if (entry.max_value < row_size) {
entry.max_value = row_size;
}
if (_sst.get_large_data_handler().maybe_record_large_rows(sst, partition_key, clustering_key, row_size).get0()) {
if (_sst.get_large_data_handler().maybe_record_large_rows(sst, partition_key, clustering_key, row_size).get()) {
entry.above_threshold++;
};
}
@@ -993,7 +993,7 @@ void writer::maybe_record_large_cells(const sstables::sstable& sst, const sstabl
if (collection_elements_entry.max_value < collection_elements) {
collection_elements_entry.max_value = collection_elements;
}
if (_sst.get_large_data_handler().maybe_record_large_cells(_sst, *_partition_key, clustering_key, cdef, cell_size, collection_elements).get0()) {
if (_sst.get_large_data_handler().maybe_record_large_cells(_sst, *_partition_key, clustering_key, cdef, cell_size, collection_elements).get()) {
if (cell_size > cell_size_entry.threshold) {
cell_size_entry.above_threshold++;
}

View File

@@ -221,7 +221,7 @@ public:
return futurize_invoke(loader, key).then_wrapped([this, key, ptr = std::move(ptr)] (auto&& f) mutable {
entry& e = ptr.get_entry();
try {
partition_index_page&& page = f.get0();
partition_index_page&& page = f.get();
e.promise()->set_value();
e.set_page(std::move(page));
_stats.used_bytes += e.size_in_allocator();

View File

@@ -575,9 +575,9 @@ future<std::pair<sstring, sstring>> sstable_directory::create_pending_deletion_l
touch_directory(pending_delete_dir).get();
auto oflags = open_flags::wo | open_flags::create | open_flags::exclusive;
// Create temporary pending_delete log file.
auto f = open_file_dma(tmp_pending_delete_log, oflags).get0();
auto f = open_file_dma(tmp_pending_delete_log, oflags).get();
// Write all toc names into the log file.
auto out = make_file_output_stream(std::move(f), 4096).get0();
auto out = make_file_output_stream(std::move(f), 4096).get();
auto close_out = deferred_close(out);
for (const auto& sst : ssts) {
@@ -589,7 +589,7 @@ future<std::pair<sstring, sstring>> sstable_directory::create_pending_deletion_l
out.flush().get();
close_out.close_now();
auto dir_f = open_directory(pending_delete_dir).get0();
auto dir_f = open_directory(pending_delete_dir).get();
auto close_dir = deferred_close(dir_f);
// Once flushed and closed, the temporary log file can be renamed.
rename_file(tmp_pending_delete_log, pending_delete_log).get();

View File

@@ -1009,7 +1009,7 @@ void sstable::do_write_simple(component_type type,
file_output_stream_options options;
options.buffer_size = buffer_size;
auto w = make_component_file_writer(type, std::move(options)).get0();
auto w = make_component_file_writer(type, std::move(options)).get();
do_write_simple(std::move(w), std::move(write_component));
}
@@ -1264,7 +1264,7 @@ void sstable::rewrite_statistics() {
file_output_stream_options options;
options.buffer_size = sstable_buffer_size;
auto w = make_component_file_writer(component_type::TemporaryStatistics, std::move(options),
open_flags::wo | open_flags::create | open_flags::truncate).get0();
open_flags::wo | open_flags::create | open_flags::truncate).get();
write(_version, w, _components->statistics);
w.close();
// rename() guarantees atomicity when renaming a file into place.
@@ -1546,7 +1546,7 @@ sharding_metadata
create_sharding_metadata(schema_ptr schema, const dht::sharder& sharder, const dht::decorated_key& first_key, const dht::decorated_key& last_key, shard_id shard) {
auto prange = dht::partition_range::make(dht::ring_position(first_key), dht::ring_position(last_key));
auto sm = sharding_metadata();
auto ranges = dht::split_range_to_single_shard(*schema, sharder, prange, shard).get0();
auto ranges = dht::split_range_to_single_shard(*schema, sharder, prange, shard).get();
if (ranges.empty()) {
auto split_ranges_all_shards = dht::split_range_to_shards(prange, *schema, sharder);
sstlog.warn("create_sharding_metadata: range={} has no intersection with shard={} first_key={} last_key={} ranges_single_shard={} ranges_all_shards={}",

View File

@@ -129,7 +129,7 @@ future<file> filesystem_storage::open_component(const sstable& sst, component_ty
}
void filesystem_storage::open(sstable& sst) {
touch_temp_dir(sst).get0();
touch_temp_dir(sst).get();
auto file_path = sst.filename(component_type::TemporaryTOC);
// Writing TOC content to temporary file.
@@ -142,10 +142,10 @@ void filesystem_storage::open(sstable& sst) {
open_flags::wo |
open_flags::create |
open_flags::exclusive,
options).get0();
options).get();
auto w = file_writer(output_stream<char>(std::move(sink)), std::move(file_path));
bool toc_exists = file_exists(sst.filename(component_type::TOC)).get0();
bool toc_exists = file_exists(sst.filename(component_type::TOC)).get();
if (toc_exists) {
// TOC will exist at this point if write_components() was called with
// the generation of a sstable that exists.
@@ -253,7 +253,7 @@ future<> filesystem_storage::check_create_links_replay(const sstable& sst, const
sstlog.error("Error while linking SSTable: {} to {}: {}", src, dst, eptr);
return make_exception_future<>(eptr);
}
auto same = fut.get0();
auto same = fut.get();
if (!same) {
auto msg = format("Error while linking SSTable: {} to {}: File exists", src, dst);
sstlog.error("{}", msg);

View File

@@ -217,7 +217,7 @@ void stream_manager::init_messaging_service_handler(abort_source& as) {
sslog.log(level, "[Stream #{}] Failed to handle STREAM_MUTATION_FRAGMENTS (receive and distribute phase) for ks={}, cf={}, peer={}: {}",
plan_id, s->ks_name(), s->cf_name(), from.addr, ex);
} else {
received_partitions = f.get0();
received_partitions = f.get();
}
if (received_partitions) {
sslog.info("[Stream #{}] Write to sstable for ks={}, cf={}, estimated_partitions={}, received_partitions={}",
@@ -298,7 +298,7 @@ future<> stream_session::on_initialization_complete() {
sslog.debug("[Stream #{}] SEND PREPARE_MESSAGE to {}", plan_id(), id);
return manager().ms().send_prepare_message(id, std::move(prepare), plan_id(), description(), get_reason(), topo_guard()).then_wrapped([this, id] (auto&& f) {
try {
auto msg = f.get0();
auto msg = f.get();
sslog.debug("[Stream #{}] GOT PREPARE_MESSAGE Reply from {}", this->plan_id(), this->peer);
this->dst_cpu_id = msg.dst_cpu_id;
for (auto& summary : msg.summaries) {

View File

@@ -62,7 +62,7 @@ SEASTAR_TEST_CASE(test_aggregate_avg) {
"avg(f), "
"avg(g_0), "
"avg(g_2), "
"avg(h) FROM test").get0();
"avg(h) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->decompose(int8_t(1))},
{short_type->decompose(int16_t(1))},
@@ -88,7 +88,7 @@ SEASTAR_TEST_CASE(test_aggregate_sum) {
"sum(f), "
"sum(g_0), "
"sum(g_2), "
"sum(h) FROM test").get0();
"sum(h) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->decompose(int8_t(3))},
{short_type->decompose(int16_t(3))},
@@ -120,7 +120,7 @@ SEASTAR_TEST_CASE(test_aggregate_max) {
"max(tm), "
"max(tu), "
"max(bl), "
"max(bo) FROM test").get0();
"max(bo) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->decompose(int8_t(2))},
{short_type->decompose(int16_t(2))},
@@ -159,7 +159,7 @@ SEASTAR_TEST_CASE(test_aggregate_min) {
"min(tm), "
"min(tu), "
"min(bl), "
"min(bo) FROM test").get0();
"min(bo) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->decompose(int8_t(1))},
{short_type->decompose(int16_t(1))},
@@ -189,27 +189,27 @@ SEASTAR_TEST_CASE(test_aggregate_count) {
e.execute_cql("INSERT INTO test(a, c, bl) VALUES (3, 3, 0x03)").get();
{
auto msg = e.execute_cql("SELECT count(*) FROM test").get0();
auto msg = e.execute_cql("SELECT count(*) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(3))}});
}
{
auto msg = e.execute_cql("SELECT count(a) FROM test").get0();
auto msg = e.execute_cql("SELECT count(a) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(3))}});
}
{
auto msg = e.execute_cql("SELECT count(b) FROM test").get0();
auto msg = e.execute_cql("SELECT count(b) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(1))}});
}
{
auto msg = e.execute_cql("SELECT count(c) FROM test").get0();
auto msg = e.execute_cql("SELECT count(c) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(2))}});
}
{
auto msg = e.execute_cql("SELECT count(bo) FROM test").get0();
auto msg = e.execute_cql("SELECT count(bo) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(2))}});
}
{
auto msg = e.execute_cql("SELECT count(a), count(b), count(c), count(bl), count(bo), count(*) FROM test").get0();
auto msg = e.execute_cql("SELECT count(a), count(b), count(c), count(bl), count(bo), count(*) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(3))},
{long_type->decompose(int64_t(1))},
{long_type->decompose(int64_t(2))},
@@ -218,7 +218,7 @@ SEASTAR_TEST_CASE(test_aggregate_count) {
{long_type->decompose(int64_t(3))}});
}
{
auto msg = e.execute_cql("SELECT count(a), count(b), count(c), count(bo), count(*) FROM test LIMIT 1").get0();
auto msg = e.execute_cql("SELECT count(a), count(b), count(c), count(bo), count(*) FROM test LIMIT 1").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(3))},
{long_type->decompose(int64_t(1))},
{long_type->decompose(int64_t(2))},
@@ -236,12 +236,12 @@ SEASTAR_TEST_CASE(test_reverse_type_aggregation) {
{
auto tp = db_clock::from_time_t(0) + std::chrono::milliseconds(1);
auto msg = e.execute_cql("SELECT min(c) FROM test").get0();
auto msg = e.execute_cql("SELECT min(c) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{timestamp_type->decompose(tp)}});
}
{
auto tp = db_clock::from_time_t(0) + std::chrono::milliseconds(2);
auto msg = e.execute_cql("SELECT max(c) FROM test").get0();
auto msg = e.execute_cql("SELECT max(c) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{timestamp_type->decompose(tp)}});
}
});
@@ -257,14 +257,14 @@ SEASTAR_TEST_CASE(test_minmax_on_set) {
const auto set_type_int = set_type_impl::get_instance(int32_type, true);
const auto set_type_blob = set_type_impl::get_instance(bytes_type, true);
{
const auto msg = e.execute_cql("SELECT max(s1), max(s2) FROM test;").get0();
const auto msg = e.execute_cql("SELECT max(s1), max(s2) FROM test;").get();
assert_that(msg).is_rows().with_size(1).with_row({
set_type_int->decompose(make_set_value(set_type_int, {-1, 1})),
set_type_blob->decompose(make_set_value(set_type_blob, {"\x02", "\xfe"}))
});
}
{
const auto msg = e.execute_cql("SELECT min(s1), min(s2) FROM test;").get0();
const auto msg = e.execute_cql("SELECT min(s1), min(s2) FROM test;").get();
assert_that(msg).is_rows().with_size(1).with_row({
set_type_int->decompose(make_set_value(set_type_int, {-2, 2})),
set_type_blob->decompose(make_set_value(set_type_blob, {"\x01", "\xff"}))

View File

@@ -31,7 +31,7 @@ static future<> broken_sst(sstring dir, sstables::generation_type::int_t generat
sstable_version_types version = la) {
return sstables::test_env::do_with_async([=] (sstables::test_env& env) {
try {
sstable_ptr sstp = env.reusable_sst(s, dir, generation, version).get0();
sstable_ptr sstp = env.reusable_sst(s, dir, generation, version).get();
auto r = sstp->make_reader(s, env.make_reader_permit(), query::full_partition_range, s->full_slice());
auto close_r = deferred_close(r);
r.consume(my_consumer{}).get();
@@ -62,7 +62,7 @@ SEASTAR_TEST_CASE(test_empty_index) {
.set_compressor_params(compression_parameters::no_compression())
.build();
future<sstable_ptr> fut = env.reusable_sst(s, "test/resource/sstables/empty_index", 36, sstable_version_types::mc);
BOOST_REQUIRE_EXCEPTION(fut.get0(), malformed_sstable_exception, exception_predicate::message_matches(
BOOST_REQUIRE_EXCEPTION(fut.get(), malformed_sstable_exception, exception_predicate::message_matches(
"index_consume_entry_context \\(state=.*\\): cannot finish parsing current entry, no more data in sstable test/resource/sstables/empty_index/mc-36-big-Index.db"));
});
}

View File

@@ -57,8 +57,8 @@ SEASTAR_TEST_CASE(test_index_doesnt_flood_cache_in_small_partition_workload) {
return do_with_cql_env_thread([] (cql_test_env& e) {
// We disable compactions because they cause confusing cache mispopulations.
e.execute_cql("CREATE TABLE ks.t(pk blob PRIMARY KEY) WITH compaction = { 'class' : 'NullCompactionStrategy' };").get();
auto insert_query = e.prepare("INSERT INTO ks.t(pk) VALUES (?)").get0();
auto select_query = e.prepare("SELECT * FROM t WHERE pk = ?").get0();
auto insert_query = e.prepare("INSERT INTO ks.t(pk) VALUES (?)").get();
auto select_query = e.prepare("SELECT * FROM t WHERE pk = ?").get();
constexpr uint64_t pk_number = 600000;
constexpr uint64_t pk_size = 1000;
@@ -75,7 +75,7 @@ SEASTAR_TEST_CASE(test_index_doesnt_flood_cache_in_small_partition_workload) {
// Populate the table.
for (size_t i = 0; i < pk_number; ++i) {
e.execute_prepared(insert_query, {{cql3::raw_value::make_value(make_key(i))}}).get0();
e.execute_prepared(insert_query, {{cql3::raw_value::make_value(make_key(i))}}).get();
}
// Flushing makes reasoning easier.
e.db().invoke_on_all(&replica::database::flush_all_memtables).get();
@@ -95,7 +95,7 @@ SEASTAR_TEST_CASE(test_index_doesnt_flood_cache_in_small_partition_workload) {
auto get_misses = [&e] { return e.local_db().row_cache_tracker().get_stats().partition_misses; };
uint64_t misses_before = get_misses();
for (size_t i = 0; i < hot_subset_size; ++i) {
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(i))}}).get0();
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(i))}}).get();
// Sanity check. If a single query is causing multiple partition misses,
// something unexpected is happening.
BOOST_REQUIRE_LE(get_misses() - misses_before, i + 1);
@@ -105,7 +105,7 @@ SEASTAR_TEST_CASE(test_index_doesnt_flood_cache_in_small_partition_workload) {
// The rows we just read have a small total size. They should be perfectly cached.
for (size_t repeat = 0; repeat < 3; ++repeat) {
for (size_t i = 0; i < hot_subset_size; ++i) {
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(i))}}).get0();
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(i))}}).get();
// If the rows were perfectly cached, there were no new misses.
BOOST_REQUIRE_EQUAL(get_misses(), misses_before);
}
@@ -133,8 +133,8 @@ SEASTAR_TEST_CASE(test_index_is_cached_in_big_partition_workload) {
return do_with_cql_env_thread([] (cql_test_env& e) {
// We disable compactions because they cause confusing cache mispopulations.
e.execute_cql("CREATE TABLE ks.t(pk bigint, ck bigint, v blob, primary key (pk, ck)) WITH compaction = { 'class' : 'NullCompactionStrategy' };").get();
auto insert_query = e.prepare("INSERT INTO ks.t(pk, ck, v) VALUES (?, ?, ?)").get0();
auto select_query = e.prepare("SELECT * FROM t WHERE pk = ? AND ck = ?").get0();
auto insert_query = e.prepare("INSERT INTO ks.t(pk, ck, v) VALUES (?, ?, ?)").get();
auto select_query = e.prepare("SELECT * FROM t WHERE pk = ? AND ck = ?").get();
constexpr uint64_t pk_number = 10;
constexpr uint64_t ck_number = 600;
@@ -153,7 +153,7 @@ SEASTAR_TEST_CASE(test_index_is_cached_in_big_partition_workload) {
// Populate the table.
for (size_t pk = 0; pk < pk_number; ++pk) {
for (size_t ck = 0; ck < ck_number; ++ck) {
e.execute_prepared(insert_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}, {cql3::raw_value::make_value(bytes(v_size, 0))}}).get0();
e.execute_prepared(insert_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}, {cql3::raw_value::make_value(bytes(v_size, 0))}}).get();
}
}
// Flushing makes reasoning easier.
@@ -162,7 +162,7 @@ SEASTAR_TEST_CASE(test_index_is_cached_in_big_partition_workload) {
// Populate the index cache.
for (size_t ck = 0; ck < ck_number; ++ck) {
for (size_t pk = 0; pk < pk_number; ++pk) {
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}}).get0();
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}}).get();
}
}
@@ -171,7 +171,7 @@ SEASTAR_TEST_CASE(test_index_is_cached_in_big_partition_workload) {
uint64_t misses_before = get_misses();
for (size_t ck = 0; ck < ck_number; ++ck) {
for (size_t pk = 0; pk < pk_number; ++pk) {
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}}).get0();
e.execute_prepared(select_query, {{cql3::raw_value::make_value(make_key(pk))}, {cql3::raw_value::make_value(make_key(ck))}}).get();
}
}
BOOST_REQUIRE_EQUAL(get_misses(), misses_before);

View File

@@ -28,7 +28,7 @@ static lru cf_lru;
static sstring read_to_string(cached_file::stream& s, size_t limit = std::numeric_limits<size_t>::max()) {
sstring b;
while (auto buf = s.next().get0()) {
while (auto buf = s.next().get()) {
b += sstring(buf.get(), buf.size());
if (b.size() >= limit) {
break;
@@ -38,7 +38,7 @@ static sstring read_to_string(cached_file::stream& s, size_t limit = std::numeri
}
static void read_to_void(cached_file::stream& s, size_t limit = std::numeric_limits<size_t>::max()) {
while (auto buf = s.next().get0()) {
while (auto buf = s.next().get()) {
if (buf.size() >= limit) {
break;
}
@@ -49,7 +49,7 @@ static void read_to_void(cached_file::stream& s, size_t limit = std::numeric_lim
static sstring read_to_string(file& f, size_t start, size_t len) {
file_input_stream_options opt;
auto in = make_file_input_stream(f, start, len, opt);
auto buf = in.read_exactly(len).get0();
auto buf = in.read_exactly(len).get();
return sstring(buf.get(), buf.size());
}
@@ -79,16 +79,16 @@ test_file make_test_file(size_t size) {
auto contents = tests::random::get_sstring(size);
auto path = dir.path() / "file";
file f = open_file_dma(path.c_str(), open_flags::create | open_flags::rw).get0();
file f = open_file_dma(path.c_str(), open_flags::create | open_flags::rw).get();
testlog.debug("file contents: {}", contents);
output_stream<char> out = make_file_output_stream(f).get0();
output_stream<char> out = make_file_output_stream(f).get();
auto close_out = defer([&] { out.close().get(); });
out.write(contents.begin(), contents.size()).get();
out.flush().get();
f = open_file_dma(path.c_str(), open_flags::ro).get0();
f = open_file_dma(path.c_str(), open_flags::ro).get();
return test_file{
.dir = std::move(dir),

View File

@@ -65,7 +65,7 @@ auto test_explicit_type_casting_in_avg_function() {
" INSERT INTO air_quality_data(sensor_id, time, co_ppm) VALUES ('my_home', '2016-08-30 07:01:05', 31); \n"
" INSERT INTO air_quality_data(sensor_id, time, co_ppm) VALUES ('my_home', '2016-08-30 07:01:10', 20); \n"
"apply batch;").get();
auto msg = e.execute_cql(format("select avg(CAST(co_ppm AS {})) from air_quality_data;", cql_type_name<RetType>::value)).get0();
auto msg = e.execute_cql(format("select avg(CAST(co_ppm AS {})) from air_quality_data;", cql_type_name<RetType>::value)).get();
assert_that(msg).is_rows().with_size(1).with_row({{data_type_for<RetType>()->decompose( RetType(17 + 18 + 19 + 20 + 30 + 31 + 20) / RetType(7) )}});
});
}
@@ -113,7 +113,7 @@ SEASTAR_TEST_CASE(test_decimal_to_bigint) {
e.execute_cql("INSERT INTO test (key, value) VALUES ('k8', -1)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k9', -9223372036854775808)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k10', -9223372036854775809)").get();
auto v = e.execute_cql("SELECT key,CAST(value as bigint) from test").get0();
auto v = e.execute_cql("SELECT key,CAST(value as bigint) from test").get();
assert_that(v).is_rows().with_rows_ignore_order({
{{utf8_type->decompose("k1")}, {long_type->decompose(std::numeric_limits<int64_t>::max())}},
{{utf8_type->decompose("k2")}, {long_type->decompose(std::numeric_limits<int64_t>::min())}},
@@ -136,7 +136,7 @@ SEASTAR_TEST_CASE(test_decimal_to_float) {
e.execute_cql("INSERT INTO test (key, value) VALUES ('k2', 1e1)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k3', 100e-1)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k4', -1e1)").get();
auto v = e.execute_cql("SELECT key, CAST(value as float) from test").get0();
auto v = e.execute_cql("SELECT key, CAST(value as float) from test").get();
assert_that(v).is_rows().with_rows_ignore_order({
{{serialized("k1")}, {serialized(float(10))}},
{{serialized("k2")}, {serialized(float(10))}},
@@ -157,7 +157,7 @@ SEASTAR_TEST_CASE(test_varint_to_bigint) {
e.execute_cql("INSERT INTO test (key, value) VALUES ('k6', -1)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k7', -9223372036854775808)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k8', -9223372036854775809)").get();
auto v = e.execute_cql("SELECT key,CAST(value as bigint) from test").get0();
auto v = e.execute_cql("SELECT key,CAST(value as bigint) from test").get();
assert_that(v).is_rows().with_rows_ignore_order({
{{utf8_type->decompose("k1")}, {long_type->decompose(std::numeric_limits<int64_t>::max())}},
{{utf8_type->decompose("k2")}, {long_type->decompose(std::numeric_limits<int64_t>::min())}},
@@ -182,7 +182,7 @@ SEASTAR_TEST_CASE(test_varint_to_int) {
e.execute_cql("INSERT INTO test (key, value) VALUES ('k6', -1)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k7', -2147483648)").get();
e.execute_cql("INSERT INTO test (key, value) VALUES ('k8', -2147483649)").get();
auto v = e.execute_cql("SELECT key,CAST(value as int) from test").get0();
auto v = e.execute_cql("SELECT key,CAST(value as int) from test").get();
assert_that(v).is_rows().with_rows_ignore_order({
{{utf8_type->decompose("k1")}, {int32_type->decompose(std::numeric_limits<int32_t>::max())}},
{{utf8_type->decompose("k2")}, {int32_type->decompose(std::numeric_limits<int32_t>::min())}},
@@ -218,7 +218,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS tinyint), "
"CAST(g AS tinyint), "
"CAST(h AS tinyint), "
"CAST(i AS tinyint) FROM test").get0();
"CAST(i AS tinyint) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->decompose(int8_t(1))},
{byte_type->decompose(int8_t(2))},
{byte_type->decompose(int8_t(3))},
@@ -238,7 +238,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS smallint), "
"CAST(g AS smallint), "
"CAST(h AS smallint), "
"CAST(i AS smallint) FROM test").get0();
"CAST(i AS smallint) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{short_type->decompose(int16_t(1))},
{short_type->decompose(int16_t(2))},
{short_type->decompose(int16_t(3))},
@@ -258,7 +258,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS int), "
"CAST(g AS int), "
"CAST(h AS int), "
"CAST(i AS int) FROM test").get0();
"CAST(i AS int) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{int32_type->decompose(int32_t(1))},
{int32_type->decompose(int32_t(2))},
{int32_type->decompose(int32_t(3))},
@@ -278,7 +278,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS bigint), "
"CAST(g AS bigint), "
"CAST(h AS bigint), "
"CAST(i AS bigint) FROM test").get0();
"CAST(i AS bigint) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{long_type->decompose(int64_t(1))},
{long_type->decompose(int64_t(2))},
{long_type->decompose(int64_t(3))},
@@ -298,7 +298,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS float), "
"CAST(g AS float), "
"CAST(h AS float), "
"CAST(i AS float) FROM test").get0();
"CAST(i AS float) FROM test").get();
// Conversions that include floating point cannot be compared with assert_that(), because result
// of such conversions may be slightly different from theoretical values.
auto cmp = [&](::size_t index, float req) {
@@ -329,7 +329,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS double), "
"CAST(g AS double), "
"CAST(h AS double), "
"CAST(i AS double) FROM test").get0();
"CAST(i AS double) FROM test").get();
// Conversions that include floating points cannot be compared with assert_that(), because result
// of such conversions may be slightly different from theoretical values.
auto cmp = [&](::size_t index, double req) {
@@ -360,7 +360,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS decimal), "
"CAST(g AS decimal), "
"CAST(h AS decimal), "
"CAST(i AS decimal) FROM test").get0();
"CAST(i AS decimal) FROM test").get();
// Conversions that include floating points cannot be compared with assert_that(), because result
// of such conversions may be slightly different from theoretical values.
auto cmp = [&](::size_t index, double req) {
@@ -391,7 +391,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS ascii), "
"CAST(g AS ascii), "
"CAST(h AS ascii), "
"CAST(i AS ascii) FROM test").get0();
"CAST(i AS ascii) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{ascii_type->decompose("1")},
{ascii_type->decompose("2")},
{ascii_type->decompose("3")},
@@ -411,7 +411,7 @@ SEASTAR_TEST_CASE(test_numeric_casts_in_selection_clause) {
"CAST(f AS text), "
"CAST(g AS text), "
"CAST(h AS text), "
"CAST(i AS text) FROM test").get0();
"CAST(i AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->decompose("1")},
{utf8_type->decompose("2")},
{utf8_type->decompose("3")},
@@ -438,7 +438,7 @@ SEASTAR_TEST_CASE(test_integers_to_decimal_casts_in_selection_clause) {
"CAST(b AS decimal), "
"CAST(c AS decimal), "
"CAST(d AS decimal), "
"CAST(h AS decimal) FROM test").get0();
"CAST(h AS decimal) FROM test").get();
auto cmp = [&](::size_t index, auto x) {
auto row = dynamic_cast<cql_transport::messages::result_message::rows&>(*msg).rs().result_set().rows().front();
@@ -468,7 +468,7 @@ SEASTAR_TEST_CASE(test_integers_to_decimal_casts_with_avg_in_selection_clause) {
"CAST(avg(CAST(b AS decimal)) AS text), "
"CAST(avg(CAST(c AS decimal)) AS text), "
"CAST(avg(CAST(d AS decimal)) AS text), "
"CAST(avg(CAST(h AS decimal)) AS text) FROM test").get0();
"CAST(avg(CAST(h AS decimal)) AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->decompose("1.5")},
{utf8_type->decompose("2.5")},
{utf8_type->decompose("3.5")},
@@ -486,35 +486,35 @@ SEASTAR_TEST_CASE(test_time_casts_in_selection_clause) {
e.execute_cql("INSERT INTO test (a, b, c, d) VALUES (d2177dd0-eaa2-11de-a572-001b779c76e3, '2015-05-21 11:03:02+00', '2015-05-21', '11:03:02')").get();
{
auto msg = e.execute_cql("SELECT CAST(a AS timestamp), CAST(a AS date), CAST(b as date), CAST(c AS timestamp) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS timestamp), CAST(a AS date), CAST(b as date), CAST(c AS timestamp) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{timestamp_type->from_string("2009-12-17t00:26:29.805+00")},
{simple_date_type->from_string("2009-12-17")},
{simple_date_type->from_string("2015-05-21")},
{timestamp_type->from_string("2015-05-21t00:00:00+00")}});
}
{
auto msg = e.execute_cql("SELECT CAST(CAST(a AS timestamp) AS text), CAST(CAST(a AS date) AS text), CAST(CAST(b as date) AS text), CAST(CAST(c AS timestamp) AS text) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(CAST(a AS timestamp) AS text), CAST(CAST(a AS date) AS text), CAST(CAST(b as date) AS text), CAST(CAST(c AS timestamp) AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->from_string("2009-12-17T00:26:29.805Z")},
{utf8_type->from_string("2009-12-17")},
{utf8_type->from_string("2015-05-21")},
{utf8_type->from_string("2015-05-21T00:00:00.000Z")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text), CAST(d AS text) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text), CAST(d AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->from_string("d2177dd0-eaa2-11de-a572-001b779c76e3")},
{utf8_type->from_string("2015-05-21T11:03:02.000Z")},
{utf8_type->from_string("2015-05-21")},
{utf8_type->from_string("11:03:02.000000000")}});
}
{
auto msg = e.execute_cql("SELECT CAST(CAST(a AS timestamp) AS ascii), CAST(CAST(a AS date) AS ascii), CAST(CAST(b as date) AS ascii), CAST(CAST(c AS timestamp) AS ascii) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(CAST(a AS timestamp) AS ascii), CAST(CAST(a AS date) AS ascii), CAST(CAST(b as date) AS ascii), CAST(CAST(c AS timestamp) AS ascii) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{ascii_type->from_string("2009-12-17T00:26:29.805Z")},
{ascii_type->from_string("2009-12-17")},
{ascii_type->from_string("2015-05-21")},
{ascii_type->from_string("2015-05-21T00:00:00.000Z")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii), CAST(d AS ascii) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii), CAST(d AS ascii) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{ascii_type->from_string("d2177dd0-eaa2-11de-a572-001b779c76e3")},
{ascii_type->from_string("2015-05-21T11:03:02.000Z")},
{ascii_type->from_string("2015-05-21")},
@@ -530,13 +530,13 @@ SEASTAR_TEST_CASE(test_other_type_casts_in_selection_clause) {
"c boolean)").get();
e.execute_cql("INSERT INTO test (a, b, c) VALUES ('test', '127.0.0.1', true)").get();
{
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->from_string("test")},
{utf8_type->from_string("127.0.0.1")},
{utf8_type->from_string("true")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{ascii_type->from_string("test")},
{ascii_type->from_string("127.0.0.1")},
{ascii_type->from_string("true")}});
@@ -552,31 +552,31 @@ SEASTAR_TEST_CASE(test_casts_with_revrsed_order_in_selection_clause) {
"primary key (a, b)) WITH CLUSTERING ORDER BY (b DESC)").get();
e.execute_cql("INSERT INTO test (a, b, c) VALUES (1, 2, 6.3)").get();
{
auto msg = e.execute_cql("SELECT CAST(a AS tinyint), CAST(b as tinyint), CAST(c AS tinyint) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS tinyint), CAST(b as tinyint), CAST(c AS tinyint) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{byte_type->from_string("1")},
{byte_type->from_string("2")},
{byte_type->from_string("6")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS smallint), CAST(b as smallint), CAST(c AS smallint) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS smallint), CAST(b as smallint), CAST(c AS smallint) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{short_type->from_string("1")},
{short_type->from_string("2")},
{short_type->from_string("6")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS double), CAST(b as double), CAST(c AS double) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS double), CAST(b as double), CAST(c AS double) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{double_type->from_string("1")},
{double_type->from_string("2")},
{double_type->from_string("6.3")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS text), CAST(b as text), CAST(c AS text) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{utf8_type->from_string("1")},
{utf8_type->from_string("2")},
{utf8_type->from_string("6.3")}});
}
{
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii) FROM test").get0();
auto msg = e.execute_cql("SELECT CAST(a AS ascii), CAST(b as ascii), CAST(c AS ascii) FROM test").get();
assert_that(msg).is_rows().with_size(1).with_row({{ascii_type->from_string("1")},
{ascii_type->from_string("2")},
{ascii_type->from_string("6.3")}});

View File

@@ -57,7 +57,7 @@ SEASTAR_THREAD_TEST_CASE(test_find_mutation_timestamp) {
.build();
auto check_stmt = [&] (const sstring& query) {
auto muts = e.get_modification_mutations(query).get0();
auto muts = e.get_modification_mutations(query).get();
BOOST_REQUIRE(!muts.empty());
for (auto& m: muts) {
@@ -417,7 +417,7 @@ static void sort_by_time(const cql_transport::messages::result_message::rows& ro
}
static auto select_log(cql_test_env& e, const sstring& table_name) {
auto msg = e.execute_cql(format("SELECT * FROM ks.{}", cdc::log_name(table_name))).get0();
auto msg = e.execute_cql(format("SELECT * FROM ks.{}", cdc::log_name(table_name))).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
return rows;
@@ -447,7 +447,7 @@ SEASTAR_THREAD_TEST_CASE(test_primary_key_logging) {
cdc::log_data_column_name("ck2"),
cdc::log_meta_column_name("operation"),
cdc::log_meta_column_name("ttl"),
cdc::log_name("tbl"))).get0();
cdc::log_name("tbl"))).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
@@ -696,7 +696,7 @@ SEASTAR_THREAD_TEST_CASE(test_range_deletion) {
cdc::log_data_column_name("pk"),
cdc::log_data_column_name("ck"),
cdc::log_meta_column_name("operation"),
cdc::log_name("tbl"))).get0();
cdc::log_name("tbl"))).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
@@ -755,7 +755,7 @@ SEASTAR_THREAD_TEST_CASE(test_add_columns) {
SEASTAR_THREAD_TEST_CASE(test_negative_ttl_fail) {
do_with_cql_env_thread([](cql_test_env& e) {
BOOST_REQUIRE_EXCEPTION(e.execute_cql("CREATE TABLE ks.fail (a int PRIMARY KEY, b int) WITH cdc = {'enabled':true,'ttl':'-1'}").get0(),
BOOST_REQUIRE_EXCEPTION(e.execute_cql("CREATE TABLE ks.fail (a int PRIMARY KEY, b int) WITH cdc = {'enabled':true,'ttl':'-1'}").get(),
exceptions::configuration_exception,
exception_predicate::message_contains("ttl"));
}).get();
@@ -786,7 +786,7 @@ SEASTAR_THREAD_TEST_CASE(test_ttls) {
query += format(" FROM ks.{}", cdc::log_name(base_tbl_name));
// Execute query and get the first (and only) row of results:
auto msg = e.execute_cql(query).get0();
auto msg = e.execute_cql(query).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
auto results = to_bytes(*rows);
@@ -1246,13 +1246,13 @@ SEASTAR_THREAD_TEST_CASE(test_frozen_logging) {
keyspace_name, base_tbl_name, column_name, value_string)).get();
// Expect only one row, with the same value as inserted
const auto base_msg = e.execute_cql(format("SELECT {} FROM {}.{}", column_name, keyspace_name, base_tbl_name)).get0();
const auto base_msg = e.execute_cql(format("SELECT {} FROM {}.{}", column_name, keyspace_name, base_tbl_name)).get();
const auto base_rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(base_msg);
BOOST_REQUIRE(base_rows);
const auto base_bytes = to_bytes(*base_rows);
BOOST_REQUIRE_EQUAL(base_bytes.size(), 1);
const auto log_msg = e.execute_cql(format("SELECT {} FROM {}.{}", column_name, keyspace_name, log_tbl_name)).get0();
const auto log_msg = e.execute_cql(format("SELECT {} FROM {}.{}", column_name, keyspace_name, log_tbl_name)).get();
const auto log_rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(log_msg);
BOOST_REQUIRE(log_rows);
const auto log_bytes = to_bytes(*log_rows);
@@ -1282,7 +1282,7 @@ SEASTAR_THREAD_TEST_CASE(test_update_insert_delete_distinction) {
cquery_nofail(e, format("DELETE FROM ks.{} WHERE pk = {} AND ck = {}", base_tbl_name, pk, ck)); // (3) a row delete
const sstring query = format("SELECT \"{}\" FROM ks.{}", cdc::log_meta_column_name("operation"), cdc::log_name(base_tbl_name));
auto msg = e.execute_cql(query).get0();
auto msg = e.execute_cql(query).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
auto results = to_bytes(*rows);
@@ -1311,7 +1311,7 @@ static std::vector<std::vector<data_value>> get_result(cql_test_env& e,
return t->deserialize(*b);
};
auto msg = e.execute_cql(query).get0();
auto msg = e.execute_cql(query).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
@@ -1569,7 +1569,7 @@ SEASTAR_THREAD_TEST_CASE(test_batch_with_row_delete) {
fmt::arg("tbl_name", base_tbl_name), fmt::arg("pk", pk), fmt::arg("ck", ck)));
const sstring query = format("SELECT v1, v2, v3, v4, \"{}\" FROM ks.{}", cdc::log_meta_column_name("operation"), cdc::log_name(base_tbl_name));
auto msg = e.execute_cql(query).get0();
auto msg = e.execute_cql(query).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
BOOST_REQUIRE(rows);
auto results = to_bytes(*rows);

View File

@@ -97,12 +97,12 @@ SEASTAR_TEST_CASE(test_simple_locking_cells) {
make_row("two", { "r2", "r3" }),
});
auto l1 = cl.lock_cells(m.decorated_key(), partition_cells_range(m.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m.decorated_key(), partition_cells_range(m.partition()), no_timeout).get();
auto f2 = cl.lock_cells(m.decorated_key(), partition_cells_range(m.partition()), no_timeout);
BOOST_REQUIRE(!f2.available());
destroy(std::move(l1));
destroy(f2.get0());
destroy(f2.get());
});
}
@@ -124,9 +124,9 @@ SEASTAR_TEST_CASE(test_disjoint_mutations) {
auto m3 = mutation(s, partition_key::from_single_value(*s, to_bytes("1")));
m3.partition() = mutation_partition(*s, m1.partition());
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get0();
auto l2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout).get0();
auto l3 = cl.lock_cells(m3.decorated_key(), partition_cells_range(m3.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get();
auto l2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout).get();
auto l3 = cl.lock_cells(m3.decorated_key(), partition_cells_range(m3.partition()), no_timeout).get();
});
}
@@ -151,15 +151,15 @@ SEASTAR_TEST_CASE(test_single_cell_overlap) {
make_row("one", { "r2", "r3" }),
});
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get();
auto f2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout);
BOOST_REQUIRE(!f2.available());
destroy(std::move(l1));
auto l2 = f2.get0();
auto l2 = f2.get();
auto f3 = cl.lock_cells(m3.decorated_key(), partition_cells_range(m3.partition()), no_timeout);
BOOST_REQUIRE(!f3.available());
destroy(std::move(l2));
auto l3 = f3.get0();
auto l3 = f3.get();
});
}
@@ -187,17 +187,17 @@ SEASTAR_TEST_CASE(test_schema_change) {
make_row("one", { "r1", "r3" }),
});
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get();
destroy(std::move(m1));
destroy(std::move(s1));
cl.set_schema(s2);
auto l2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout).get0();
auto l2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout).get();
auto f3 = cl.lock_cells(m3.decorated_key(), partition_cells_range(m3.partition()), no_timeout);
BOOST_REQUIRE(!f3.available());
destroy(std::move(l1));
auto l3 = f3.get0();
auto l3 = f3.get();
auto s3 = make_schema_disjoint_with_others();
cl.set_schema(s3);
@@ -206,7 +206,7 @@ SEASTAR_TEST_CASE(test_schema_change) {
make_row("one", { "r8", "r9" }),
make_row("two", { "r8", "r9" }),
});
auto l4 = cl.lock_cells(m4.decorated_key(), partition_cells_range(m4.partition()), no_timeout).get0();
auto l4 = cl.lock_cells(m4.decorated_key(), partition_cells_range(m4.partition()), no_timeout).get();
});
}
@@ -225,17 +225,17 @@ SEASTAR_TEST_CASE(test_timed_out) {
make_row("one", { "r1", "r2" }),
});
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get();
auto timeout = db::timeout_clock::now();
forward_jump_clocks(1h);
BOOST_REQUIRE_THROW(cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), timeout).get0(),
BOOST_REQUIRE_THROW(cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), timeout).get(),
timed_out_error);
auto f2 = cl.lock_cells(m2.decorated_key(), partition_cells_range(m2.partition()), no_timeout);
BOOST_REQUIRE(!f2.available());
destroy(std::move(l1));
auto l2 = f2.get0();
auto l2 = f2.get();
});
}
@@ -255,7 +255,7 @@ SEASTAR_TEST_CASE(test_locker_stats) {
make_row("one", { "r2", "r3" }),
});
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get0();
auto l1 = cl.lock_cells(m1.decorated_key(), partition_cells_range(m1.partition()), no_timeout).get();
BOOST_REQUIRE_EQUAL(cl_stats.lock_acquisitions, 4);
BOOST_REQUIRE_EQUAL(cl_stats.operations_waiting_for_lock, 0);
@@ -265,7 +265,7 @@ SEASTAR_TEST_CASE(test_locker_stats) {
BOOST_REQUIRE(!f2.available());
destroy(std::move(l1));
destroy(f2.get0());
destroy(f2.get());
BOOST_REQUIRE_EQUAL(cl_stats.lock_acquisitions, 8);
BOOST_REQUIRE_EQUAL(cl_stats.operations_waiting_for_lock, 0);
});

View File

@@ -30,14 +30,14 @@ SEASTAR_TEST_CASE(test_column_mapping_persistence) {
// Check that stored column mapping is correctly serialized and deserialized
column_mapping cm;
BOOST_REQUIRE_NO_THROW(cm = db::schema_tables::get_column_mapping(e.get_system_keyspace().local(), table_id, v1).get0());
BOOST_REQUIRE_NO_THROW(cm = db::schema_tables::get_column_mapping(e.get_system_keyspace().local(), table_id, v1).get());
BOOST_REQUIRE_EQUAL(orig_cm, cm);
// Alter the test table and check that new column mapping is also inserted for the new schema version
cquery_nofail(e, "alter table test ADD dummy int");
auto altered_schema = e.local_db().find_schema("ks", "test");
column_mapping altered_cm;
BOOST_REQUIRE_NO_THROW(altered_cm = db::schema_tables::get_column_mapping(e.get_system_keyspace().local(), table_id, altered_schema->version()).get0());
BOOST_REQUIRE_NO_THROW(altered_cm = db::schema_tables::get_column_mapping(e.get_system_keyspace().local(), table_id, altered_schema->version()).get());
BOOST_REQUIRE_EQUAL(altered_schema->get_column_mapping(), altered_cm);
});
}

View File

@@ -953,7 +953,7 @@ SEASTAR_TEST_CASE(test_commitlog_replay_invalid_key){
{
auto paths = cl.get_active_segment_names();
BOOST_REQUIRE(!paths.empty());
auto rp = db::commitlog_replayer::create_replayer(env.db(), env.get_system_keyspace()).get0();
auto rp = db::commitlog_replayer::create_replayer(env.db(), env.get_system_keyspace()).get();
rp.recover(paths, db::commitlog::descriptor::FILENAME_PREFIX).get();
}
@@ -966,11 +966,11 @@ SEASTAR_TEST_CASE(test_commitlog_replay_invalid_key){
}
auto rd = make_combined_reader(s, permit, std::move(readers));
auto close_rd = deferred_close(rd);
auto mopt = read_mutation_from_flat_mutation_reader(rd).get0();
auto mopt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(mopt);
mopt = {};
mopt = read_mutation_from_flat_mutation_reader(rd).get0();
mopt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(!mopt);
}
});
@@ -1001,7 +1001,7 @@ SEASTAR_TEST_CASE(test_commitlog_add_entry) {
std::set<segment_id_type> ids;
for (auto& w : writers) {
auto h = log.add_entry(w.schema()->id(), w, db::timeout_clock::now() + 60s).get0();
auto h = log.add_entry(w.schema()->id(), w, db::timeout_clock::now() + 60s).get();
ids.emplace(h.rp().id);
rps.emplace_back(h.rp());
}
@@ -1061,7 +1061,7 @@ SEASTAR_TEST_CASE(test_commitlog_add_entries) {
writers.emplace_back(gen.schema(), mutations.back(), fs);
}
auto res = log.add_entries(writers, db::timeout_clock::now() + 60s).get0();
auto res = log.add_entries(writers, db::timeout_clock::now() + 60s).get();
std::set<segment_id_type> ids;
for (auto& h : res) {

View File

@@ -87,13 +87,13 @@ void verify_unauthorized_then_ok(
const auto cql_query_string = sstring(cql_query);
with_user(env, user_name, [&env, &cql_query_string] {
BOOST_REQUIRE_THROW(env.execute_cql(cql_query_string).get0(), exceptions::unauthorized_exception);
BOOST_REQUIRE_THROW(env.execute_cql(cql_query_string).get(), exceptions::unauthorized_exception);
});
resolve();
with_user(env, user_name, [&env, &cql_query_string] {
env.execute_cql(cql_query_string).get0();
env.execute_cql(cql_query_string).get();
});
}
@@ -108,7 +108,7 @@ SEASTAR_TEST_CASE(create_role_restrictions) {
//
verify_unauthorized_then_ok(env, alice, "CREATE ROLE lord", [&env] {
env.execute_cql("GRANT CREATE ON ALL ROLES TO alice").get0();
env.execute_cql("GRANT CREATE ON ALL ROLES TO alice").get();
});
//
@@ -116,7 +116,7 @@ SEASTAR_TEST_CASE(create_role_restrictions) {
//
verify_unauthorized_then_ok(env, bob, "CREATE ROLE emperor WITH SUPERUSER = true", [&env] {
env.execute_cql("ALTER USER bob SUPERUSER").get0();
env.execute_cql("ALTER USER bob SUPERUSER").get();
});
}, db_config_with_auth());
}
@@ -127,14 +127,14 @@ SEASTAR_TEST_CASE(create_role_restrictions) {
SEASTAR_TEST_CASE(alter_role_restrictions) {
return do_with_cql_env_thread([](auto&& env) {
env.execute_cql("CREATE ROLE lord").get0();
env.execute_cql("CREATE ROLE lord").get();
//
// A user cannot alter a role without ALTER on the role.
//
verify_unauthorized_then_ok(env, alice, "ALTER ROLE lord WITH LOGIN = true", [&env] {
env.execute_cql("GRANT ALTER ON ROLE lord TO alice").get0();
env.execute_cql("GRANT ALTER ON ROLE lord TO alice").get();
});
//
@@ -142,7 +142,7 @@ SEASTAR_TEST_CASE(alter_role_restrictions) {
//
with_user(env, bob, [&env] {
env.execute_cql("ALTER ROLE bob WITH LOGIN = true").get0();
env.execute_cql("ALTER ROLE bob WITH LOGIN = true").get();
});
//
@@ -150,7 +150,7 @@ SEASTAR_TEST_CASE(alter_role_restrictions) {
//
verify_unauthorized_then_ok(env, bob, "ALTER ROLE lord WITH SUPERUSER = true", [&env] {
env.execute_cql("ALTER USER bob SUPERUSER").get0();
env.execute_cql("ALTER USER bob SUPERUSER").get();
});
//
@@ -160,7 +160,7 @@ SEASTAR_TEST_CASE(alter_role_restrictions) {
with_user(env, bob, [&env] {
BOOST_REQUIRE_THROW(
env.execute_cql("ALTER ROLE bob WITH SUPERUSER = true").get0(),
env.execute_cql("ALTER ROLE bob WITH SUPERUSER = true").get(),
exceptions::unauthorized_exception);
});
}, db_config_with_auth());
@@ -172,14 +172,14 @@ SEASTAR_TEST_CASE(alter_role_restrictions) {
SEASTAR_TEST_CASE(drop_role_restrictions) {
return do_with_cql_env_thread([](auto&& env) {
env.execute_cql("CREATE ROLE LORD").get0();
env.execute_cql("CREATE ROLE LORD").get();
//
// A user cannot drop a role without DROP on the role.
//
verify_unauthorized_then_ok(env, alice, "DROP ROLE lord", [&env] {
env.execute_cql("GRANT DROP ON ROLE lord TO alice").get0();
env.execute_cql("GRANT DROP ON ROLE lord TO alice").get();
});
//
@@ -187,17 +187,17 @@ SEASTAR_TEST_CASE(drop_role_restrictions) {
//
with_user(env, alice, [&env] {
BOOST_REQUIRE_THROW(env.execute_cql("DROP ROLE alice").get0(), exceptions::request_validation_exception);
BOOST_REQUIRE_THROW(env.execute_cql("DROP ROLE alice").get(), exceptions::request_validation_exception);
});
//
// Only a superuser can drop a role that has been granted a superuser role.
//
env.execute_cql("CREATE ROLE emperor WITH SUPERUSER = true").get0();
env.execute_cql("CREATE ROLE emperor WITH SUPERUSER = true").get();
verify_unauthorized_then_ok(env, bob, "DROP ROLE emperor", [&env] {
env.execute_cql("ALTER USER bob SUPERUSER").get0();
env.execute_cql("ALTER USER bob SUPERUSER").get();
});
}, db_config_with_auth());
@@ -209,14 +209,14 @@ SEASTAR_TEST_CASE(drop_role_restrictions) {
SEASTAR_TEST_CASE(list_roles_restrictions) {
return do_with_cql_env_thread([](auto&& env) {
env.execute_cql("CREATE ROLE lord").get0();
env.execute_cql("CREATE ROLE lord").get();
//
// A user cannot list all roles of a role not granted to them.
//
verify_unauthorized_then_ok(env, alice, "LIST ROLES OF lord", [&env] {
env.execute_cql("GRANT lord TO alice").get0();
env.execute_cql("GRANT lord TO alice").get();
});
}, db_config_with_auth());
}
@@ -227,14 +227,14 @@ SEASTAR_TEST_CASE(list_roles_restrictions) {
SEASTAR_TEST_CASE(grant_role_restrictions) {
return do_with_cql_env_thread([](auto&& env) {
env.execute_cql("CREATE ROLE lord").get0();
env.execute_cql("CREATE ROLE lord").get();
//
// A user cannot grant a role to another user without AUTHORIZE on the role being granted.
//
verify_unauthorized_then_ok(env, alice, "GRANT lord TO alice", [&env] {
env.execute_cql("GRANT AUTHORIZE ON ROLE lord TO alice").get0();
env.execute_cql("GRANT AUTHORIZE ON ROLE lord TO alice").get();
});
}, db_config_with_auth());
}
@@ -247,15 +247,15 @@ SEASTAR_TEST_CASE(revoke_role_restrictions) {
return do_with_cql_env_thread([](auto&& env) {
create_user_if_not_exists(env, alice);
env.execute_cql("CREATE ROLE lord").get0();
env.execute_cql("GRANT lord TO alice").get0();
env.execute_cql("CREATE ROLE lord").get();
env.execute_cql("GRANT lord TO alice").get();
//
// A user cannot revoke a role from another user without AUTHORIZE on the role being revoked.
//
verify_unauthorized_then_ok(env, alice, "REVOKE lord FROM alice", [&env] {
env.execute_cql("GRANT AUTHORIZE ON ROLE lord TO alice").get0();
env.execute_cql("GRANT AUTHORIZE ON ROLE lord TO alice").get();
});
}, db_config_with_auth());
}
@@ -275,16 +275,16 @@ static void verify_default_permissions(
std::string_view creation_query,
const auth::resource& r) {
create_user_if_not_exists(env, user);
env.execute_cql(sstring(grant_query)).get0();
env.execute_cql(sstring(grant_query)).get();
with_user(env, user, [&env, creation_query] {
env.execute_cql(sstring(creation_query)).get0();
env.execute_cql(sstring(creation_query)).get();
});
const auto default_permissions = auth::get_permissions(
env.local_auth_service(),
auth::authenticated_user(user),
r).get0();
r).get();
BOOST_REQUIRE_EQUAL(
auth::permissions::to_strings(default_permissions),

View File

@@ -128,7 +128,7 @@ struct aggregate_function_test {
return tbl_name;
}
void call_function_and_expect(const char* fname, data_type type, data_value expected) {
auto msg = _e.execute_cql(format("select {}(value) from {}", fname, table_name())).get0();
auto msg = _e.execute_cql(format("select {}(value) from {}", fname, table_name())).get();
assert_that(msg).is_rows()
.with_size(1)
.with_column_types({type})
@@ -150,7 +150,7 @@ public:
.build();
}).get();
auto prepared = _e.prepare(format("insert into {} (pk, ck, value) values ('key1', ?, ?)", cf_name)).get0();
auto prepared = _e.prepare(format("insert into {} (pk, ck, value) values ('key1', ?, ?)", cf_name)).get();
for (int i = 0; i < (int)_sorted_values.size(); i++) {
const auto& value = _sorted_values[i];
BOOST_ASSERT(&*value.type() == &*_column_type);

View File

@@ -63,7 +63,7 @@ SEASTAR_THREAD_TEST_CASE(test_large_collection) {
}
flush(e);
assert_that(e.execute_cql("select partition_key, column_name from system.large_cells where table_name = 'tbl' allow filtering;").get0())
assert_that(e.execute_cql("select partition_key, column_name from system.large_cells where table_name = 'tbl' allow filtering;").get())
.is_rows()
.with_size(1)
.with_row({"42", "b", "tbl"});
@@ -83,7 +83,7 @@ SEASTAR_THREAD_TEST_CASE(test_large_data) {
e.execute_cql("insert into tbl (a, b) values (44, '" + blob + "');").get();
flush(e);
shared_ptr<cql_transport::messages::result_message> msg = e.execute_cql("select partition_key, row_size from system.large_rows where table_name = 'tbl' allow filtering;").get0();
shared_ptr<cql_transport::messages::result_message> msg = e.execute_cql("select partition_key, row_size from system.large_rows where table_name = 'tbl' allow filtering;").get();
auto res = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(msg);
auto rows = res->rs().result_set().rows();
@@ -103,7 +103,7 @@ SEASTAR_THREAD_TEST_CASE(test_large_data) {
BOOST_REQUIRE(row_size > 1024*1024 && row_size < 1025*1024);
// Check that it was added to system.large_cells too
assert_that(e.execute_cql("select partition_key, column_name from system.large_cells where table_name = 'tbl' allow filtering;").get0())
assert_that(e.execute_cql("select partition_key, column_name from system.large_cells where table_name = 'tbl' allow filtering;").get())
.is_rows()
.with_size(1)
.with_row({"44", "b", "tbl"});
@@ -121,10 +121,10 @@ SEASTAR_THREAD_TEST_CASE(test_large_data) {
});
}).get();
assert_that(e.execute_cql("select partition_key from system.large_rows where table_name = 'tbl' allow filtering;").get0())
assert_that(e.execute_cql("select partition_key from system.large_rows where table_name = 'tbl' allow filtering;").get())
.is_rows()
.is_empty();
assert_that(e.execute_cql("select partition_key from system.large_cells where table_name = 'tbl' allow filtering;").get0())
assert_that(e.execute_cql("select partition_key from system.large_cells where table_name = 'tbl' allow filtering;").get())
.is_rows()
.is_empty();
@@ -149,13 +149,13 @@ SEASTAR_TEST_CASE(test_insert_large_collection_values) {
}).get();
sstring long_value(std::numeric_limits<uint16_t>::max() + 10, 'x');
e.execute_cql(format("INSERT INTO tbl (pk, l) VALUES ('Zamyatin', ['{}']);", long_value)).get();
assert_that(e.execute_cql("SELECT l FROM tbl WHERE pk ='Zamyatin';").get0())
assert_that(e.execute_cql("SELECT l FROM tbl WHERE pk ='Zamyatin';").get())
.is_rows().with_rows({
{ make_list_value(list_type, list_type_impl::native_type({{long_value}})).serialize() }
});
BOOST_REQUIRE_THROW(e.execute_cql(format("INSERT INTO tbl (pk, s) VALUES ('Orwell', {{'{}'}});", long_value)).get(), std::exception);
e.execute_cql(format("INSERT INTO tbl (pk, m) VALUES ('Haksli', {{'key': '{}'}});", long_value)).get();
assert_that(e.execute_cql("SELECT m FROM tbl WHERE pk ='Haksli';").get0())
assert_that(e.execute_cql("SELECT m FROM tbl WHERE pk ='Haksli';").get())
.is_rows().with_rows({
{ make_map_value(map_type, map_type_impl::native_type({{sstring("key"), long_value}})).serialize() }
});

View File

@@ -110,7 +110,7 @@ SEASTAR_TEST_CASE(test_like_operator_bind_marker) {
return do_with_cql_env_thread([] (cql_test_env& e) {
cquery_nofail(e, "create table t (s text primary key, )");
cquery_nofail(e, "insert into t (s) values ('abc')");
auto stmt = e.prepare("select s from t where s like ? allow filtering").get0();
auto stmt = e.prepare("select s from t where s like ? allow filtering").get();
require_rows(e, stmt, {cql3::raw_value::make_value(T("_b_"))}, {{T("abc")}});
require_rows(e, stmt, {cql3::raw_value::make_value(T("%g"))}, {});
require_rows(e, stmt, {cql3::raw_value::make_value(T("%c"))}, {{T("abc")}});

File diff suppressed because it is too large Load Diff

View File

@@ -91,7 +91,7 @@ results test_data_listeners(cql_test_env& e, sstring cf_name) {
res.read += li_res.read;
res.write += li_res.write;
return res;
}).get0();
}).get();
testlog.info("test_data_listeners: rd={} wr={}", res.read, res.write);

View File

@@ -429,8 +429,8 @@ SEASTAR_THREAD_TEST_CASE(test_distributed_loader_with_pending_delete) {
sstring pending_delete_dir = sst_dir + "/" + sstables::pending_delete_dir;
auto write_file = [] (const sstring& file_name, const sstring& text) {
auto f = open_file_dma(file_name, open_flags::wo | open_flags::create | open_flags::truncate).get0();
auto os = make_file_output_stream(f, file_output_stream_options{}).get0();
auto f = open_file_dma(file_name, open_flags::wo | open_flags::create | open_flags::truncate).get();
auto os = make_file_output_stream(f, file_output_stream_options{}).get();
os.write(text).get();
os.flush().get();
os.close().get();
@@ -632,7 +632,7 @@ SEASTAR_TEST_CASE(snapshot_list_okay) {
auto& cf = e.local_db().find_column_family("ks", "cf");
take_snapshot(e).get();
auto details = cf.get_snapshot_details().get0();
auto details = cf.get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 1);
auto sd = details["test"];
@@ -644,7 +644,7 @@ SEASTAR_TEST_CASE(snapshot_list_okay) {
return make_ready_future<>();
}).get();
auto sd_post_deletion = cf.get_snapshot_details().get0().at("test");
auto sd_post_deletion = cf.get_snapshot_details().get().at("test");
BOOST_REQUIRE_EQUAL(sd_post_deletion.total, sd_post_deletion.live);
BOOST_REQUIRE_EQUAL(sd.total, sd_post_deletion.live);
@@ -657,7 +657,7 @@ SEASTAR_TEST_CASE(snapshot_list_contains_dropped_tables) {
return do_with_some_data({"cf1", "cf2", "cf3", "cf4"}, [] (cql_test_env& e) {
e.execute_cql("DROP TABLE ks.cf1;").get();
auto details = e.local_db().get_snapshot_details().get0();
auto details = e.local_db().get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 1);
const auto& sd = details.front().details;
@@ -667,12 +667,12 @@ SEASTAR_TEST_CASE(snapshot_list_contains_dropped_tables) {
take_snapshot(e, "ks", "cf2", "test2").get();
take_snapshot(e, "ks", "cf3", "test3").get();
details = e.local_db().get_snapshot_details().get0();
details = e.local_db().get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 3);
e.execute_cql("DROP TABLE ks.cf4;").get();
details = e.local_db().get_snapshot_details().get0();
details = e.local_db().get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 4);
for (const auto& result : details) {
@@ -694,7 +694,7 @@ SEASTAR_TEST_CASE(snapshot_list_contains_dropped_tables) {
SEASTAR_TEST_CASE(snapshot_list_inexistent) {
return do_with_some_data({"cf"}, [] (cql_test_env& e) {
auto& cf = e.local_db().find_column_family("ks", "cf");
auto details = cf.get_snapshot_details().get0();
auto details = cf.get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 0);
return make_ready_future<>();
});
@@ -811,14 +811,14 @@ SEASTAR_TEST_CASE(test_snapshot_ctl_details) {
auto& cf = e.local_db().find_column_family("ks", "cf");
take_snapshot(e).get();
auto details = cf.get_snapshot_details().get0();
auto details = cf.get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 1);
auto sd = details["test"];
BOOST_REQUIRE_EQUAL(sd.live, 0);
BOOST_REQUIRE_GT(sd.total, 0);
auto sc_details = sc.local().get_snapshot_details().get0();
auto sc_details = sc.local().get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(sc_details.size(), 1);
auto sc_sd_vec = sc_details["test"];
@@ -834,12 +834,12 @@ SEASTAR_TEST_CASE(test_snapshot_ctl_details) {
return make_ready_future<>();
}).get();
auto sd_post_deletion = cf.get_snapshot_details().get0().at("test");
auto sd_post_deletion = cf.get_snapshot_details().get().at("test");
BOOST_REQUIRE_EQUAL(sd_post_deletion.total, sd_post_deletion.live);
BOOST_REQUIRE_EQUAL(sd.total, sd_post_deletion.live);
sc_details = sc.local().get_snapshot_details().get0();
sc_details = sc.local().get_snapshot_details().get();
auto sc_sd_post_deletion_vec = sc_details["test"];
BOOST_REQUIRE_EQUAL(sc_sd_post_deletion_vec.size(), 1);
const auto &sc_sd_post_deletion = sc_sd_post_deletion_vec[0];
@@ -861,14 +861,14 @@ SEASTAR_TEST_CASE(test_snapshot_ctl_true_snapshots_size) {
auto& cf = e.local_db().find_column_family("ks", "cf");
take_snapshot(e).get();
auto details = cf.get_snapshot_details().get0();
auto details = cf.get_snapshot_details().get();
BOOST_REQUIRE_EQUAL(details.size(), 1);
auto sd = details["test"];
BOOST_REQUIRE_EQUAL(sd.live, 0);
BOOST_REQUIRE_GT(sd.total, 0);
auto sc_live_size = sc.local().true_snapshots_size().get0();
auto sc_live_size = sc.local().true_snapshots_size().get();
BOOST_REQUIRE_EQUAL(sc_live_size, sd.live);
lister::scan_dir(fs::path(cf.dir()), lister::dir_entry_types::of<directory_entry_type::regular>(), [] (fs::path parent_dir, directory_entry de) {
@@ -876,12 +876,12 @@ SEASTAR_TEST_CASE(test_snapshot_ctl_true_snapshots_size) {
return make_ready_future<>();
}).get();
auto sd_post_deletion = cf.get_snapshot_details().get0().at("test");
auto sd_post_deletion = cf.get_snapshot_details().get().at("test");
BOOST_REQUIRE_EQUAL(sd_post_deletion.total, sd_post_deletion.live);
BOOST_REQUIRE_EQUAL(sd.total, sd_post_deletion.live);
sc_live_size = sc.local().true_snapshots_size().get0();
sc_live_size = sc.local().true_snapshots_size().get();
BOOST_REQUIRE_EQUAL(sc_live_size, sd_post_deletion.live);
return make_ready_future<>();
@@ -894,7 +894,7 @@ SEASTAR_TEST_CASE(toppartitions_cross_shard_schema_ptr) {
e.execute_cql("CREATE TABLE ks.tab (id int PRIMARY KEY)").get();
db::toppartitions_query tq(e.db(), {{"ks", "tab"}}, {}, 1s, 100, 100);
tq.scatter().get();
auto q = e.prepare("INSERT INTO ks.tab(id) VALUES(?)").get0();
auto q = e.prepare("INSERT INTO ks.tab(id) VALUES(?)").get();
// Generate many values to ensure crossing shards
for (auto i = 0; i != 100; ++i) {
e.execute_prepared(q, {cql3::raw_value::make_value(int32_type->decompose(i))}).get();
@@ -907,7 +907,7 @@ SEASTAR_TEST_CASE(toppartitions_cross_shard_schema_ptr) {
SEASTAR_THREAD_TEST_CASE(read_max_size) {
do_with_cql_env_and_compaction_groups([] (cql_test_env& e) {
e.execute_cql("CREATE TABLE test (pk text, ck int, v text, PRIMARY KEY (pk, ck));").get();
auto id = e.prepare("INSERT INTO test (pk, ck, v) VALUES (?, ?, ?);").get0();
auto id = e.prepare("INSERT INTO test (pk, ck, v) VALUES (?, ?, ?);").get();
auto& db = e.local_db();
auto& tab = db.find_column_family("ks", "test");
@@ -963,7 +963,7 @@ SEASTAR_THREAD_TEST_CASE(read_max_size) {
}
query::read_command cmd(s->id(), s->version(), slice, query::max_result_size(max_size), query::tombstone_limit::max);
try {
auto size = query_method(s, cmd).get0();
auto size = query_method(s, cmd).get();
// Just to ensure we are not interpreting empty results as success.
BOOST_REQUIRE(size != 0);
if (should_throw) {
@@ -996,7 +996,7 @@ SEASTAR_THREAD_TEST_CASE(unpaged_mutation_read_global_limit) {
cfg.dbcfg->available_memory = 2 * 1024 * 1024;
do_with_cql_env_and_compaction_groups([] (cql_test_env& e) {
e.execute_cql("CREATE TABLE test (pk text, ck int, v text, PRIMARY KEY (pk, ck));").get();
auto id = e.prepare("INSERT INTO test (pk, ck, v) VALUES (?, ?, ?);").get0();
auto id = e.prepare("INSERT INTO test (pk, ck, v) VALUES (?, ?, ?);").get();
auto& db = e.local_db();
auto& tab = db.find_column_family("ks", "test");
@@ -1040,7 +1040,7 @@ SEASTAR_THREAD_TEST_CASE(unpaged_mutation_read_global_limit) {
slice.options.remove<query::partition_slice::option::allow_short_read>();
query::read_command cmd(s->id(), s->version(), slice, query::max_result_size(max_size), query::tombstone_limit::max);
try {
auto size = query_method(s, cmd).get0();
auto size = query_method(s, cmd).get();
// Just to ensure we are not interpreting empty results as success.
BOOST_REQUIRE(size != 0);
BOOST_FAIL("Expected exception, but none was thrown.");

View File

@@ -386,19 +386,19 @@ SEASTAR_TEST_CASE(test_inject_cql) {
cquery_nofail(e, "insert into error_name (name, one_shot) values ('test1', 'true')");
// Check no error injections before injecting
auto ret0 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret0 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret0).is_rows().with_rows({
{row_empty}
});
cquery_nofail(e, "select enable_injection(name, one_shot) from error_name where name = 'test1'");
// enabled_injections() returns a list all injections in one call, so limit 1
auto ret1 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret1 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret1).is_rows().with_rows({
{row_test1}
});
utils::get_local_injector().inject("test1", [] {}); // Noop one-shot injection
auto ret2 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret2 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret2).is_rows().with_rows({
// Empty list after one shot executed
{row_empty}
@@ -407,13 +407,13 @@ SEASTAR_TEST_CASE(test_inject_cql) {
// Again (test1,one_shot=true) but disable with CQL API
cquery_nofail(e, "select enable_injection(name, one_shot) from error_name where name = 'test1'");
// enabled_injections() returns a list all injections in one call, so limit 1
auto ret3 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret3 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret3).is_rows().with_rows({
{row_test1}
});
// Disable
cquery_nofail(e, "select disable_injection(name) from error_name where name = 'test1'");
auto ret4 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret4 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret4).is_rows().with_rows({
// Empty list after one shot disabled
{row_empty}
@@ -422,7 +422,7 @@ SEASTAR_TEST_CASE(test_inject_cql) {
cquery_nofail(e, "insert into error_name (name, one_shot) values ('test2', 'false')");
cquery_nofail(e, "select enable_injection(name, one_shot) from error_name where name = 'test2'");
utils::get_local_injector().inject("test2", [] {}); // Noop injection, doesn't disable
auto ret5 = e.execute_cql("select enabled_injections() from error_name limit 1").get0();
auto ret5 = e.execute_cql("select enabled_injections() from error_name limit 1").get();
assert_that(ret5).is_rows().with_rows({
{row_test2}
});

View File

@@ -89,7 +89,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
e.execute_cql("INSERT INTO t (a,b,c,d,e) VALUES (21, 22, 23, 24, 25)").get();
e.execute_cql("INSERT INTO t (a,b,c,d,e) VALUES (31, 32, 33, 34, 35)").get();
auto msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c = 16").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c = 16").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -100,7 +100,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
BOOST_CHECK_THROW(e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 12 AND c > 13 AND d = 14").get(), exceptions::invalid_request_exception);
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c = 16").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c = 16").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -109,7 +109,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
int32_type->decompose(18),
}});
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c > 13 AND d >= 17 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c > 13 AND d >= 17 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -120,7 +120,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
BOOST_CHECK_THROW(e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 12 AND c > 13 AND d > 17").get(), exceptions::invalid_request_exception);
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c > 13 AND d >= 17 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a = 11 AND b = 15 AND c > 13 AND d >= 17 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -129,7 +129,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
int32_type->decompose(18),
}});
msg = e.execute_cql("SELECT * FROM t WHERE a <= 11 AND c > 15 AND d >= 16 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a <= 11 AND c > 15 AND d >= 16 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -138,7 +138,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
int32_type->decompose(18),
}});
msg = e.execute_cql("SELECT * FROM t WHERE a <= 11 AND b >= 15 AND c > 15 AND d >= 16 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a <= 11 AND b >= 15 AND c > 15 AND d >= 16 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(11),
int32_type->decompose(15),
@@ -147,7 +147,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_pk_ck) {
int32_type->decompose(18),
}});
msg = e.execute_cql("SELECT * FROM t WHERE a <= 100 AND b >= 15 AND c > 0 AND d <= 100 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE a <= 100 AND b >= 15 AND c > 0 AND d <= 100 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(11),
@@ -185,7 +185,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multi_column) {
e.execute_cql("INSERT INTO t (a,b,c,d,e) VALUES (1, 2, 1, 2, 25)").get();
e.execute_cql("INSERT INTO t (a,b,c,d,e) VALUES (1, 2, 1, 3, 35)").get();
auto msg = e.execute_cql("SELECT * FROM t WHERE (c, d) = (1, 2) ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE (c, d) = (1, 2) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -203,7 +203,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multi_column) {
},
});
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) IN ((1, 2), (1,3), (1,4)) ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) IN ((1, 2), (1,3), (1,4)) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -228,7 +228,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multi_column) {
},
});
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) < (1, 3) ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) < (1, 3) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -253,7 +253,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multi_column) {
},
});
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) < (1, 3) AND (c, d) > (1, 1) ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE (c, d) < (1, 3) AND (c, d) > (1, 1) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -293,7 +293,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_clustering_column) {
e.execute_cql("INSERT INTO t (k, c, v) VALUES (1, 3, 2)").get();
e.execute_cql("INSERT INTO t (k, c, v) VALUES (2, 2, 3)").get();
auto msg = e.execute_cql("SELECT * FROM t WHERE k = 1").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE k = 1").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -307,21 +307,21 @@ SEASTAR_TEST_CASE(test_allow_filtering_clustering_column) {
}
});
msg = e.execute_cql("SELECT * FROM t WHERE k = 1 AND c > 2").get0();
msg = e.execute_cql("SELECT * FROM t WHERE k = 1 AND c > 2").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(3),
int32_type->decompose(2)
}});
msg = e.execute_cql("SELECT * FROM t WHERE k = 1 AND c = 2").get0();
msg = e.execute_cql("SELECT * FROM t WHERE k = 1 AND c = 2").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(2),
int32_type->decompose(1)
}});
msg = e.execute_cql("SELECT * FROM t WHERE c = 2 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE c = 2 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -335,7 +335,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_clustering_column) {
}
});
msg = e.execute_cql("SELECT * FROM t WHERE c > 2 AND c <= 4 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE c > 2 AND c <= 4 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(3),
@@ -353,7 +353,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_two_clustering_columns) {
e.execute_cql("INSERT INTO t (p, c1, c2, data) VALUES (1, 2, 5, 3)").get();
e.execute_cql("INSERT INTO t (p, c1, c2, data) VALUES (2, 3, 4, 4)").get();
auto res = e.execute_cql("SELECT * FROM t WHERE p = 1 and c1 < 3 and c2 > 3 ALLOW FILTERING").get0();
auto res = e.execute_cql("SELECT * FROM t WHERE p = 1 and c1 < 3 and c2 > 3 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -365,7 +365,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_two_clustering_columns) {
// In issue #4121, we noticed that although with "SELECT *" filtering
// was correct, when we select only a column *not* involved in the
// filtering, one of the constraints was ignored.
res = e.execute_cql("SELECT data FROM t WHERE p = 1 and c1 < 3 and c2 > 3 ALLOW FILTERING").get0();
res = e.execute_cql("SELECT data FROM t WHERE p = 1 and c1 < 3 and c2 > 3 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{
int32_type->decompose(3),
@@ -385,7 +385,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_two_clustering_columns) {
e.execute_cql("INSERT INTO t2 (p, c1, c2, c3, c4, data) VALUES (1, 1, 2, 5, 4, 3)").get();
e.execute_cql("INSERT INTO t2 (p, c1, c2, c3, c4, data) VALUES (1, 1, 4, 3, 4, 4)").get();
e.execute_cql("INSERT INTO t2 (p, c1, c2, c3, c4, data) VALUES (1, 2, 4, 4, 2, 5)").get();
res = e.execute_cql("SELECT data FROM t2 WHERE p = 1 and c1 = 1 and c2 < 3 and c3 > 4 and c4 < 7 ALLOW FILTERING").get0();
res = e.execute_cql("SELECT data FROM t2 WHERE p = 1 and c1 = 1 and c2 < 3 and c3 > 4 and c4 < 7 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{
int32_type->decompose(3),
@@ -410,7 +410,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_static_column) {
e.execute_cql("INSERT INTO t (a, b, c, s) VALUES (2, 1, 1, 2)").get();
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t WHERE c = 1 AND s = 2 ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE c = 1 AND s = 2 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(2),
int32_type->decompose(1),
@@ -420,7 +420,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_static_column) {
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t WHERE c = 1 AND s = 1 ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE c = 1 AND s = 1 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -459,51 +459,51 @@ SEASTAR_TEST_CASE(test_allow_filtering_multiple_regular) {
auto my_set_type = set_type_impl::get_instance(int32_type, true);
auto my_map_type = map_type_impl::get_instance(int32_type, utf8_type, true);
auto msg = e.execute_cql("SELECT f FROM t WHERE f contains 1 ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT f FROM t WHERE f contains 1 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1}}))},
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1, 2}}))},
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1, 2, 3}}))},
});
msg = e.execute_cql("SELECT f FROM t WHERE f contains 2 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT f FROM t WHERE f contains 2 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1, 2}}))},
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1, 2, 3}}))},
});
msg = e.execute_cql("SELECT f FROM t WHERE f contains 2 AND f contains 3 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT f FROM t WHERE f contains 2 AND f contains 3 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_list_type->decompose(make_list_value(my_list_type, list_type_impl::native_type{{1, 2, 3}}))},
});
msg = e.execute_cql("SELECT g FROM t WHERE g contains 7 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT g FROM t WHERE g contains 7 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_set_type->decompose(make_set_value(my_set_type, set_type_impl::native_type{{1, 2, 7}}))},
});
msg = e.execute_cql("SELECT g FROM t WHERE g contains 1 and g contains 7 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT g FROM t WHERE g contains 1 and g contains 7 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_set_type->decompose(make_set_value(my_set_type, set_type_impl::native_type{{1, 2, 7}}))},
});
msg = e.execute_cql("SELECT h FROM t WHERE h contains key 3 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT h FROM t WHERE h contains key 3 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_map_type->decompose(make_map_value(my_map_type, map_type_impl::native_type{{{3, "three"}}}))},
{my_map_type->decompose(make_map_value(my_map_type, map_type_impl::native_type{{{3, "three"}, {4, "four"}}}))},
});
msg = e.execute_cql("SELECT h FROM t WHERE h contains 'four' ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT h FROM t WHERE h contains 'four' ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_map_type->decompose(make_map_value(my_map_type, map_type_impl::native_type{{{3, "three"}, {4, "four"}}}))},
});
msg = e.execute_cql("SELECT h FROM t WHERE h contains key 3 and h contains 'four' ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT h FROM t WHERE h contains key 3 and h contains 'four' ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{my_map_type->decompose(make_map_value(my_map_type, map_type_impl::native_type{{{3, "three"}, {4, "four"}}}))},
});
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 3 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 3 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(2),
@@ -512,7 +512,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multiple_regular) {
int32_type->decompose(5)
}});
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE e >= 5 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE e >= 5 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -537,7 +537,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_multiple_regular) {
}
});
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 5 and e = 9 and d = 1 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 5 and e = 9 and d = 1 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(3),
@@ -546,12 +546,12 @@ SEASTAR_TEST_CASE(test_allow_filtering_multiple_regular) {
int32_type->decompose(9)
}});
cql3::prepared_cache_key_type prepared_id = e.prepare("SELECT a, b, c, d, e FROM t WHERE a = ? and d = ? ALLOW FILTERING").get0();
cql3::prepared_cache_key_type prepared_id = e.prepare("SELECT a, b, c, d, e FROM t WHERE a = ? and d = ? ALLOW FILTERING").get();
std::vector<cql3::raw_value> raw_values {
cql3::raw_value::make_value(int32_type->decompose(1)),
cql3::raw_value::make_value(int32_type->decompose(1))
};
msg = e.execute_prepared(prepared_id, raw_values).get0();
msg = e.execute_prepared(prepared_id, raw_values).get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -569,9 +569,9 @@ SEASTAR_TEST_CASE(test_allow_filtering_multiple_regular) {
}
});
prepared_id = e.prepare("SELECT a, b, c, d, e FROM t WHERE a = ? and d = ? ALLOW FILTERING").get0();
prepared_id = e.prepare("SELECT a, b, c, d, e FROM t WHERE a = ? and d = ? ALLOW FILTERING").get();
raw_values[1] = cql3::raw_value::make_value(int32_type->decompose(9));
msg = e.execute_prepared(prepared_id, raw_values).get0();
msg = e.execute_prepared(prepared_id, raw_values).get();
assert_that(msg).is_rows().with_size(0);
@@ -588,7 +588,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_desc) {
e.execute_cql("INSERT INTO t (a, b, c, d, e) VALUES (1, 2, 5, 1, 9)").get();
e.execute_cql("INSERT INTO t (a, b, c, d, e) VALUES (1, 2, 6, 7, 5)").get();
auto msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c > 3 ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c > 3 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -606,7 +606,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_desc) {
}
});
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c < 4 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c < 4 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -624,7 +624,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_desc) {
}
});
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 4 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 4 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_size(0);
});
}
@@ -640,7 +640,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
e.execute_cql("INSERT INTO t (a, b, c, d, e) VALUES (1, 3, 5, 1, 9)").get();
e.execute_cql("INSERT INTO t (a, b, c, d, e) VALUES (1, 4, 5, 7, 5)").get();
auto msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 3").get0();
auto msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 3").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(2),
@@ -651,7 +651,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
BOOST_CHECK_THROW(e.execute_cql("SELECT * FROM t WHERE c = 5 and d = 1").get(), exceptions::invalid_request_exception);
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 5 and d = 1 ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT a, b, c, d, e FROM t WHERE c = 5 and d = 1 ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(3),
@@ -672,12 +672,12 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
}
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 0 AND c1 < 5 AND c2 = 1 AND v = 3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 0 AND c1 < 5 AND c2 = 1 AND v = 3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({});
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 0 AND c1 < 5 AND c2 = 3 AND v = 3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 0 AND c1 < 5 AND c2 = 3 AND v = 3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -704,12 +704,12 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c2 > 1 AND c2 < 5 AND v = 1 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c2 > 1 AND c2 < 5 AND v = 1 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({});
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 1 AND c2 > 2 AND v = 3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND c1 > 1 AND c2 > 2 AND v = 3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -729,7 +729,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND pk2 > 1 AND c2 > 2 AND v = 3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 = 1 AND pk2 > 1 AND c2 > 2 AND v = 3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({{
int32_type->decompose(1),
int32_type->decompose(3),
@@ -740,7 +740,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) {
});
eventually([&] {
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 >= 2 AND pk2 <=3 AND c1 IN(0,1,2) AND c2 IN(0,1,2) AND v < 3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT * FROM t2 WHERE pk1 >= 2 AND pk2 <=3 AND c1 IN(0,1,2) AND c2 IN(0,1,2) AND v < 3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(2),
@@ -804,12 +804,12 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
"APPLY BATCH;"
).get();
auto msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(3), boolean_type->decompose(true)},
});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false ALLOW FILTERING;").get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)},
@@ -820,14 +820,14 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true LIMIT 1 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true LIMIT 1 ALLOW FILTERING;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(3), boolean_type->decompose(true)},
});
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 5 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 5 ALLOW FILTERING;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)},
@@ -838,7 +838,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 2 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 2 ALLOW FILTERING;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)}
@@ -846,7 +846,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)},
@@ -855,7 +855,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get();
auto paging_state = extract_paging_state(msg);
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)}
@@ -866,7 +866,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
while (rows_fetched == 0) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get();
rows_fetched = count_rows_fetched(msg);
paging_state = extract_paging_state(msg);
}
@@ -878,7 +878,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
while (rows_fetched == 0) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get();
rows_fetched = count_rows_fetched(msg);
if (rows_fetched == 0) {
paging_state = extract_paging_state(msg);
@@ -894,7 +894,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_limit) {
while (remaining > 0) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false LIMIT 3 ALLOW FILTERING;", std::move(qo)).get();
rows_fetched += count_rows_fetched(msg);
paging_state = extract_paging_state(msg);
if (!paging_state) {
@@ -930,7 +930,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
"APPLY BATCH;"
).get();
auto msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false PER PARTITION LIMIT 2 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false PER PARTITION LIMIT 2 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)},
@@ -938,7 +938,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
{ int32_type->decompose(2), boolean_type->decompose(false)},
});
msg = e.execute_cql("SELECT c, liked FROM timeline PER PARTITION LIMIT 2;").get0();
msg = e.execute_cql("SELECT c, liked FROM timeline PER PARTITION LIMIT 2;").get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
{ int32_type->decompose(2), boolean_type->decompose(false)},
@@ -946,14 +946,14 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
{ int32_type->decompose(2), boolean_type->decompose(false)},
});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE user='b' PER PARTITION LIMIT 2 LIMIT 1 ALLOW FILTERING;").get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE user='b' PER PARTITION LIMIT 2 LIMIT 1 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
});
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true PER PARTITION LIMIT 1 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=true PER PARTITION LIMIT 1 ALLOW FILTERING;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(3), boolean_type->decompose(true)},
{ int32_type->decompose(3), boolean_type->decompose(true)},
@@ -961,7 +961,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{3, nullptr, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline PER PARTITION LIMIT 1;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline PER PARTITION LIMIT 1;", std::move(qo)).get();
assert_that(msg).is_rows().with_rows({
{ int32_type->decompose(1), boolean_type->decompose(false)},
});
@@ -972,7 +972,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
while (rows_fetched == 0) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false PER PARTITION LIMIT 1 ALLOW FILTERING;", std::move(qo)).get0();
msg = e.execute_cql("SELECT c, liked FROM timeline WHERE liked=false PER PARTITION LIMIT 1 ALLOW FILTERING;", std::move(qo)).get();
rows_fetched = count_rows_fetched(msg);
paging_state = extract_paging_state(msg);
}
@@ -993,7 +993,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_per_partition_limit) {
sstring query = allow_filtering ?
fmt::format("SELECT c, liked FROM timeline WHERE liked=false PER PARTITION LIMIT {} ALLOW FILTERING;", ppl) :
fmt::format("SELECT c, liked FROM timeline PER PARTITION LIMIT {};", ppl);
msg = e.execute_cql(query, std::move(qo)).get0();
msg = e.execute_cql(query, std::move(qo)).get();
rows_fetched += count_rows_fetched(msg);
paging_state = extract_paging_state(msg);
if (!paging_state) {
@@ -1018,7 +1018,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_in_on_regular_column) {
e.execute_cql("INSERT INTO t (k, c, v) VALUES (1, 3, 2)").get();
e.execute_cql("INSERT INTO t (k, c, v) VALUES (2, 2, 3)").get();
auto msg = e.execute_cql("SELECT * FROM t WHERE v IN (1) ALLOW FILTERING").get0();
auto msg = e.execute_cql("SELECT * FROM t WHERE v IN (1) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -1027,7 +1027,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_in_on_regular_column) {
}
});
msg = e.execute_cql("SELECT * FROM t WHERE v IN (2, 3) ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE v IN (2, 3) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -1041,7 +1041,7 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_in_on_regular_column) {
}
});
msg = e.execute_cql("SELECT * FROM t WHERE c in (2, 4) AND v IN (1, 2, 3, 4, 5) ALLOW FILTERING").get0();
msg = e.execute_cql("SELECT * FROM t WHERE c in (2, 4) AND v IN (1, 2, 3, 4, 5) ALLOW FILTERING").get();
assert_that(msg).is_rows().with_rows_ignore_order({
{
int32_type->decompose(1),
@@ -1102,7 +1102,7 @@ SEASTAR_TEST_CASE(test_filtering) {
// test filtering on partition keys
{
auto msg = e.execute_cql("SELECT k FROM cf WHERE v=3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT k FROM cf WHERE v=3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_serialized_columns_count(1).with_rows_ignore_order({
{ int32_type->decompose(7), int32_type->decompose(3)},
{ int32_type->decompose(8), int32_type->decompose(3) },
@@ -1115,7 +1115,7 @@ SEASTAR_TEST_CASE(test_filtering) {
// test filtering on clustering keys
{
auto msg = e.execute_cql("SELECT k FROM cf WHERE n=4 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT k FROM cf WHERE n=4 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_serialized_columns_count(1).with_rows_ignore_order({
{ int32_type->decompose(10), int32_type->decompose(4) },
{ int32_type->decompose(11), int32_type->decompose(4) },
@@ -1124,7 +1124,7 @@ SEASTAR_TEST_CASE(test_filtering) {
//test filtering on regular columns
{
auto msg = e.execute_cql("SELECT k FROM cf WHERE o>7 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT k FROM cf WHERE o>7 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_serialized_columns_count(1).with_rows_ignore_order({
{ int32_type->decompose(8), int32_type->decompose(8) },
{ int32_type->decompose(9), int32_type->decompose(9) },
@@ -1137,7 +1137,7 @@ SEASTAR_TEST_CASE(test_filtering) {
//test filtering on static columns
{
auto msg = e.execute_cql("SELECT k FROM cf WHERE p>=10 AND p<=12 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT k FROM cf WHERE p>=10 AND p<=12 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_serialized_columns_count(1).with_rows_ignore_order({
{ int32_type->decompose(10), int32_type->decompose(10) },
{ int32_type->decompose(11), int32_type->decompose(11) },
@@ -1145,7 +1145,7 @@ SEASTAR_TEST_CASE(test_filtering) {
}
//test filtering with count
{
auto msg = e.execute_cql("SELECT COUNT(k) FROM cf WHERE n>3 ALLOW FILTERING;").get0();
auto msg = e.execute_cql("SELECT COUNT(k) FROM cf WHERE n>3 ALLOW FILTERING;").get();
assert_that(msg).is_rows().with_serialized_columns_count(1).with_size(1).with_rows_ignore_order({
{ long_type->decompose(4L), int32_type->decompose(5) },
});

View File

@@ -103,10 +103,10 @@ static size_t count_fragments(mutation m) {
auto r = make_flat_mutation_reader_from_mutations_v2(m.schema(), semaphore.make_permit(), m);
auto close_reader = deferred_close(r);
size_t res = 0;
auto mfopt = r().get0();
auto mfopt = r().get();
while (bool(mfopt)) {
++res;
mfopt = r().get0();
mfopt = r().get();
}
return res;
}
@@ -118,7 +118,7 @@ SEASTAR_THREAD_TEST_CASE(test_flat_mutation_reader_consume_single_partition) {
for (size_t depth = 1; depth <= fragments_in_m + 1; ++depth) {
auto r = make_flat_mutation_reader_from_mutations_v2(m.schema(), semaphore.make_permit(), m);
auto close_reader = deferred_close(r);
auto result = r.consume(mock_consumer(*m.schema(), semaphore.make_permit(), depth)).get0();
auto result = r.consume(mock_consumer(*m.schema(), semaphore.make_permit(), depth)).get();
BOOST_REQUIRE(result._consume_end_of_stream_called);
BOOST_REQUIRE_EQUAL(1, result._consume_new_partition_call_count);
BOOST_REQUIRE_EQUAL(1, result._consume_end_of_partition_call_count);
@@ -143,18 +143,18 @@ SEASTAR_THREAD_TEST_CASE(test_flat_mutation_reader_consume_two_partitions) {
for (size_t depth = 1; depth < fragments_in_m1; ++depth) {
auto r = make_flat_mutation_reader_from_mutations_v2(m1.schema(), semaphore.make_permit(), {m1, m2});
auto close_r = deferred_close(r);
auto result = r.consume(mock_consumer(*m1.schema(), semaphore.make_permit(), depth)).get0();
auto result = r.consume(mock_consumer(*m1.schema(), semaphore.make_permit(), depth)).get();
BOOST_REQUIRE(result._consume_end_of_stream_called);
BOOST_REQUIRE_EQUAL(1, result._consume_new_partition_call_count);
BOOST_REQUIRE_EQUAL(1, result._consume_end_of_partition_call_count);
BOOST_REQUIRE_EQUAL(m1.partition().partition_tombstone() ? 1 : 0, result._consume_tombstone_call_count);
auto r2 = make_flat_mutation_reader_from_mutations_v2(m1.schema(), semaphore.make_permit(), {m1, m2});
auto close_r2 = deferred_close(r2);
auto start = r2().get0();
auto start = r2().get();
BOOST_REQUIRE(start);
BOOST_REQUIRE(start->is_partition_start());
for (auto& mf : result._fragments) {
auto mfopt = r2().get0();
auto mfopt = r2().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mf.equal(*m1.schema(), *mfopt));
}
@@ -162,7 +162,7 @@ SEASTAR_THREAD_TEST_CASE(test_flat_mutation_reader_consume_two_partitions) {
for (size_t depth = fragments_in_m1; depth < fragments_in_m1 + fragments_in_m2 + 1; ++depth) {
auto r = make_flat_mutation_reader_from_mutations_v2(m1.schema(), semaphore.make_permit(), {m1, m2});
auto close_r = deferred_close(r);
auto result = r.consume(mock_consumer(*m1.schema(), semaphore.make_permit(), depth)).get0();
auto result = r.consume(mock_consumer(*m1.schema(), semaphore.make_permit(), depth)).get();
BOOST_REQUIRE(result._consume_end_of_stream_called);
BOOST_REQUIRE_EQUAL(2, result._consume_new_partition_call_count);
BOOST_REQUIRE_EQUAL(2, result._consume_end_of_partition_call_count);
@@ -176,14 +176,14 @@ SEASTAR_THREAD_TEST_CASE(test_flat_mutation_reader_consume_two_partitions) {
BOOST_REQUIRE_EQUAL(tombstones_count, result._consume_tombstone_call_count);
auto r2 = make_flat_mutation_reader_from_mutations_v2(m1.schema(), semaphore.make_permit(), {m1, m2});
auto close_r2 = deferred_close(r2);
auto start = r2().get0();
auto start = r2().get();
BOOST_REQUIRE(start);
BOOST_REQUIRE(start->is_partition_start());
for (auto& mf : result._fragments) {
auto mfopt = r2().get0();
auto mfopt = r2().get();
BOOST_REQUIRE(mfopt);
if (mfopt->is_partition_start() || mfopt->is_end_of_partition()) {
mfopt = r2().get0();
mfopt = r2().get();
}
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mf.equal(*m1.schema(), *mfopt));
@@ -208,7 +208,7 @@ SEASTAR_THREAD_TEST_CASE(test_fragmenting_and_freezing) {
BOOST_REQUIRE(!frag);
fms.emplace_back(std::move(fm));
return make_ready_future<stop_iteration>(stop_iteration::no);
}, std::numeric_limits<size_t>::max()).get0();
}, std::numeric_limits<size_t>::max()).get();
BOOST_REQUIRE_EQUAL(fms.size(), 1);
@@ -223,7 +223,7 @@ SEASTAR_THREAD_TEST_CASE(test_fragmenting_and_freezing) {
*fragmented = frag;
fms.emplace_back(std::move(fm));
return make_ready_future<stop_iteration>(stop_iteration::no);
}, 1).get0();
}, 1).get();
auto&& rows = m.partition().non_dummy_rows();
auto expected_fragments = std::distance(rows.begin(), rows.end())
@@ -254,7 +254,7 @@ SEASTAR_THREAD_TEST_CASE(test_fragmenting_and_freezing) {
BOOST_REQUIRE(!frag);
frozen.emplace_back(fm);
return make_ready_future<stop_iteration>(stop_iteration::no);
}, std::numeric_limits<size_t>::max()).get0();
}, std::numeric_limits<size_t>::max()).get();
BOOST_REQUIRE_EQUAL(muts.size(), frozen.size());
for (auto j = 0u; j < muts.size(); j++) {
BOOST_REQUIRE_EQUAL(muts[j], frozen[j].unfreeze(s));
@@ -266,7 +266,7 @@ SEASTAR_THREAD_TEST_CASE(test_fragmenting_and_freezing) {
BOOST_REQUIRE(!frag);
frozen.emplace_back(fm);
return make_ready_future<stop_iteration>(stop_iteration::yes);
}, std::numeric_limits<size_t>::max()).get0();
}, std::numeric_limits<size_t>::max()).get();
BOOST_REQUIRE_EQUAL(frozen.size(), 1);
BOOST_REQUIRE_EQUAL(muts[0], frozen[0].unfreeze(s));
@@ -275,7 +275,7 @@ SEASTAR_THREAD_TEST_CASE(test_fragmenting_and_freezing) {
fragment_and_freeze(make_flat_mutation_reader_from_mutations_v2(gen.schema(), semaphore.make_permit(), muts), [&] (auto fm, bool frag) {
frozen.emplace_back(fm);
return make_ready_future<stop_iteration>(stop_iteration::no);
}, 1).get0();
}, 1).get();
std::vector<mutation> unfrozen;
while (!frozen.empty()) {
auto m = frozen.front().unfreeze(s);
@@ -359,7 +359,7 @@ SEASTAR_THREAD_TEST_CASE(test_flat_mutation_reader_move_buffer_content_to) {
auto dummy_reader = flat_mutation_reader_v2(std::move(dummy_impl));
auto close_dummy_reader = deferred_close(dummy_reader);
auto mut_new = read_mutation_from_flat_mutation_reader(dummy_reader).get0();
auto mut_new = read_mutation_from_flat_mutation_reader(dummy_reader).get();
assert_that(mut_new)
.has_mutation()
@@ -581,9 +581,9 @@ void test_flat_stream(schema_ptr s, std::vector<mutation> muts, reversed_partiti
return with_closeable(make_reversing_reader(make_delegating_reader(fmr), query::max_result_size(size_t(1) << 20)),
[fsc = std::move(fsc)] (flat_mutation_reader_v2& reverse_reader) mutable {
return reverse_reader.consume(std::move(fsc));
}).get0();
}).get();
}
return fmr.consume(std::move(fsc)).get0();
return fmr.consume(std::move(fsc)).get();
}
};

View File

@@ -414,18 +414,18 @@ SEASTAR_THREAD_TEST_CASE(test_read_fragmented_buffer) {
auto in = input_stream<char>(data_source(std::make_unique<memory_data_source>(std::move(buffers))));
auto prefix = in.read_exactly(prefix_size).get0();
auto prefix = in.read_exactly(prefix_size).get();
BOOST_CHECK_EQUAL(prefix.size(), prefix_size);
BOOST_CHECK_EQUAL(bytes_view(reinterpret_cast<const bytes::value_type*>(prefix.get()), prefix.size()),
expected_prefix);
auto reader = fragmented_temporary_buffer::reader();
auto fbuf = reader.read_exactly(in, size).get0();
auto fbuf = reader.read_exactly(in, size).get();
auto view = fragmented_temporary_buffer::view(fbuf);
BOOST_CHECK_EQUAL(view.size_bytes(), size);
BOOST_CHECK_EQUAL(linearized(view), expected_data);
auto suffix = in.read_exactly(suffix_size).get0();
auto suffix = in.read_exactly(suffix_size).get();
BOOST_CHECK_EQUAL(suffix.size(), suffix_size);
BOOST_CHECK_EQUAL(bytes_view(reinterpret_cast<const bytes::value_type*>(suffix.get()), suffix.size()),
expected_suffix);
@@ -494,7 +494,7 @@ static void do_test_read_exactly_eof(size_t input_size) {
auto ds = data_source(std::make_unique<memory_data_source>(std::move(data)));
auto is = input_stream<char>(std::move(ds));
auto reader = fragmented_temporary_buffer::reader();
auto result = reader.read_exactly(is, input_size + 1).get0();
auto result = reader.read_exactly(is, input_size + 1).get();
BOOST_CHECK_EQUAL(result.size_bytes(), size_t(0));
}

View File

@@ -87,7 +87,7 @@ SEASTAR_TEST_CASE(test_group0_cmd_merge) {
};
std::vector<canonical_mutation> cms;
size_t size = 0;
auto muts = service::prepare_keyspace_drop_announcement(env.local_db(), "ks", api::new_timestamp()).get0();
auto muts = service::prepare_keyspace_drop_announcement(env.local_db(), "ks", api::new_timestamp()).get();
// Maximum mutation size is 1/3 of commitlog segment size which we set
// to 1M. Make one command a little bit larger than third of the max size.
while (size < 150*1024) {

View File

@@ -20,7 +20,7 @@ SEASTAR_TEST_CASE(test_index_with_paging) {
sstring big_string(100, 'j');
// There should be enough rows to use multiple pages
auto prepared_id = e.prepare("INSERT INTO tab (pk, ck, v, v2, v3) VALUES (?, ?, 1, ?, ?)").get0();
auto prepared_id = e.prepare("INSERT INTO tab (pk, ck, v, v2, v3) VALUES (?, ?, 1, ?, ?)").get();
auto big_string_v = cql3::raw_value::make_value(serialized(big_string));
max_concurrent_for_each(boost::irange(0, 64 * 1024), 2, [&] (auto i) {
return e.execute_prepared(prepared_id, {
@@ -40,7 +40,7 @@ SEASTAR_TEST_CASE(test_index_with_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{4321, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
auto rows = dynamic_pointer_cast<cql_transport::messages::result_message::rows>(res);
BOOST_REQUIRE_NE(rows, nullptr);
// It's fine to get less rows than requested due to paging limit, but never more than that
@@ -48,7 +48,7 @@ SEASTAR_TEST_CASE(test_index_with_paging) {
});
eventually([&] {
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1").get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1").get();
assert_that(res).is_rows().with_size(64 * 1024);
});
});

View File

@@ -82,7 +82,7 @@ SEASTAR_TEST_CASE(test_select_json_types) {
" 1y2mo3w4d5h6m7s8ms9us10ns"
");").get();
auto msg = e.execute_cql("SELECT JSON a, b, c, d, e, f, \"G\", \"H\", \"I\", j, k, l, m, n, o, p, q, r, s, u, w, unixtimestampof(k) FROM all_types WHERE a = 'ascii'").get0();
auto msg = e.execute_cql("SELECT JSON a, b, c, d, e, f, \"G\", \"H\", \"I\", j, k, l, m, n, o, p, q, r, s, u, w, unixtimestampof(k) FROM all_types WHERE a = 'ascii'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose(
@@ -115,7 +115,7 @@ SEASTAR_TEST_CASE(test_select_json_types) {
msg = e.execute_cql("SELECT toJson(a), toJson(b), toJson(c), toJson(d), toJson(e), toJson(f),"
"toJson(\"G\"), toJson(\"H\"), toJson(\"I\"), toJson(j), toJson(k), toJson(l), toJson(m), toJson(n),"
"toJson(o), toJson(p), toJson(q), toJson(r), toJson(s), toJson(u), toJson(w),"
"toJson(unixtimestampof(k)), toJson(toJson(toJson(p))) FROM all_types WHERE a = 'ascii'").get0();
"toJson(unixtimestampof(k)), toJson(toJson(toJson(p))) FROM all_types WHERE a = 'ascii'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose("\"ascii\""),
@@ -166,7 +166,7 @@ SEASTAR_TEST_CASE(test_select_json_collections) {
" [[ 3 , 1, 4, 1, 5, 9 ], [ ], [ 1, 1, 2 ]]"
");").get();
auto msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key'").get0();
auto msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose(
@@ -178,7 +178,7 @@ SEASTAR_TEST_CASE(test_select_json_collections) {
}
});
msg = e.execute_cql("SELECT toJson(a), toJson(b), toJson(c), toJson(d) FROM collections WHERE a = 'key'").get0();
msg = e.execute_cql("SELECT toJson(a), toJson(b), toJson(c), toJson(d) FROM collections WHERE a = 'key'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose("\"key\""),
@@ -250,7 +250,7 @@ SEASTAR_TEST_CASE(test_insert_json_types) {
"\"u\": \"1y2mo25d5h6m7s8ms9us10ns\"}"
"'").get();
auto msg = e.execute_cql("SELECT * FROM all_types WHERE a = 'ascii'").get0();
auto msg = e.execute_cql("SELECT * FROM all_types WHERE a = 'ascii'").get();
struct tm t = { 0 };
t.tm_year = 2001 - 1900;
t.tm_mon = 10 - 1;
@@ -285,7 +285,7 @@ SEASTAR_TEST_CASE(test_insert_json_types) {
e.execute_cql("UPDATE all_types SET n = fromJson('\"2147483648\"') WHERE a = fromJson('\"ascii\"');").get();
e.execute_cql("UPDATE all_types SET o = fromJson('\"3.45\"') WHERE a = fromJson('\"ascii\"');").get();
msg = e.execute_cql("SELECT a, b, \"I\", n, o FROM all_types WHERE a = 'ascii'").get0();
msg = e.execute_cql("SELECT a, b, \"I\", n, o FROM all_types WHERE a = 'ascii'").get();
assert_that(msg).is_rows().with_rows({
{
ascii_type->decompose(sstring("ascii")),
@@ -347,7 +347,7 @@ SEASTAR_TEST_CASE(test_insert_json_types) {
"\"v\": 6 "
"}'").get();
msg = e.execute_cql("SELECT * FROM multi_column_pk_table").get0();
msg = e.execute_cql("SELECT * FROM multi_column_pk_table").get();
assert_that(msg).is_rows().with_rows({
{
int32_type->decompose(1),
@@ -381,7 +381,7 @@ SEASTAR_TEST_CASE(test_insert_json_collections) {
"\"d\": [[3, 1, 4, 1, 5, 9], [], [1, 1, 2]]}"
"'").get();
auto msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key'").get0();
auto msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose(
@@ -394,7 +394,7 @@ SEASTAR_TEST_CASE(test_insert_json_collections) {
});
e.execute_cql("INSERT INTO collections JSON '{\"a\": \"key2\"}'").get();
msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key2'").get0();
msg = e.execute_cql("SELECT JSON * FROM collections WHERE a = 'key2'").get();
assert_that(msg).is_rows().with_rows({
{
utf8_type->decompose(
@@ -426,7 +426,7 @@ SEASTAR_TEST_CASE(test_insert_json_null_frozen_collections) {
e.execute_cql("INSERT INTO collections JSON '{\"k\": 0}'").get();
e.execute_cql("INSERT INTO collections JSON '{\"k\": 1, \"m\": null, \"s\": null, \"l\": null, \"u\": null}'").get();
assert_that(e.execute_cql("SELECT JSON * FROM collections WHERE k = 0").get0()).is_rows().with_rows({
assert_that(e.execute_cql("SELECT JSON * FROM collections WHERE k = 0").get()).is_rows().with_rows({
{
utf8_type->decompose(
"{\"k\": 0, "
@@ -438,7 +438,7 @@ SEASTAR_TEST_CASE(test_insert_json_null_frozen_collections) {
}
});
assert_that(e.execute_cql("SELECT JSON * FROM collections WHERE k = 1").get0()).is_rows().with_rows({
assert_that(e.execute_cql("SELECT JSON * FROM collections WHERE k = 1").get()).is_rows().with_rows({
{
utf8_type->decompose(
"{\"k\": 1, "
@@ -579,7 +579,7 @@ SEASTAR_TEST_CASE(test_prepared_json) {
" insert into json_data json ?; \n"
" insert into json_data json :named_bound1; \n"
" insert into json_data json ?; \n"
"apply batch;").get0();
"apply batch;").get();
std::vector<cql3::raw_value> raw_values;
raw_values.emplace_back(cql3::raw_value::make_value(utf8_type->decompose(
@@ -593,22 +593,22 @@ SEASTAR_TEST_CASE(test_prepared_json) {
e.execute_prepared(prepared_id, raw_values).get();
auto msg = e.execute_cql("select json * from json_data where a='a1'").get0();
auto msg = e.execute_cql("select json * from json_data where a='a1'").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(
"{\"a\": \"a1\", \"b\": {\"0\": \"zero\", \"3\": \"three\", \"6\": \"six\"}, \"c\": 1.23, \"d\": [1.25, 3.75, 2.5]}")
}});
msg = e.execute_cql("select json * from json_data where a='a2'").get0();
msg = e.execute_cql("select json * from json_data where a='a2'").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(
"{\"a\": \"a2\", \"b\": {\"0\": \"zero\", \"6\": \"six\"}, \"c\": 1.23, \"d\": [3.75, 2.5]}")
}});
msg = e.execute_cql("select json * from json_data where a='a3'").get0();
msg = e.execute_cql("select json * from json_data where a='a3'").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(
"{\"a\": \"a3\", \"b\": {\"0\": \"zero\", \"3\": \"three\"}, \"c\": 1.23, \"d\": [1.25, 2.5]}")
}});
msg = e.execute_cql("select json * from json_data where a='a4'").get0();
msg = e.execute_cql("select json * from json_data where a='a4'").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(
"{\"a\": \"a4\", \"b\": {\"1\": \"one\"}, \"c\": 1.23, \"d\": [1]}")
@@ -631,7 +631,7 @@ SEASTAR_TEST_CASE(test_json_default_unset) {
e.execute_cql("INSERT INTO json_data JSON '{\"a\": \"abc\", \"b\": 2, \"c\": 1}'").get();
auto msg = e.execute_cql("select * from json_data where a='abc'").get0();
auto msg = e.execute_cql("select * from json_data where a='abc'").get();
assert_that(msg).is_rows().with_rows({{
{utf8_type->decompose(sstring("abc"))},
{int32_type->decompose(2)},
@@ -641,7 +641,7 @@ SEASTAR_TEST_CASE(test_json_default_unset) {
e.execute_cql("INSERT INTO json_data JSON '{\"a\": \"abc\", \"b\": 2, \"d\": 5}' DEFAULT UNSET").get();
msg = e.execute_cql("select * from json_data where a='abc'").get0();
msg = e.execute_cql("select * from json_data where a='abc'").get();
assert_that(msg).is_rows().with_rows({{
{utf8_type->decompose(sstring("abc"))},
{int32_type->decompose(2)},
@@ -651,7 +651,7 @@ SEASTAR_TEST_CASE(test_json_default_unset) {
e.execute_cql("INSERT INTO json_data JSON '{\"a\": \"abc\", \"b\": 2, \"d\": 4}' DEFAULT NULL").get();
msg = e.execute_cql("select * from json_data where a='abc'").get0();
msg = e.execute_cql("select * from json_data where a='abc'").get();
assert_that(msg).is_rows().with_rows({{
{utf8_type->decompose(sstring("abc"))},
{int32_type->decompose(2)},
@@ -673,7 +673,7 @@ SEASTAR_TEST_CASE(test_json_insert_null) {
e.execute_cql("INSERT INTO mytable JSON '{\"myid\" : \"id2\", \"mytext\" : \"text234\", \"mytext1\" : \"text235\", \"mytext2\" : null}';").get();
auto msg = e.execute_cql("SELECT * FROM mytable;").get0();
auto msg = e.execute_cql("SELECT * FROM mytable;").get();
assert_that(msg).is_rows().with_rows({{
{utf8_type->decompose(sstring("id2"))},
{utf8_type->decompose(sstring("text234"))},
@@ -696,7 +696,7 @@ SEASTAR_TEST_CASE(test_json_tuple) {
auto tt = tuple_type_impl::get_instance({int32_type, utf8_type, float_type});
auto msg = e.execute_cql("SELECT * FROM t;").get0();
auto msg = e.execute_cql("SELECT * FROM t;").get();
assert_that(msg).is_rows().with_rows({{
{int32_type->decompose(7)},
{tt->decompose(make_tuple_value(tt, tuple_type_impl::native_type({int32_t(5), sstring("test123"), float(2.5)})))},
@@ -704,7 +704,7 @@ SEASTAR_TEST_CASE(test_json_tuple) {
e.execute_cql("INSERT INTO t (id, v) VALUES (3, (5, 'test543', 4.5));").get();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get0();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(sstring("{\"id\": 3, \"v\": [5, \"test543\", 4.5]}"))
}});
@@ -724,7 +724,7 @@ static future<> test_json_udt(bool frozen) {
auto ut = user_type_impl::get_instance("ks", "utype", std::vector{bytes("first"), bytes("second"), bytes("third")}, {int32_type, utf8_type, float_type}, !frozen);
auto msg = e.execute_cql("SELECT * FROM t;").get0();
auto msg = e.execute_cql("SELECT * FROM t;").get();
assert_that(msg).is_rows().with_rows({{
{int32_type->decompose(7)},
{ut->decompose(make_user_value(ut, user_type_impl::native_type({int32_t(5), sstring("test123"), float(2.5)})))},
@@ -732,14 +732,14 @@ static future<> test_json_udt(bool frozen) {
e.execute_cql("INSERT INTO t (id, v) VALUES (3, (5, 'test543', 4.5));").get();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get0();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(sstring("{\"id\": 3, \"v\": {\"first\": 5, \"second\": \"test543\", \"third\": 4.5}}"))
}});
e.execute_cql("INSERT INTO t (id, v) VALUES (3, {\"first\": 3, \"third\": 4.5});").get();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get0();
msg = e.execute_cql("SELECT JSON * FROM t WHERE id = 3;").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(sstring("{\"id\": 3, \"v\": {\"first\": 3, \"second\": null, \"third\": 4.5}}"))
}});
@@ -752,7 +752,7 @@ static future<> test_json_udt(bool frozen) {
e.execute_cql(format("CREATE TABLE t2(id int PRIMARY KEY, v {});", frozen ? "frozen<utype2>" : "utype2")).get();
e.execute_cql("INSERT INTO t2 (id, v) VALUES (1, (7));").get();
msg = e.execute_cql("SELECT JSON * FROM t2 WHERE id = 1;").get0();
msg = e.execute_cql("SELECT JSON * FROM t2 WHERE id = 1;").get();
assert_that(msg).is_rows().with_rows({{
utf8_type->decompose(sstring("{\"id\": 1, \"v\": {\"WeirdNameThatNeedsEscaping\\\\n,)\": 7}}"))
}});
@@ -785,7 +785,7 @@ SEASTAR_TEST_CASE(test_unpack_decimal){
auto lt = list_type_impl::get_instance(ut, true);
auto lt_val = lt->decompose(make_list_value(lt, list_type_impl::native_type{{ut_val}}));
auto msg = e.execute_cql("select * from t where id = 1;").get0();
auto msg = e.execute_cql("select * from t where id = 1;").get();
assert_that(msg).is_rows().with_rows({{int32_type->decompose(1), lt_val}});
});
}

View File

@@ -41,7 +41,7 @@ static bool has_more_pages(::shared_ptr<cql_transport::messages::result_message>
SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state) {
return do_with_cql_env_thread([] (cql_test_env& e) {
e.execute_cql("CREATE TABLE test (pk int, ck int, PRIMARY KEY (pk, ck));").get();
auto id = e.prepare("INSERT INTO test (pk, ck) VALUES (?, ?);").get0();
auto id = e.prepare("INSERT INTO test (pk, ck) VALUES (?, ?);").get();
const auto raw_pk = int32_type->decompose(data_value(0));
const auto cql3_pk = cql3::raw_value::make_value(raw_pk);
@@ -52,7 +52,7 @@ SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state) {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{5, nullptr, {}, api::new_timestamp()});
auto msg = e.execute_cql("select * from test;", std::move(qo)).get0();
auto msg = e.execute_cql("select * from test;", std::move(qo)).get();
auto paging_state = extract_paging_state(msg);
uint64_t rows_fetched = count_rows_fetched(msg);
BOOST_REQUIRE_EQUAL(paging_state->get_remaining() + rows_fetched, query::max_rows);
@@ -64,7 +64,7 @@ SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state) {
while (has_more_pages(msg)) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{5, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT * FROM test;", std::move(qo)).get0();
msg = e.execute_cql("SELECT * FROM test;", std::move(qo)).get();
rows_fetched = count_rows_fetched(msg);
test_remaining = test_remaining - rows_fetched;
if (has_more_pages(msg)) {
@@ -79,7 +79,7 @@ SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state) {
SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state_filtering) {
return do_with_cql_env_thread([] (cql_test_env& e) {
e.execute_cql("CREATE TABLE test (pk int, ck int, PRIMARY KEY (pk, ck));").get();
auto id = e.prepare("INSERT INTO test (pk, ck) VALUES (?, ?);").get0();
auto id = e.prepare("INSERT INTO test (pk, ck) VALUES (?, ?);").get();
const auto raw_pk = int32_type->decompose(data_value(0));
const auto cql3_pk = cql3::raw_value::make_value(raw_pk);
@@ -90,7 +90,7 @@ SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state_filtering
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{5, nullptr, {}, api::new_timestamp()});
auto msg = e.execute_cql("select * from test where ck > 10 allow filtering;", std::move(qo)).get0();
auto msg = e.execute_cql("select * from test where ck > 10 allow filtering;", std::move(qo)).get();
auto paging_state = extract_paging_state(msg);
uint64_t rows_fetched = count_rows_fetched(msg);
BOOST_REQUIRE_EQUAL(paging_state->get_remaining() + rows_fetched, query::max_rows);
@@ -102,7 +102,7 @@ SEASTAR_TEST_CASE(test_use_high_bits_of_remaining_rows_in_paging_state_filtering
while (has_more_pages(msg)) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{5, paging_state, {}, api::new_timestamp()});
msg = e.execute_cql("SELECT * FROM test where ck > 10 allow filtering;", std::move(qo)).get0();
msg = e.execute_cql("SELECT * FROM test where ck > 10 allow filtering;", std::move(qo)).get();
rows_fetched = count_rows_fetched(msg);
test_remaining = test_remaining - rows_fetched;
if (has_more_pages(msg)) {

View File

@@ -55,7 +55,7 @@ void test_get(unsigned limit) {
auto tested = make_limiting_data_source(std::move(src), [limit] { return limit; });
char expected = 0;
auto test_get = [&] {
auto buf = tested.get().get0();
auto buf = tested.get().get();
BOOST_REQUIRE(buf.size() <= limit);
for (unsigned i = 0; i < buf.size(); ++i) {
BOOST_REQUIRE_EQUAL(expected++, buf[i]);
@@ -69,7 +69,7 @@ void test_get(unsigned limit) {
data_source prepare_test_skip() {
auto src = create_test_data_source();
auto tested = make_limiting_data_source(std::move(src), [] { return 1; });
auto buf = tested.get().get0();
auto buf = tested.get().get();
BOOST_REQUIRE_EQUAL(1, buf.size());
BOOST_REQUIRE_EQUAL(0, buf[0]);
// At this point we have 9 chars buffered in limiting_data_source_impl
@@ -93,21 +93,21 @@ SEASTAR_THREAD_TEST_CASE(test_get_smaller_bigger_than_limit) {
SEASTAR_THREAD_TEST_CASE(test_skip_smaller_than_buffered_data) {
auto tested = prepare_test_skip();
auto buf = tested.skip(8).get0();
auto buf = tested.skip(8).get();
BOOST_REQUIRE_EQUAL(1, buf.size());
BOOST_REQUIRE_EQUAL(9, buf[0]);
}
SEASTAR_THREAD_TEST_CASE(test_skip_equal_to_buffered_data) {
auto tested = prepare_test_skip();
auto buf = tested.skip(9).get0();
auto buf = tested.skip(9).get();
BOOST_REQUIRE_EQUAL(1, buf.size());
BOOST_REQUIRE_EQUAL(10, buf[0]);
}
SEASTAR_THREAD_TEST_CASE(test_skip_bigger_than_buffered_data) {
auto tested = prepare_test_skip();
auto buf = tested.skip(10).get0();
auto buf = tested.skip(10).get();
BOOST_REQUIRE_EQUAL(1, buf.size());
BOOST_REQUIRE_EQUAL(11, buf[0]);
}

View File

@@ -713,20 +713,20 @@ SEASTAR_THREAD_TEST_CASE(test_loading_cache_remove_leaves_no_old_entries_behind)
BOOST_REQUIRE_EQUAL(loading_cache.find(0), nullptr);
BOOST_REQUIRE_EQUAL(loading_cache.size(), 0);
auto ptr1 = f.get0();
auto ptr1 = f.get();
BOOST_REQUIRE_EQUAL(*ptr1, "v1");
BOOST_REQUIRE_EQUAL(loading_cache.find(0), nullptr);
BOOST_REQUIRE_EQUAL(loading_cache.size(), 0);
ptr1 = loading_cache.get_ptr(0, load_v2).get0();
ptr1 = loading_cache.get_ptr(0, load_v2).get();
loading_cache.remove(0);
BOOST_REQUIRE_EQUAL(*ptr1, "v2");
//
// Test that live ptr1, removed from cache, does not prevent reload of new value
//
auto ptr2 = loading_cache.get_ptr(0, load_v3).get0();
auto ptr2 = loading_cache.get_ptr(0, load_v3).get();
ptr1 = nullptr;
BOOST_REQUIRE_EQUAL(*ptr2, "v3");
}
@@ -750,20 +750,20 @@ SEASTAR_THREAD_TEST_CASE(test_loading_cache_remove_leaves_no_old_entries_behind)
BOOST_REQUIRE_EQUAL(loading_cache.find(0), nullptr);
BOOST_REQUIRE_EQUAL(loading_cache.size(), 0);
auto ptr1 = f.get0();
auto ptr1 = f.get();
BOOST_REQUIRE_EQUAL(*ptr1, "v1");
BOOST_REQUIRE_EQUAL(loading_cache.find(0), nullptr);
BOOST_REQUIRE_EQUAL(loading_cache.size(), 0);
ptr1 = loading_cache.get_ptr(0, load_v2).get0();
ptr1 = loading_cache.get_ptr(0, load_v2).get();
loading_cache.remove_if([] (auto&& v) { return v == "v2"; });
BOOST_REQUIRE_EQUAL(*ptr1, "v2");
//
// Test that live ptr1, removed from cache, does not prevent reload of new value
//
auto ptr2 = loading_cache.get_ptr(0, load_v3).get0();
auto ptr2 = loading_cache.get_ptr(0, load_v3).get();
ptr1 = nullptr;
BOOST_REQUIRE_EQUAL(*ptr2, "v3");
ptr2 = nullptr;
@@ -786,7 +786,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_small_cache) {
// filling "privileged section" of loading_cache.
std::vector<cql3::prepared_cache_key_type> prepared_ids_privileged;
for (int i = 0; i < 100; i++) {
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get0();
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get();
e.execute_prepared(prepared_id, {}).get();
e.execute_prepared(prepared_id, {}).get();
prepared_ids_privileged.push_back(prepared_id);
@@ -809,7 +809,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_small_cache) {
// which will occupy "unprivileged section" of loading_cache.
std::vector<cql3::prepared_cache_key_type> prepared_ids_unprivileged;
for (int i = 0; i < 5; i++) {
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get0();
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get();
e.execute_prepared(prepared_id, {}).get();
prepared_ids_unprivileged.push_back(prepared_id);
}
@@ -827,7 +827,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_small_cache) {
// Prepare 500 queries and execute them a random number of times.
for (int i = 0; i < 500; i++) {
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get0();
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get();
auto times = rand_int(4);
for (int j = 0; j < times; j++) {
e.execute_prepared(prepared_id, {}).get();
@@ -839,7 +839,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_small_cache) {
for (int i = 0; i < 100; i++) {
std::vector<cql3::prepared_cache_key_type> prepared_ids_batch;
for (int j = 0; j < 5; j++) {
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get0();
auto prepared_id = e.prepare(fmt::format("SELECT * FROM tbl1 WHERE a = {}", current_uid++)).get();
prepared_ids_batch.push_back(prepared_id);
}
auto times = rand_int(4);

View File

@@ -728,7 +728,7 @@ SEASTAR_THREAD_TEST_CASE(background_reclaim) {
// Set up the background reclaimer
auto background_reclaim_scheduling_group = create_scheduling_group("background_reclaim", 100).get0();
auto background_reclaim_scheduling_group = create_scheduling_group("background_reclaim", 100).get();
auto kill_sched_group = defer([&] () noexcept {
destroy_scheduling_group(background_reclaim_scheduling_group).get();
});

View File

@@ -329,7 +329,7 @@ SEASTAR_TEST_CASE(test_unspooled_dirty_accounting_on_flush) {
flush_reader_check.produces_partition(current_ring[1]);
unspooled_dirty_values.push_back(mgr.unspooled_dirty_memory());
while ((*rd1)().get0()) ;
while ((*rd1)().get()) ;
close_rd1.close_now();
logalloc::shard_tracker().full_compaction();
@@ -447,17 +447,17 @@ SEASTAR_TEST_CASE(test_segment_migration_during_flush) {
auto close_rd = deferred_close(rd);
for (int i = 0; i < partitions; ++i) {
auto mfopt = rd().get0();
auto mfopt = rd().get();
BOOST_REQUIRE(bool(mfopt));
BOOST_REQUIRE(mfopt->is_partition_start());
while (!mfopt->is_end_of_partition()) {
logalloc::shard_tracker().full_compaction();
mfopt = rd().get0();
mfopt = rd().get();
}
BOOST_REQUIRE_LE(mgr.unspooled_dirty_memory(), mgr.real_dirty_memory());
}
BOOST_REQUIRE(!rd().get0());
BOOST_REQUIRE(!rd().get());
});
}
@@ -807,8 +807,8 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
{
auto rd = mt->make_flat_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(!row.cells().cell_hash_for(0));
}
@@ -817,16 +817,16 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
slice.options.set<query::partition_slice::option::with_digest>();
auto rd = mt->make_flat_reader(s, semaphore.make_permit(), query::full_partition_range, slice);
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
{
auto rd = mt->make_flat_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
@@ -836,8 +836,8 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
{
auto rd = mt->make_flat_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(!row.cells().cell_hash_for(0));
}
@@ -846,16 +846,16 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
slice.options.set<query::partition_slice::option::with_digest>();
auto rd = mt->make_flat_reader(s, semaphore.make_permit(), query::full_partition_range, slice);
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
{
auto rd = mt->make_flat_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
});
@@ -1025,7 +1025,7 @@ SEASTAR_TEST_CASE(sstable_compaction_does_not_resurrect_data) {
t.compact_all_sstables().get();
// If we get additional row (1, 2, 4), that means the tombstone was purged and data was resurrected
assert_that(env.execute_cql(format("SELECT * FROM {}.{};", ks_name, table_name)).get0())
assert_that(env.execute_cql(format("SELECT * FROM {}.{};", ks_name, table_name)).get())
.is_rows()
.with_rows_ignore_order({
{serialized(1), serialized(3), serialized(3)},

View File

@@ -56,7 +56,7 @@ static auto make_populate(bool evict_paused_readers, bool single_fragment_buffer
}
return make_foreign(mt);
}).get0();
}).get();
remote_memtables->emplace_back(std::move(remote_mt));
}
keep_alive_sharder.push_back(sharder);

View File

@@ -163,7 +163,7 @@ static uint64_t aggregate_querier_cache_stat(distributed<replica::database>& db,
auto& stats = local_db.get_querier_cache_stats();
return stats.*stat;
});
}, 0, std::plus<size_t>()).get0();
}, 0, std::plus<size_t>()).get();
}
static void check_cache_population(distributed<replica::database>& db, size_t queriers,
@@ -175,7 +175,7 @@ static void check_cache_population(distributed<replica::database>& db, size_t qu
auto& stats = local_db.get_querier_cache_stats();
tests::require_equal(stats.population, queriers);
});
}).get0();
}).get();
}
static void require_eventually_empty_caches(distributed<replica::database>& db,
@@ -234,9 +234,9 @@ static std::vector<mutation> read_all_partitions_one_by_one(distributed<replica:
query::max_result_size(query::result_memory_limiter::unlimited_result_size), query::tombstone_limit::max);
const auto range = dht::partition_range::make_singular(pkey);
return make_foreign(std::make_unique<reconcilable_result>(
std::get<0>(db.query_mutations(std::move(s), cmd, range, nullptr, db::no_timeout).get0())));
std::get<0>(db.query_mutations(std::move(s), cmd, range, nullptr, db::no_timeout).get())));
});
}).get0();
}).get();
tests::require_equal(res->partitions().size(), 1u);
results.emplace_back(res->partitions().front().mut().unfreeze(s));

View File

@@ -339,7 +339,7 @@ SEASTAR_TEST_CASE(test_schema_upgrader_is_equivalent_with_mutation_upgrade) {
auto reader = transform(make_flat_mutation_reader_from_mutations_v2(m1.schema(), semaphore.make_permit(), {m1}), schema_upgrader_v2(m2.schema()));
auto close_reader = deferred_close(reader);
auto from_upgrader = read_mutation_from_flat_mutation_reader(reader).get0();
auto from_upgrader = read_mutation_from_flat_mutation_reader(reader).get();
auto regular = m1;
regular.upgrade(m2.schema());

View File

@@ -78,7 +78,7 @@ static query::result_memory_accounter make_accounter() {
// Called from a seastar thread
query::result_set to_result_set(const reconcilable_result& r, schema_ptr s, const query::partition_slice& slice) {
return query::result_set::from_raw_result(s, slice, to_data_query_result(r, s, slice, inf32, inf32).get0());
return query::result_set::from_raw_result(s, slice, to_data_query_result(r, s, slice, inf32, inf32).get());
}
static reconcilable_result mutation_query(schema_ptr s, reader_permit permit, const mutation_source& source, const dht::partition_range& range,
@@ -463,28 +463,28 @@ SEASTAR_TEST_CASE(test_result_row_count) {
auto src = make_source({m1});
auto r = to_data_query_result(mutation_query(s, semaphore.make_permit(), make_source({m1}), query::full_partition_range, slice, 10000, query::max_partitions, now),
s, slice, inf32, inf32).get0();
s, slice, inf32, inf32).get();
BOOST_REQUIRE_EQUAL(r.row_count().value(), 0);
m1.set_static_cell("s1", data_value(bytes("S_v1")), 1);
r = to_data_query_result(mutation_query(s, semaphore.make_permit(), make_source({m1}), query::full_partition_range, slice, 10000, query::max_partitions, now),
s, slice, inf32, inf32).get0();
s, slice, inf32, inf32).get();
BOOST_REQUIRE_EQUAL(r.row_count().value(), 1);
m1.set_clustered_cell(clustering_key::from_single_value(*s, bytes("A")), "v1", data_value(bytes("A_v1")), 1);
r = to_data_query_result(mutation_query(s, semaphore.make_permit(), make_source({m1}), query::full_partition_range, slice, 10000, query::max_partitions, now),
s, slice, inf32, inf32).get0();
s, slice, inf32, inf32).get();
BOOST_REQUIRE_EQUAL(r.row_count().value(), 1);
m1.set_clustered_cell(clustering_key::from_single_value(*s, bytes("B")), "v1", data_value(bytes("B_v1")), 1);
r = to_data_query_result(mutation_query(s, semaphore.make_permit(), make_source({m1}), query::full_partition_range, slice, 10000, query::max_partitions, now),
s, slice, inf32, inf32).get0();
s, slice, inf32, inf32).get();
BOOST_REQUIRE_EQUAL(r.row_count().value(), 2);
mutation m2(s, partition_key::from_single_value(*s, "key2"));
m2.set_static_cell("s1", data_value(bytes("S_v1")), 1);
r = to_data_query_result(mutation_query(s, semaphore.make_permit(), make_source({m1, m2}), query::full_partition_range, slice, 10000, query::max_partitions, now),
s, slice, inf32, inf32).get0();
s, slice, inf32, inf32).get();
BOOST_REQUIRE_EQUAL(r.row_count().value(), 3);
});
}
@@ -555,11 +555,11 @@ SEASTAR_THREAD_TEST_CASE(test_result_size_calculation) {
slice.options.set<query::partition_slice::option::allow_short_read>();
query::result::builder digest_only_builder(slice, query::result_options{query::result_request::only_digest, query::digest_algorithm::xxHash},
l.new_digest_read(query::max_result_size(query::result_memory_limiter::maximum_result_size), query::short_read::yes).get0(), query::max_tombstones);
l.new_digest_read(query::max_result_size(query::result_memory_limiter::maximum_result_size), query::short_read::yes).get(), query::max_tombstones);
data_query(s, semaphore.make_permit(), source, query::full_partition_range, slice, digest_only_builder);
query::result::builder result_and_digest_builder(slice, query::result_options{query::result_request::result_and_digest, query::digest_algorithm::xxHash},
l.new_data_read(query::max_result_size(query::result_memory_limiter::maximum_result_size), query::short_read::yes).get0(), query::max_tombstones);
l.new_data_read(query::max_result_size(query::result_memory_limiter::maximum_result_size), query::short_read::yes).get(), query::max_tombstones);
data_query(s, semaphore.make_permit(), source, query::full_partition_range, slice, result_and_digest_builder);
BOOST_REQUIRE_EQUAL(digest_only_builder.memory_accounter().used_memory(), result_and_digest_builder.memory_accounter().used_memory());

View File

@@ -1249,7 +1249,7 @@ SEASTAR_THREAD_TEST_CASE(test_foreign_reader_as_mutation_source) {
}
return make_foreign(mt);
}).get0();
}).get();
auto reader_factory = [&env, remote_shard, remote_mt = std::move(remote_mt)] (schema_ptr s,
reader_permit permit,
@@ -1267,7 +1267,7 @@ SEASTAR_THREAD_TEST_CASE(test_foreign_reader_as_mutation_source) {
trace_state.get(),
fwd_sm,
fwd_mr)));
}).get0();
}).get();
return make_foreign_reader(s, std::move(permit), std::move(remote_reader), fwd_sm);
};
@@ -1814,7 +1814,7 @@ SEASTAR_THREAD_TEST_CASE(test_stopping_reader_with_pending_read_ahead) {
std::vector<uint32_t>{0, 1})));
return make_ready_future<std::tuple<control_type, reader_type>>(std::tuple(std::move(control), std::move(reader)));
}).get0();
}).get();
auto& remote_control = std::get<0>(remote_control_remote_reader);
auto& remote_reader = std::get<1>(remote_control_remote_reader);
@@ -1830,7 +1830,7 @@ SEASTAR_THREAD_TEST_CASE(test_stopping_reader_with_pending_read_ahead) {
BOOST_REQUIRE(!smp::submit_to(shard_of_interest, [remote_control = remote_control.get()] {
return remote_control->destroyed;
}).get0());
}).get());
bool buffer_filled = false;
auto destroyed_after_close = reader.close().then([&] {
@@ -1846,9 +1846,9 @@ SEASTAR_THREAD_TEST_CASE(test_stopping_reader_with_pending_read_ahead) {
smp::submit_to(shard_of_interest, [remote_control = remote_control.get(), &buffer_filled] {
buffer_filled = true;
remote_control->buffer_filled.set_value();
}).get0();
}).get();
BOOST_REQUIRE(destroyed_after_close.get0());
BOOST_REQUIRE(destroyed_after_close.get());
return make_ready_future<>();
}).get();
@@ -2090,7 +2090,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_destroyed_with_pending
return smp::submit_to(multishard_reader_for_read_ahead::blocked_shard,
[control = remote_controls.at(multishard_reader_for_read_ahead::blocked_shard).get()] {
return control->pending;
}).get0();
}).get();
}));
// Destroy reader.
@@ -2113,7 +2113,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_destroyed_with_pending
});
},
true,
std::logical_and<bool>()).get0();
std::logical_and<bool>()).get();
}));
return make_ready_future<>();
@@ -2146,7 +2146,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_fast_forwarded_with_pe
return smp::submit_to(multishard_reader_for_read_ahead::blocked_shard,
[control = remote_controls.at(multishard_reader_for_read_ahead::blocked_shard).get()] {
return control->pending;
}).get0();
}).get();
}));
auto end_token = dht::token(pr->end()->value().token());
@@ -2170,7 +2170,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_fast_forwarded_with_pe
});
},
true,
std::logical_and<bool>()).get0();
std::logical_and<bool>()).get();
BOOST_REQUIRE(all_shard_fast_forwarded);
@@ -2188,7 +2188,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_fast_forwarded_with_pe
});
},
true,
std::logical_and<bool>()).get0();
std::logical_and<bool>()).get();
}));
return make_ready_future<>();
@@ -2201,7 +2201,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_next_partition) {
" WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get();
env.execute_cql("CREATE TABLE multishard_combining_reader_next_partition_ks.test (pk int, v int, PRIMARY KEY(pk));").get();
const auto insert_id = env.prepare("INSERT INTO multishard_combining_reader_next_partition_ks.test (\"pk\", \"v\") VALUES (?, ?);").get0();
const auto insert_id = env.prepare("INSERT INTO multishard_combining_reader_next_partition_ks.test (\"pk\", \"v\") VALUES (?, ?);").get();
const auto partition_count = 1000;
@@ -2286,7 +2286,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_streaming_reader) {
env.execute_cql("CREATE KEYSPACE multishard_streaming_reader_ks WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get();
env.execute_cql("CREATE TABLE multishard_streaming_reader_ks.test (pk int, v int, PRIMARY KEY(pk));").get();
const auto insert_id = env.prepare("INSERT INTO multishard_streaming_reader_ks.test (\"pk\", \"v\") VALUES (?, ?);").get0();
const auto insert_id = env.prepare("INSERT INTO multishard_streaming_reader_ks.test (\"pk\", \"v\") VALUES (?, ?);").get();
const auto partition_count = 10000;
@@ -2335,12 +2335,12 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_streaming_reader) {
auto close_reference_reader = deferred_close(reference_reader);
std::vector<mutation> reference_muts;
while (auto mut_opt = read_mutation_from_flat_mutation_reader(reference_reader).get0()) {
while (auto mut_opt = read_mutation_from_flat_mutation_reader(reference_reader).get()) {
reference_muts.push_back(std::move(*mut_opt));
}
std::vector<mutation> tested_muts;
while (auto mut_opt = read_mutation_from_flat_mutation_reader(tested_reader).get0()) {
while (auto mut_opt = read_mutation_from_flat_mutation_reader(tested_reader).get()) {
tested_muts.push_back(std::move(*mut_opt));
}
@@ -2367,7 +2367,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
auto read_all = [] (flat_mutation_reader_v2& reader, std::vector<mutation>& muts) {
return async([&reader, &muts] {
auto close_reader = deferred_close(reader);
while (auto mut_opt = read_mutation_from_flat_mutation_reader(reader).get0()) {
while (auto mut_opt = read_mutation_from_flat_mutation_reader(reader).get()) {
muts.emplace_back(std::move(*mut_opt));
}
});
@@ -2377,7 +2377,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
return async([&] {
auto reader = make_flat_mutation_reader_from_mutations_v2(muts.front().schema(), semaphore.make_permit(), muts);
auto close_reader = deferred_close(reader);
while (auto mf_opt = reader().get0()) {
while (auto mf_opt = reader().get()) {
handle.push(std::move(*mf_opt)).get();
}
handle.push_end_of_stream();
@@ -2409,7 +2409,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
auto expected_reader = make_flat_mutation_reader_from_mutations_v2(expected_muts.front().schema(), semaphore.make_permit(), expected_muts);
auto close_expected_reader = deferred_close(expected_reader);
handle.push(std::move(*expected_reader().get0())).get();
handle.push(std::move(*expected_reader().get())).get();
BOOST_REQUIRE(!fill_buffer_fut.available());
@@ -2433,7 +2433,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
auto push_fut = make_ready_future<>();
while (push_fut.available()) {
push_fut = handle.push(std::move(*expected_reader().get0()));
push_fut = handle.push(std::move(*expected_reader().get()));
}
BOOST_REQUIRE(!push_fut.available());
@@ -2473,7 +2473,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
auto expected_reader = make_flat_mutation_reader_from_mutations_v2(expected_muts.front().schema(), semaphore.make_permit(), expected_muts);
auto close_expected_reader = deferred_close(expected_reader);
handle.push(std::move(*expected_reader().get0())).get();
handle.push(std::move(*expected_reader().get())).get();
BOOST_REQUIRE(!fill_buffer_fut.available());
@@ -2501,7 +2501,7 @@ SEASTAR_THREAD_TEST_CASE(test_queue_reader) {
auto expected_reader = make_flat_mutation_reader_from_mutations_v2(expected_muts.front().schema(), semaphore.make_permit(), expected_muts);
auto close_expected_reader = deferred_close(expected_reader);
handle.push(std::move(*expected_reader().get0())).get();
handle.push(std::move(*expected_reader().get())).get();
BOOST_REQUIRE(!fill_buffer_fut.available());
@@ -2852,7 +2852,7 @@ flat_mutation_reader_v2 create_evictable_reader_and_evict_after_first_buffer(
rd.set_max_buffer_size(max_buffer_size);
rd.fill_buffer().get0();
rd.fill_buffer().get();
const auto eq_cmp = position_in_partition::equal_compare(*schema);
BOOST_REQUIRE(rd.is_buffer_full());
@@ -2913,7 +2913,7 @@ void check_evictable_reader_validation_is_triggered(
const bool fail = !error_prefix.empty();
try {
rd.fill_buffer().get0();
rd.fill_buffer().get();
} catch (std::runtime_error& e) {
if (fail) {
if (error_prefix == std::string_view(e.what(), error_prefix.size())) {
@@ -4210,7 +4210,7 @@ SEASTAR_THREAD_TEST_CASE(test_clustering_combining_of_empty_readers) {
std::make_unique<simple_position_reader_queue>(*s, std::move(rs)));
auto close_r = deferred_close(r);
auto mf = r().get0();
auto mf = r().get();
if (mf) {
BOOST_FAIL(format("reader combined of empty readers returned fragment {}", mutation_fragment_v2::printer(*s, *mf)));
}

View File

@@ -86,7 +86,7 @@ static mutation_partition get_partition(reader_permit permit, replica::memtable&
auto range = dht::partition_range::make_singular(dk);
auto reader = mt.make_flat_reader(mt.schema(), std::move(permit), range);
auto close_reader = deferred_close(reader);
auto mo = read_mutation_from_flat_mutation_reader(reader).get0();
auto mo = read_mutation_from_flat_mutation_reader(reader).get();
BOOST_REQUIRE(bool(mo));
return std::move(mo->partition());
}
@@ -451,7 +451,7 @@ SEASTAR_THREAD_TEST_CASE(test_large_collection_allocation) {
auto rd = mt->make_flat_reader(schema, semaphore.make_permit());
auto close_rd = deferred_close(rd);
auto res_mut_opt = read_mutation_from_flat_mutation_reader(rd).get0();
auto res_mut_opt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(res_mut_opt);
res_mut_opt->partition().compact_for_query(*schema, res_mut_opt->decorated_key(), gc_clock::now(), {query::full_clustering_range}, true, false,
@@ -2775,7 +2775,7 @@ void run_compaction_data_stream_split_test(const schema& schema, reader_permit p
survived_compacted_fragments_consumer(schema, query_time, get_max_purgeable),
purged_compacted_fragments_consumer(schema, query_time, get_max_purgeable));
auto [survived_muts, purged_muts] = reader.consume(std::move(consumer)).get0();
auto [survived_muts, purged_muts] = reader.consume(std::move(consumer)).get();
auto survived_muts_it = survived_muts.begin();
const auto survived_muts_end = survived_muts.end();
@@ -2833,7 +2833,7 @@ SEASTAR_THREAD_TEST_CASE(test_compaction_data_stream_split) {
return tests::expiry_info{ttl, query_time + gc_clock::duration{offset_dist(engine)}};
};
const auto mutations = tests::generate_random_mutations(random_schema, ts_gen, exp_gen, partition_count_dist,
clustering_row_count_dist).get0();
clustering_row_count_dist).get();
run_compaction_data_stream_split_test(schema, semaphore.make_permit(), query_time, mutations);
}
@@ -2868,7 +2868,7 @@ SEASTAR_THREAD_TEST_CASE(test_compaction_data_stream_split) {
return tests::expiry_info{ttl, query_time + gc_clock::duration{offset_dist(engine)}};
};
const auto mutations = tests::generate_random_mutations(random_schema, ts_gen, all_purged_exp_gen, partition_count_dist,
clustering_row_count_dist).get0();
clustering_row_count_dist).get();
run_compaction_data_stream_split_test(schema, semaphore.make_permit(), query_time, mutations);
}
@@ -2897,7 +2897,7 @@ SEASTAR_THREAD_TEST_CASE(test_compaction_data_stream_split) {
}
};
const auto mutations = tests::generate_random_mutations(random_schema, ts_gen, tests::no_expiry_expiry_generator(), partition_count_dist,
clustering_row_count_dist).get0();
clustering_row_count_dist).get();
run_compaction_data_stream_split_test(schema, semaphore.make_permit(), query_time, mutations);
}
}

View File

@@ -92,7 +92,7 @@ SEASTAR_TEST_CASE(test_multishard_writer) {
});
});
}
).get0();
).get();
BOOST_REQUIRE_EQUAL(partitions_received, partition_nr);
BOOST_REQUIRE_EQUAL(shards_after, shards_before);
}
@@ -162,7 +162,7 @@ SEASTAR_TEST_CASE(test_multishard_writer_producer_aborts) {
});
});
}
).get0();
).get();
} catch (...) {
// The distribute_reader_and_consume_on_shards is expected to fail and not block forever
}
@@ -369,7 +369,7 @@ SEASTAR_THREAD_TEST_CASE(test_timestamp_based_splitting_mutation_writer) {
return underlying(engine, ts_dest, min_timestamp);
};
auto muts = tests::generate_random_mutations(random_schema, ts_gen).get0();
auto muts = tests::generate_random_mutations(random_schema, ts_gen).get();
auto classify_fn = [] (api::timestamp_type ts) {
return int64_t(ts % 2);
@@ -403,7 +403,7 @@ static void assert_that_segregator_produces_correct_data(const bucket_map_t& buc
}
std::vector<mutation> combined_mutations;
while (auto m = read_mutation_from_flat_mutation_reader(reader).get0()) {
while (auto m = read_mutation_from_flat_mutation_reader(reader).get()) {
m->partition().compact_for_compaction(*random_schema.schema(), always_gc, m->decorated_key(), now, tombstone_gc_state(nullptr));
combined_mutations.emplace_back(std::move(*m));
}
@@ -440,7 +440,7 @@ SEASTAR_THREAD_TEST_CASE(test_timestamp_based_splitting_mutation_writer_abort) {
return underlying(engine, ts_dest, min_timestamp);
};
auto muts = tests::generate_random_mutations(random_schema, ts_gen).get0();
auto muts = tests::generate_random_mutations(random_schema, ts_gen).get();
auto classify_fn = [] (api::timestamp_type ts) {
return int64_t(ts % 2);
@@ -563,7 +563,7 @@ SEASTAR_THREAD_TEST_CASE(test_token_group_based_splitting_mutation_writer) {
size_t partition_count = many_partitions();
auto muts = tests::generate_random_mutations(random_schema, partition_count).get0();
auto muts = tests::generate_random_mutations(random_schema, partition_count).get();
auto classify_fn = [] (dht::token t) -> mutation_writer::token_group_id {
return dht::compaction_group_of(1, t);

View File

@@ -161,7 +161,7 @@ void full_ring_check(const std::vector<ring_point>& ring_points,
const auto& topo = tm.get_topology();
strategy_sanity_check(ars_ptr, tmptr, options);
auto erm = calculate_effective_replication_map(ars_ptr, tmptr).get0();
auto erm = calculate_effective_replication_map(ars_ptr, tmptr).get();
for (auto& rp : ring_points) {
double cur_point1 = rp.point - 0.5;
@@ -447,7 +447,7 @@ SEASTAR_THREAD_TEST_CASE(NetworkTopologyStrategy_tablets_test) {
.with_column("v", utf8_type)
.build();
auto tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get0();
auto tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get();
full_ring_check(tmap, options323, ars_ptr, stm.get());
///////////////
@@ -464,7 +464,7 @@ SEASTAR_THREAD_TEST_CASE(NetworkTopologyStrategy_tablets_test) {
tab_awr_ptr = ars_ptr->maybe_as_tablet_aware();
BOOST_REQUIRE(tab_awr_ptr);
tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get0();
tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get();
full_ring_check(tmap, options320, ars_ptr, stm.get());
// Test the case of not enough nodes to meet RF in DC 102
@@ -480,7 +480,7 @@ SEASTAR_THREAD_TEST_CASE(NetworkTopologyStrategy_tablets_test) {
tab_awr_ptr = ars_ptr->maybe_as_tablet_aware();
BOOST_REQUIRE(tab_awr_ptr);
tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get0();
tmap = tab_awr_ptr->allocate_tablets_for_new_table(s, stm.get(), 1).get();
full_ring_check(tmap, options324, ars_ptr, stm.get());
}
@@ -657,7 +657,7 @@ static void test_equivalence(const shared_token_metadata& stm, const locator::to
for (size_t i = 0; i < 1000; ++i) {
auto token = dht::token::get_random_token();
auto expected = calculate_natural_endpoints(token, tm, topo, datacenters);
auto actual = nts.calculate_natural_endpoints(token, *stm.get()).get0();
auto actual = nts.calculate_natural_endpoints(token, *stm.get()).get();
// Because the old algorithm does not put the nodes in the correct order in the case where more replicas
// are required than there are racks in a dc, we accept different order as long as the primary

View File

@@ -447,7 +447,7 @@ static
void
do_test_split_range_to_single_shard(const schema& s, const dht::sharder& sharder_, const dht::partition_range& pr) {
for (auto shard : boost::irange(0u, sharder_.shard_count())) {
auto ranges = dht::split_range_to_single_shard(s, sharder_, pr, shard).get0();
auto ranges = dht::split_range_to_single_shard(s, sharder_, pr, shard).get();
auto sharder = dht::ring_position_range_sharder(sharder_, pr);
auto x = sharder.next(s);
auto cmp = dht::ring_position_comparator(s);

View File

@@ -216,7 +216,7 @@ public:
const auto cache_key = make_cache_key(key);
auto querier = make_querier<Querier>(range);
auto dk_ck = querier.consume_page(dummy_result_builder{}, row_limit, std::numeric_limits<uint32_t>::max(), gc_clock::now()).get0();
auto dk_ck = querier.consume_page(dummy_result_builder{}, row_limit, std::numeric_limits<uint32_t>::max(), gc_clock::now()).get();
auto&& dk = dk_ck.first;
auto&& ck = dk_ck.second;
auto permit = querier.permit();
@@ -648,7 +648,7 @@ SEASTAR_THREAD_TEST_CASE(test_resources_based_cache_eviction) {
BOOST_REQUIRE(env.local_db().has_schema("querier_cache", "test"));
auto insert_id = env.prepare("INSERT INTO querier_cache.test (pk, ck, value) VALUES (?, ?, ?);").get0();
auto insert_id = env.prepare("INSERT INTO querier_cache.test (pk, ck, value) VALUES (?, ?, ?);").get();
auto pk = cql3::raw_value::make_value(serialized(0));
for (int i = 0; i < 100; ++i) {
auto ck = cql3::raw_value::make_value(serialized(i));
@@ -737,7 +737,7 @@ SEASTAR_THREAD_TEST_CASE(test_immediate_evict_on_insert) {
test_querier_cache t;
auto& sem = t.get_semaphore();
auto permit1 = sem.obtain_permit(t.get_schema(), get_name(), 0, db::no_timeout, {}).get0();
auto permit1 = sem.obtain_permit(t.get_schema(), get_name(), 0, db::no_timeout, {}).get();
auto resources = permit1.consume_resources(reader_resources(sem.available_resources().count, 0));

View File

@@ -94,14 +94,14 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_destroyed_permit_rele
// Admitted, active
{
auto permit = semaphore.obtain_permit(s.schema(), get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(s.schema(), get_name(), 1024, db::no_timeout, {}).get();
auto units1 = permit.consume_memory(1024);
}
BOOST_REQUIRE_EQUAL(semaphore.available_resources(), initial_resources);
// Admitted, inactive
{
auto permit = semaphore.obtain_permit(s.schema(), get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(s.schema(), get_name(), 1024, db::no_timeout, {}).get();
auto units1 = permit.consume_memory(1024);
auto handle = semaphore.register_inactive_read(make_empty_flat_reader_v2(s.schema(), permit));
@@ -421,23 +421,23 @@ SEASTAR_TEST_CASE(reader_restriction_file_tracking) {
BOOST_REQUIRE_EQUAL(4 * 1024, semaphore.available_resources().memory);
auto buf1 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
auto buf1 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(3 * 1024, semaphore.available_resources().memory);
auto buf2 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
auto buf2 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(2 * 1024, semaphore.available_resources().memory);
auto buf3 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
auto buf3 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(1 * 1024, semaphore.available_resources().memory);
auto buf4 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
auto buf4 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(0 * 1024, semaphore.available_resources().memory);
auto buf5 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
auto buf5 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(-1 * 1024, semaphore.available_resources().memory);
// Reassing buf1, should still have the same amount of units.
buf1 = tracked_file.dma_read_bulk<char>(0, 1024).get0();
buf1 = tracked_file.dma_read_bulk<char>(0, 1024).get();
BOOST_REQUIRE_EQUAL(-1 * 1024, semaphore.available_resources().memory);
// Move buf1 to the heap, so that we can safely destroy it
@@ -531,7 +531,7 @@ SEASTAR_TEST_CASE(reader_concurrency_semaphore_max_queue_length) {
permit1 = {};
{
auto res = permit2_fut.get0();
auto res = permit2_fut.get();
}
{
auto res = permit3_fut.get();
@@ -867,7 +867,7 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_need_cpu_awaits) {
BOOST_REQUIRE_EQUAL(semaphore.get_stats().need_cpu_permits, 0);
BOOST_REQUIRE_EQUAL(semaphore.get_stats().awaits_permits, 0);
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
for (auto scenario = 0; scenario < 5; ++scenario) {
testlog.info("Running scenario {}", scenario);
@@ -1062,8 +1062,8 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_set_resources) {
reader_concurrency_semaphore semaphore(reader_concurrency_semaphore::for_tests{}, get_name(), initial_resources.count, initial_resources.memory);
auto stop_sem = deferred_stop(semaphore);
auto permit1 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit2 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit1 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
auto permit2 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
BOOST_REQUIRE_EQUAL(semaphore.available_resources(), reader_resources(2, 2 * 1024));
BOOST_REQUIRE_EQUAL(semaphore.initial_resources(), reader_resources(4, 4 * 1024));
@@ -1385,7 +1385,7 @@ SEASTAR_TEST_CASE(test_reader_concurrency_semaphore_memory_limit_no_oom) {
const auto num_reads = 128;
#endif
auto read_id = env.prepare("SELECT value FROM ks.tbl WHERE pk = ? AND ck = ?").get0();
auto read_id = env.prepare("SELECT value FROM ks.tbl WHERE pk = ? AND ck = ?").get();
parallel_for_each(boost::irange(0, num_reads), [&] (int i) {
return env.execute_prepared(read_id, {cql3::raw_value::make_value(tbl.pk.explode().front()), cql3::raw_value::make_value(tbl.ck.explode().front())}).then_wrapped(
@@ -1435,7 +1435,7 @@ SEASTAR_TEST_CASE(test_reader_concurrency_semaphore_memory_limit_engages) {
const auto num_reads = 128;
auto read_id = env.prepare("SELECT value FROM ks.tbl WHERE pk = ? AND ck = ?").get0();
auto read_id = env.prepare("SELECT value FROM ks.tbl WHERE pk = ? AND ck = ?").get();
// We first check that the test params are not too strict and a single
// read can finish successfully.
@@ -1495,7 +1495,7 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_request_memory_preser
utils::updateable_value<uint32_t>(serialize_multiplier), utils::updateable_value<uint32_t>(kill_multiplier), reader_concurrency_semaphore::register_metrics::no);
auto stop_sem = deferred_stop(semaphore);
auto sponge_permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto sponge_permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
uint64_t reads_enqueued_for_memory = 0;
@@ -1530,20 +1530,20 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_request_memory_preser
// active
{
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
do_check(permit, 0, 0, seastar::compat::source_location::current());
}
// need_cpu
{
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
reader_permit::need_cpu_guard ncpu_guard{permit};
do_check(permit, 1, 0, seastar::compat::source_location::current());
}
// awaits
{
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
reader_permit::need_cpu_guard ncpu_guard{permit};
reader_permit::awaits_guard awaits_guard{permit};
do_check(permit, 1, 1, seastar::compat::source_location::current());
@@ -1620,8 +1620,8 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_permit_waiting_for_me
utils::updateable_value<uint32_t>(serialize_multiplier), utils::updateable_value<uint32_t>(kill_multiplier), reader_concurrency_semaphore::register_metrics::no);
auto stop_sem = deferred_stop(semaphore);
auto permit1 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit2 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get0();
auto permit1 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
auto permit2 = semaphore.obtain_permit(nullptr, get_name(), 1024, db::no_timeout, {}).get();
std::vector<reader_permit::resource_units> res;

View File

@@ -50,7 +50,7 @@ void require_rows(cql_test_env& e,
cql3::cql_config cfg(cql3::cql_config::default_tag{});
auto opts = to_options(cfg, std::move(names), std::vector(rvals.begin(), rvals.end()));
try {
assert_that(e.execute_prepared_with_qo(id, std::move(opts)).get0()).is_rows().with_rows_ignore_order(expected);
assert_that(e.execute_prepared_with_qo(id, std::move(opts)).get()).is_rows().with_rows_ignore_order(expected);
} catch (const std::exception& e) {
BOOST_FAIL(format("execute_prepared failed: {}\n{}:{}: originally from here",
e.what(), loc.file_name(), loc.line()));
@@ -107,13 +107,13 @@ SEASTAR_THREAD_TEST_CASE(regular_col_eq) {
require_rows(e, "select r from t where q=12 and p=2 and r=99 allow filtering", {});
cquery_nofail(e, "insert into t(p) values (100)");
require_rows(e, "select q from t where q=12 allow filtering", {{I(12)}});
auto stmt = e.prepare("select q from t where q=? allow filtering").get0();
auto stmt = e.prepare("select q from t where q=? allow filtering").get();
require_rows(e, stmt, {}, {I(12)}, {{I(12)}});
require_rows(e, stmt, {}, {I(99)}, {});
stmt = e.prepare("select q from t where q=:q allow filtering").get0();
stmt = e.prepare("select q from t where q=:q allow filtering").get();
require_rows(e, stmt, {{"q"}}, {I(12)}, {{I(12)}});
require_rows(e, stmt, {{"q"}}, {I(99)}, {});
stmt = e.prepare("select p from t where q=? and r=? allow filtering").get0();
stmt = e.prepare("select p from t where q=? and r=? allow filtering").get();
require_rows(e, stmt, {}, {I(12), I(22)}, {{I(2), I(12), I(22)}});
require_rows(e, stmt, {}, {I(11), I(21)}, {{I(1), I(11), I(21)}});
require_rows(e, stmt, {}, {I(11), I(22)}, {});
@@ -204,7 +204,7 @@ SEASTAR_THREAD_TEST_CASE(map_entry_eq) {
const auto m3new = my_map_type->decompose(
make_map_value(my_map_type, map_type_impl::native_type({{1, 111}})));
require_rows(e, "select p from t where m[1]=111 allow filtering", {{I(3), m3new}});
const auto stmt = e.prepare("select p from t where m[1]=:uno and m[3]=:tres allow filtering").get0();
const auto stmt = e.prepare("select p from t where m[1]=:uno and m[3]=:tres allow filtering").get();
const auto m1 = my_map_type->decompose(
make_map_value(my_map_type, map_type_impl::native_type({{1, 11}, {2, 12}, {3, 13}})));
require_rows(e, stmt, {{"uno", "tres"}}, {I(11), I(13)}, {{I(1), m1}});
@@ -338,17 +338,17 @@ SEASTAR_THREAD_TEST_CASE(multi_col_eq) {
require_rows(e, "select c2 from t where (c1,c2)=('two',11) allow filtering", {});
require_rows(e, "select c1 from t where (c1)=('one') allow filtering", {{T("one")}});
require_rows(e, "select c1 from t where (c1)=('x') allow filtering", {});
auto stmt = e.prepare("select p from t where (c1,c2)=:t allow filtering").get0();
auto stmt = e.prepare("select p from t where (c1,c2)=:t allow filtering").get();
require_rows(e, stmt, {{"t"}}, {make_tuple({utf8_type, float_type}, {sstring("two"), 12.f})}, {{I(2)}});
require_rows(e, stmt, {{"t"}}, {make_tuple({utf8_type, float_type}, {sstring("x"), 12.f})}, {});
stmt = e.prepare("select p from t where (c1,c2)=('two',?) allow filtering").get0();
stmt = e.prepare("select p from t where (c1,c2)=('two',?) allow filtering").get();
require_rows(e, stmt, {}, {F(12)}, {{I(2)}});
require_rows(e, stmt, {}, {F(99)}, {});
stmt = e.prepare("select c1 from t where (c1)=? allow filtering").get0();
stmt = e.prepare("select c1 from t where (c1)=? allow filtering").get();
require_rows(e, stmt, {}, {make_tuple({utf8_type}, {sstring("one")})}, {{T("one")}});
require_rows(e, stmt, {}, {make_tuple({utf8_type}, {sstring("two")})}, {{T("two")}});
require_rows(e, stmt, {}, {make_tuple({utf8_type}, {sstring("three")})}, {});
stmt = e.prepare("select c1 from t where (c1)=(:c1) allow filtering").get0();
stmt = e.prepare("select c1 from t where (c1)=(:c1) allow filtering").get();
require_rows(e, stmt, {{"c1"}}, {T("one")}, {{T("one")}});
require_rows(e, stmt, {{"c1"}}, {T("two")}, {{T("two")}});
require_rows(e, stmt, {{"c1"}}, {T("three")}, {});
@@ -368,16 +368,16 @@ SEASTAR_THREAD_TEST_CASE(multi_col_slice) {
require_rows(e, "select c1 from t where (c1)>=('c') allow filtering", {{T("c")}});
require_rows(e, "select c1 from t where (c1,c2)<=('c',13) allow filtering", {{T("a")}, {T("b")}, {T("c")}});
require_rows(e, "select c1 from t where (c1,c2)>=('b',2) and (c1,c2)<=('b',2) allow filtering", {{T("b")}});
auto stmt = e.prepare("select c1 from t where (c1,c2)<? allow filtering").get0();
auto stmt = e.prepare("select c1 from t where (c1,c2)<? allow filtering").get();
require_rows(e, stmt, {}, {make_tuple({utf8_type, float_type}, {sstring("a"), 12.f})}, {{T("a")}});
require_rows(e, stmt, {}, {make_tuple({utf8_type, float_type}, {sstring("a"), 11.f})}, {});
stmt = e.prepare("select c1 from t where (c1,c2)<('a',:c2) allow filtering").get0();
stmt = e.prepare("select c1 from t where (c1,c2)<('a',:c2) allow filtering").get();
require_rows(e, stmt, {{"c2"}}, {F(12)}, {{T("a")}});
require_rows(e, stmt, {{"c2"}}, {F(11)}, {});
stmt = e.prepare("select c1 from t where (c1)>=? allow filtering").get0();
stmt = e.prepare("select c1 from t where (c1)>=? allow filtering").get();
require_rows(e, stmt, {}, {make_tuple({utf8_type}, {sstring("c")})}, {{T("c")}});
require_rows(e, stmt, {}, {make_tuple({utf8_type}, {sstring("x")})}, {});
stmt = e.prepare("select c1 from t where (c1)>=(:c1) allow filtering").get0();
stmt = e.prepare("select c1 from t where (c1)>=(:c1) allow filtering").get();
require_rows(e, stmt, {{"c1"}}, {T("c")}, {{T("c")}});
require_rows(e, stmt, {{"c1"}}, {T("x")}, {});
}).get();
@@ -451,7 +451,7 @@ SEASTAR_THREAD_TEST_CASE(set_contains) {
require_rows(e, "select p from t where st contains null allow filtering", {});
cquery_nofail(e, "delete from t where p={4}");
require_rows(e, "select p from t where st contains 105 allow filtering", {{SI({5}), SI({104, 105})}});
const auto stmt = e.prepare("select p from t where p contains :p allow filtering").get0();
const auto stmt = e.prepare("select p from t where p contains :p allow filtering").get();
require_rows(e, stmt, {{"p"}}, {I(999)}, {});
require_rows(e, stmt, {{"p"}}, {I(1)}, {{SI({1})}, {SI({1, 3})}});
require_rows(e, stmt, {{"p"}}, {I(2)}, {{SI({2})}});
@@ -583,7 +583,7 @@ SEASTAR_THREAD_TEST_CASE(contains_key) {
const auto s6 = int_text_map_type->decompose(
make_map_value(int_text_map_type, map_type_impl::native_type({{55, "bbbb"}, {66, "bbbb"}})));
require_rows(e, "select p from t where s contains key 55 allow filtering", {{p5, s5}, {p5, s5}, {p6, s6}});
const auto stmt = e.prepare("select p from t where s contains key :k allow filtering").get0();
const auto stmt = e.prepare("select p from t where s contains key :k allow filtering").get();
require_rows(e, stmt, {{"k"}}, {I(55)}, {{p5, s5}, {p5, s5}, {p6, s6}});
require_rows(e, stmt, {{"k"}}, {I(999)}, {});
}).get();
@@ -616,7 +616,7 @@ SEASTAR_THREAD_TEST_CASE(like) {
{{T("c2a")}, {T("c2b")}, {T("c2ba")}, {T("c2c")}});
require_rows(e, "select * from t where ck1 like '' and ck2 like '_2a' allow filtering", {});
require_rows(e, "select r from t where r='rb' and ck2 like 'c2_' allow filtering", {{T("rb"), T("c2b")}});
const auto stmt = e.prepare("select ck1 from t where ck1 like ? allow filtering").get0();
const auto stmt = e.prepare("select ck1 from t where ck1 like ? allow filtering").get();
require_rows(e, stmt, {}, {T("%c")}, {{T("c1c")}});
require_rows(e, stmt, {}, {T("%xyxyz")}, {});
}).get();
@@ -657,7 +657,7 @@ SEASTAR_THREAD_TEST_CASE(scalar_in) {
require_rows(e, "select s from t where s in ('34') allow filtering", {{T("34")}, {T("34")}});
require_rows(e, "select s from t where s in ('34','35') and r=24 allow filtering",
{{T("34"), F(24)}, {T("34"), F(24)}});
const auto stmt = e.prepare("select r from t where r in ? allow filtering").get0();
const auto stmt = e.prepare("select r from t where r in ? allow filtering").get();
require_rows(e, stmt, {}, {LF({99.f, 88.f, 77.f})}, {});
require_rows(e, stmt, {}, {LF({21.f})}, {{F(21)}});
require_rows(e, stmt, {}, {LF({21.f, 22.f, 23.f})}, {{F(21)}, {F(23)}});
@@ -743,7 +743,7 @@ SEASTAR_THREAD_TEST_CASE(multi_col_in) {
{{I(4), I(13), F(23), T("a")}});
cquery_nofail(e, "delete from t where pk=4");
require_rows(e, "select pk from t where (ck1,ck2) in ((13,23)) allow filtering", {{I(3)}});
auto stmt = e.prepare("select ck1 from t where (ck1,ck2) in ? allow filtering").get0();
auto stmt = e.prepare("select ck1 from t where (ck1,ck2) in ? allow filtering").get();
auto bound_tuples = [] (std::vector<std::tuple<int32_t, float>> tuples) {
const auto tuple_type = tuple_type_impl::get_instance({int32_type, float_type});
const auto list_type = list_type_impl::get_instance(tuple_type, true);
@@ -759,21 +759,21 @@ SEASTAR_THREAD_TEST_CASE(multi_col_in) {
require_rows(e, stmt, {}, {bound_tuples({{13, 13}, {12, 22}})}, {{I(12)}});
require_rows(e, stmt, {}, {bound_tuples({{12, 21}})}, {});
require_rows(e, stmt, {}, {bound_tuples({{12, 21}, {12, 21}, {13, 21}, {14, 21}})}, {});
stmt = e.prepare("select ck1 from t where (ck1,ck2) in (?) allow filtering").get0();
stmt = e.prepare("select ck1 from t where (ck1,ck2) in (?) allow filtering").get();
auto tpl = [] (int32_t e1, float e2) {
return make_tuple({int32_type, float_type}, {e1, e2});
};
require_rows(e, stmt, {}, {tpl(11, 21)}, {{I(11)}});
require_rows(e, stmt, {}, {tpl(12, 22)}, {{I(12)}});
require_rows(e, stmt, {}, {tpl(12, 21)}, {});
stmt = e.prepare("select ck1 from t where (ck1,ck2) in (:t1,:t2) allow filtering").get0();
stmt = e.prepare("select ck1 from t where (ck1,ck2) in (:t1,:t2) allow filtering").get();
require_rows(e, stmt, {{"t1", "t2"}}, {tpl(11, 21), tpl(12, 22)}, {{I(11)}, {I(12)}});
require_rows(e, stmt, {{"t1", "t2"}}, {tpl(11, 21), tpl(11, 21)}, {{I(11)}});
require_rows(e, stmt, {{"t1", "t2"}}, {tpl(11, 21), tpl(99, 99)}, {{I(11)}});
require_rows(e, stmt, {{"t1", "t2"}}, {tpl(9, 9), tpl(99, 99)}, {});
// Parsing error:
// stmt = e.prepare("select ck1 from t where (ck1,ck2) in ((13,23),:p1)").get0();
stmt = e.prepare("select ck1 from t where (ck1,ck2) in ((13,23),(?,?)) allow filtering").get0();
// stmt = e.prepare("select ck1 from t where (ck1,ck2) in ((13,23),:p1)").get();
stmt = e.prepare("select ck1 from t where (ck1,ck2) in ((13,23),(?,?)) allow filtering").get();
require_rows(e, stmt, {}, {I(0), F(0)}, {{I(13)}});
require_rows(e, stmt, {}, {I(11), F(21)}, {{I(11)}, {I(13)}});
}).get();
@@ -791,10 +791,10 @@ SEASTAR_THREAD_TEST_CASE(bounds) {
require_rows(e, "select p from t where p=1 and (c) = (11)", {{I(1)}});
require_rows(e, "select c from t where p in (1,2,3) and c > 11 and c < 13", {{I(12)}});
require_rows(e, "select c from t where p in (1,2,3) and c >= 11 and c < 13", {{I(11)}, {I(12)}});
auto stmt = e.prepare("select c from t where p in (1,2,3) and c >= 11 and c < ?").get0();
auto stmt = e.prepare("select c from t where p in (1,2,3) and c >= 11 and c < ?").get();
require_rows(e, stmt, {}, {I(13)}, {{I(11)}, {I(12)}});
require_rows(e, stmt, {}, {I(10)}, {});
stmt = e.prepare("select c from t where p in (1,2,3) and (c) < ?").get0();
stmt = e.prepare("select c from t where p in (1,2,3) and (c) < ?").get();
require_rows(e, stmt, {}, {make_tuple({int32_type}, {13})}, {{I(11)}, {I(12)}});
require_rows(e, stmt, {}, {make_tuple({int32_type}, {11})}, {});
}).get();
@@ -866,7 +866,7 @@ SEASTAR_THREAD_TEST_CASE(token) {
require_rows(e, "select p from t where token(p,q) <= token(1,11) and r<102 allow filtering",
{{I(1), I(101)}});
require_rows(e, "select p from t where token(p,q) = token(2,12) and r<102 allow filtering", {});
const auto stmt = e.prepare("select p from t where token(p,q) = token(1,?)").get0();
const auto stmt = e.prepare("select p from t where token(p,q) = token(1,?)").get();
require_rows(e, stmt, {}, {I(11)}, {{I(1)}});
require_rows(e, stmt, {}, {I(10)}, {});

View File

@@ -26,7 +26,7 @@ auto make_manager(cql_test_env& env) {
SEASTAR_TEST_CASE(create_role) {
return do_with_cql_env_thread([](auto&& env) {
auto m = make_manager(env);
m->start().get0();
m->start().get();
const auto anon = auth::authenticated_user();
@@ -38,26 +38,26 @@ SEASTAR_TEST_CASE(create_role) {
c.is_superuser = true;
m->create("admin", c).get();
BOOST_REQUIRE_EQUAL(m->exists("admin").get0(), true);
BOOST_REQUIRE_EQUAL(m->can_login("admin").get0(), false);
BOOST_REQUIRE_EQUAL(m->is_superuser("admin").get0(), true);
BOOST_REQUIRE_EQUAL(m->exists("admin").get(), true);
BOOST_REQUIRE_EQUAL(m->can_login("admin").get(), false);
BOOST_REQUIRE_EQUAL(m->is_superuser("admin").get(), true);
BOOST_REQUIRE_EQUAL(
m->query_granted("admin", auth::recursive_role_query::yes).get0(),
m->query_granted("admin", auth::recursive_role_query::yes).get(),
std::unordered_set<sstring>{"admin"});
//
// Creating a role that already exists is an error.
//
BOOST_REQUIRE_THROW(m->create("admin", c).get0(), auth::role_already_exists);
BOOST_REQUIRE_THROW(m->create("admin", c).get(), auth::role_already_exists);
});
}
SEASTAR_TEST_CASE(drop_role) {
return do_with_cql_env_thread([](auto&& env) {
auto m = make_manager(env);
m->start().get0();
m->start().get();
const auto anon = auth::authenticated_user();
@@ -67,145 +67,145 @@ SEASTAR_TEST_CASE(drop_role) {
m->create("lord", auth::role_config()).get();
m->drop("lord").get();
BOOST_REQUIRE_EQUAL(m->exists("lord").get0(), false);
BOOST_REQUIRE_EQUAL(m->exists("lord").get(), false);
//
// Dropping a role revokes it from other roles and revokes other roles from it.
//
m->create("peasant", auth::role_config()).get0();
m->create("lord", auth::role_config()).get0();
m->create("king", auth::role_config()).get0();
m->create("peasant", auth::role_config()).get();
m->create("lord", auth::role_config()).get();
m->create("king", auth::role_config()).get();
auth::role_config tim_config;
tim_config.is_superuser = false;
tim_config.can_login = true;
m->create("tim", tim_config).get0();
m->create("tim", tim_config).get();
m->grant("lord", "peasant").get0();
m->grant("king", "lord").get0();
m->grant("tim", "lord").get0();
m->grant("lord", "peasant").get();
m->grant("king", "lord").get();
m->grant("tim", "lord").get();
m->drop("lord").get0();
m->drop("lord").get();
BOOST_REQUIRE_EQUAL(
m->query_granted("tim", auth::recursive_role_query::yes).get0(),
m->query_granted("tim", auth::recursive_role_query::yes).get(),
std::unordered_set<sstring>{"tim"});
BOOST_REQUIRE_EQUAL(
m->query_granted("king", auth::recursive_role_query::yes).get0(),
m->query_granted("king", auth::recursive_role_query::yes).get(),
std::unordered_set<sstring>{"king"});
//
// Dropping a role that does not exist is an error.
//
BOOST_REQUIRE_THROW(m->drop("emperor").get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->drop("emperor").get(), auth::nonexistant_role);
});
}
SEASTAR_TEST_CASE(grant_role) {
return do_with_cql_env_thread([](auto&& env) {
auto m = make_manager(env);
m->start().get0();
m->start().get();
const auto anon = auth::authenticated_user();
auth::role_config jsnow_config;
jsnow_config.is_superuser = false;
jsnow_config.can_login = true;
m->create("jsnow", jsnow_config).get0();
m->create("jsnow", jsnow_config).get();
m->create("lord", auth::role_config()).get0();
m->create("king", auth::role_config()).get0();
m->create("lord", auth::role_config()).get();
m->create("king", auth::role_config()).get();
//
// All kings have the rights of lords, and 'jsnow' is a king.
//
m->grant("king", "lord").get0();
m->grant("jsnow", "king").get0();
m->grant("king", "lord").get();
m->grant("jsnow", "king").get();
BOOST_REQUIRE_EQUAL(
m->query_granted("king", auth::recursive_role_query::yes).get0(),
m->query_granted("king", auth::recursive_role_query::yes).get(),
(std::unordered_set<sstring>{"king", "lord"}));
BOOST_REQUIRE_EQUAL(
m->query_granted("jsnow", auth::recursive_role_query::no).get0(),
m->query_granted("jsnow", auth::recursive_role_query::no).get(),
(std::unordered_set<sstring>{"jsnow", "king"}));
BOOST_REQUIRE_EQUAL(
m->query_granted("jsnow", auth::recursive_role_query::yes).get0(),
m->query_granted("jsnow", auth::recursive_role_query::yes).get(),
(std::unordered_set<sstring>{"jsnow", "king", "lord"}));
// A non-existing role cannot be granted.
BOOST_REQUIRE_THROW(m->grant("jsnow", "doctor").get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->grant("jsnow", "doctor").get(), auth::nonexistant_role);
// A role cannot be granted to a non-existing role.
BOOST_REQUIRE_THROW(m->grant("hpotter", "lord").get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->grant("hpotter", "lord").get(), auth::nonexistant_role);
});
}
SEASTAR_TEST_CASE(revoke_role) {
return do_with_cql_env_thread([](auto&& env) {
auto m = make_manager(env);
m->start().get0();
m->start().get();
const auto anon = auth::authenticated_user();
auth::role_config rrat_config;
rrat_config.is_superuser = false;
rrat_config.can_login = true;
m->create("rrat", rrat_config).get0();
m->create("rrat", rrat_config).get();
m->create("chef", auth::role_config()).get0();
m->create("sous_chef", auth::role_config()).get0();
m->create("chef", auth::role_config()).get();
m->create("sous_chef", auth::role_config()).get();
m->grant("chef", "sous_chef").get0();
m->grant("rrat", "chef").get0();
m->grant("chef", "sous_chef").get();
m->grant("rrat", "chef").get();
m->revoke("chef", "sous_chef").get0();
m->revoke("chef", "sous_chef").get();
BOOST_REQUIRE_EQUAL(
m->query_granted("rrat", auth::recursive_role_query::yes).get0(),
m->query_granted("rrat", auth::recursive_role_query::yes).get(),
(std::unordered_set<sstring>{"chef", "rrat"}));
m->revoke("rrat", "chef").get0();
m->revoke("rrat", "chef").get();
BOOST_REQUIRE_EQUAL(
m->query_granted("rrat", auth::recursive_role_query::yes).get0(),
m->query_granted("rrat", auth::recursive_role_query::yes).get(),
std::unordered_set<sstring>{"rrat"});
// A non-existing role cannot be revoked.
BOOST_REQUIRE_THROW(m->revoke("rrat", "taster").get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->revoke("rrat", "taster").get(), auth::nonexistant_role);
// A role cannot be revoked from a non-existing role.
BOOST_REQUIRE_THROW(m->revoke("ccasper", "chef").get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->revoke("ccasper", "chef").get(), auth::nonexistant_role);
// Revoking a role not granted is an error.
BOOST_REQUIRE_THROW(m->revoke("rrat", "sous_chef").get0(), auth::revoke_ungranted_role);
BOOST_REQUIRE_THROW(m->revoke("rrat", "sous_chef").get(), auth::revoke_ungranted_role);
});
}
SEASTAR_TEST_CASE(alter_role) {
return do_with_cql_env_thread([](auto&& env) {
auto m = make_manager(env);
m->start().get0();
m->start().get();
const auto anon = auth::authenticated_user();
auth::role_config tsmith_config;
tsmith_config.is_superuser = true;
tsmith_config.can_login = true;
m->create("tsmith", tsmith_config).get0();
m->create("tsmith", tsmith_config).get();
auth::role_config_update u;
u.can_login = false;
m->alter("tsmith", u).get0();
m->alter("tsmith", u).get();
BOOST_REQUIRE_EQUAL(m->is_superuser("tsmith").get0(), true);
BOOST_REQUIRE_EQUAL(m->can_login("tsmith").get0(), false);
BOOST_REQUIRE_EQUAL(m->is_superuser("tsmith").get(), true);
BOOST_REQUIRE_EQUAL(m->can_login("tsmith").get(), false);
// Altering a non-existing role is an error.
BOOST_REQUIRE_THROW(m->alter("hjones", u).get0(), auth::nonexistant_role);
BOOST_REQUIRE_THROW(m->alter("hjones", u).get(), auth::nonexistant_role);
});
}

View File

@@ -103,7 +103,7 @@ bool has_key(row_cache& cache, const dht::decorated_key& key) {
auto range = dht::partition_range::make_singular(key);
auto reader = cache.make_reader(cache.schema(), semaphore.make_permit(), range);
auto close_reader = deferred_close(reader);
auto mo = read_mutation_from_flat_mutation_reader(reader).get0();
auto mo = read_mutation_from_flat_mutation_reader(reader).get();
if (!bool(mo)) {
return false;
}
@@ -924,7 +924,7 @@ SEASTAR_TEST_CASE(test_eviction_after_schema_change) {
rd.fill_buffer().get();
}
tracker.cleaner().drain().get0();
tracker.cleaner().drain().get();
while (tracker.region().evict_some() == memory::reclaiming_result::reclaimed_something) ;
// The partition should be evictable after schema change
@@ -940,9 +940,9 @@ void test_sliced_read_row_presence(flat_mutation_reader_v2 reader, schema_ptr s,
auto close_reader = deferred_close(reader);
clustering_key::equality ck_eq(*s);
auto mfopt = reader().get0();
auto mfopt = reader().get();
BOOST_REQUIRE(mfopt->is_partition_start());
while ((mfopt = reader().get0()) && !mfopt->is_end_of_partition()) {
while ((mfopt = reader().get()) && !mfopt->is_end_of_partition()) {
if (mfopt->is_clustering_row()) {
BOOST_REQUIRE(!expected.empty());
auto expected_ck = expected.front();
@@ -956,7 +956,7 @@ void test_sliced_read_row_presence(flat_mutation_reader_v2 reader, schema_ptr s,
}
BOOST_REQUIRE(expected.empty());
BOOST_REQUIRE(mfopt && mfopt->is_end_of_partition());
BOOST_REQUIRE(!reader().get0());
BOOST_REQUIRE(!reader().get());
}
SEASTAR_TEST_CASE(test_single_partition_update) {
@@ -1190,7 +1190,7 @@ SEASTAR_TEST_CASE(test_update_failure) {
auto reader = cache.make_reader(s, semaphore.make_permit(), query::full_partition_range);
auto close_reader = deferred_close(reader);
for (int i = 0; i < partition_count; i++) {
auto mopt = read_mutation_from_flat_mutation_reader(reader).get0();
auto mopt = read_mutation_from_flat_mutation_reader(reader).get();
if (!mopt) {
break;
}
@@ -1198,7 +1198,7 @@ SEASTAR_TEST_CASE(test_update_failure) {
BOOST_REQUIRE(it != partitions.end());
BOOST_REQUIRE(it->second.equal(*s, mopt->partition()));
}
BOOST_REQUIRE(!reader().get0());
BOOST_REQUIRE(!reader().get());
};
if (failed) {
@@ -1571,7 +1571,7 @@ SEASTAR_TEST_CASE(test_mvcc) {
if (with_active_memtable_reader) {
assert(mt1_reader_opt);
auto mt1_reader_mutation = read_mutation_from_flat_mutation_reader(*mt1_reader_opt).get0();
auto mt1_reader_mutation = read_mutation_from_flat_mutation_reader(*mt1_reader_opt).get();
BOOST_REQUIRE(mt1_reader_mutation);
assert_that(*mt1_reader_mutation).is_equal_to_compacted(m2);
}
@@ -1579,7 +1579,7 @@ SEASTAR_TEST_CASE(test_mvcc) {
assert_that(std::move(rd4)).produces(m12);
assert_that(std::move(rd1)).produces(m1);
cache.invalidate(row_cache::external_updater([] {})).get0();
cache.invalidate(row_cache::external_updater([] {})).get();
assert_that(std::move(rd2)).produces(m1);
assert_that(std::move(rd5)).produces(m12);
@@ -1630,7 +1630,7 @@ SEASTAR_TEST_CASE(test_slicing_mutation_reader) {
row_cache cache(s, snapshot_source_from_snapshot(mt->as_data_source()), tracker);
auto run_tests = [&] (auto& ps, std::deque<int> expected) {
cache.invalidate(row_cache::external_updater([] {})).get0();
cache.invalidate(row_cache::external_updater([] {})).get();
auto reader = cache.make_reader(s, semaphore.make_permit(), query::full_partition_range, ps);
test_sliced_read_row_presence(std::move(reader), s, expected);
@@ -1644,7 +1644,7 @@ SEASTAR_TEST_CASE(test_slicing_mutation_reader) {
reader = cache.make_reader(s, semaphore.make_permit(), singular_range, ps);
test_sliced_read_row_presence(std::move(reader), s, expected);
cache.invalidate(row_cache::external_updater([] {})).get0();
cache.invalidate(row_cache::external_updater([] {})).get();
reader = cache.make_reader(s, semaphore.make_permit(), singular_range, ps);
test_sliced_read_row_presence(std::move(reader), s, expected);
@@ -2138,7 +2138,7 @@ SEASTAR_TEST_CASE(test_tombstone_merging_in_partial_partition) {
}
static void consume_all(flat_mutation_reader_v2& rd) {
while (auto mfopt = rd().get0()) {}
while (auto mfopt = rd().get()) {}
}
static void populate_range(row_cache& cache, const dht::partition_range& pr = query::full_partition_range,
@@ -2577,9 +2577,9 @@ SEASTAR_TEST_CASE(test_exception_safety_of_reads) {
memory::with_allocation_failures([&] {
auto rd = cache.make_reader(s, semaphore.make_permit(), singular_pr, slice);
auto close_rd = deferred_close(rd);
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get0();
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(got_opt);
BOOST_REQUIRE(!read_mutation_from_flat_mutation_reader(rd).get0());
BOOST_REQUIRE(!read_mutation_from_flat_mutation_reader(rd).get());
assert_that(*got_opt).is_equal_to_compacted(mut, ranges);
assert_that(cache.make_reader(s, semaphore.make_permit(), singular_pr, slice))
@@ -2589,9 +2589,9 @@ SEASTAR_TEST_CASE(test_exception_safety_of_reads) {
memory::with_allocation_failures([&] {
auto rd = cache.make_reader(s, semaphore.make_permit(), query::full_partition_range, slice);
auto close_rd = deferred_close(rd);
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get0();
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(got_opt);
BOOST_REQUIRE(!read_mutation_from_flat_mutation_reader(rd).get0());
BOOST_REQUIRE(!read_mutation_from_flat_mutation_reader(rd).get());
assert_that(*got_opt).is_equal_to_compacted(mut, ranges);
assert_that(cache.make_reader(s, semaphore.make_permit(), query::full_partition_range, slice))
@@ -2657,9 +2657,9 @@ SEASTAR_TEST_CASE(test_exception_safety_of_transitioning_from_underlying_read_to
auto rd = cache.make_reader(s.schema(), semaphore.make_permit(), pr, slice);
auto close_rd = deferred_close(rd);
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get0();
auto got_opt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(got_opt);
auto mfopt = rd().get0();
auto mfopt = rd().get();
BOOST_REQUIRE(!mfopt);
assert_that(*got_opt).is_equal_to(mut);
@@ -2930,7 +2930,7 @@ SEASTAR_TEST_CASE(test_random_row_population) {
while (!readers.empty()) {
std::vector<read> remaining_readers;
for (auto i = readers.begin(); i != readers.end(); i++) {
auto mfo = i->reader().get0();
auto mfo = i->reader().get();
if (!mfo) {
auto&& ranges = i->slice->row_ranges(*s.schema(), pk.key());
auto result = *i->result_builder.consume_end_of_stream();
@@ -3401,7 +3401,7 @@ SEASTAR_TEST_CASE(test_concurrent_reads_and_eviction) {
auto rd = make_reader(slice);
auto close_rd = deferred_close(rd);
auto actual_opt = read_mutation_from_flat_mutation_reader(rd).get0();
auto actual_opt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(actual_opt);
auto actual = *actual_opt;
@@ -3607,8 +3607,8 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
{
auto rd = cache.make_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(!row.cells().cell_hash_for(0));
}
@@ -3617,16 +3617,16 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
slice.options.set<query::partition_slice::option::with_digest>();
auto rd = cache.make_reader(s, semaphore.make_permit(), query::full_partition_range, slice);
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
{
auto rd = cache.make_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
@@ -3637,8 +3637,8 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
{
auto rd = cache.make_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(!row.cells().cell_hash_for(0));
}
@@ -3647,16 +3647,16 @@ SEASTAR_TEST_CASE(test_hash_is_cached) {
slice.options.set<query::partition_slice::option::with_digest>();
auto rd = cache.make_reader(s, semaphore.make_permit(), query::full_partition_range, slice);
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
{
auto rd = cache.make_reader(s, semaphore.make_permit());
auto close_rd = deferred_close(rd);
rd().get0()->as_partition_start();
clustering_row row = std::move(*rd().get0()).as_clustering_row();
rd().get()->as_partition_start();
clustering_row row = std::move(*rd().get()).as_clustering_row();
BOOST_REQUIRE(row.cells().cell_hash_for(0));
}
});
@@ -4217,11 +4217,11 @@ SEASTAR_TEST_CASE(test_eviction_of_upper_bound_of_population_range) {
.build();
auto rd = cache.make_reader(s.schema(), semaphore.make_permit(), pr, slice);
auto close_rd = deferred_close(rd);
auto m_cache = read_mutation_from_flat_mutation_reader(rd).get0();
auto m_cache = read_mutation_from_flat_mutation_reader(rd).get();
close_rd.close_now();
rd = cache_mt->make_flat_reader(s.schema(), semaphore.make_permit(), pr, slice);
auto close_rd2 = deferred_close(rd);
auto m_mt = read_mutation_from_flat_mutation_reader(rd).get0();
auto m_mt = read_mutation_from_flat_mutation_reader(rd).get();
BOOST_REQUIRE(m_mt);
assert_that(m_cache).has_mutation().is_equal_to(*m_mt);
};

View File

@@ -71,21 +71,21 @@ SEASTAR_THREAD_TEST_CASE(test_client_put_get_object) {
cln->put_object(name, std::move(data)).get();
testlog.info("Get object size\n");
size_t sz = cln->get_object_size(name).get0();
size_t sz = cln->get_object_size(name).get();
BOOST_REQUIRE_EQUAL(sz, 10);
testlog.info("Get object stats\n");
s3::stats st = cln->get_object_stats(name).get0();
s3::stats st = cln->get_object_stats(name).get();
BOOST_REQUIRE_EQUAL(st.size, 10);
// forgive timezone difference as minio server is GMT by default
BOOST_REQUIRE(std::difftime(st.last_modified, gc_clock::to_time_t(gc_clock::now())) < 24*3600);
testlog.info("Get object content\n");
temporary_buffer<char> res = cln->get_object_contiguous(name).get0();
temporary_buffer<char> res = cln->get_object_contiguous(name).get();
BOOST_REQUIRE_EQUAL(to_sstring(std::move(res)), sstring("1234567890"));
testlog.info("Get object part\n");
res = cln->get_object_contiguous(name, s3::range{ 1, 3 }).get0();
res = cln->get_object_contiguous(name, s3::range{ 1, 3 }).get();
BOOST_REQUIRE_EQUAL(to_sstring(std::move(res)), sstring("234"));
testlog.info("Delete object\n");
@@ -136,7 +136,7 @@ void do_test_client_multipart_upload(bool with_copy_upload) {
close.close_now();
testlog.info("Checking file size\n");
size_t sz = cln->get_object_size(name).get0();
size_t sz = cln->get_object_size(name).get();
BOOST_REQUIRE_EQUAL(sz, object_size);
testlog.info("Checking correctness\n");
@@ -144,7 +144,7 @@ void do_test_client_multipart_upload(bool with_copy_upload) {
uint64_t len = tests::random::get_int(1u, chunk_size);
uint64_t off = tests::random::get_int(object_size - len);
auto s_buf = cln->get_object_contiguous(name, s3::range{ off, len }).get0();
auto s_buf = cln->get_object_contiguous(name, s3::range{ off, len }).get();
unsigned align = off % chunk_size;
testlog.info("Got [{}:{}) chunk\n", off, len);
testlog.info("Checking {} vs {} len {}\n", align, 0, std::min<uint64_t>(chunk_size - align, len));
@@ -188,7 +188,7 @@ SEASTAR_THREAD_TEST_CASE(test_client_multipart_upload_fallback) {
close.close_now();
testlog.info("Get object content");
temporary_buffer<char> res = cln->get_object_contiguous(name).get0();
temporary_buffer<char> res = cln->get_object_contiguous(name).get();
BOOST_REQUIRE_EQUAL(to_sstring(std::move(res)), to_sstring(std::move(data)));
}
@@ -209,12 +209,12 @@ SEASTAR_THREAD_TEST_CASE(test_client_readable_file) {
auto close_readable_file = deferred_close(f);
testlog.info("Check file size\n");
size_t sz = f.size().get0();
size_t sz = f.size().get();
BOOST_REQUIRE_EQUAL(sz, 16);
testlog.info("Check buffer read\n");
char buffer[16];
sz = f.dma_read(4, buffer, 7).get0();
sz = f.dma_read(4, buffer, 7).get();
BOOST_REQUIRE_EQUAL(sz, 7);
BOOST_REQUIRE_EQUAL(sstring(buffer, 7), sstring("567890A"));
@@ -223,14 +223,14 @@ SEASTAR_THREAD_TEST_CASE(test_client_readable_file) {
iovs.push_back({buffer, 3});
iovs.push_back({buffer + 3, 2});
iovs.push_back({buffer + 5, 4});
sz = f.dma_read(3, std::move(iovs)).get0();
sz = f.dma_read(3, std::move(iovs)).get();
BOOST_REQUIRE_EQUAL(sz, 9);
BOOST_REQUIRE_EQUAL(sstring(buffer, 3), sstring("456"));
BOOST_REQUIRE_EQUAL(sstring(buffer + 3, 2), sstring("78"));
BOOST_REQUIRE_EQUAL(sstring(buffer + 5, 4), sstring("90AB"));
testlog.info("Check bulk read\n");
auto buf = f.dma_read_bulk<char>(5, 8).get0();
auto buf = f.dma_read_bulk<char>(5, 8).get();
BOOST_REQUIRE_EQUAL(to_sstring(std::move(buf)), sstring("67890ABC"));
}
@@ -254,7 +254,7 @@ SEASTAR_THREAD_TEST_CASE(test_client_readable_file_stream) {
auto close_stream = deferred_close(in);
testlog.info("Check input stream read\n");
auto res = seastar::util::read_entire_stream_contiguous(in).get0();
auto res = seastar::util::read_entire_stream_contiguous(in).get();
BOOST_REQUIRE_EQUAL(res, sample);
}
@@ -269,20 +269,20 @@ SEASTAR_THREAD_TEST_CASE(test_client_put_get_tagging) {
auto delete_object = deferred_delete_object(client, name);
{
auto tagset = client->get_object_tagging(name).get0();
auto tagset = client->get_object_tagging(name).get();
BOOST_CHECK(tagset.empty());
}
{
s3::tag_set expected_tagset{{"1", "one"}, {"2", "two"}};
client->put_object_tagging(name, expected_tagset).get();
auto actual_tagset = client->get_object_tagging(name).get0();
auto actual_tagset = client->get_object_tagging(name).get();
std::ranges::sort(actual_tagset);
std::ranges::sort(expected_tagset);
BOOST_CHECK(actual_tagset == expected_tagset);
}
{
client->delete_object_tagging(name).get();
auto tagset = client->get_object_tagging(name).get0();
auto tagset = client->get_object_tagging(name).get();
BOOST_CHECK(tagset.empty());
}
}

View File

@@ -510,7 +510,7 @@ SEASTAR_TEST_CASE(test_merging_creates_a_table_even_if_keyspace_was_recreated) {
{
auto group0_guard = mm.start_group0_operation().get();
const auto ts = group0_guard.write_timestamp();
auto muts = service::prepare_keyspace_drop_announcement(e.local_db(), "ks", ts).get0();
auto muts = service::prepare_keyspace_drop_announcement(e.local_db(), "ks", ts).get();
boost::copy(muts, std::back_inserter(all_muts));
mm.announce(muts, std::move(group0_guard), "").get();
}
@@ -529,7 +529,7 @@ SEASTAR_TEST_CASE(test_merging_creates_a_table_even_if_keyspace_was_recreated) {
auto group0_guard = mm.start_group0_operation().get();
const auto ts = group0_guard.write_timestamp();
auto muts = service::prepare_new_column_family_announcement(mm.get_storage_proxy(), s0, ts).get0();
auto muts = service::prepare_new_column_family_announcement(mm.get_storage_proxy(), s0, ts).get();
boost::copy(muts, std::back_inserter(all_muts));
mm.announce(all_muts, std::move(group0_guard), "").get();
@@ -725,7 +725,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_is_invalidated_by_schema_change) {
logging::logger_registry().set_logger_level("query_processor", logging::log_level::debug);
e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get();
e.execute_cql("create table tests.table1 (pk int primary key, c1 int, c2 int);").get();
auto id = e.prepare("select * from tests.table1;").get0();
auto id = e.prepare("select * from tests.table1;").get();
e.execute_cql("alter table tests.table1 add s1 int;").get();
@@ -810,7 +810,7 @@ future<> test_schema_digest_does_not_change_with_disabled_features(sstring data_
// with highest timestamp will win and be sent to other nodes.
// Thus, system_distributed.* tables are officially not taken into account,
// which makes it less likely that this test case would need to be needlessly regenerated.
auto actual = calculate_schema_digest(e.get_storage_proxy(), sf, std::not_fn(&is_internal_keyspace)).get0();
auto actual = calculate_schema_digest(e.get_storage_proxy(), sf, std::not_fn(&is_internal_keyspace)).get();
if (regenerate) {
std::cout << format(" utils::UUID(\"{}\"),", actual) << "\n";
} else {

View File

@@ -65,7 +65,7 @@ SEASTAR_TEST_CASE(test_async_loading) {
auto s1_loaded = local_schema_registry().get_or_load(s1->version(), [s1] (table_schema_version) {
return make_ready_future<frozen_schema>(frozen_schema(s1));
}).get0();
}).get();
BOOST_REQUIRE(s1_loaded);
BOOST_REQUIRE(s1_loaded->version() == s1->version());
@@ -74,7 +74,7 @@ SEASTAR_TEST_CASE(test_async_loading) {
auto s2_loaded = local_schema_registry().get_or_load(s2->version(), [s2] (table_schema_version) {
return yield().then([s2] { return frozen_schema(s2); });
}).get0();
}).get();
BOOST_REQUIRE(s2_loaded);
BOOST_REQUIRE(s2_loaded->version() == s2->version());
@@ -223,7 +223,7 @@ SEASTAR_THREAD_TEST_CASE(test_table_is_attached) {
s3_entered.get();
local_schema_registry().learn(s3);
s3_thr.unblock();
auto s3_s = learned_s3.get0();
auto s3_s = learned_s3.get();
BOOST_REQUIRE(s3_s->maybe_table() == s0->maybe_table());
BOOST_REQUIRE(s3->maybe_table() == s0->maybe_table());
@@ -240,7 +240,7 @@ SEASTAR_THREAD_TEST_CASE(test_table_is_attached) {
s4_entered.get();
s4 = local_schema_registry().get_or_load(s4->version(), [&, fs = frozen_schema(s4)] (table_schema_version) { return fs; });
s4_thr.unblock();
auto s4_s = learned_s4.get0();
auto s4_s = learned_s4.get();
BOOST_REQUIRE(s4_s->maybe_table() == s0->maybe_table());
BOOST_REQUIRE(s4->maybe_table() == s0->maybe_table());

View File

@@ -150,7 +150,7 @@ SEASTAR_TEST_CASE(test_secondary_index_case_compound_partition_key) {
eventually([&] {
// We expect this search to find the single row, with the compound
// partition key (a, b) = (1, 2).
auto res = e.execute_cql("SELECT * from tab WHERE c = 3").get0();
auto res = e.execute_cql("SELECT * from tab WHERE c = 3").get();
assert_that(res).is_rows()
.with_size(1)
.with_row({
@@ -246,7 +246,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
// we inserted above.
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1").get();
assert_that(res).is_rows().with_size(3)
.with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}},
@@ -256,7 +256,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
});
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE b = 2").get0();
auto res = e.execute_cql("SELECT * from tab WHERE b = 2").get();
assert_that(res).is_rows().with_size(3)
.with_rows({
{{int32_type->decompose(0)}, {int32_type->decompose(2)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}},
@@ -266,7 +266,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
});
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE c = 3").get0();
auto res = e.execute_cql("SELECT * from tab WHERE c = 3").get();
assert_that(res).is_rows().with_size(3)
.with_rows({
{{int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(3)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}},
@@ -276,7 +276,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
});
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE d = 4").get0();
auto res = e.execute_cql("SELECT * from tab WHERE d = 4").get();
assert_that(res).is_rows().with_size(2)
.with_rows({
{{int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(4)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}},
@@ -285,7 +285,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
});
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE e = 5").get0();
auto res = e.execute_cql("SELECT * from tab WHERE e = 5").get();
assert_that(res).is_rows().with_size(3)
.with_rows({
{{int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(5)}, {int32_type->decompose(0)}},
@@ -295,7 +295,7 @@ SEASTAR_TEST_CASE(test_many_columns) {
});
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE f = 6").get0();
auto res = e.execute_cql("SELECT * from tab WHERE f = 6").get();
assert_that(res).is_rows().with_size(2)
.with_rows({
{{int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(0)}, {int32_type->decompose(7)}, {int32_type->decompose(0)}, {int32_type->decompose(6)}},
@@ -327,7 +327,7 @@ SEASTAR_TEST_CASE(test_index_with_partition_key) {
// Queries that restrict the whole partition key and an index should not require filtering - they are not performance-heavy
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and e = 5").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and e = 5").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}},
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(7)}, {int32_type->decompose(5)}, {int32_type->decompose(0)}}
@@ -340,7 +340,7 @@ SEASTAR_TEST_CASE(test_index_with_partition_key) {
// Indexed queries with full primary key are allowed without filtering as well
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and c = 3 and d = 4 and e = 5").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and c = 3 and d = 4 and e = 5").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}}
});
@@ -348,7 +348,7 @@ SEASTAR_TEST_CASE(test_index_with_partition_key) {
// And it's also sufficient if only full partition key + clustering key prefix is present
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and c = 3 and e = 5").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and c = 3 and e = 5").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}},
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(7)}, {int32_type->decompose(5)}, {int32_type->decompose(0)}}
@@ -358,14 +358,14 @@ SEASTAR_TEST_CASE(test_index_with_partition_key) {
// This query needs filtering, because clustering key restrictions do not form a prefix
BOOST_REQUIRE_THROW(e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and d = 4 and e = 5").get(), exceptions::invalid_request_exception);
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and d = 4 and e = 5 ALLOW FILTERING").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and d = 4 and e = 5 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}}
});
});
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b IN (2, 3) and d IN (4, 5, 6, 7) and e = 5 ALLOW FILTERING").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b IN (2, 3) and d IN (4, 5, 6, 7) and e = 5 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}},
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(7)}, {int32_type->decompose(5)}, {int32_type->decompose(0)}}
@@ -373,7 +373,7 @@ SEASTAR_TEST_CASE(test_index_with_partition_key) {
});
eventually([&] {
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and (c, d) in ((3, 4), (1, 1), (3, 7)) and e = 5 ALLOW FILTERING").get0();
auto res = e.execute_cql("SELECT * from tab WHERE a = 1 and b = 2 and (c, d) in ((3, 4), (1, 1), (3, 7)) and e = 5 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}},
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(7)}, {int32_type->decompose(5)}, {int32_type->decompose(0)}}
@@ -400,19 +400,19 @@ SEASTAR_TEST_CASE(test_index_on_pk_ck_with_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{101, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
assert_that(res).is_rows().with_size(101);
});
eventually([&] {
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1").get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1").get();
assert_that(res).is_rows().with_size(2052);
});
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE pk2 = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE pk2 = 1", std::move(qo)).get();
assert_that(res).is_rows().with_rows({{
{int32_type->decompose(1)}, {int32_type->decompose(1)}, {utf8_type->decompose("hello1")}, {utf8_type->decompose("world1")},
{int32_type->decompose(1)}, {int32_type->decompose(1)}, {utf8_type->decompose(big_string)}
@@ -422,7 +422,7 @@ SEASTAR_TEST_CASE(test_index_on_pk_ck_with_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{100, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE ck2 = 'world8'", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE ck2 = 'world8'", std::move(qo)).get();
assert_that(res).is_rows().with_rows({{
{int32_type->decompose(2)}, {int32_type->decompose(8)}, {utf8_type->decompose("hello8")}, {utf8_type->decompose("world8")},
{int32_type->decompose(1)}, {int32_type->decompose(8)}, {utf8_type->decompose("small_string")}
@@ -458,7 +458,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
auto paging_state = extract_paging_state(res);
expect_more_pages(res, true);
@@ -468,7 +468,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
expect_more_pages(res, true);
paging_state = extract_paging_state(res);
@@ -478,7 +478,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
paging_state = extract_paging_state(res);
assert_that(res).is_rows().with_rows({{
@@ -493,7 +493,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
} catch (...) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
assert_that(res).is_rows().with_size(0);
expect_more_pages(res, false);
}
@@ -503,7 +503,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get();
auto paging_state = extract_paging_state(res);
assert_that(res).is_rows().with_rows({{
@@ -512,7 +512,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get();
assert_that(res).is_rows().with_rows({{
{int32_type->decompose(3)}, {int32_type->decompose(2)}, {int32_type->decompose(1)},
@@ -522,7 +522,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
{
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get();
auto paging_state = extract_paging_state(res);
assert_that(res).is_rows().with_rows({{
@@ -540,7 +540,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE c = 2", std::move(qo)).get();
assert_that(res).is_rows().with_size(0);
}
@@ -553,7 +553,7 @@ SEASTAR_TEST_CASE(test_simple_index_paging) {
1, query_id::create_random_id(), service::pager::paging_state::replicas_per_token_range{}, std::nullopt, 1);
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE v = 1", std::move(qo)).get();
assert_that(res).is_rows().with_size(0);
}
@@ -618,50 +618,50 @@ SEASTAR_TEST_CASE(test_secondary_index_collections) {
e.execute_cql(insert_into + "(2, {2}, {3: 'three', 7: 'five'}, [3, 4, 5], {2}, {3: 'three'}, [3, 4, 5])").get();
e.execute_cql(insert_into + "(3, {2, 3}, {3: 'three', 5: 'five', 7: 'seven'}, [2, 8, 9], {3}, {5: 'five', 7: 'seven'}, [7, 8, 9])").get();
auto res = e.execute_cql("SELECT p from t where s1 CONTAINS 2").get0();
auto res = e.execute_cql("SELECT p from t where s1 CONTAINS 2").get();
assert_that(res).is_rows().with_rows_ignore_order({{{{int32_type->decompose(2)}}}, {{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where s1 CONTAINS 4").get0();
res = e.execute_cql("SELECT p from t where s1 CONTAINS 4").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'three'").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'three'").get();
assert_that(res).is_rows().with_rows_ignore_order({{{{int32_type->decompose(2)}}}, {{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'seven'").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'seven'").get();
assert_that(res).is_rows().with_rows({{{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'ten'").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS 'ten'").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 3").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 3").get();
assert_that(res).is_rows().with_rows_ignore_order({{{{int32_type->decompose(2)}}}, {{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 5").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 5").get();
assert_that(res).is_rows().with_rows({{{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 10").get0();
res = e.execute_cql("SELECT p from t where m1 CONTAINS KEY 10").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where m1[3] = 'three'").get0();
res = e.execute_cql("SELECT p from t where m1[3] = 'three'").get();
assert_that(res).is_rows().with_rows_ignore_order({{{{int32_type->decompose(3)}}}, {{{int32_type->decompose(2)}}}});
res = e.execute_cql("SELECT p from t where m1[7] = 'seven'").get0();
res = e.execute_cql("SELECT p from t where m1[7] = 'seven'").get();
assert_that(res).is_rows().with_rows({{{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where m1[3] = 'five'").get0();
res = e.execute_cql("SELECT p from t where m1[3] = 'five'").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where l1 CONTAINS 2").get0();
res = e.execute_cql("SELECT p from t where l1 CONTAINS 2").get();
assert_that(res).is_rows().with_rows_ignore_order({{{{int32_type->decompose(1)}}}, {{{int32_type->decompose(3)}}}});
res = e.execute_cql("SELECT p from t where l1 CONTAINS 1").get0();
res = e.execute_cql("SELECT p from t where l1 CONTAINS 1").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where s2 = {2}").get0();
res = e.execute_cql("SELECT p from t where s2 = {2}").get();
assert_that(res).is_rows().with_rows({{{int32_type->decompose(2)}}});
res = e.execute_cql("SELECT p from t where s2 = {}").get0();
res = e.execute_cql("SELECT p from t where s2 = {}").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where m2 = {5: 'five', 7: 'seven'}").get0();
res = e.execute_cql("SELECT p from t where m2 = {5: 'five', 7: 'seven'}").get();
assert_that(res).is_rows().with_rows({{{int32_type->decompose(3)}}});
res = e.execute_cql("SELECT p from t where m2 = {1: 'one', 2: 'three'}").get0();
res = e.execute_cql("SELECT p from t where m2 = {1: 'one', 2: 'three'}").get();
assert_that(res).is_rows().with_size(0);
res = e.execute_cql("SELECT p from t where l2 = [2]").get0();
res = e.execute_cql("SELECT p from t where l2 = [2]").get();
assert_that(res).is_rows().with_rows({{{int32_type->decompose(1)}}});
res = e.execute_cql("SELECT p from t where l2 = [3]").get0();
res = e.execute_cql("SELECT p from t where l2 = [3]").get();
assert_that(res).is_rows().with_size(0);
});
}
@@ -704,7 +704,7 @@ SEASTAR_TEST_CASE(test_secondary_index_contains_virtual_columns) {
e.execute_cql("create index on cf (c)").get();
e.execute_cql("update cf set v = 1 where p = 1 and c = 1").get();
eventually([&] {
auto res = e.execute_cql("select * from cf where c = 1").get0();
auto res = e.execute_cql("select * from cf where c = 1").get();
assert_that(res).is_rows().with_rows({{{int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(1)}}});
});
// Similar test to the above, just indexing a partition-key column
@@ -713,7 +713,7 @@ SEASTAR_TEST_CASE(test_secondary_index_contains_virtual_columns) {
e.execute_cql("create index on cf2 (p1)").get();
e.execute_cql("update cf2 set v = 1 where p1 = 1 and p2 = 1 and c = 1").get();
eventually([&] {
auto res = e.execute_cql("select * from cf2 where p1 = 1").get0();
auto res = e.execute_cql("select * from cf2 where p1 = 1").get();
assert_that(res).is_rows().with_rows({{{int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(1)}}});
});
});
@@ -738,12 +738,12 @@ SEASTAR_TEST_CASE(test_local_secondary_index) {
auto get_local_index_read_count = [&] {
return e.db().map_reduce0([] (replica::database& local_db) {
return local_db.find_column_family("ks", "local_t_v1_index").get_stats().reads.hist.count;
}, 0, std::plus<int64_t>()).get0();
}, 0, std::plus<int64_t>()).get();
};
int64_t expected_read_count = 0;
eventually([&] {
auto res = e.execute_cql("select * from t where p = 1 and v1 = 3").get0();
auto res = e.execute_cql("select * from t where p = 1 and v1 = 3").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(2)}},
{{int32_type->decompose(1)}, {int32_type->decompose(3)}, {int32_type->decompose(3)}, {int32_type->decompose(3)}},
@@ -753,7 +753,7 @@ SEASTAR_TEST_CASE(test_local_secondary_index) {
});
// Even with local indexes present, filtering should work without issues
auto res = e.execute_cql("select * from t where v1 = 1 ALLOW FILTERING").get0();
auto res = e.execute_cql("select * from t where v1 = 1 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(1)}},
});
@@ -777,19 +777,19 @@ SEASTAR_TEST_CASE(test_local_and_global_secondary_index) {
auto get_local_index_read_count = [&] {
return e.db().map_reduce0([] (replica::database& local_db) {
return local_db.find_column_family("ks", "local_t_v1_index").get_stats().reads.hist.count;
}, 0, std::plus<int64_t>()).get0();
}, 0, std::plus<int64_t>()).get();
};
auto get_global_index_read_count = [&] {
return e.db().map_reduce0([] (replica::database& local_db) {
return local_db.find_column_family("ks", "global_t_v1_index").get_stats().reads.hist.count;
}, 0, std::plus<int64_t>()).get0();
}, 0, std::plus<int64_t>()).get();
};
int64_t expected_local_index_read_count = 0;
int64_t expected_global_index_read_count = 0;
eventually([&] {
auto res = e.execute_cql("select * from t where p = 1 and v1 = 3").get0();
auto res = e.execute_cql("select * from t where p = 1 and v1 = 3").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(2)}},
{{int32_type->decompose(1)}, {int32_type->decompose(3)}, {int32_type->decompose(3)}, {int32_type->decompose(3)}},
@@ -800,7 +800,7 @@ SEASTAR_TEST_CASE(test_local_and_global_secondary_index) {
});
eventually([&] {
auto res = e.execute_cql("select * from t where v1 = 3").get0();
auto res = e.execute_cql("select * from t where v1 = 3").get();
++expected_global_index_read_count;
BOOST_REQUIRE_EQUAL(get_local_index_read_count(), expected_local_index_read_count);
BOOST_REQUIRE_EQUAL(get_global_index_read_count(), expected_global_index_read_count);
@@ -835,7 +835,7 @@ SEASTAR_TEST_CASE(test_local_index_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and v = 1", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and v = 1", std::move(qo)).get();
auto paging_state = extract_paging_state(res);
assert_that(res).is_rows().with_rows({{
@@ -844,7 +844,7 @@ SEASTAR_TEST_CASE(test_local_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and v = 1", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and v = 1", std::move(qo)).get();
assert_that(res).is_rows().with_rows({{
{int32_type->decompose(1)}, {int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(1)},
@@ -854,7 +854,7 @@ SEASTAR_TEST_CASE(test_local_index_paging) {
eventually([&] {
auto qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, nullptr, {}, api::new_timestamp()});
auto res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and c2 = 2", std::move(qo)).get0();
auto res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and c2 = 2", std::move(qo)).get();
auto paging_state = extract_paging_state(res);
assert_that(res).is_rows().with_rows({{
@@ -863,7 +863,7 @@ SEASTAR_TEST_CASE(test_local_index_paging) {
qo = std::make_unique<cql3::query_options>(db::consistency_level::LOCAL_ONE, std::vector<cql3::raw_value>{},
cql3::query_options::specific_options{1, paging_state, {}, api::new_timestamp()});
res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and c2 = 2", std::move(qo)).get0();
res = e.execute_cql("SELECT * FROM tab WHERE p = 1 and c2 = 2", std::move(qo)).get();
assert_that(res).is_rows().with_rows({{
{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(2)}, {int32_type->decompose(4)},
@@ -904,7 +904,7 @@ SEASTAR_TEST_CASE(test_local_index_multi_pk_columns) {
e.execute_cql("INSERT INTO tab (p1, p2, c1, c2, v) VALUES (3, 3, 1, 2, 1)").get();
eventually([&] {
auto res = e.execute_cql("select * from tab where p1 = 1 and p2 = 2 and v = 4").get0();
auto res = e.execute_cql("select * from tab where p1 = 1 and p2 = 2 and v = 4").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(2)}, {int32_type->decompose(4)}},
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(7)}, {int32_type->decompose(4)}},
@@ -912,7 +912,7 @@ SEASTAR_TEST_CASE(test_local_index_multi_pk_columns) {
});
eventually([&] {
auto res = e.execute_cql("select * from tab where p1 = 1 and p2 = 2 and v = 5").get0();
auto res = e.execute_cql("select * from tab where p1 = 1 and p2 = 2 and v = 5").get();
assert_that(res).is_rows().with_size(0);
});
@@ -1016,20 +1016,20 @@ SEASTAR_TEST_CASE(test_local_index_prefix_optimization) {
e.execute_cql("INSERT INTO t (p1,p2,c1,c2,v) VALUES (3,4,5,6,7);").get();
eventually([&] {
auto res = e.execute_cql("select * from t where p1 = 1 and p2 = 2 and c1 = 3 and v = 5").get0();
auto res = e.execute_cql("select * from t where p1 = 1 and p2 = 2 and c1 = 3 and v = 5").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}},
});
});
eventually([&] {
auto res = e.execute_cql("select * from t where p1 = 1 and p2 = 2 and c1 = 3 and c2 = 4 and v = 5").get0();
auto res = e.execute_cql("select * from t where p1 = 1 and p2 = 2 and c1 = 3 and c2 = 4 and v = 5").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}},
});
});
BOOST_REQUIRE_THROW(e.execute_cql("select * from t where p1 = 1 and p2 = 2 and c2 = 4 and v = 5").get(), exceptions::invalid_request_exception);
eventually([&] {
auto res = e.execute_cql("select * from t where p1 = 2 and p2 = 3 and c2 = 5 and v = 6 ALLOW FILTERING").get0();
auto res = e.execute_cql("select * from t where p1 = 2 and p2 = 3 and c2 = 5 and v = 6 ALLOW FILTERING").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}, {int32_type->decompose(5)}, {int32_type->decompose(6)}},
});
@@ -1054,7 +1054,7 @@ SEASTAR_TEST_CASE(test_secondary_index_single_value_in) {
// An ordinary "p=3 and a=4" query should work
BOOST_TEST_PASSPOINT();
eventually([&] {
auto res = e.execute_cql("select * from cf where p = 3 and a = 4").get0();
auto res = e.execute_cql("select * from cf where p = 3 and a = 4").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(3)}, {int32_type->decompose(4)}}});
});
@@ -1062,7 +1062,7 @@ SEASTAR_TEST_CASE(test_secondary_index_single_value_in) {
// IN with multiple values isn't yet supported. Before fixing
// #4455, this wasn't supported.
BOOST_TEST_PASSPOINT();
auto res = e.execute_cql("select * from cf where p IN (3) and a = 4").get0();
auto res = e.execute_cql("select * from cf where p IN (3) and a = 4").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(3)}, {int32_type->decompose(4)}}});
@@ -1073,11 +1073,11 @@ SEASTAR_TEST_CASE(test_secondary_index_single_value_in) {
// queries over the indexed column: Since "a=4" works, so
// should "a IN (4)":
BOOST_TEST_PASSPOINT();
res = e.execute_cql("select * from cf where a = 4").get0();
res = e.execute_cql("select * from cf where a = 4").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(3)}, {int32_type->decompose(4)}}});
BOOST_TEST_PASSPOINT();
res = e.execute_cql("select * from cf where a IN (4)").get0();
res = e.execute_cql("select * from cf where a IN (4)").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(3)}, {int32_type->decompose(4)}}});
@@ -1088,10 +1088,10 @@ SEASTAR_TEST_CASE(test_secondary_index_single_value_in) {
e.execute_cql("create table cf2 (p int, c1 int, c2 int, primary key (p, c1, c2))").get();
e.execute_cql("insert into cf2 (p, c1, c2) VALUES (1, 2, 3)").get();
e.execute_cql("insert into cf2 (p, c1, c2) VALUES (4, 5, 6)").get();
res = e.execute_cql("select * from cf2 where p = 1 and (c1, c2) = (2, 3)").get0();
res = e.execute_cql("select * from cf2 where p = 1 and (c1, c2) = (2, 3)").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}}});
res = e.execute_cql("select * from cf2 where p = 1 and (c1, c2) IN ((2, 3))").get0();
res = e.execute_cql("select * from cf2 where p = 1 and (c1, c2) IN ((2, 3))").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}}});
@@ -1114,16 +1114,16 @@ SEASTAR_TEST_CASE(test_secondary_index_allow_some_column_drops) {
e.execute_cql("create index on cf (a)").get();
e.execute_cql("insert into cf (p, a, b) VALUES (1, 2, 3)").get();
BOOST_TEST_PASSPOINT();
auto res = e.execute_cql("select * from cf").get0();
auto res = e.execute_cql("select * from cf").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}}});
e.execute_cql("alter table cf drop b").get();
BOOST_TEST_PASSPOINT();
res = e.execute_cql("select * from cf").get0();
res = e.execute_cql("select * from cf").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}}});
eventually([&] {
auto res = e.execute_cql("select * from cf where a = 2").get0();
auto res = e.execute_cql("select * from cf where a = 2").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}}});
});
@@ -1148,7 +1148,7 @@ SEASTAR_TEST_CASE(test_secondary_index_allow_some_column_drops) {
e.execute_cql("create index on cf2 (c)").get();
e.execute_cql("insert into cf2 (p, c, a, b) VALUES (1, 2, 3, 4)").get();
BOOST_TEST_PASSPOINT();
res = e.execute_cql("select * from cf2").get0();
res = e.execute_cql("select * from cf2").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}, {int32_type->decompose(4)}}});
BOOST_REQUIRE_THROW(e.execute_cql("alter table cf2 drop b").get(), exceptions::invalid_request_exception);
@@ -1171,7 +1171,7 @@ SEASTAR_TEST_CASE(test_secondary_index_on_partition_key_with_filtering) {
e.execute_cql("CREATE INDEX ON test_a(a);").get();
e.execute_cql("INSERT INTO test_a (a, b, c) VALUES (1, 2, 3);").get();
eventually([&] {
auto res = e.execute_cql("SELECT * FROM test_a WHERE a = 1 AND b = 2 AND c = 3 ALLOW FILTERING;").get0();
auto res = e.execute_cql("SELECT * FROM test_a WHERE a = 1 AND b = 2 AND c = 3 ALLOW FILTERING;").get();
assert_that(res).is_rows().with_rows({
{{int32_type->decompose(1)}, {int32_type->decompose(2)}, {int32_type->decompose(3)}}});
});
@@ -1541,7 +1541,7 @@ SEASTAR_TEST_CASE(test_computed_columns) {
BOOST_REQUIRE(global1->get_column_definition(token_column_name)->is_computed());
BOOST_REQUIRE(global2->get_column_definition(token_column_name)->is_computed());
auto msg = e.execute_cql("SELECT computation FROM system_schema.computed_columns WHERE keyspace_name='ks'").get0();
auto msg = e.execute_cql("SELECT computation FROM system_schema.computed_columns WHERE keyspace_name='ks'").get();
assert_that(msg).is_rows().with_rows({
{{bytes_type->decompose(token_computation)}},
{{bytes_type->decompose(token_computation)}}
@@ -1659,15 +1659,15 @@ SEASTAR_TEST_CASE(test_select_with_token_range_cases) {
assert_that(q("token(pk) < 5 AND token(pk) > 100")).is_rows().with_size(0);
// prepared statement
auto prepared_id = e.prepare(get_query("token(pk) >= ? AND token(pk) <= ?")).get0();
auto prepared_id = e.prepare(get_query("token(pk) >= ? AND token(pk) <= ?")).get();
auto msg = e.execute_prepared(prepared_id, {
cql3::raw_value::make_value(long_type->decompose(testset_tokens[1])), cql3::raw_value::make_value(long_type->decompose(testset_tokens[5]))
}).get0();
}).get();
assert_that(msg).is_rows().with_rows(get_result_rows(1, 5));
msg = e.execute_prepared(prepared_id, {
cql3::raw_value::make_value(long_type->decompose(testset_tokens[2])), cql3::raw_value::make_value(long_type->decompose(testset_tokens[6]))
}).get0();
}).get();
assert_that(msg).is_rows().with_rows(get_result_rows(2, 6));
};
@@ -1979,7 +1979,7 @@ SEASTAR_TEST_CASE(test_returning_failure_from_ghost_rows_deletion) {
if (!utils::get_local_injector().enabled_injections().empty()) {
// Test that when a single query to the base table fails, it is propagated
// to the user
BOOST_REQUIRE_THROW(e.execute_cql("PRUNE MATERIALIZED VIEW tv").get0(), std::runtime_error);
BOOST_REQUIRE_THROW(e.execute_cql("PRUNE MATERIALIZED VIEW tv").get(), std::runtime_error);
}
});
}

View File

@@ -2694,7 +2694,7 @@ SEASTAR_TEST_CASE(test_uncompressed_simple_load) {
SEASTAR_TEST_CASE(test_uncompressed_simple_read_index) {
return test_env::do_with_async([] (test_env& env) {
sstable_assertions sst(env, UNCOMPRESSED_SIMPLE_SCHEMA, UNCOMPRESSED_SIMPLE_PATH);
auto vec = sst.read_index().get0();
auto vec = sst.read_index().get();
BOOST_REQUIRE_EQUAL(5, vec.size());
});
}
@@ -2999,7 +2999,7 @@ SEASTAR_TEST_CASE(test_uncompressed_collections_read) {
}
static sstables::shared_sstable open_sstable(test_env& env, schema_ptr schema, sstring dir, sstables::generation_type generation) {
return env.reusable_sst(std::move(schema), dir, generation, sstables::sstable::version_types::mc).get0();
return env.reusable_sst(std::move(schema), dir, generation, sstables::sstable::version_types::mc).get();
}
static std::vector<sstables::shared_sstable> open_sstables(test_env& env, schema_ptr s, sstring dir, std::vector<sstables::generation_type> generations) {
@@ -3089,7 +3089,7 @@ SEASTAR_TEST_CASE(compact_deleted_row) {
*/
mutation_opt m = with_closeable(compacted_sstable_reader(env, s, table_name, {1, 2}), [&] (flat_mutation_reader_v2& reader) {
return read_mutation_from_flat_mutation_reader(reader);
}).get0();
}).get();
BOOST_REQUIRE(m);
BOOST_REQUIRE(m->key().equal(*s, partition_key::from_singular(*s, data_value(sstring("key")))));
BOOST_REQUIRE(!m->partition().partition_tombstone());
@@ -3161,7 +3161,7 @@ SEASTAR_TEST_CASE(compact_deleted_cell) {
*/
mutation_opt m = with_closeable(compacted_sstable_reader(env, s, table_name, {1, 2}), [&] (flat_mutation_reader_v2& reader) {
return read_mutation_from_flat_mutation_reader(reader);
}).get0();
}).get();
BOOST_REQUIRE(m);
BOOST_REQUIRE(m->key().equal(*s, partition_key::from_singular(*s, data_value(sstring("key")))));
BOOST_REQUIRE(!m->partition().partition_tombstone());
@@ -3189,7 +3189,7 @@ static void compare_sstables(const std::filesystem::path& result_path, sstring t
"ks", table_name, sstables::sstable_version_types::mc, generation_from_value(1), big, file_type);
auto result_filename =
sstable::filename(result_path.string(), "ks", table_name, sst->get_version(), sst->generation(), big, file_type);
auto eq = tests::compare_files(orig_filename, result_filename).get0();
auto eq = tests::compare_files(orig_filename, result_filename).get();
BOOST_REQUIRE(eq);
}
}
@@ -3278,7 +3278,7 @@ static constexpr api::timestamp_type write_timestamp = 1525385507816568;
static constexpr gc_clock::time_point write_time_point = gc_clock::time_point{} + gc_clock::duration{1525385507};
static void do_validate_stats_metadata(schema_ptr s, sstable_assertions& written_sst, sstring table_name) {
auto orig_sst = written_sst.get_env().reusable_sst(s, get_write_test_path(table_name), 1, sstable_version_types::mc).get0();
auto orig_sst = written_sst.get_env().reusable_sst(s, get_write_test_path(table_name), 1, sstable_version_types::mc).get();
const auto& orig_stats = orig_sst->get_stats_metadata();
const auto& written_stats = written_sst.get_stats_metadata();
@@ -4542,7 +4542,7 @@ static std::unique_ptr<index_reader> get_index_reader(shared_sstable sst, reader
}
shared_sstable make_test_sstable(test_env& env, schema_ptr schema, const sstring& table_name) {
return env.reusable_sst(schema, get_read_index_test_path(table_name), sstables::generation_type{1}).get0();
return env.reusable_sst(schema, get_read_index_test_path(table_name), sstables::generation_type{1}).get();
}
/*

View File

@@ -976,7 +976,7 @@ SEASTAR_TEST_CASE(tombstone_purge_test) {
for (auto&& sst : all) {
column_family_test(cf).add_sstable(sst).get();
}
return compact_sstables(env, sstables::compaction_descriptor(to_compact), cf, sst_gen).get0().new_sstables;
return compact_sstables(env, sstables::compaction_descriptor(to_compact), cf, sst_gen).get().new_sstables;
};
auto next_timestamp = [] {
@@ -1266,7 +1266,7 @@ SEASTAR_TEST_CASE(test_sstable_max_local_deletion_time_2) {
BOOST_REQUIRE(now.time_since_epoch().count() == sst2->get_stats_metadata().max_local_deletion_time);
auto creator = sst_gen;
auto info = compact_sstables(env, sstables::compaction_descriptor({sst1, sst2}), cf, creator).get0();
auto info = compact_sstables(env, sstables::compaction_descriptor({sst1, sst2}), cf, creator).get();
BOOST_REQUIRE(info.new_sstables.size() == 1);
BOOST_REQUIRE(((now + gc_clock::duration(100)).time_since_epoch().count()) ==
info.new_sstables.front()->get_stats_metadata().max_local_deletion_time);
@@ -1351,7 +1351,7 @@ SEASTAR_TEST_CASE(compaction_with_fully_expired_table) {
auto expired_sst = *expired.begin();
BOOST_REQUIRE(expired_sst == sst);
auto ret = compact_sstables(env, sstables::compaction_descriptor(ssts), cf, sst_gen).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor(ssts), cf, sst_gen).get();
BOOST_REQUIRE(ret.new_sstables.empty());
BOOST_REQUIRE(ret.stats.end_size == 0);
});
@@ -1557,7 +1557,7 @@ SEASTAR_TEST_CASE(time_window_strategy_size_tiered_behavior_correctness) {
auto close_cf = deferred_stop(cf);
auto major_compact_bucket = [&] (api::timestamp_type window_ts) {
auto bound = time_window_compaction_strategy::get_window_lower_bound(window_size, window_ts);
auto ret = compact_sstables(env, sstables::compaction_descriptor(std::move(buckets[bound])), cf, sst_gen).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor(std::move(buckets[bound])), cf, sst_gen).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
buckets[bound] = std::move(ret.new_sstables);
};
@@ -1653,7 +1653,7 @@ SEASTAR_TEST_CASE(min_max_clustering_key_test_2) {
check_min_max_column_names(sst2, {"9ck101"}, {"9ck298"});
auto creator = sst_gen;
auto info = compact_sstables(env, sstables::compaction_descriptor({sst, sst2}), cf, creator).get0();
auto info = compact_sstables(env, sstables::compaction_descriptor({sst, sst2}), cf, creator).get();
BOOST_REQUIRE(info.new_sstables.size() == 1);
check_min_max_column_names(info.new_sstables.front(), {"0ck100"}, {"9ck298"});
}
@@ -1734,7 +1734,7 @@ SEASTAR_TEST_CASE(sstable_expired_data_ratio) {
BOOST_REQUIRE(std::fabs(run.estimate_droppable_tombstone_ratio(now, gc_state, stcs_schema) - expired) <= 0.1);
auto creator = sst_gen;
auto info = compact_sstables(env, sstables::compaction_descriptor({ sst }), stcs_table, creator).get0();
auto info = compact_sstables(env, sstables::compaction_descriptor({ sst }), stcs_table, creator).get();
BOOST_REQUIRE(info.new_sstables.size() == 1);
BOOST_REQUIRE(info.new_sstables.front()->estimate_droppable_tombstone_ratio(now, gc_state, stcs_schema) == 0.0f);
BOOST_REQUIRE_CLOSE(info.new_sstables.front()->data_size(), uncompacted_size*(1-expired), 5);
@@ -1809,7 +1809,7 @@ SEASTAR_TEST_CASE(compaction_correctness_with_partitioned_sstable_set) {
auto cf = env.make_table_for_tests(s);
auto close_cf = deferred_stop(cf);
return compact_sstables(env, sstables::compaction_descriptor(std::move(all), 0, 0 /*std::numeric_limits<uint64_t>::max()*/),
cf, sst_gen).get0().new_sstables;
cf, sst_gen).get().new_sstables;
};
auto make_insert = [&] (const dht::decorated_key& key) {
@@ -1931,7 +1931,7 @@ SEASTAR_TEST_CASE(sstable_cleanup_correctness_test) {
auto local_ranges = compaction::make_owned_ranges_ptr(db.get_keyspace_local_ranges(ks_name));
auto descriptor = sstables::compaction_descriptor({sst}, compaction_descriptor::default_level,
compaction_descriptor::default_max_sstable_bytes, run_identifier, compaction_type_options::make_cleanup(), std::move(local_ranges));
auto ret = compact_sstables(env, std::move(descriptor), cf, sst_gen).get0();
auto ret = compact_sstables(env, std::move(descriptor), cf, sst_gen).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
BOOST_REQUIRE(ret.new_sstables.front()->get_estimated_key_count() >= total_partitions);
@@ -1947,7 +1947,7 @@ SEASTAR_TEST_CASE(sstable_cleanup_correctness_test) {
descriptor = sstables::compaction_descriptor({sst}, compaction_descriptor::default_level,
compaction_descriptor::default_max_sstable_bytes, run_identifier,
compaction_type_options::make_cleanup(), std::move(local_ranges));
ret = compact_sstables(env, std::move(descriptor), cf, sst_gen).get0();
ret = compact_sstables(env, std::move(descriptor), cf, sst_gen).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
auto reader = ret.new_sstables[0]->as_mutation_source().make_reader_v2(s, env.make_reader_permit(), query::full_partition_range, s->full_slice());
assert_that(std::move(reader))
@@ -2809,7 +2809,7 @@ SEASTAR_TEST_CASE(sstable_run_based_compaction_test) {
cf->start();
cf->set_compaction_strategy(sstables::compaction_strategy_type::size_tiered);
auto compact = [&, s] (std::vector<shared_sstable> all, auto replacer) -> std::vector<shared_sstable> {
return compact_sstables(env, sstables::compaction_descriptor(std::move(all), 1, 0), cf, sst_gen, replacer).get0().new_sstables;
return compact_sstables(env, sstables::compaction_descriptor(std::move(all), 1, 0), cf, sst_gen, replacer).get().new_sstables;
};
auto make_insert = [&] (const dht::decorated_key& key) {
mutation m(s, key);
@@ -2997,7 +2997,7 @@ SEASTAR_TEST_CASE(backlog_tracker_correctness_after_changing_compaction_strategy
cf.as_table_state().get_backlog_tracker().replace_sstables({}, {sst});
}
auto ret = fut.get0();
auto ret = fut.get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
}
// triggers code that iterates through registered compactions.
@@ -3072,7 +3072,7 @@ SEASTAR_TEST_CASE(purged_tombstone_consumer_sstable_test) {
stop_iteration consume(range_tombstone_change&& rtc) { return _writer.consume(std::move(rtc)); }
stop_iteration consume_end_of_partition() { return _writer.consume_end_of_partition(); }
void consume_end_of_stream() { _writer.consume_end_of_stream(); _sst->open_data().get0(); }
void consume_end_of_stream() { _writer.consume_end_of_stream(); _sst->open_data().get(); }
};
std::optional<gc_clock::time_point> gc_before;
@@ -3259,7 +3259,7 @@ SEASTAR_TEST_CASE(incremental_compaction_data_resurrection_test) {
// since we use compacting_reader expired tombstones shouldn't be read from sstables
// so we just check there are no live (resurrected for this test) rows in partition
auto is_partition_dead = [&s, &cf, &env] (const dht::decorated_key& key) {
replica::column_family::const_mutation_partition_ptr mp = cf->find_partition(s, env.make_reader_permit(), key).get0();
replica::column_family::const_mutation_partition_ptr mp = cf->find_partition(s, env.make_reader_permit(), key).get();
return mp && mp->live_row_count(*s, gc_clock::time_point::max()) == 0;
};
@@ -3298,7 +3298,7 @@ SEASTAR_TEST_CASE(incremental_compaction_data_resurrection_test) {
try {
// The goal is to have one sstable generated for each mutation to trigger the issue.
auto max_sstable_size = 0;
auto result = compact_sstables(env, sstables::compaction_descriptor(sstables, 0, max_sstable_size), cf, sst_gen, replacer).get0().new_sstables;
auto result = compact_sstables(env, sstables::compaction_descriptor(sstables, 0, max_sstable_size), cf, sst_gen, replacer).get().new_sstables;
BOOST_REQUIRE_EQUAL(2, result.size());
} catch (...) {
// swallow exception
@@ -3358,11 +3358,11 @@ SEASTAR_TEST_CASE(twcs_major_compaction_test) {
auto original_together = make_sstable_containing(sst_gen, {mut3, mut4});
auto ret = compact_sstables(env, sstables::compaction_descriptor({original_together}), cf, sst_gen, replacer_fn_no_op()).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor({original_together}), cf, sst_gen, replacer_fn_no_op()).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
auto original_apart = make_sstable_containing(sst_gen, {mut1, mut2});
ret = compact_sstables(env, sstables::compaction_descriptor({original_apart}), cf, sst_gen, replacer_fn_no_op()).get0();
ret = compact_sstables(env, sstables::compaction_descriptor({original_apart}), cf, sst_gen, replacer_fn_no_op()).get();
BOOST_REQUIRE(ret.new_sstables.size() == 2);
});
}
@@ -3489,7 +3489,7 @@ SEASTAR_TEST_CASE(test_bug_6472) {
// Make sure everything we wanted expired is expired by now.
forward_jump_clocks(std::chrono::hours(101));
auto ret = compact_sstables(env, sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
});
}
@@ -3605,7 +3605,7 @@ SEASTAR_TEST_CASE(test_twcs_partition_estimate) {
make_sstable(3),
};
auto ret = compact_sstables(env, sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get();
// The real test here is that we don't assert() in
// sstables::prepare_summary() with the compact_sstables() call above,
// this is only here as a sanity check.
@@ -3784,7 +3784,7 @@ SEASTAR_TEST_CASE(test_twcs_compaction_across_buckets) {
}();
sstables_spanning_many_windows.push_back(make_sstable_containing(sst_gen, {deletion_mut}));
auto ret = compact_sstables(env, sstables::compaction_descriptor(std::move(sstables_spanning_many_windows)), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get0();
auto ret = compact_sstables(env, sstables::compaction_descriptor(std::move(sstables_spanning_many_windows)), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get();
BOOST_REQUIRE(ret.new_sstables.size() == 1);
assert_that(sstable_reader(ret.new_sstables[0], s, env.make_reader_permit()))
@@ -3817,7 +3817,7 @@ SEASTAR_TEST_CASE(test_offstrategy_sstable_compaction) {
auto sst = make_sstable_containing(sst_gen, {mut});
cf->add_sstable_and_update_cache(std::move(sst), sstables::offstrategy::yes).get();
}
BOOST_REQUIRE(cf->perform_offstrategy_compaction().get0());
BOOST_REQUIRE(cf->perform_offstrategy_compaction().get());
}
});
}
@@ -4408,9 +4408,9 @@ SEASTAR_TEST_CASE(twcs_single_key_reader_through_compound_set_test) {
tracing::trace_state_ptr(), ::streamed_mutation::forwarding::no,
::mutation_reader::forwarding::no);
auto close_reader = deferred_close(reader);
auto mfopt = read_mutation_from_flat_mutation_reader(reader).get0();
auto mfopt = read_mutation_from_flat_mutation_reader(reader).get();
BOOST_REQUIRE(mfopt);
mfopt = read_mutation_from_flat_mutation_reader(reader).get0();
mfopt = read_mutation_from_flat_mutation_reader(reader).get();
BOOST_REQUIRE(!mfopt);
BOOST_REQUIRE(cf.cf_stats().clustering_filter_count > 0);
});
@@ -4747,7 +4747,7 @@ SEASTAR_TEST_CASE(test_large_partition_splitting_on_compaction) {
// Set block size to 1, so promoted index is generated for every row written, allowing the split to happen as soon as possible.
env.manager().set_promoted_index_block_size(1);
auto ret = compact_sstables(env, std::move(desc), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get0();
auto ret = compact_sstables(env, std::move(desc), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get();
testlog.info("Large partition splitting on compaction created {} sstables", ret.new_sstables.size());
BOOST_REQUIRE(ret.new_sstables.size() > 1);
@@ -4759,12 +4759,12 @@ SEASTAR_TEST_CASE(test_large_partition_splitting_on_compaction) {
position_in_partition::tri_compare pos_tri_cmp(*s);
for (auto& sst : ret.new_sstables) {
sst = env.reusable_sst(sst).get0();
sst = env.reusable_sst(sst).get();
BOOST_REQUIRE(sst->may_have_partition_tombstones());
auto reader = sstable_reader(sst, s, env.make_reader_permit());
mutation_opt m = read_mutation_from_flat_mutation_reader(reader).get0();
mutation_opt m = read_mutation_from_flat_mutation_reader(reader).get();
BOOST_REQUIRE(m);
BOOST_REQUIRE(m->decorated_key().equal(*s, pkey));
// ASSERT that partition tobmstone is replicated to every fragment.
@@ -4799,7 +4799,7 @@ SEASTAR_TEST_CASE(test_large_partition_splitting_on_compaction) {
BOOST_REQUIRE(pos_tri_cmp(*previous_last_pos, current_first_pos) == 0);
}
BOOST_REQUIRE(!(reader)().get0());
BOOST_REQUIRE(!(reader)().get());
reader.close().get();
@@ -4905,7 +4905,7 @@ SEASTAR_TEST_CASE(tombstone_gc_disabled_test) {
for (auto& sst : all) {
column_family_test(t).add_sstable(sst).get();
}
return compact_sstables(env, sstables::compaction_descriptor(all), t, my_sst_gen).get0().new_sstables;
return compact_sstables(env, sstables::compaction_descriptor(all), t, my_sst_gen).get().new_sstables;
};
auto next_timestamp = [] {
@@ -4988,7 +4988,7 @@ SEASTAR_TEST_CASE(compaction_optimization_to_avoid_bloom_filter_checks) {
}
auto desc = sstables::compaction_descriptor(std::move(c));
desc.enable_garbage_collection(t->get_sstable_set());
return compact_sstables(env, std::move(desc), t, sst_gen).get0();
return compact_sstables(env, std::move(desc), t, sst_gen).get();
};
auto make_insert = [&] (partition_key key) {
@@ -5296,7 +5296,7 @@ SEASTAR_TEST_CASE(produces_optimal_filter_by_estimating_correctly_partitions_per
t->disable_auto_compaction().get();
auto desc = sstables::compaction_descriptor(std::move(c));
desc.max_sstable_bytes = max_size;
return compact_sstables(env, std::move(desc), t, sst_gen).get0();
return compact_sstables(env, std::move(desc), t, sst_gen).get();
};
auto make_insert = [&] (partition_key key) {
@@ -5323,7 +5323,7 @@ SEASTAR_TEST_CASE(produces_optimal_filter_by_estimating_correctly_partitions_per
uint64_t partitions_per_sstable = keys / ret.new_sstables.size();
auto filter = utils::i_filter::get_filter(partitions_per_sstable, s->bloom_filter_fp_chance(), utils::filter_format::m_format);
auto comp = ret.new_sstables.front()->get_open_info().get0();
auto comp = ret.new_sstables.front()->get_open_info().get();
// Filter for SSTable generated cannot be lower than the one expected
testlog.info("filter size: actual={}, expected>={}", comp.components->filter->memory_size(), filter->memory_size());
@@ -5383,7 +5383,7 @@ SEASTAR_TEST_CASE(splitting_compaction_test) {
auto desc = sstables::compaction_descriptor({input});
desc.options = compaction_type_options::make_split(classify_fn);
auto ret = compact_sstables(env, std::move(desc), t, sst_gen, replacer_fn_no_op()).get0();
auto ret = compact_sstables(env, std::move(desc), t, sst_gen, replacer_fn_no_op()).get();
auto twcs_options = time_window_compaction_strategy_options(s->compaction_strategy_options());
auto window_for = [&twcs_options] (api::timestamp_type timestamp) {

View File

@@ -37,7 +37,7 @@ mutation_source make_sstable_mutation_source(sstables::test_env& env, schema_ptr
}
static void consume_all(flat_mutation_reader_v2& rd) {
while (auto mfopt = rd().get0()) {}
while (auto mfopt = rd().get()) {}
}
// It is assumed that src won't change.

View File

@@ -537,7 +537,7 @@ void test_sliced_read_row_presence(shared_sstable sst, schema_ptr s, reader_perm
partition_key::equality pk_eq(*s);
clustering_key::equality ck_eq(*s);
auto mfopt = reader().get0();
auto mfopt = reader().get();
while (mfopt) {
BOOST_REQUIRE(mfopt->is_partition_start());
auto it = std::find_if(expected.begin(), expected.end(), [&] (auto&& x) {
@@ -547,7 +547,7 @@ void test_sliced_read_row_presence(shared_sstable sst, schema_ptr s, reader_perm
auto expected_cr = std::move(it->second);
expected.erase(it);
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
while (!mfopt->is_end_of_partition()) {
if (mfopt->is_clustering_row()) {
@@ -561,12 +561,12 @@ void test_sliced_read_row_presence(shared_sstable sst, schema_ptr s, reader_perm
BOOST_REQUIRE(it != expected_cr.end());
expected_cr.erase(it);
}
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
}
BOOST_REQUIRE(expected_cr.empty());
mfopt = reader().get0();
mfopt = reader().get();
}
BOOST_REQUIRE(expected.empty());
}
@@ -598,7 +598,7 @@ SEASTAR_TEST_CASE(test_sliced_mutation_reads) {
.with_column("v2", set_of_ints_type);
auto s = builder.build();
auto sst = env.reusable_sst(s, get_test_dir("sliced_mutation_reads", s), 1, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("sliced_mutation_reads", s), 1, version).get();
{
auto ps = partition_slice_builder(*s)
@@ -693,7 +693,7 @@ SEASTAR_TEST_CASE(test_wrong_range_tombstone_order) {
auto pkey = partition_key::from_exploded(*s, { int32_type->decompose(0) });
auto dkey = dht::decorate_key(*s, std::move(pkey));
auto sst = env.reusable_sst(s, get_test_dir("wrong_range_tombstone_order", s), 1, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("wrong_range_tombstone_order", s), 1, version).get();
auto reader = sstable_reader_v2(sst, s, env.make_reader_permit());
using kind = mutation_fragment_v2::kind;
@@ -760,15 +760,15 @@ SEASTAR_TEST_CASE(test_counter_read) {
auto node1 = counter_id(utils::UUID("8379ab99-4507-4ab1-805d-ac85a863092b"));
auto node2 = counter_id(utils::UUID("b8a6c3f3-e222-433f-9ce9-de56a8466e07"));
auto sst = env.reusable_sst(s, get_test_dir("counter_test", s), 5, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("counter_test", s), 5, version).get();
auto reader = sstable_reader_v2(sst, s, env.make_reader_permit());
auto close_reader = deferred_close(reader);
auto mfopt = reader().get0();
auto mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_partition_start());
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_clustering_row());
const clustering_row* cr = &mfopt->as_clustering_row();
@@ -796,7 +796,7 @@ SEASTAR_TEST_CASE(test_counter_read) {
}
});
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_clustering_row());
cr = &mfopt->as_clustering_row();
@@ -809,11 +809,11 @@ SEASTAR_TEST_CASE(test_counter_read) {
}
});
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_end_of_partition());
mfopt = reader().get0();
mfopt = reader().get();
BOOST_REQUIRE(!mfopt);
}
});
@@ -881,7 +881,7 @@ SEASTAR_TEST_CASE(test_promoted_index_read) {
.with_column("ck2", int32_type, column_kind::clustering_key)
.with_column("v", int32_type)
.build();
auto sst = env.reusable_sst(s, get_test_dir("promoted_index_read", s), 1, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("promoted_index_read", s), 1, version).get();
auto pkey = partition_key::from_exploded(*s, { int32_type->decompose(0) });
auto dkey = dht::decorate_key(*s, std::move(pkey));
@@ -1567,7 +1567,7 @@ SEASTAR_TEST_CASE(test_partition_skipping) {
.with_column("v", int32_type)
.build();
auto sst = env.reusable_sst(s, get_test_dir("partition_skipping",s), 1, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("partition_skipping",s), 1, version).get();
std::vector<dht::decorated_key> keys;
for (int i = 0; i < 10; i++) {
@@ -1825,15 +1825,15 @@ static void copy_directory(fs::path src_dir, fs::path dst_dir) {
SEASTAR_TEST_CASE(test_unknown_component) {
return test_env::do_with_async([] (test_env& env) {
copy_directory("test/resource/sstables/unknown_component", std::string(env.tempdir().path().string()) + "/unknown_component");
auto sstp = env.reusable_sst(uncompressed_schema(), env.tempdir().path().string() + "/unknown_component").get0();
auto sstp = env.reusable_sst(uncompressed_schema(), env.tempdir().path().string() + "/unknown_component").get();
test::create_links(*sstp, env.tempdir().path().string()).get();
// check that create_links() moved unknown component to new dir
BOOST_REQUIRE(file_exists(env.tempdir().path().string() + "/la-1-big-UNKNOWN.txt").get0());
BOOST_REQUIRE(file_exists(env.tempdir().path().string() + "/la-1-big-UNKNOWN.txt").get());
sstp = env.reusable_sst(uncompressed_schema(), generation_type{1}).get0();
sstp = env.reusable_sst(uncompressed_schema(), generation_type{1}).get();
env.manager().delete_atomically({sstp}).get();
// assure unknown component is deleted
BOOST_REQUIRE(!file_exists(env.tempdir().path().string() + "/la-1-big-UNKNOWN.txt").get0());
BOOST_REQUIRE(!file_exists(env.tempdir().path().string() + "/la-1-big-UNKNOWN.txt").get());
});
}
@@ -2000,7 +2000,7 @@ SEASTAR_TEST_CASE(sstable_tombstone_histogram_test) {
}
auto sst = make_sstable_containing(env.make_sstable(s, version), mutations);
auto histogram = sst->get_stats_metadata().estimated_tombstone_drop_time;
sst = env.reusable_sst(sst).get0();
sst = env.reusable_sst(sst).get();
auto histogram2 = sst->get_stats_metadata().estimated_tombstone_drop_time;
// check that histogram respected limit
@@ -2017,7 +2017,7 @@ SEASTAR_TEST_CASE(sstable_bad_tombstone_histogram_test) {
.with_column("id", utf8_type, column_kind::partition_key)
.with_column("value", int32_type);
auto s = builder.build();
auto sst = env.reusable_sst(s, "test/resource/sstables/bad_tombstone_histogram").get0();
auto sst = env.reusable_sst(s, "test/resource/sstables/bad_tombstone_histogram").get();
auto histogram = sst->get_stats_metadata().estimated_tombstone_drop_time;
BOOST_REQUIRE(histogram.max_bin_size == sstables::TOMBSTONE_HISTOGRAM_BIN_SIZE);
// check that bad histogram was discarded
@@ -2051,7 +2051,7 @@ SEASTAR_TEST_CASE(sstable_owner_shards) {
};
auto sst = make_sstable_containing(sst_gen, std::move(muts));
auto schema = schema_builder(s).with_sharder(smp_count, ignore_msb).build();
sst = env.reusable_sst(std::move(schema), sst).get0();
sst = env.reusable_sst(std::move(schema), sst).get();
return sst;
};
@@ -2154,7 +2154,7 @@ SEASTAR_TEST_CASE(test_wrong_counter_shard_order) {
.with_column("c5", counter_type)
.build();
auto sst = env.reusable_sst(s, get_test_dir("wrong_counter_shard_order", s), 2, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("wrong_counter_shard_order", s), 2, version).get();
auto reader = sstable_reader_v2(sst, s, env.make_reader_permit());
auto close_reader = deferred_close(reader);
@@ -2177,32 +2177,32 @@ SEASTAR_TEST_CASE(test_wrong_counter_shard_order) {
};
{
auto mfopt = reader().get0();
auto mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_partition_start());
verify_row(reader().get0(), 28545);
verify_row(reader().get0(), 27967);
verify_row(reader().get0(), 28342);
verify_row(reader().get0(), 28325);
mfopt = reader().get0();
verify_row(reader().get(), 28545);
verify_row(reader().get(), 27967);
verify_row(reader().get(), 28342);
verify_row(reader().get(), 28325);
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_end_of_partition());
}
{
auto mfopt = reader().get0();
auto mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_partition_start());
verify_row(reader().get0(), 28386);
verify_row(reader().get0(), 28378);
verify_row(reader().get0(), 28129);
verify_row(reader().get0(), 28260);
mfopt = reader().get0();
verify_row(reader().get(), 28386);
verify_row(reader().get(), 28378);
verify_row(reader().get(), 28129);
verify_row(reader().get(), 28260);
mfopt = reader().get();
BOOST_REQUIRE(mfopt);
BOOST_REQUIRE(mfopt->is_end_of_partition());
}
BOOST_REQUIRE(!reader().get0());
BOOST_REQUIRE(!reader().get());
}
});
}
@@ -2261,7 +2261,7 @@ SEASTAR_TEST_CASE(test_old_format_non_compound_range_tombstone_is_read) {
.with_column("v", int32_type)
.build(schema_builder::compact_storage::yes);
auto sst = env.reusable_sst(s, get_test_dir("broken_non_compound_pi_and_range_tombstone", s), 1, version).get0();
auto sst = env.reusable_sst(s, get_test_dir("broken_non_compound_pi_and_range_tombstone", s), 1, version).get();
auto pk = partition_key::from_exploded(*s, { int32_type->decompose(1) });
auto dk = dht::decorate_key(*s, pk);
@@ -2308,7 +2308,7 @@ SEASTAR_TEST_CASE(summary_rebuild_sanity) {
BOOST_REQUIRE(s1.entries.size() > 1);
sstables::test(sst).remove_component(component_type::Summary).get();
sst = env.reusable_sst(sst).get0();
sst = env.reusable_sst(sst).get();
summary& s2 = sstables::test(sst).get_summary();
BOOST_REQUIRE(::memcmp(&s1.header, &s2.header, sizeof(summary::header)) == 0);
@@ -2514,7 +2514,7 @@ SEASTAR_TEST_CASE(test_reads_cassandra_static_compact) {
.build(schema_builder::compact_storage::yes);
// INSERT INTO ks.cf (key, c1, c2) VALUES ('a', 'abc', 'cde');
auto sst = env.reusable_sst(s, get_test_dir("cassandra_static_compact", s), 1, sstables::sstable::version_types::mc).get0();
auto sst = env.reusable_sst(s, get_test_dir("cassandra_static_compact", s), 1, sstables::sstable::version_types::mc).get();
auto pkey = partition_key::from_exploded(*s, { utf8_type->decompose("a") });
auto dkey = dht::decorate_key(*s, std::move(pkey));
mutation m(s, dkey);
@@ -2593,7 +2593,7 @@ SEASTAR_TEST_CASE(test_zero_estimated_partitions) {
auto sst_mr = sst->as_mutation_source().make_reader_v2(s, env.make_reader_permit(), query::full_partition_range, s->full_slice());
auto close_mr = deferred_close(sst_mr);
auto sst_mut = read_mutation_from_flat_mutation_reader(sst_mr).get0();
auto sst_mut = read_mutation_from_flat_mutation_reader(sst_mr).get();
// The real test here is that we don't assert() in
// sstables::prepare_summary() with the write_components() call above,
@@ -3023,10 +3023,10 @@ SEASTAR_TEST_CASE(find_first_position_in_partition_from_sstable_test) {
BOOST_REQUIRE(sst->max_position().key() == last_position->key());
}
auto first_position_opt = sst->find_first_position_in_partition(env.make_reader_permit(), sst->get_first_decorated_key(), false).get0();
auto first_position_opt = sst->find_first_position_in_partition(env.make_reader_permit(), sst->get_first_decorated_key(), false).get();
BOOST_REQUIRE(first_position_opt);
auto last_position_opt = sst->find_first_position_in_partition(env.make_reader_permit(), sst->get_last_decorated_key(), true).get0();
auto last_position_opt = sst->find_first_position_in_partition(env.make_reader_permit(), sst->get_last_decorated_key(), true).get();
BOOST_REQUIRE(last_position_opt);
BOOST_REQUIRE(eq(*first_position_opt, *first_position));
@@ -3071,8 +3071,8 @@ future<> test_sstable_bytes_correctness(sstring tname, test_env_config cfg) {
uint64_t bytes_on_disk = 0;
auto& underlying_storage = const_cast<sstables::storage&>(sst->get_storage());
for (auto& component_type : sstables::test(sst).get_components()) {
file f = underlying_storage.open_component(*sst, component_type, open_flags::ro, file_open_options{}, true).get0();
bytes_on_disk += f.size().get0();
file f = underlying_storage.open_component(*sst, component_type, open_flags::ro, file_open_options{}, true).get();
bytes_on_disk += f.size().get();
}
return bytes_on_disk;
};
@@ -3142,7 +3142,7 @@ SEASTAR_TEST_CASE(test_sstable_set_predicate) {
auto verify_reader_result = [&] (flat_mutation_reader_v2 sst_mr, bool expect_eos) {
auto close_mr = deferred_close(sst_mr);
auto sst_mut = read_mutation_from_flat_mutation_reader(sst_mr).get0();
auto sst_mut = read_mutation_from_flat_mutation_reader(sst_mr).get();
if (expect_eos) {
BOOST_REQUIRE(sst_mr.is_buffer_empty());

View File

@@ -185,7 +185,7 @@ SEASTAR_TEST_CASE(sstable_directory_test_table_simple_empty_directory_scan) {
with_sstable_directory(env, [] (sharded<sstables::sstable_directory>& sstdir) {
distributed_loader_for_tests::process_sstable_dir(sstdir, {}).get();
auto max_generation_seen = highest_generation_seen(sstdir).get0();
auto max_generation_seen = highest_generation_seen(sstdir).get();
// No generation found on empty directory.
BOOST_REQUIRE(!max_generation_seen);
});
@@ -457,7 +457,7 @@ SEASTAR_TEST_CASE(sstable_directory_test_table_lock_works) {
std::unordered_map<bool, size_t> res;
for (const auto& [shard, files] : sstables) {
for (const auto& f : files) {
res[file_exists(f).get0()]++;
res[file_exists(f).get()]++;
}
}
return res;
@@ -514,7 +514,7 @@ SEASTAR_TEST_CASE(sstable_directory_shared_sstables_reshard_correctly) {
verify_that_all_sstables_are_local(sstdir, 0).get();
sharded<sstables::sstable_generation_generator> sharded_gen;
auto max_generation_seen = highest_generation_seen(sstdir).get0();
auto max_generation_seen = highest_generation_seen(sstdir).get();
sharded_gen.start(max_generation_seen.as_int()).get();
auto stop_generator = deferred_stop(sharded_gen);
@@ -567,7 +567,7 @@ SEASTAR_TEST_CASE(sstable_directory_shared_sstables_reshard_correctly_with_owned
verify_that_all_sstables_are_local(sstdir, 0).get();
sharded<sstables::sstable_generation_generator> sharded_gen;
auto max_generation_seen = highest_generation_seen(sstdir).get0();
auto max_generation_seen = highest_generation_seen(sstdir).get();
sharded_gen.start(max_generation_seen.as_int()).get();
auto stop_generator = deferred_stop(sharded_gen);
@@ -620,7 +620,7 @@ SEASTAR_TEST_CASE(sstable_directory_shared_sstables_reshard_distributes_well_eve
verify_that_all_sstables_are_local(sstdir, 0).get();
sharded<sstables::sstable_generation_generator> sharded_gen;
auto max_generation_seen = highest_generation_seen(sstdir).get0();
auto max_generation_seen = highest_generation_seen(sstdir).get();
sharded_gen.start(max_generation_seen.as_int()).get();
auto stop_generator = deferred_stop(sharded_gen);
@@ -671,7 +671,7 @@ SEASTAR_TEST_CASE(sstable_directory_shared_sstables_reshard_respect_max_threshol
verify_that_all_sstables_are_local(sstdir, 0).get();
sharded<sstables::sstable_generation_generator> sharded_gen;
auto max_generation_seen = highest_generation_seen(sstdir).get0();
auto max_generation_seen = highest_generation_seen(sstdir).get();
sharded_gen.start(max_generation_seen.as_int()).get();
auto stop_generator = deferred_stop(sharded_gen);
@@ -793,7 +793,7 @@ SEASTAR_TEST_CASE(test_pending_log_garbage_collection) {
// Now start atomic deletion -- create the pending deletion log for all
// three sstables, move TOC file for one of them into temporary-TOC, and
// partially delete another
sstable_directory::create_pending_deletion_log(ssts_to_remove).get0();
sstable_directory::create_pending_deletion_log(ssts_to_remove).get();
rename_file(test(ssts_to_remove[1]).filename(sstables::component_type::TOC).native(), test(ssts_to_remove[1]).filename(sstables::component_type::TemporaryTOC).native()).get();
rename_file(test(ssts_to_remove[2]).filename(sstables::component_type::TOC).native(), test(ssts_to_remove[2]).filename(sstables::component_type::TemporaryTOC).native()).get();
remove_file(test(ssts_to_remove[2]).filename(sstables::component_type::Data).native()).get();

View File

@@ -20,14 +20,14 @@ namespace fs = std::filesystem;
// Must be called from a seastar thread
static auto copy_sst_to_tmpdir(fs::path tmp_path, test_env& env, sstables::schema_ptr schema_ptr, fs::path src_path, sstables::generation_type gen) {
auto sst = env.reusable_sst(schema_ptr, src_path.native(), gen).get0();
auto sst = env.reusable_sst(schema_ptr, src_path.native(), gen).get();
auto dst_path = tmp_path / src_path.filename() / format("gen-{}", gen);
recursive_touch_directory(dst_path.native()).get();
for (auto p : sst->all_components()) {
auto src_path = test(sst).filename(p.first);
copy_file(src_path, dst_path / src_path.filename());
}
return std::make_pair(env.reusable_sst(schema_ptr, dst_path.native(), gen).get0(), dst_path.native());
return std::make_pair(env.reusable_sst(schema_ptr, dst_path.native(), gen).get(), dst_path.native());
}
SEASTAR_THREAD_TEST_CASE(test_sstable_move) {
@@ -51,7 +51,7 @@ SEASTAR_THREAD_TEST_CASE(test_sstable_move) {
// close the sst and make we can load it from the new directory.
sst->close_files().get();
sst = env.reusable_sst(uncompressed_schema(), cur_dir, gen).get0();
sst = env.reusable_sst(uncompressed_schema(), cur_dir, gen).get();
}
SEASTAR_THREAD_TEST_CASE(test_sstable_move_idempotent) {

View File

@@ -794,7 +794,7 @@ static schema_ptr buffer_overflow_schema() {
SEASTAR_TEST_CASE(buffer_overflow) {
return test_env::do_with_async([] (test_env& env) {
auto s = buffer_overflow_schema();
auto sstp = ka_sst(env, s, "test/resource/sstables/buffer_overflow", 5).get0();
auto sstp = ka_sst(env, s, "test/resource/sstables/buffer_overflow", 5).get();
auto r = sstp->make_reader(s, env.make_reader_permit(), query::full_partition_range, s->full_slice());
auto pk1 = partition_key::from_exploded(*s, { int32_type->decompose(4) });
auto dk1 = dht::decorate_key(*s, pk1);
@@ -848,7 +848,7 @@ SEASTAR_TEST_CASE(test_non_compound_table_row_is_not_marked_as_static) {
auto sst = make_sstable_containing(env.make_sstable(s, version), {std::move(m)});
auto mut = with_closeable(sst->make_reader(s, env.make_reader_permit(), query::full_partition_range, s->full_slice()), [] (auto& mr) {
return read_mutation_from_flat_mutation_reader(mr);
}).get0();
}).get();
BOOST_REQUIRE(bool(mut));
}
});
@@ -874,12 +874,12 @@ SEASTAR_TEST_CASE(test_has_partition_key) {
auto hk = sstables::sstable::make_hashed_key(*s, dk.key());
auto mr = sst->make_reader(s, env.make_reader_permit(), query::full_partition_range, s->full_slice());
auto close_mr = deferred_close(mr);
auto res = sst->has_partition_key(hk, dk).get0();
auto res = sst->has_partition_key(hk, dk).get();
BOOST_REQUIRE(bool(res));
auto dk2 = dht::decorate_key(*s, partition_key::from_nodetool_style_string(s, "xx"));
auto hk2 = sstables::sstable::make_hashed_key(*s, dk2.key());
res = sst->has_partition_key(hk2, dk2).get0();
res = sst->has_partition_key(hk2, dk2).get();
BOOST_REQUIRE(! bool(res));
}
});
@@ -1373,13 +1373,13 @@ SEASTAR_TEST_CASE(test_large_index_pages_do_not_cause_large_allocations) {
mutation expected = *with_closeable(mt->make_flat_reader(s, env.make_reader_permit(), pr), [] (auto& mt_reader) {
return read_mutation_from_flat_mutation_reader(mt_reader);
}).get0();
}).get();
auto t0 = std::chrono::steady_clock::now();
auto large_allocs_before = memory::stats().large_allocations();
mutation actual = *with_closeable(sst->as_mutation_source().make_reader_v2(s, env.make_reader_permit(), pr), [] (auto& sst_reader) {
return read_mutation_from_flat_mutation_reader(sst_reader);
}).get0();
}).get();
auto large_allocs_after = memory::stats().large_allocations();
auto duration = std::chrono::steady_clock::now() - t0;

View File

@@ -87,8 +87,8 @@ SEASTAR_THREAD_TEST_CASE(test_caching) {
lru.evict_all();
});
partition_index_cache::entry_ptr ptr0 = f0.get0();
partition_index_cache::entry_ptr ptr1 = f1.get0();
partition_index_cache::entry_ptr ptr0 = f0.get();
partition_index_cache::entry_ptr ptr1 = f1.get();
r.full_compaction();
with_allocator(r.allocator(), [&] {
@@ -131,7 +131,7 @@ SEASTAR_THREAD_TEST_CASE(test_caching) {
}
{
auto ptr4 = cache.get_or_load(0, page0_loader).get0();
auto ptr4 = cache.get_or_load(0, page0_loader).get();
has_page0(ptr4);
BOOST_REQUIRE_EQUAL(stats.misses, old_stats.misses + 2);
@@ -177,7 +177,7 @@ SEASTAR_THREAD_TEST_CASE(test_exception_while_loading) {
f1.get();
});
auto ptr = cache.get_or_load(0, page0_loader).get0();
auto ptr = cache.get_or_load(0, page0_loader).get();
has_page0(ptr);
}

View File

@@ -87,7 +87,7 @@ void run_sstable_resharding_test(sstables::test_env& env) {
}
auto filter_fname = sstables::test(sst).filename(component_type::Filter);
return file_size(filter_fname.native()).get0();
return file_size(filter_fname.native()).get();
};
uint64_t bloom_filter_size_before = filter_size(sst);
@@ -102,13 +102,13 @@ void run_sstable_resharding_test(sstables::test_env& env) {
// or resource usage wouldn't be fairly distributed among shards.
auto gen = smp::submit_to(shard, [&cf] () {
return column_family_test::calculate_generation_for_new_table(*cf);
}).get0();
}).get();
return env.make_sstable(cf->schema(), gen, version);
};
auto cdata = compaction_manager::create_compaction_data();
compaction_progress_monitor progress_monitor;
auto res = sstables::compact_sstables(std::move(descriptor), cdata, cf.as_table_state(), progress_monitor).get0();
auto res = sstables::compact_sstables(std::move(descriptor), cdata, cf.as_table_state(), progress_monitor).get();
sst->destroy().get();
auto new_sstables = std::move(res.new_sstables);
@@ -118,7 +118,7 @@ void run_sstable_resharding_test(sstables::test_env& env) {
std::unordered_set<shard_id> processed_shards;
for (auto& sstable : new_sstables) {
auto new_sst = env.reusable_sst(s, sstable->generation(), version).get0();
auto new_sst = env.reusable_sst(s, sstable->generation(), version).get();
bloom_filter_size_after += filter_size(new_sst);
auto shards = new_sst->get_shards_for_this_sstable();
BOOST_REQUIRE(shards.size() == 1); // check sstable is unshared.
@@ -199,7 +199,7 @@ SEASTAR_TEST_CASE(sstable_is_shared_correctness) {
BOOST_REQUIRE(!sst->is_shared());
auto all_shards_s = get_schema(smp::count, cfg->murmur3_partitioner_ignore_msb_bits());
sst = env.reusable_sst(all_shards_s, sst->generation(), version).get0();
sst = env.reusable_sst(all_shards_s, sst->generation(), version).get();
BOOST_REQUIRE(smp::count == 1 || sst->is_shared());
BOOST_REQUIRE(sst->get_shards_for_this_sstable().size() == smp::count);
assert_sstable_computes_correct_owners(env, sst).get();

Some files were not shown because too many files have changed in this diff Show More