Module: Cassandra::TimestampGenerator Abstract

Included in:
Simple, TickingOnDuplicate
Defined in:
lib/cassandra/timestamp_generator.rb,
lib/cassandra/timestamp_generator/simple.rb,
lib/cassandra/timestamp_generator/ticking_on_duplicate.rb

Overview

This module is abstract.

A timestamp generator given to cluster doesn't need to include this module, but needs to implement the same methods. This module exists only for documentation purposes.

A generator is used to create client-timestamps (in the form of long integers) to send with C* requests when the :client_timestamps cluster option is set to true.

Defined Under Namespace

Classes: Simple, TickingOnDuplicate

Instance Method Summary collapse

Instance Method Details

#nextInteger

Create a new timestamp, as a 64-bit integer. Calls must return monotonically increasing values.

Returns:

  • (Integer)

    an integer representing a timestamp in microseconds.

Raises:

  • (NotImplementedError)

    if a class including this module does not define this method.



30
31
32
# File 'lib/cassandra/timestamp_generator.rb', line 30

def next
  raise NotImplementedError, "#{self.class} class must implement the 'next' method"
end