I am having an issue where Cassandra doesn't seem to be able to distinguish 
between 2 different UUIDs if based on the same exact time, and sorting by 
TimeUUID.

*****************************
Some of my config:
*****************************
<Keyspaces>
                <Keyspace Name="OD">
              <KeysCachedFraction>0.01</KeysCachedFraction>
              <ColumnFamily CompareWith="TimeUUIDType" Name="Events"/>
                </Keyspace>
</Keyspaces>
...
<Partitioner>org.apache.cassandra.dht.OrderPreservingPartitioner</Partitioner>


*****************************
Ruby sample:
*****************************
require 'rubygems'
require 'cassandra'

logs = [{:DateTime=>'1257195334', :Text=>"something happened"},
        {:DateTime=>'1257195334', :Text=>"something happened again at the same 
time"},
        {:DateTime=>'1257195334', :Text=>"something happened one second later"}]

client = Cassandra.new("OD")
logs.each do |log_line| 
  event_id = UUID.new(Time.at(log_line['DateTime'].to_i))
  puts event_id.to_guid
  if client.get(:Events, "processed", event_id) != nil
     puts "duplicate: " + event_id.to_guid + " " + log_line['DateTime'].to_s
  end
  client.insert(:Events, "processed", event_id=>"#{log_line['Text']}")
end


*****************************
Outputs:
*****************************
1257195334
1077e700-c7f2-11de-86d5-f5bcc793a028
1257195334
1077e700-c7f2-11de-982e-6fad363d5f29
duplicate: 1077e700-c7f2-11de-982e-6fad363d5f29 1257195334
1257195335
11107d80-c7f2-11de-9b6f-4c8aee849eef


Cassandra doesn't seem to be able to distinguish between 2 different UUIDs if 
based on the same exact time, and sorting by TimeUUID.

What am I missing???

--
John Alessi
SocketLabs, Inc.
484-418-1282


Reply via email to