Generates client-side, microsecond-precision query timestamps.

Given that Cassandra uses those timestamps to resolve conflicts, implementations should generate monotonically increasing timestamps for successive invocations of TimestampGenerator.next().

Constructor

new

TimestampGenerator

()

Creates a new instance of TimestampGenerator.

Methods

next

(Client client)

Returns 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.

Abstract
This function is abstract
Parameters:
Name Type Description
client Client

The Client instance to generate timestamps to.

Returns:
Type Description
Long, Number or null

the next timestamp (in microseconds). If it’s equals to null, it won’t be sent by the driver, letting the server to generate the timestamp.