Skip to content

Commit 161ae8a

Browse files
committed
statement: remove per-statement custom timestamp setting
A timestamp is something related to a single execution of a statement, not to the statement itself. Also, setting a timestamp on a statement inside the Batch would not set a timestamp on a Batch itself, which has shown to be a pitfall. This commit finishes the migration to the new per-execution timestamp API by removing timestamp settings from statements.
1 parent 236cabf commit 161ae8a

File tree

4 files changed

+0
-39
lines changed

4 files changed

+0
-39
lines changed

scylla/src/statement/batch.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,6 @@ impl Batch {
109109
self.config.tracing
110110
}
111111

112-
/// Sets the default timestamp for this batch in microseconds.
113-
/// If not None, it will replace the server side assigned timestamp as default timestamp for
114-
/// all the statements contained in the batch.
115-
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
116-
self.config.timestamp = timestamp
117-
}
118-
119-
/// Gets the default timestamp for this batch in microseconds.
120-
pub fn get_timestamp(&self) -> Option<i64> {
121-
self.config.timestamp
122-
}
123-
124112
/// Set the retry policy for this batch, overriding the one from execution profile if not None.
125113
#[inline]
126114
pub fn set_retry_policy(&mut self, retry_policy: Option<Arc<dyn RetryPolicy>>) {

scylla/src/statement/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub(crate) struct StatementConfig {
3333

3434
pub(crate) skip_result_metadata: bool,
3535
pub(crate) tracing: bool,
36-
pub(crate) timestamp: Option<i64>,
3736
pub(crate) request_timeout: Option<Duration>,
3837

3938
pub(crate) history_listener: Option<Arc<dyn HistoryListener>>,

scylla/src/statement/prepared_statement.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,6 @@ impl PreparedStatement {
370370
self.config.skip_result_metadata
371371
}
372372

373-
/// Sets the default timestamp for this statement in microseconds.
374-
/// If not None, it will replace the server side assigned timestamp as default timestamp
375-
/// If a statement contains a `USING TIMESTAMP` clause, calling this method won't change
376-
/// anything
377-
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
378-
self.config.timestamp = timestamp
379-
}
380-
381-
/// Gets the default timestamp for this statement in microseconds.
382-
pub fn get_timestamp(&self) -> Option<i64> {
383-
self.config.timestamp
384-
}
385-
386373
/// Sets the client-side timeout for this statement.
387374
/// If not None, the driver will stop waiting for the request
388375
/// to finish after `timeout` passed.

scylla/src/statement/query.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,6 @@ impl Query {
103103
self.config.tracing
104104
}
105105

106-
/// Sets the default timestamp for this statement in microseconds.
107-
/// If not None, it will replace the server side assigned timestamp as default timestamp
108-
/// If a statement contains a `USING TIMESTAMP` clause, calling this method won't change
109-
/// anything
110-
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
111-
self.config.timestamp = timestamp
112-
}
113-
114-
/// Gets the default timestamp for this statement in microseconds.
115-
pub fn get_timestamp(&self) -> Option<i64> {
116-
self.config.timestamp
117-
}
118-
119106
/// Sets the client-side timeout for this statement.
120107
/// If not None, the driver will stop waiting for the request
121108
/// to finish after `timeout` passed.

0 commit comments

Comments
 (0)