Package com.datastax.driver.core
Class ServerSideTimestampGenerator
- java.lang.Object
-
- com.datastax.driver.core.ServerSideTimestampGenerator
-
- All Implemented Interfaces:
TimestampGenerator
public class ServerSideTimestampGenerator extends Object implements TimestampGenerator
A timestamp generator that always returnsLong.MIN_VALUE, in order to let Cassandra assign server-side timestamps.
-
-
Field Summary
Fields Modifier and Type Field Description static TimestampGeneratorINSTANCEThe unique instance of this generator.
-
-
-
Field Detail
-
INSTANCE
public static final TimestampGenerator INSTANCE
The unique instance of this generator.
-
-
Method Detail
-
next
public long next()
Description copied from interface:TimestampGeneratorReturns the next timestamp.Implementors should enforce increasing monotonicity of timestamps, that is, a timestamp returned should always be strictly greater that any previously returned timestamp.
Implementors should strive to achieve microsecond precision in the best possible way, which is usually largely dependent on the underlying operating system's capabilities.
- Specified by:
nextin interfaceTimestampGenerator- Returns:
- the next timestamp (in microseconds). If it equals
Long.MIN_VALUE, it won't be sent by the driver, letting Cassandra generate a server-side timestamp.
-
-