Was this page helpful?
TimestampGenerator¶
policies/timestampGeneration~TimestampGenerator()
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¶
(abstract) next(client) → {Long|Number|null}
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.
Parameters:
| Name | Type | Description |
|---|---|---|
client |
Client | The Client instance to generate timestamps to. |
Returns:
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.
- Type
- Long | Number | null