Skip to content

Commit cfcffee

Browse files
committed
treewide: adjust docstrings and variable names to statement terminology
1 parent adc9c04 commit cfcffee

File tree

9 files changed

+149
-149
lines changed

9 files changed

+149
-149
lines changed

scylla/src/client/execution_profile.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `ExecutionProfile` is a grouping of configurable options regarding query execution.
1+
//! `ExecutionProfile` is a grouping of configurable options regarding CQL statement execution.
22
//!
33
//! Profiles can be created to represent different workloads, which thanks to them
44
//! can be run conveniently on a single session.
@@ -38,7 +38,7 @@
3838
//! ```
3939
//!
4040
//! ### Example
41-
//! To create an `ExecutionProfile` and attach it to a `Query`:
41+
//! To create an [`ExecutionProfile`] and attach it to a [`Statement`](crate::statement::Statement):
4242
//! ```
4343
//! # extern crate scylla;
4444
//! # use std::error::Error;
@@ -82,7 +82,7 @@
8282
//! let profile = base_profile.to_builder()
8383
//! .consistency(Consistency::All)
8484
//! .build();
85-
//
85+
//!
8686
//! # Ok(())
8787
//! # }
8888
//! ```
@@ -259,16 +259,16 @@ impl ExecutionProfileBuilder {
259259
self
260260
}
261261

262-
/// Specify a default consistency to be used for queries.
262+
/// Specify a default consistency to be used for statement executions.
263263
/// It's possible to override it by explicitly setting a consistency on the chosen query.
264264
pub fn consistency(mut self, consistency: Consistency) -> Self {
265265
self.consistency = Some(consistency);
266266
self
267267
}
268268

269-
/// Specify a default serial consistency to be used for queries.
269+
/// Specify a default serial consistency to be used for statement executions.
270270
/// It's possible to override it by explicitly setting a serial consistency
271-
/// on the chosen query.
271+
/// on the chosen statement.
272272
pub fn serial_consistency(mut self, serial_consistency: Option<SerialConsistency>) -> Self {
273273
self.serial_consistency = Some(serial_consistency);
274274
self
@@ -297,7 +297,7 @@ impl ExecutionProfileBuilder {
297297
self
298298
}
299299

300-
/// Sets the [`RetryPolicy`] to use by default on queries.
300+
/// Sets the [`RetryPolicy`] to use by default on statements.
301301
/// The default is [DefaultRetryPolicy](crate::policies::retry::DefaultRetryPolicy).
302302
/// It is possible to implement a custom retry policy by implementing the trait [`RetryPolicy`].
303303
///
@@ -390,11 +390,11 @@ impl Default for ExecutionProfileBuilder {
390390
}
391391
}
392392

393-
/// A profile that groups configurable options regarding query execution.
393+
/// A profile that groups configurable options regarding statement execution.
394394
///
395395
/// Execution profile is immutable as such, but the driver implements double indirection of form:
396-
/// query/Session -> ExecutionProfileHandle -> ExecutionProfile
397-
/// which enables on-fly changing the actual profile associated with all entities (query/Session)
396+
/// statement/Session -> [`ExecutionProfileHandle`] -> [`ExecutionProfile`]
397+
/// which enables on-fly changing the actual profile associated with all entities (statements/Session)
398398
/// by the same handle.
399399
#[derive(Debug, Clone)]
400400
pub struct ExecutionProfile(pub(crate) Arc<ExecutionProfileInner>);
@@ -493,7 +493,7 @@ impl ExecutionProfile {
493493

494494
/// A handle that points to an ExecutionProfile.
495495
///
496-
/// Its goal is to enable remapping all associated entities (query/Session)
496+
/// Its goal is to enable remapping all associated entities (statement/Session)
497497
/// to another execution profile at once.
498498
/// Note: Cloned handles initially point to the same Arc'ed execution profile.
499499
/// However, as the mapping has yet another level of indirection - through
@@ -521,7 +521,7 @@ impl ExecutionProfileHandle {
521521
}
522522

523523
/// Makes the handle point to a new execution profile.
524-
/// All entities (queries/Session) holding this handle will reflect the change.
524+
/// All entities (statements/Session) holding this handle will reflect the change.
525525
pub fn map_to_another_profile(&mut self, profile: ExecutionProfile) {
526526
self.0 .0.store(profile.0)
527527
}

scylla/src/client/pager.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,47 +661,47 @@ impl QueryPager {
661661
}
662662

663663
pub(crate) async fn new_for_query(
664-
query: Statement,
664+
statement: Statement,
665665
execution_profile: Arc<ExecutionProfileInner>,
666666
cluster_state: Arc<ClusterState>,
667667
metrics: Arc<Metrics>,
668668
) -> Result<Self, NextPageError> {
669669
let (sender, receiver) = mpsc::channel::<Result<ReceivedPage, NextPageError>>(1);
670670

671-
let consistency = query
671+
let consistency = statement
672672
.config
673673
.consistency
674674
.unwrap_or(execution_profile.consistency);
675-
let serial_consistency = query
675+
let serial_consistency = statement
676676
.config
677677
.serial_consistency
678678
.unwrap_or(execution_profile.serial_consistency);
679679

680-
let page_size = query.get_validated_page_size();
680+
let page_size = statement.get_validated_page_size();
681681

682682
let routing_info = RoutingInfo {
683683
consistency,
684684
serial_consistency,
685685
..Default::default()
686686
};
687687

688-
let retry_session = query
688+
let retry_session = statement
689689
.get_retry_policy()
690690
.map(|rp| &**rp)
691691
.unwrap_or(&*execution_profile.retry_policy)
692692
.new_session();
693693

694694
let parent_span = tracing::Span::current();
695695
let worker_task = async move {
696-
let query_ref = &query;
696+
let statement_ref = &statement;
697697

698698
let page_query = |connection: Arc<Connection>,
699699
consistency: Consistency,
700700
paging_state: PagingState| {
701701
async move {
702702
connection
703703
.query_raw_with_consistency(
704-
query_ref,
704+
statement_ref,
705705
consistency,
706706
serial_consistency,
707707
Some(page_size),
@@ -711,7 +711,7 @@ impl QueryPager {
711711
}
712712
};
713713

714-
let query_ref = &query;
714+
let query_ref = &statement;
715715

716716
let span_creator = move || {
717717
let span = RequestSpan::new_query(&query_ref.contents);
@@ -723,13 +723,13 @@ impl QueryPager {
723723
sender: sender.into(),
724724
page_query,
725725
statement_info: routing_info,
726-
query_is_idempotent: query.config.is_idempotent,
726+
query_is_idempotent: statement.config.is_idempotent,
727727
query_consistency: consistency,
728728
retry_session,
729729
execution_profile,
730730
metrics,
731731
paging_state: PagingState::start(),
732-
history_listener: query.config.history_listener.clone(),
732+
history_listener: statement.config.history_listener.clone(),
733733
current_request_id: None,
734734
current_attempt_id: None,
735735
parent_span,

0 commit comments

Comments
 (0)