Was this page helpful?
Caution
You're viewing documentation for an unstable version of ScyllaDB CPP RS Driver. Switch to the latest stable version.
CassTimestampGen¶
-
struct CassTimestampGen¶
Policies that defined the behavior of a request when a server-side read/write timeout or unavailable error occurs.
Generators of client-side, microsecond-precision timestamps.
Public Functions
-
CassTimestampGen *cass_timestamp_gen_server_side_new()¶
Creates a new server-side timestamp generator. This generator allows Cassandra to assign timestamps server-side.
See also
- Returns:
Returns a timestamp generator that must be freed.
-
CassTimestampGen *cass_timestamp_gen_monotonic_new()¶
Creates a new monotonically increasing timestamp generator with microsecond precision.
This implementation guarantees a monotonically increasing timestamp. If the timestamp generation rate exceeds one per microsecond or if the clock skews into the past the generator will artificially increment the previously generated timestamp until the request rate decreases or the clock skew is corrected.
By default, this timestamp generator will generate warnings if more than 1 second of clock skew is detected. It will print an error every second until the clock skew is resolved. These settings can be changed by using
cass_timestamp_gen_monotonic_new_with_settings()to create the generator instance.Note: This is the default timestamp generator.
Note: This generator is thread-safe and can be shared by multiple sessions.
See also
- Returns:
Returns a timestamp generator that must be freed.
-
CassTimestampGen *cass_timestamp_gen_monotonic_new_with_settings(cass_int64_t warning_threshold_us, cass_int64_t warning_interval_ms)¶
Same as cass_timestamp_gen_monotonic_new(), but with settings for controlling warnings about clock skew.
- Parameters:
warning_threshold_us – The amount of clock skew, in microseconds, that must be detected before a warning is triggered. A threshold less than 0 can be used to disable warnings.
warning_interval_ms – The amount of time, in milliseconds, to wait before warning again about clock skew. An interval value less than or equal to 0 allows the warning to be triggered every millisecond.
- Returns:
Returns a timestamp generator that must be freed.
-
void cass_timestamp_gen_free(CassTimestampGen *timestamp_gen)¶
Frees a timestamp generator instance.
- Parameters:
timestamp_gen – [in]
-
CassTimestampGen *cass_timestamp_gen_server_side_new()¶