Skip to content

Commit 701927b

Browse files
committed
history: rename QueryId -> RequestId
1 parent 0c1c9e3 commit 701927b

File tree

3 files changed

+92
-87
lines changed

3 files changed

+92
-87
lines changed

scylla/src/client/pager.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct PagerWorker<'a, QueryFunc, SpanCreatorFunc> {
148148
paging_state: PagingState,
149149

150150
history_listener: Option<Arc<dyn HistoryListener>>,
151-
current_query_id: Option<history::QueryId>,
151+
current_request_id: Option<history::RequestId>,
152152
current_attempt_id: Option<history::AttemptId>,
153153

154154
parent_span: tracing::Span,
@@ -398,7 +398,7 @@ where
398398
None => return,
399399
};
400400

401-
self.current_query_id = Some(history_listener.log_query_start());
401+
self.current_request_id = Some(history_listener.log_query_start());
402402
}
403403

404404
fn log_query_success(&mut self) {
@@ -407,12 +407,12 @@ where
407407
None => return,
408408
};
409409

410-
let query_id: history::QueryId = match &self.current_query_id {
410+
let request_id: history::RequestId = match &self.current_request_id {
411411
Some(id) => *id,
412412
None => return,
413413
};
414414

415-
history_listener.log_query_success(query_id);
415+
history_listener.log_query_success(request_id);
416416
}
417417

418418
fn log_query_error(&mut self, error: &RequestError) {
@@ -421,12 +421,12 @@ where
421421
None => return,
422422
};
423423

424-
let query_id: history::QueryId = match &self.current_query_id {
424+
let request_id: history::RequestId = match &self.current_request_id {
425425
Some(id) => *id,
426426
None => return,
427427
};
428428

429-
history_listener.log_query_error(query_id, error);
429+
history_listener.log_query_error(request_id, error);
430430
}
431431

432432
fn log_attempt_start(&mut self, node_addr: SocketAddr) {
@@ -435,13 +435,13 @@ where
435435
None => return,
436436
};
437437

438-
let query_id: history::QueryId = match &self.current_query_id {
438+
let request_id: history::RequestId = match &self.current_request_id {
439439
Some(id) => *id,
440440
None => return,
441441
};
442442

443443
self.current_attempt_id =
444-
Some(history_listener.log_attempt_start(query_id, None, node_addr));
444+
Some(history_listener.log_attempt_start(request_id, None, node_addr));
445445
}
446446

447447
fn log_attempt_success(&mut self) {
@@ -754,7 +754,7 @@ impl QueryPager {
754754
metrics,
755755
paging_state: PagingState::start(),
756756
history_listener: query.config.history_listener.clone(),
757-
current_query_id: None,
757+
current_request_id: None,
758758
current_attempt_id: None,
759759
parent_span,
760760
span_creator,
@@ -872,7 +872,7 @@ impl QueryPager {
872872
metrics: config.metrics,
873873
paging_state: PagingState::start(),
874874
history_listener: config.prepared.config.history_listener.clone(),
875-
current_query_id: None,
875+
current_request_id: None,
876876
current_attempt_id: None,
877877
parent_span,
878878
span_creator,

scylla/src/client/session.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@ where
18501850
QueryFut: Future<Output = Result<ResT, RequestAttemptError>>,
18511851
ResT: AllowedRunRequestResTType,
18521852
{
1853-
let history_listener_and_id: Option<(&'a dyn HistoryListener, history::QueryId)> =
1853+
let history_listener_and_id: Option<(&'a dyn HistoryListener, history::RequestId)> =
18541854
statement_config
18551855
.history_listener
18561856
.as_ref()
@@ -1900,16 +1900,18 @@ where
19001900
let request_runner_generator = |is_speculative: bool| {
19011901
let history_data: Option<HistoryData> = history_listener_and_id
19021902
.as_ref()
1903-
.map(|(history_listener, query_id)| {
1903+
.map(|(history_listener, request_id)| {
19041904
let speculative_id: Option<history::SpeculativeId> =
19051905
if is_speculative {
1906-
Some(history_listener.log_new_speculative_fiber(*query_id))
1906+
Some(
1907+
history_listener.log_new_speculative_fiber(*request_id),
1908+
)
19071909
} else {
19081910
None
19091911
};
19101912
HistoryData {
19111913
listener: *history_listener,
1912-
query_id: *query_id,
1914+
request_id: *request_id,
19131915
speculative_id,
19141916
}
19151917
});
@@ -1948,9 +1950,9 @@ where
19481950
let history_data: Option<HistoryData> =
19491951
history_listener_and_id
19501952
.as_ref()
1951-
.map(|(history_listener, query_id)| HistoryData {
1953+
.map(|(history_listener, request_id)| HistoryData {
19521954
listener: *history_listener,
1953-
query_id: *query_id,
1955+
request_id: *request_id,
19541956
speculative_id: None,
19551957
});
19561958
self.run_request_speculative_fiber(
@@ -1983,10 +1985,10 @@ where
19831985
None => runner.await.map_err(RequestError::from),
19841986
};
19851987

1986-
if let Some((history_listener, query_id)) = history_listener_and_id {
1988+
if let Some((history_listener, request_id)) = history_listener_and_id {
19871989
match &result {
1988-
Ok(_) => history_listener.log_query_success(query_id),
1989-
Err(e) => history_listener.log_query_error(query_id, e),
1990+
Ok(_) => history_listener.log_query_success(request_id),
1991+
Err(e) => history_listener.log_query_error(request_id, e),
19901992
}
19911993
}
19921994

@@ -2185,15 +2187,15 @@ struct ExecuteRequestContext<'a> {
21852187

21862188
struct HistoryData<'a> {
21872189
listener: &'a dyn HistoryListener,
2188-
query_id: history::QueryId,
2190+
request_id: history::RequestId,
21892191
speculative_id: Option<history::SpeculativeId>,
21902192
}
21912193

21922194
impl ExecuteRequestContext<'_> {
21932195
fn log_attempt_start(&self, node_addr: SocketAddr) -> Option<history::AttemptId> {
21942196
self.history_data.as_ref().map(|hd| {
21952197
hd.listener
2196-
.log_attempt_start(hd.query_id, hd.speculative_id, node_addr)
2198+
.log_attempt_start(hd.request_id, hd.speculative_id, node_addr)
21972199
})
21982200
}
21992201

0 commit comments

Comments
 (0)