@@ -349,6 +349,14 @@ typedef struct CassUuidGen_ CassUuidGen;
349
349
* Policies that defined the behavior of a request when a server-side
350
350
* read/write timeout or unavailable error occurs.
351
351
*
352
+ * Generators of client-side, microsecond-precision timestamps.
353
+ *
354
+ * @struct CassTimestampGen
355
+ *
356
+ */
357
+ typedef struct CassTimestampGen_ CassTimestampGen ;
358
+
359
+ /**
352
360
* @struct CassRetryPolicy
353
361
*/
354
362
typedef struct CassRetryPolicy_ CassRetryPolicy ;
@@ -1202,6 +1210,23 @@ CASS_EXPORT void
1202
1210
cass_cluster_set_tcp_keepalive (CassCluster * cluster ,
1203
1211
cass_bool_t enabled ,
1204
1212
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 );
1205
1230
1206
1231
/**
1207
1232
* Sets the retry policy used for all requests unless overridden by setting
@@ -2069,6 +2094,20 @@ CASS_EXPORT CassError
2069
2094
cass_statement_set_paging_state (CassStatement * statement ,
2070
2095
const CassResult * result );
2071
2096
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
+
2072
2111
/**
2073
2112
* Sets the statement's retry policy.
2074
2113
*
@@ -3005,6 +3044,34 @@ CASS_EXPORT CassError
3005
3044
cass_batch_set_consistency (CassBatch * batch ,
3006
3045
CassConsistency consistency );
3007
3046
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
+
3008
3075
/**
3009
3076
* Sets the batch's retry policy.
3010
3077
*
@@ -5713,6 +5780,56 @@ cass_uuid_from_string_n(const char* str,
5713
5780
size_t str_length ,
5714
5781
CassUuid * output );
5715
5782
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
+
5716
5833
5717
5834
/***********************************************************************************
5718
5835
*
0 commit comments