Re: Insert LongType with ruby

2011-01-04 Thread vicent roca daniel
I'm getting more consistent results using Time.stamp instead of Time From: https://github.com/fauna/cassandra/blob/master/lib/cassandra/long.rb when NilClass, Time # Time.stamp is 52 bytes, so we have 12 bytes of entropy left over int = ((bytes || Time).stamp 12) + rand(2**12)

Re: Insert LongType with ruby

2011-01-04 Thread Ryan King
On Tue, Jan 4, 2011 at 12:50 PM, vicent roca daniel sap...@gmail.com wrote: I'm getting more consistent results using Time.stamp instead of Time From: https://github.com/fauna/cassandra/blob/master/lib/cassandra/long.rb Yeah, you were probably overwriting values then. -ryan

Re: Insert LongType with ruby

2011-01-04 Thread vicent roca daniel
I don't know. Looking the table with de cli I see this results: Using app.insert(:Numers, 'device1-cpu', {Time.now = i.to_s }) : = (column=5300944406187227576, value=3, timestamp=1294175880417061) = (column=5300944406181604704, value=2, timestamp=1294175880415584) = (column=5300944406071978530,

Re: Insert LongType with ruby

2011-01-03 Thread Ryan King
On Sun, Jan 2, 2011 at 3:45 PM, vicent roca daniel sap...@gmail.com wrote: Hi guys, I need your help. I'm trying to insert a column name of type LongType using the ruby wrapper, but I can't get it working. What I'm trying is something like this:    app.insert(:Data, 'device1-cpu', { Time.now

Re: Insert LongType with ruby

2011-01-03 Thread vicent roca daniel
hi, no I'n not getting any exception. The value gets inserted withou problem. If I try to convert to string I get: Cassandra::Comparable::TypeError: Expected 2011-01-03 22:14:40 +0100 to cast to a Cassandra::Long (invalid bytecount) from

Re: Insert LongType with ruby

2011-01-03 Thread Ryan King
On Mon, Jan 3, 2011 at 1:15 PM, vicent roca daniel sap...@gmail.com wrote: hi, no I'n not getting any exception. Then what problem are you seeing? -ryan The value gets inserted withou problem. If I try to convert to string I get: Cassandra::Comparable::TypeError: Expected 2011-01-03

Re: Insert LongType with ruby

2011-01-03 Thread vicent roca daniel
The problem I think I have is that I think I'm not storing the correct value. If I do this (for example): app.insert(:NumData, 'device1-cpu', { Time.now + 1 minut = 10.to_s }) app.insert(:NumData, 'device1-cpu', { Time.now + 1 minu = 10.to_s }) app.insert(:NumData, 'device1-cpu', { Time.now + 1