From 7597663ef5b8fde36196185bfacfbc2a7d0fdcbb Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Sat, 12 Aug 2023 12:45:04 +0300 Subject: [PATCH] cql_test_env: Use table.find_row() shortcut The require_column_has_value() finds the cell in three steps -- finds partition, then row, then cell. The class table already has a method to facilitate row finding by partition and clustering key Signed-off-by: Pavel Emelyanov --- test/lib/cql_test_env.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index f51a2dc2ee..da9476299b 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -315,7 +315,7 @@ public: auto exp = expected.type()->decompose(expected); auto dk = dht::decorate_key(*schema, pkey); auto shard = cf.get_effective_replication_map()->shard_of(*schema, dk._token); - return _db.invoke_on(shard, [pkey = std::move(pkey), + return _db.invoke_on(shard, [dk = std::move(dk), ckey = std::move(ckey), ks_name = std::move(ks_name), column_name = std::move(column_name), @@ -324,10 +324,7 @@ public: auto& cf = db.find_column_family(ks_name, table_name); auto schema = cf.schema(); auto permit = db.get_reader_concurrency_semaphore().make_tracking_only_permit(schema.get(), "require_column_has_value()", db::no_timeout, {}); - return cf.find_partition_slow(schema, permit, pkey) - .then([schema, ckey, column_name, exp] (replica::column_family::const_mutation_partition_ptr p) { - assert(p != nullptr); - auto row = p->find_row(*schema, ckey); + return cf.find_row(schema, permit, dk, ckey).then([schema, column_name, exp] (auto row) { assert(row != nullptr); auto col_def = schema->get_column_definition(utf8_type->decompose(column_name)); assert(col_def != nullptr);