class Time

Open the time class to add logic for the hbase timestamp

Public Class Methods

from_bigrecord_timestamp(timestamp) click to toggle source
# File lib/big_record/connection_adapters/abstract_adapter.rb, line 186
def self.from_bigrecord_timestamp(timestamp)
  Time.at(timestamp >> 32, timestamp & 0xFFFFFFFF)
end

Public Instance Methods

to_bigrecord_timestamp() click to toggle source

Return this time is the hbase timestamp format, i.e. a 'long'. The 4 high bytes contain the number of seconds since epoch and the 4 low bytes contain the microseconds. That format is an arbitrary one and could have been something else.

# File lib/big_record/connection_adapters/abstract_adapter.rb, line 182
def to_bigrecord_timestamp
  (self.to_i << 32) + self.usec
end