Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec_profile: expose public getters for profile configuration #1104

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading