Skip to content
Draft
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions scylla-rust-wrapper/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const DEFAULT_CONNECT_TIMEOUT: Duration = Duration::from_millis(5000);
const DEFAULT_KEEPALIVE_INTERVAL: Duration = Duration::from_secs(30);
// - keepalive timeout is 60 secs
const DEFAULT_KEEPALIVE_TIMEOUT: Duration = Duration::from_secs(60);
// - tracing info fetch interval is 3 millis
const DEFAULT_TRACING_INFO_FETCH_INTERVAL: Duration = Duration::from_millis(3);
// - tracing consistency is ONE
Comment on lines 46 to 51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ 3ms is the defualt in Rust Driver. Is that the default in cpp-driver too?

const DEFAULT_TRACING_CONSISTENCY: Consistency = Consistency::One;

Expand Down Expand Up @@ -185,6 +187,7 @@ pub unsafe extern "C" fn cass_cluster_new() -> *mut CassCluster {
.connection_timeout(DEFAULT_CONNECT_TIMEOUT)
.keepalive_interval(DEFAULT_KEEPALIVE_INTERVAL)
.keepalive_timeout(DEFAULT_KEEPALIVE_TIMEOUT)
.tracing_info_fetch_interval(DEFAULT_TRACING_INFO_FETCH_INTERVAL)
.tracing_info_fetch_consistency(DEFAULT_TRACING_CONSISTENCY)
};

Expand Down Expand Up @@ -411,6 +414,17 @@ pub unsafe extern "C" fn cass_cluster_set_request_timeout(
})
}

#[no_mangle]
pub unsafe extern "C" fn cass_cluster_set_tracing_retry_wait_time(
cluster_raw: *mut CassCluster,
retry_wait_time_ms: c_uint,
) {
let cluster = ptr_to_ref_mut(cluster_raw);

cluster.session_builder.config.tracing_info_fetch_interval =
Duration::from_millis(retry_wait_time_ms.into());
}

#[no_mangle]
pub unsafe extern "C" fn cass_cluster_set_tracing_consistency(
cluster_raw: *mut CassCluster,
Expand Down