@@ -349,6 +349,14 @@ typedef struct CassUuidGen_ CassUuidGen;
349349 * Policies that defined the behavior of a request when a server-side
350350 * read/write timeout or unavailable error occurs.
351351 *
352+ * Generators of client-side, microsecond-precision timestamps.
353+ *
354+ * @struct CassTimestampGen
355+ *
356+ */
357+ typedef struct CassTimestampGen_ CassTimestampGen ;
358+
359+ /**
352360 * @struct CassRetryPolicy
353361 */
354362typedef struct CassRetryPolicy_ CassRetryPolicy ;
@@ -1202,6 +1210,23 @@ CASS_EXPORT void
12021210cass_cluster_set_tcp_keepalive (CassCluster * cluster ,
12031211 cass_bool_t enabled ,
12041212 unsigned delay_secs );
1213+ /**
1214+ * Sets the timestamp generator used to assign timestamps to all requests
1215+ * unless overridden by setting the default timestamp on a statement or a batch.
1216+ *
1217+ * <b>Default:</b> server-side timestamp generator.
1218+ *
1219+ * @public @memberof CassCluster
1220+ *
1221+ * @param[in] cluster
1222+ * @param[in] timestamp_gen
1223+ *
1224+ * @see cass_statement_set_default_timestamp()
1225+ * @see cass_batch_set_default_timestamp()
1226+ */
1227+ CASS_EXPORT void
1228+ cass_cluster_set_timestamp_gen (CassCluster * cluster ,
1229+ CassTimestampGen * timestamp_gen );
12051230
12061231/**
12071232 * Sets the retry policy used for all requests unless overridden by setting
@@ -2069,6 +2094,20 @@ CASS_EXPORT CassError
20692094cass_statement_set_paging_state (CassStatement * statement ,
20702095 const CassResult * result );
20712096
2097+ /**
2098+ * Sets the statement's default timestamp.
2099+ *
2100+ * @public @memberof CassStatement
2101+ *
2102+ * @param[in] statement
2103+ * @param[in] timestamp
2104+ * @return CASS_OK if successful, otherwise an error occurred.
2105+ */
2106+ CASS_EXPORT CassError
2107+ cass_statement_set_default_timestamp (CassStatement * statement ,
2108+ cass_int64_t timestamp );
2109+
2110+
20722111/**
20732112 * Sets the statement's retry policy.
20742113 *
@@ -3005,6 +3044,34 @@ CASS_EXPORT CassError
30053044cass_batch_set_consistency (CassBatch * batch ,
30063045 CassConsistency consistency );
30073046
3047+ /**
3048+ * Sets the batch's serial consistency level.
3049+ *
3050+ * <b>Default:</b> Not set
3051+ *
3052+ * @public @memberof CassBatch
3053+ *
3054+ * @param[in] batch
3055+ * @param[in] serial_consistency
3056+ * @return CASS_OK if successful, otherwise an error occurred.
3057+ */
3058+ CASS_EXPORT CassError
3059+ cass_batch_set_serial_consistency (CassBatch * batch ,
3060+ CassConsistency serial_consistency );
3061+
3062+ /**
3063+ * Sets the batch's default timestamp.
3064+ *
3065+ * @public @memberof CassBatch
3066+ *
3067+ * @param[in] batch
3068+ * @param[in] timestamp
3069+ * @return CASS_OK if successful, otherwise an error occurred.
3070+ */
3071+ CASS_EXPORT CassError
3072+ cass_batch_set_default_timestamp (CassBatch * batch ,
3073+ cass_int64_t timestamp );
3074+
30083075/**
30093076 * Sets the batch's retry policy.
30103077 *
@@ -5713,6 +5780,56 @@ cass_uuid_from_string_n(const char* str,
57135780 size_t str_length ,
57145781 CassUuid * output );
57155782
5783+ /***********************************************************************************
5784+ *
5785+ * Timestamp generators
5786+ *
5787+ ***********************************************************************************/
5788+
5789+ /**
5790+ * Creates a new server-side timestamp generator. This generator allows Cassandra
5791+ * to assign timestamps server-side.
5792+ *
5793+ * <bold>Note:</bold> This is the default timestamp generator.
5794+ *
5795+ * @public @memberof CassTimestampGen
5796+ *
5797+ * @return Returns a timestamp generator that must be freed.
5798+ *
5799+ * @see cass_timestamp_gen_free()
5800+ */
5801+ CASS_EXPORT CassTimestampGen *
5802+ cass_timestamp_gen_server_side_new ();
5803+
5804+ /**
5805+ * Creates a new monotonically increasing timestamp generator. This generates
5806+ * microsecond timestamps with the sub-millisecond part generated using a counter.
5807+ * The implementation gaurantees that no more than 1000 timestamps will be generated
5808+ * for a given clock tick even if shared by multiple session objects. If that rate is
5809+ * excceeded then a warning is logged and timestamps stop incrementing until the next
5810+ * clock tick.
5811+ *
5812+ * <bold>Note:</bold> This generator is thread-safe and can be shared by multiple sessions.
5813+ *
5814+ * @public @memberof CassTimestampGen
5815+ *
5816+ * @return Returns a timestamp generator that must be freed.
5817+ *
5818+ * @see cass_timestamp_gen_free()
5819+ */
5820+ CASS_EXPORT CassTimestampGen *
5821+ cass_timestamp_gen_monotonic_new ();
5822+
5823+ /**
5824+ * Frees a timestamp generator instance.
5825+ *
5826+ * @public @memberof CassTimestampGen
5827+ *
5828+ * @param[in] timestamp_gen
5829+ */
5830+ CASS_EXPORT void
5831+ cass_timestamp_gen_free (CassTimestampGen * timestamp_gen );
5832+
57165833
57175834/***********************************************************************************
57185835 *
0 commit comments