Skip to content

Commit

Permalink
statement: remove per-statement custom timestamp setting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wprzytula committed Jan 2, 2025
1 parent 236cabf commit 161ae8a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
12 changes: 0 additions & 12 deletions scylla/src/statement/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,6 @@ impl Batch {
self.config.tracing
}

/// Sets the default timestamp for this batch in microseconds.
/// If not None, it will replace the server side assigned timestamp as default timestamp for
/// all the statements contained in the batch.
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
self.config.timestamp = timestamp
}

/// Gets the default timestamp for this batch in microseconds.
pub fn get_timestamp(&self) -> Option<i64> {
self.config.timestamp
}

/// Set the retry policy for this batch, overriding the one from execution profile if not None.
#[inline]
pub fn set_retry_policy(&mut self, retry_policy: Option<Arc<dyn RetryPolicy>>) {
Expand Down
1 change: 0 additions & 1 deletion scylla/src/statement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub(crate) struct StatementConfig {

pub(crate) skip_result_metadata: bool,
pub(crate) tracing: bool,
pub(crate) timestamp: Option<i64>,
pub(crate) request_timeout: Option<Duration>,

pub(crate) history_listener: Option<Arc<dyn HistoryListener>>,
Expand Down
13 changes: 0 additions & 13 deletions scylla/src/statement/prepared_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,6 @@ impl PreparedStatement {
self.config.skip_result_metadata
}

/// Sets the default timestamp for this statement in microseconds.
/// If not None, it will replace the server side assigned timestamp as default timestamp
/// If a statement contains a `USING TIMESTAMP` clause, calling this method won't change
/// anything
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
self.config.timestamp = timestamp
}

/// Gets the default timestamp for this statement in microseconds.
pub fn get_timestamp(&self) -> Option<i64> {
self.config.timestamp
}

/// Sets the client-side timeout for this statement.
/// If not None, the driver will stop waiting for the request
/// to finish after `timeout` passed.
Expand Down
13 changes: 0 additions & 13 deletions scylla/src/statement/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ impl Query {
self.config.tracing
}

/// Sets the default timestamp for this statement in microseconds.
/// If not None, it will replace the server side assigned timestamp as default timestamp
/// If a statement contains a `USING TIMESTAMP` clause, calling this method won't change
/// anything
pub fn set_timestamp(&mut self, timestamp: Option<i64>) {
self.config.timestamp = timestamp
}

/// Gets the default timestamp for this statement in microseconds.
pub fn get_timestamp(&self) -> Option<i64> {
self.config.timestamp
}

/// Sets the client-side timeout for this statement.
/// If not None, the driver will stop waiting for the request
/// to finish after `timeout` passed.
Expand Down

0 comments on commit 161ae8a

Please sign in to comment.