Skip to content

Commit

Permalink
Merge pull request #1104 from muzarski/exec-profile-getters
Browse files Browse the repository at this point in the history
exec_profile: expose public getters for profile configuration
  • Loading branch information
wprzytula authored Oct 28, 2024
2 parents 4c96bd4 + f9d554e commit 07553fe
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scylla/src/transport/execution_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,36 @@ impl ExecutionProfile {
pub fn into_handle_with_label(self, label: String) -> ExecutionProfileHandle {
ExecutionProfileHandle(Arc::new((ArcSwap::new(self.0), Some(label))))
}

/// Gets client timeout associated with this profile.
pub fn get_request_timeout(&self) -> Option<Duration> {
self.0.request_timeout
}

/// Gets consistency associated with this profile.
pub fn get_consistency(&self) -> Consistency {
self.0.consistency
}

/// Gets serial consistency (if set) associated with this profile.
pub fn get_serial_consistency(&self) -> Option<SerialConsistency> {
self.0.serial_consistency
}

/// Gets load balancing policy associated with this profile.
pub fn get_load_balancing_policy(&self) -> &Arc<dyn LoadBalancingPolicy> {
&self.0.load_balancing_policy
}

/// Gets retry policy associated with this profile.
pub fn get_retry_policy(&self) -> &Arc<dyn RetryPolicy> {
&self.0.retry_policy
}

/// Gets speculative execution policy associated with this profile.
pub fn get_speculative_execution_policy(&self) -> Option<&Arc<dyn SpeculativeExecutionPolicy>> {
self.0.speculative_execution_policy.as_ref()
}
}

/// A handle that points to an ExecutionProfile.
Expand Down

0 comments on commit 07553fe

Please sign in to comment.