Was this page helpful?
Caution
You're viewing documentation for an unstable version of Scylla Rust Driver. Switch to the latest stable version.
ExecutionProfile
supports all the following options:
use scylla::query::Query;
use scylla::speculative_execution::SimpleSpeculativeExecutionPolicy;
use scylla::statement::{Consistency, SerialConsistency};
use scylla::transport::ExecutionProfile;
use scylla::transport::load_balancing::DefaultPolicy;
use scylla::transport::retry_policy::FallthroughRetryPolicy;
use std::{sync::Arc, time::Duration};
let profile = ExecutionProfile::builder()
.consistency(Consistency::All)
.serial_consistency(Some(SerialConsistency::Serial))
.request_timeout(Some(Duration::from_secs(30)))
.retry_policy(Box::new(FallthroughRetryPolicy::new()))
.load_balancing_policy(Arc::new(DefaultPolicy::default()))
.speculative_execution_policy(
Some(
Arc::new(
SimpleSpeculativeExecutionPolicy {
max_retry_count: 3,
retry_interval: Duration::from_millis(100),
}
)
)
)
.build();
let mut query = Query::from("SELECT * FROM ks.table");
query.set_execution_profile_handle(Some(profile.into_handle()));
Was this page helpful?