Skip to content

Commit

Permalink
session: rename do_query -> run_request_once
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Dec 24, 2024
1 parent ef80cd9 commit bf00f8b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scylla/src/transport/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ where
statement_info: RoutingInfo<'a>,
statement_config: &'a StatementConfig,
execution_profile: Arc<ExecutionProfileInner>,
do_query: impl Fn(Arc<Connection>, Consistency, &ExecutionProfileInner) -> QueryFut,
run_request_once: impl Fn(Arc<Connection>, Consistency, &ExecutionProfileInner) -> QueryFut,
request_span: &'a RequestSpan,
) -> Result<RunRequestResult<ResT>, QueryError>
where
Expand Down Expand Up @@ -2008,7 +2008,7 @@ where

self.run_request_speculative_fiber(
&shared_query_plan,
&do_query,
&run_request_once,
&execution_profile,
ExecuteRequestContext {
is_idempotent: statement_config.is_idempotent,
Expand Down Expand Up @@ -2043,7 +2043,7 @@ where
});
self.run_request_speculative_fiber(
query_plan,
&do_query,
&run_request_once,
&execution_profile,
ExecuteRequestContext {
is_idempotent: statement_config.is_idempotent,
Expand Down Expand Up @@ -2086,15 +2086,15 @@ where
result
}

/// Executes the closure `do_query`, provided the load balancing plan and some information
/// Executes the closure `run_request_once`, provided the load balancing plan and some information
/// about the request, including retry session.
/// If request fails, retry session is used to perform retries.
///
/// Returns None, if provided plan is empty.
async fn run_request_speculative_fiber<'a, QueryFut, ResT>(
&'a self,
query_plan: impl Iterator<Item = (NodeRef<'a>, Shard)>,
do_query: impl Fn(Arc<Connection>, Consistency, &ExecutionProfileInner) -> QueryFut,
run_request_once: impl Fn(Arc<Connection>, Consistency, &ExecutionProfileInner) -> QueryFut,
execution_profile: &ExecutionProfileInner,
mut context: ExecuteRequestContext<'a>,
) -> Option<Result<RunRequestResult<ResT>, QueryError>>
Expand Down Expand Up @@ -2137,7 +2137,7 @@ where
let attempt_id: Option<history::AttemptId> =
context.log_attempt_start(connection.get_connect_address());
let query_result: Result<ResT, QueryError> =
do_query(connection, current_consistency, execution_profile)
run_request_once(connection, current_consistency, execution_profile)
.instrument(span.clone())
.await;

Expand Down

0 comments on commit bf00f8b

Please sign in to comment.