@@ -35,6 +35,11 @@ const DEFAULT_CONSISTENCY: Consistency = Consistency::LocalOne;
3535const DEFAULT_REQUEST_TIMEOUT : Duration = Duration :: from_millis ( 12000 ) ;
3636// - fetching schema metadata is true
3737const DEFAULT_DO_FETCH_SCHEMA_METADATA : bool = true ;
38+ // - schema agreement timeout is 10000 millis,
39+ const DEFAULT_MAX_SCHEMA_WAIT_TIME : Duration = Duration :: from_millis ( 10000 ) ;
40+ // - schema agreement interval is 200 millis.
41+ // This default is taken from rust-driver, since this option is an extension to cpp-rust-driver.
42+ const DEFAULT_SCHEMA_AGREEMENT_INTERVAL : Duration = Duration :: from_millis ( 200 ) ;
3843// - setting TCP_NODELAY is true
3944const DEFAULT_SET_TCP_NO_DELAY : bool = true ;
4045// - connect timeout is 5000 millis
@@ -179,6 +184,8 @@ pub unsafe extern "C" fn cass_cluster_new() -> *mut CassCluster {
179184 SessionBuilder :: new ( )
180185 . custom_identity ( custom_identity)
181186 . fetch_schema_metadata ( DEFAULT_DO_FETCH_SCHEMA_METADATA )
187+ . schema_agreement_timeout ( DEFAULT_MAX_SCHEMA_WAIT_TIME )
188+ . schema_agreement_interval ( DEFAULT_SCHEMA_AGREEMENT_INTERVAL )
182189 . tcp_nodelay ( DEFAULT_SET_TCP_NO_DELAY )
183190 . connection_timeout ( DEFAULT_CONNECT_TIMEOUT )
184191 . keepalive_interval ( DEFAULT_KEEPALIVE_INTERVAL )
@@ -408,6 +415,28 @@ pub unsafe extern "C" fn cass_cluster_set_request_timeout(
408415 } )
409416}
410417
418+ #[ no_mangle]
419+ pub unsafe extern "C" fn cass_cluster_set_max_schema_wait_time (
420+ cluster_raw : * mut CassCluster ,
421+ wait_time_ms : c_uint ,
422+ ) {
423+ let cluster = ptr_to_ref_mut ( cluster_raw) ;
424+
425+ cluster. session_builder . config . schema_agreement_timeout =
426+ Duration :: from_millis ( wait_time_ms. into ( ) ) ;
427+ }
428+
429+ #[ no_mangle]
430+ pub unsafe extern "C" fn cass_cluster_set_schema_agreement_interval (
431+ cluster_raw : * mut CassCluster ,
432+ interval_ms : c_uint ,
433+ ) {
434+ let cluster = ptr_to_ref_mut ( cluster_raw) ;
435+
436+ cluster. session_builder . config . schema_agreement_interval =
437+ Duration :: from_millis ( interval_ms. into ( ) ) ;
438+ }
439+
411440#[ no_mangle]
412441pub unsafe extern "C" fn cass_cluster_set_port (
413442 cluster_raw : * mut CassCluster ,
0 commit comments