File tree 4 files changed +11
-8
lines changed
test/integration_tests/src
topics/basics/client_side_timestamps
4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -2335,7 +2335,7 @@ cass_cluster_set_tcp_keepalive(CassCluster* cluster,
2335
2335
* Sets the timestamp generator used to assign timestamps to all requests
2336
2336
* unless overridden by setting the timestamp on a statement or a batch.
2337
2337
*
2338
- * <b>Default:</b> server -side timestamp generator.
2338
+ * <b>Default:</b> Monotonically increasing, client -side timestamp generator.
2339
2339
*
2340
2340
* @cassandra{2.1+}
2341
2341
*
@@ -10533,7 +10533,7 @@ cass_timestamp_gen_monotonic_new();
10533
10533
* @param warning_threshold_us The amount of clock skew, in microseconds, that
10534
10534
* must be detected before a warning is triggered. A threshold less than 0 can
10535
10535
* be used to disable warnings.
10536
- * @param warning_interval_ms The amount of time, in milliseonds , to wait before
10536
+ * @param warning_interval_ms The amount of time, in milliseconds , to wait before
10537
10537
* warning again about clock skew. An interval value less than or equal to 0 allows
10538
10538
* the warning to be triggered every millisecond.
10539
10539
* @return Returns a timestamp generator that must be freed.
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class Config {
57
57
, tcp_keepalive_delay_secs_(CASS_DEFAULT_TCP_KEEPALIVE_DELAY_SECS)
58
58
, connection_idle_timeout_secs_(CASS_DEFAULT_IDLE_TIMEOUT_SECS)
59
59
, connection_heartbeat_interval_secs_(CASS_DEFAULT_HEARTBEAT_INTERVAL_SECS)
60
- , timestamp_gen_(Memory::allocate<ServerSideTimestampGenerator >())
60
+ , timestamp_gen_(Memory::allocate<MonotonicTimestampGenerator >())
61
61
, use_schema_(CASS_DEFAULT_USE_SCHEMA)
62
62
, use_hostname_resolution_(CASS_DEFAULT_HOSTNAME_RESOLUTION_ENABLED)
63
63
, use_randomized_contact_points_(CASS_DEFAULT_USE_RANDOMIZED_CONTACT_POINTS)
Original file line number Diff line number Diff line change @@ -240,10 +240,10 @@ BOOST_AUTO_TEST_CASE(generator)
240
240
}
241
241
242
242
/* *
243
- * Test the default timestamp generator.
243
+ * Test the server-side generator.
244
244
*
245
- * Verifies that the timestamp is set by the server when no timestamp
246
- * generator is set and the timestamp is not set directly on the statement.
245
+ * Verifies that the timestamp is set by the server when using the server-side
246
+ * generator and the timestamp is not set directly on the statement.
247
247
*
248
248
* @since 2.1.0
249
249
* @jira_ticket CPP-266
@@ -255,6 +255,9 @@ BOOST_AUTO_TEST_CASE(server_side)
255
255
CCM::CassVersion version = test_utils::get_version ();
256
256
if ((version.major_version >= 2 && version.minor_version >= 1 ) || version.major_version >= 3 ) {
257
257
TimestampsTest tester;
258
+ CassTimestampGen* gen = cass_timestamp_gen_server_side_new ();
259
+ cass_cluster_set_timestamp_gen (tester.cluster , gen);
260
+ cass_timestamp_gen_free (gen);
258
261
tester.create_session ();
259
262
// Server-side is the default timestamp generator
260
263
std::string table_name (" table_" + test_utils::generate_unique_str (tester.uuid_gen ));
Original file line number Diff line number Diff line change 4
4
5
5
Cassandra uses timestamps to serialize write operations. That is, values with a
6
6
more current timestamp are considered to be the most up-to-date version of that
7
- information. By default, timestamps are assigned by Cassandra on the
8
- server -side. This behavior can be overridden by configuring the driver to use a
7
+ information. By default, timestamps are assigned by the driver on the
8
+ client -side. This behavior can be overridden by configuring the driver to use a
9
9
timestamp generator or assigning a timestamp directly to a [ ` CassStatement ` ] or
10
10
[ ` CassBatch ` ] .
11
11
You can’t perform that action at this time.
0 commit comments