Re: Timeuuid inserted with now(), how to get the value back in Java client?

2014-04-01 Thread Vivek Mishra
You would get UUID object from cassandra API. Then you may use
uuid.timestamp() to get time stamp for the same

-Vivek


On Tue, Apr 1, 2014 at 9:55 PM, Theo Hultberg  wrote:

> no, there's no way. you should generate the TIMEUUID on the client side so
> that you have it.
>
> T#
>
>
> On Sat, Mar 29, 2014 at 1:01 AM, Andy Atj2  wrote:
>
>> I'm writing a Java client to a Cassandra db.
>>
>> One of the main primary keys is a timeuuid.
>>
>> I plan to do INSERTs using now() and have Cassandra generate the value of
>> the timeuuid.
>>
>> After the INSERT, I need the Cassandra-generated timeuuid value. Is there
>> an easy wsay to get it, without having to re-query for the record I just
>> inserted, hoping to get only one record back? Remember, I don't have the PK.
>>
>> Eg, in every other db there's a way to get the generated PK back. In sql
>> it's @@identity, in oracle its...etc etc.
>>
>> I know Cassandra is not an RDBMS. All I want is the value Cassandra just
>> generated.
>>
>> Thanks,
>> Andy
>>
>>
>


Re: Timeuuid inserted with now(), how to get the value back in Java client?

2014-04-01 Thread Theo Hultberg
no, there's no way. you should generate the TIMEUUID on the client side so
that you have it.

T#


On Sat, Mar 29, 2014 at 1:01 AM, Andy Atj2  wrote:

> I'm writing a Java client to a Cassandra db.
>
> One of the main primary keys is a timeuuid.
>
> I plan to do INSERTs using now() and have Cassandra generate the value of
> the timeuuid.
>
> After the INSERT, I need the Cassandra-generated timeuuid value. Is there
> an easy wsay to get it, without having to re-query for the record I just
> inserted, hoping to get only one record back? Remember, I don't have the PK.
>
> Eg, in every other db there's a way to get the generated PK back. In sql
> it's @@identity, in oracle its...etc etc.
>
> I know Cassandra is not an RDBMS. All I want is the value Cassandra just
> generated.
>
> Thanks,
> Andy
>
>


Re: timeuuid and cql3 query

2013-06-21 Thread Ryan, Brent
Yes.  The problem is that I can't use "counter" as the partition key otherwise 
I'd wind up with hot spots in my cluster where majority of the data is being 
written to single node in the cluster.  The only real way around this problem 
with Cassandra is to follow along with what this blog does:

http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra


From: Eric Stevens mailto:migh...@gmail.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Friday, June 21, 2013 8:38 AM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query

It's my understanding that if cardinality of the first part of the primary key 
has low cardinality, you will struggle with cluster balance as (unless you use 
WITH COMPACT STORAGE) the first entry of the primary key equates to the row key 
from the traditional interface, thus all entries related to a single value for 
the "counter" column will map to the same partition.

So consider the cardinality of this field, if cardinality is low, you might 
need to remodel with PRIMARY KEY (counter, ts, key1) then tack on WITH COMPACT 
STORAGE (then the entire primary key becomes the row key, but you can only have 
one column which is not part of the primary key)  If cardinality of "counter" 
is high, then you have nothing to worry about.


On Wed, Jun 19, 2013 at 3:16 PM, Francisco Andrades Grassi 
mailto:bigjoc...@gmail.com>> wrote:
Hi,

I believe what he's recommending is:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (counter, ts)
)

That way counter will be your partitioning key, and all the rows that have the 
same counter value will be clustered (stored as a single wide row sorted by the 
ts value). In this scenario the query:

 where counter = 'test' and ts > minTimeuuid('2013-06-18 16:23:00') and ts < 
minTimeuuid('2013-06-18 16:24:00');

would actually be a sequential read on a wide row on a single node.

--
Francisco Andrades Grassi
www.bigjocker.com<http://www.bigjocker.com/>
@bigjocker

On Jun 19, 2013, at 12:17 PM, "Ryan, Brent" 
mailto:br...@cvent.com>> wrote:

Tyler,

You're recommending this schema instead, correct?

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (ts, counter)
)

I believe I tried this as well and ran into similar problems but I'll try it 
again.  I'm using the "ByteOrderedPartitioner" if that helps with the latest 
version of DSE community edition which I believe is Cassandra 1.2.3.


Thanks,
Brent


From: Tyler Hobbs mailto:ty...@datastax.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Wednesday, June 19, 2013 11:00 AM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query


On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent 
mailto:br...@cvent.com>> wrote:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY ((counter, ts))
)

Instead of doing a composite partition key, remove a set of parens and let ts 
be your clustering key.  That will cause cql rows to be stored in sorted order 
by the ts column (for a given value of "counter") and allow you to do the kind 
of query you're looking for.


--
Tyler Hobbs
DataStax<http://datastax.com/>




Re: timeuuid and cql3 query

2013-06-21 Thread Eric Stevens
It's my understanding that if cardinality of the first part of the primary
key has low cardinality, you will struggle with cluster balance as (unless
you use WITH COMPACT STORAGE) the first entry of the primary key equates to
the row key from the traditional interface, thus all entries related to a
single value for the "counter" column will map to the same partition.

So consider the cardinality of this field, if cardinality is low, you might
need to remodel with PRIMARY KEY (counter, ts, key1) then tack on WITH
COMPACT STORAGE (then the entire primary key becomes the row key, but you
can only have one column which is not part of the primary key)  If
cardinality of "counter" is high, then you have nothing to worry about.


On Wed, Jun 19, 2013 at 3:16 PM, Francisco Andrades Grassi <
bigjoc...@gmail.com> wrote:

> Hi,
>
> I believe what he's recommending is:
>
> CREATE TABLE count3 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY (counter, ts)
> )
>
> That way *counter* will be your partitioning key, and all the rows that
> have the same *counter* value will be clustered (stored as a single wide
> row sorted by the *ts* value). In this scenario the query:
>
>  where counter = 'test' and ts > minTimeuuid('2013-06-18 16:23:00') and ts
> < minTimeuuid('2013-06-18 16:24:00');
>
> would actually be a sequential read on a wide row on a single node.
>
> --
> Francisco Andrades Grassi
> www.bigjocker.com
> @bigjocker
>
> On Jun 19, 2013, at 12:17 PM, "Ryan, Brent"  wrote:
>
>  Tyler,
>
>  You're recommending this schema instead, correct?
>
>  CREATE TABLE count3 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY (ts, counter)
> )
>
>  I believe I tried this as well and ran into similar problems but I'll
> try it again.  I'm using the "ByteOrderedPartitioner" if that helps with
> the latest version of DSE community edition which I believe is Cassandra
> 1.2.3.
>
>
>  Thanks,
> Brent
>
>
>   From: Tyler Hobbs 
> Reply-To: "user@cassandra.apache.org" 
> Date: Wednesday, June 19, 2013 11:00 AM
> To: "user@cassandra.apache.org" 
> Subject: Re: timeuuid and cql3 query
>
>
> On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent  wrote:
>
>>
>>  CREATE TABLE count3 (
>>   counter text,
>>   ts timeuuid,
>>   key1 text,
>>   value int,
>>   PRIMARY KEY ((counter, ts))
>> )
>>
>
> Instead of doing a composite partition key, remove a set of parens and let
> ts be your clustering key.  That will cause cql rows to be stored in sorted
> order by the ts column (for a given value of "counter") and allow you to do
> the kind of query you're looking for.
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>
>
>


Re: timeuuid and cql3 query

2013-06-19 Thread Francisco Andrades Grassi
Hi,

I believe what he's recommending is:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (counter, ts)
)

That way counter will be your partitioning key, and all the rows that have the 
same counter value will be clustered (stored as a single wide row sorted by the 
ts value). In this scenario the query:

 where counter = 'test' and ts > minTimeuuid('2013-06-18 16:23:00') and ts < 
minTimeuuid('2013-06-18 16:24:00');

would actually be a sequential read on a wide row on a single node.

--
Francisco Andrades Grassi
www.bigjocker.com
@bigjocker

On Jun 19, 2013, at 12:17 PM, "Ryan, Brent"  wrote:

> Tyler,
> 
> You're recommending this schema instead, correct?
> 
> CREATE TABLE count3 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY (ts, counter)
> )
> 
> I believe I tried this as well and ran into similar problems but I'll try it 
> again.  I'm using the "ByteOrderedPartitioner" if that helps with the latest 
> version of DSE community edition which I believe is Cassandra 1.2.3.
> 
> 
> Thanks,
> Brent
> 
> 
> From: Tyler Hobbs 
> Reply-To: "user@cassandra.apache.org" 
> Date: Wednesday, June 19, 2013 11:00 AM
> To: "user@cassandra.apache.org" 
> Subject: Re: timeuuid and cql3 query
> 
> 
> On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent  wrote:
> 
> CREATE TABLE count3 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY ((counter, ts))
> )
> 
> Instead of doing a composite partition key, remove a set of parens and let ts 
> be your clustering key.  That will cause cql rows to be stored in sorted 
> order by the ts column (for a given value of "counter") and allow you to do 
> the kind of query you're looking for.
> 
> 
> -- 
> Tyler Hobbs
> DataStax



Re: timeuuid and cql3 query

2013-06-19 Thread Sylvain Lebresne
So part of it is a bug, namely
https://issues.apache.org/jira/browse/CASSANDRA-5666. In summary CQL3
should not accept: ts > minTimeuuid('2013-06-17 22:36:16') and ts <
minTimeuuid('2013-06-20 22:44:02'), because it does no know how to handle
it properly. What it should support is token(ts) >
token(minTimeuuid('2013-06-17 22:36:16')) and token(ts) <
token(minTimeuuid('2013-06-20 22:44:02')). And that is different because
the token always sort by bytes, and comparing timeuuid by bytes does not
yield a time based ordering.

Long story short, using non-equal condition on the partition key (i.e. the
first part of your primary key) is generally not advised. Or to put it
another way, the use of the byte ordering partitioner is discouraged. But
if you still want to use the ordering partitioner and do range queries on
the partition key, do not use a timeuuid, because the ordering that the
partitioner enforce will not be one that is meaningful (due to the timeuuid
layout).

--
Sylvain



On Wed, Jun 19, 2013 at 7:04 PM, Ryan, Brent  wrote:

>  Note that it seems to work when you structure your schema in this
> example below, BUT this is a problem because all of my data will wind up
> hitting a single node in my cassandra cluster because the partitioning key
> is "counter" and that isn't unique enough.  I was hoping that I wasn't
> going to need to build up my own "sharding" scheme as this blog talks about
> (http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra)
> because this becomes much harder for other clients to integrate with
> because they now need to know how my data is structured in order to get it
> out.
>
>  CREATE TABLE count5 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY (counter, ts)
> ) WITH
>   bloom_filter_fp_chance=0.01 AND
>   caching='KEYS_ONLY' AND
>   comment='' AND
>   dclocal_read_repair_chance=0.00 AND
>   gc_grace_seconds=864000 AND
>   read_repair_chance=0.10 AND
>   replicate_on_write='true' AND
>   populate_io_cache_on_flush='false' AND
>   compaction={'class': 'SizeTieredCompactionStrategy'} AND
>   compression={'sstable_compression': 'SnappyCompressor'};
>
>  cqlsh:Test> select counter,dateof(ts),key1,value from count5 where
> counter = 'test' and ts > minTimeuuid('2013-06-17 22:36:16') and ts <
> minTimeuuid('2013-06-18 22:44:02');
>
>   counter | dateof(ts)   | key1 | value
> -+--+--+---
> test | 2013-06-18 22:43:53-0400 |1 | 1
> test | 2013-06-18 22:43:54-0400 |1 | 1
> test | 2013-06-18 22:43:55-0400 |1 | 1
> test | 2013-06-18 22:43:56-0400 |1 | 1
> test | 2013-06-18 22:43:58-0400 |1 | 1
> test | 2013-06-18 22:43:58-0400 |1 | 1
> test | 2013-06-18 22:43:59-0400 |1 | 1
> test | 2013-06-18 22:44:00-0400 |1 | 1
> test | 2013-06-18 22:44:01-0400 |1 | 1
>
>  cqlsh:Test> select counter,dateof(ts),key1,value from count5 where
> counter = 'test' and ts > minTimeuuid('2013-06-17 22:36:16') and ts <
> minTimeuuid('2013-06-20 22:44:02');
>
>   counter | dateof(ts)   | key1 | value
> -+--+--+---
> test | 2013-06-18 22:43:53-0400 |1 | 1
> test | 2013-06-18 22:43:54-0400 |1 | 1
> test | 2013-06-18 22:43:55-0400 |1 | 1
> test | 2013-06-18 22:43:56-0400 |1 | 1
> test | 2013-06-18 22:43:58-0400 |1 | 1
> test | 2013-06-18 22:43:58-0400 |1 | 1
> test | 2013-06-18 22:43:59-0400 |1 | 1
> test | 2013-06-18 22:44:00-0400 |1 | 1
> test | 2013-06-18 22:44:01-0400 |1 | 1
> test | 2013-06-18 22:44:02-0400 |1 | 1
>     test | 2013-06-18 22:44:02-0400 |1 | 1
> test | 2013-06-18 22:44:03-0400 |1 | 1
> test | 2013-06-18 22:44:04-0400 |1 | 1
> test | 2013-06-18 22:44:05-0400 |1 | 1
> test | 2013-06-18 22:44:06-0400 |1 | 1
>
>
>   From: , Brent Ryan 
> Reply-To: "user@cassandra.apache.org" 
> Date: Wednesday, June 19, 2013 12:56 PM
>
> To: "user@cassandra.apache.org" 
> Subject: Re: timeuuid and cql3 query
>
>   Here's an example of that not working:
>
>  cqlsh:Test> desc table count4;
>
>  CREATE TABLE count4 (
>   ts timeuuid,
>   counter text,
>   key1 text,
>   value int,
>   PRIMARY KEY (ts, counter)
> ) WI

Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
Note that it seems to work when you structure your schema in this example 
below, BUT this is a problem because all of my data will wind up hitting a 
single node in my cassandra cluster because the partitioning key is "counter" 
and that isn't unique enough.  I was hoping that I wasn't going to need to 
build up my own "sharding" scheme as this blog talks about 
(http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra) because 
this becomes much harder for other clients to integrate with because they now 
need to know how my data is structured in order to get it out.

CREATE TABLE count5 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (counter, ts)
) WITH
  bloom_filter_fp_chance=0.01 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.00 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.10 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

cqlsh:Test> select counter,dateof(ts),key1,value from count5 where counter = 
'test' and ts > minTimeuuid('2013-06-17 22:36:16') and ts < 
minTimeuuid('2013-06-18 22:44:02');

 counter | dateof(ts)   | key1 | value
-+--+--+---
test | 2013-06-18 22:43:53-0400 |1 | 1
test | 2013-06-18 22:43:54-0400 |1 | 1
test | 2013-06-18 22:43:55-0400 |1 | 1
test | 2013-06-18 22:43:56-0400 |1 | 1
test | 2013-06-18 22:43:58-0400 |1 | 1
test | 2013-06-18 22:43:58-0400 |1 | 1
test | 2013-06-18 22:43:59-0400 |1 | 1
test | 2013-06-18 22:44:00-0400 |1 | 1
test | 2013-06-18 22:44:01-0400 |1 | 1

cqlsh:Test> select counter,dateof(ts),key1,value from count5 where counter = 
'test' and ts > minTimeuuid('2013-06-17 22:36:16') and ts < 
minTimeuuid('2013-06-20 22:44:02');

 counter | dateof(ts)   | key1 | value
-+--+--+---
test | 2013-06-18 22:43:53-0400 |1 | 1
test | 2013-06-18 22:43:54-0400 |1 | 1
test | 2013-06-18 22:43:55-0400 |1 | 1
test | 2013-06-18 22:43:56-0400 |1 | 1
test | 2013-06-18 22:43:58-0400 |1 | 1
test | 2013-06-18 22:43:58-0400 |1 | 1
test | 2013-06-18 22:43:59-0400 |1 | 1
test | 2013-06-18 22:44:00-0400 |1 | 1
test | 2013-06-18 22:44:01-0400 |1 | 1
test | 2013-06-18 22:44:02-0400 |1 | 1
test | 2013-06-18 22:44:02-0400 |1 | 1
test | 2013-06-18 22:44:03-0400 |1 | 1
test | 2013-06-18 22:44:04-0400 |1 | 1
test | 2013-06-18 22:44:05-0400 |1 | 1
test | 2013-06-18 22:44:06-0400 |1 | 1


From: , Brent Ryan mailto:br...@cvent.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Wednesday, June 19, 2013 12:56 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query

Here's an example of that not working:

cqlsh:Test> desc table count4;

CREATE TABLE count4 (
  ts timeuuid,
  counter text,
  key1 text,
  value int,
  PRIMARY KEY (ts, counter)
) WITH
  bloom_filter_fp_chance=0.01 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.00 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.10 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

cqlsh:Test> select counter,dateof(ts),key1,value from count4;

 counter | dateof(ts)   | key1 | value
-+--+--+---
test | 2013-06-18 22:36:16-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:19-0400 |1 | 1
test | 2013-06-18 22:36:19-0400 |1 | 1
test | 2013-06-18 22:36:20-0400 |1 | 1
test | 2013-06-18 22:36:20-0400 |1 | 1
test | 2013-06-18 22:36:21-0400 |1 | 1
test | 2013-06-18 22:36:21-0400 |1 | 1
test | 2013-06-18 22:36:22-0400 |1 | 1
test | 2013-06-18 22:36:22-0400 |1 | 1
test | 2013-06-18 22:36:23-0400 |1 | 1
test | 2013-06-18 22:36:23-0400 |1 | 1
test | 2013-06-18 22:

Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
Here's an example of that not working:

cqlsh:Test> desc table count4;

CREATE TABLE count4 (
  ts timeuuid,
  counter text,
  key1 text,
  value int,
  PRIMARY KEY (ts, counter)
) WITH
  bloom_filter_fp_chance=0.01 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.00 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.10 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

cqlsh:Test> select counter,dateof(ts),key1,value from count4;

 counter | dateof(ts)   | key1 | value
-+--+--+---
test | 2013-06-18 22:36:16-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:18-0400 |1 | 1
test | 2013-06-18 22:36:19-0400 |1 | 1
test | 2013-06-18 22:36:19-0400 |1 | 1
test | 2013-06-18 22:36:20-0400 |1 | 1
test | 2013-06-18 22:36:20-0400 |1 | 1
test | 2013-06-18 22:36:21-0400 |1 | 1
test | 2013-06-18 22:36:21-0400 |1 | 1
test | 2013-06-18 22:36:22-0400 |1 | 1
test | 2013-06-18 22:36:22-0400 |1 | 1
test | 2013-06-18 22:36:23-0400 |1 | 1
test | 2013-06-18 22:36:23-0400 |1 | 1
test | 2013-06-18 22:36:25-0400 |1 | 1
test | 2013-06-18 22:36:27-0400 |1 | 1
test | 2013-06-18 22:36:28-0400 |1 | 1

cqlsh:Statistics> select counter,dateof(ts),key1,value from count4 where ts > 
minTimeuuid('2013-06-17 22:36:16') and ts < minTimeuuid('2013-06-19 22:36:20');
Bad Request: 2 Start key must sort before (or equal to) finish key in your 
partitioner!



Any ideas?  Seems like a bug to me, right?

Brent

From: , Brent Ryan mailto:br...@cvent.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Wednesday, June 19, 2013 12:47 PM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query

Tyler,

You're recommending this schema instead, correct?

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (ts, counter)
)

I believe I tried this as well and ran into similar problems but I'll try it 
again.  I'm using the "ByteOrderedPartitioner" if that helps with the latest 
version of DSE community edition which I believe is Cassandra 1.2.3.


Thanks,
Brent


From: Tyler Hobbs mailto:ty...@datastax.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Wednesday, June 19, 2013 11:00 AM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query


On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent 
mailto:br...@cvent.com>> wrote:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY ((counter, ts))
)

Instead of doing a composite partition key, remove a set of parens and let ts 
be your clustering key.  That will cause cql rows to be stored in sorted order 
by the ts column (for a given value of "counter") and allow you to do the kind 
of query you're looking for.


--
Tyler Hobbs
DataStax<http://datastax.com/>


Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
Tyler,

You're recommending this schema instead, correct?

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY (ts, counter)
)

I believe I tried this as well and ran into similar problems but I'll try it 
again.  I'm using the "ByteOrderedPartitioner" if that helps with the latest 
version of DSE community edition which I believe is Cassandra 1.2.3.


Thanks,
Brent


From: Tyler Hobbs mailto:ty...@datastax.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Date: Wednesday, June 19, 2013 11:00 AM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
mailto:user@cassandra.apache.org>>
Subject: Re: timeuuid and cql3 query


On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent 
mailto:br...@cvent.com>> wrote:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY ((counter, ts))
)

Instead of doing a composite partition key, remove a set of parens and let ts 
be your clustering key.  That will cause cql rows to be stored in sorted order 
by the ts column (for a given value of "counter") and allow you to do the kind 
of query you're looking for.


--
Tyler Hobbs
DataStax<http://datastax.com/>


Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
I'm using the byte ordered partitioner.

Sent from my iPhone

On Jun 19, 2013, at 11:26 AM, "Sylvain Lebresne" 
mailto:sylv...@datastax.com>> wrote:

You're using the ordered partitioner, right?


On Wed, Jun 19, 2013 at 5:06 PM, Davide Anastasia 
mailto:davide.anasta...@gmail.com>> wrote:

Hi Tyler,
I am interested in this scenario as well: could you please elaborate further 
your answer?

Thanks a lot,
Davide

On 19 Jun 2013 16:01, "Tyler Hobbs" 
mailto:ty...@datastax.com>> wrote:

On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent 
mailto:br...@cvent.com>> wrote:

CREATE TABLE count3 (
  counter text,
  ts timeuuid,
  key1 text,
  value int,
  PRIMARY KEY ((counter, ts))
)

Instead of doing a composite partition key, remove a set of parens and let ts 
be your clustering key.  That will cause cql rows to be stored in sorted order 
by the ts column (for a given value of "counter") and allow you to do the kind 
of query you're looking for.


--
Tyler Hobbs
DataStax



Re: timeuuid and cql3 query

2013-06-19 Thread Sylvain Lebresne
You're using the ordered partitioner, right?


On Wed, Jun 19, 2013 at 5:06 PM, Davide Anastasia <
davide.anasta...@gmail.com> wrote:

> Hi Tyler,
> I am interested in this scenario as well: could you please elaborate
> further your answer?
>
> Thanks a lot,
> Davide
> On 19 Jun 2013 16:01, "Tyler Hobbs"  wrote:
>
>>
>> On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent  wrote:
>>
>>>
>>>  CREATE TABLE count3 (
>>>   counter text,
>>>   ts timeuuid,
>>>   key1 text,
>>>   value int,
>>>   PRIMARY KEY ((counter, ts))
>>> )
>>>
>>
>> Instead of doing a composite partition key, remove a set of parens and
>> let ts be your clustering key.  That will cause cql rows to be stored in
>> sorted order by the ts column (for a given value of "counter") and allow
>> you to do the kind of query you're looking for.
>>
>>
>> --
>> Tyler Hobbs
>> DataStax 
>>
>


Re: timeuuid and cql3 query

2013-06-19 Thread Davide Anastasia
Hi Tyler,
I am interested in this scenario as well: could you please elaborate
further your answer?

Thanks a lot,
Davide
On 19 Jun 2013 16:01, "Tyler Hobbs"  wrote:

>
> On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent  wrote:
>
>>
>>  CREATE TABLE count3 (
>>   counter text,
>>   ts timeuuid,
>>   key1 text,
>>   value int,
>>   PRIMARY KEY ((counter, ts))
>> )
>>
>
> Instead of doing a composite partition key, remove a set of parens and let
> ts be your clustering key.  That will cause cql rows to be stored in sorted
> order by the ts column (for a given value of "counter") and allow you to do
> the kind of query you're looking for.
>
>
> --
> Tyler Hobbs
> DataStax 
>


Re: timeuuid and cql3 query

2013-06-19 Thread Tyler Hobbs
On Wed, Jun 19, 2013 at 8:08 AM, Ryan, Brent  wrote:

>
>  CREATE TABLE count3 (
>   counter text,
>   ts timeuuid,
>   key1 text,
>   value int,
>   PRIMARY KEY ((counter, ts))
> )
>

Instead of doing a composite partition key, remove a set of parens and let
ts be your clustering key.  That will cause cql rows to be stored in sorted
order by the ts column (for a given value of "counter") and allow you to do
the kind of query you're looking for.


-- 
Tyler Hobbs
DataStax 


Re: TimeUUID Order Partitioner

2013-03-28 Thread Carlos Pérez Miguel
Apparently the MemTable..writeSortedContents has the same problem: I can
see how it iterates over the stored keys in byte order, so  my classes have
something wrong. For the curious, these are my classes until now:

https://gist.github.com/anonymous/5261611


Carlos Pérez Miguel


2013/3/28 aaron morton 

> That is the order I would expect to find if I read the CF, but if I do, I
> obtain (with any client or library I've tried):
>
>
> What happens if you export sstables with sstable2json ?
>
> Put some logging in Memtable.FlushRunnable.writeSortedContents to see the
> order the rows are written
>
> Cheers
>
>-
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 28/03/2013, at 5:05 AM, Carlos Pérez Miguel 
> wrote:
>
> Thanks, Lanny. That is what I am doing.
>
> Actually I'm having another problem. My UUIDOrderedPartitioner doesn't
> order by time. Instead, it orders by byte order and I cannot find why.
> Which are the functions that control ordering between tokens? I have
> implemented time ordering in the "compareTo" function of my UUID token
> class, but it seems that Cassandra is ignoring it. For example:
>
> Let's suppouse that I have a Users CF where each row represents a user in
> a cluster of 1 node. Rows are ordered by TimeUUID. I create some users in
> the next order:
>
> user a created with user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500
> user b created with user_id: f17f9ae8-96f4-11e2-98aa-421151417092
> user c created with user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c
> user d created with user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308
> user e created with user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e
> user f created with user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4
> user g created with user_id: 13036b86-96f5-11e2-80dd-566654c686cb
> user h created with user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0
>
> That is the order I would expect to find if I read the CF, but if I do, I
> obtain (with any client or library I've tried):
>
> user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e name:"e"
> user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4 name:"f"
> user_id: 13036b86-96f5-11e2-80dd-566654c686cb name:"g"
> user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0 name:"h"
> user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500 name:"a"
> user_id: f17f9ae8-96f4-11e2-98aa-421151417092 name:"b"
> user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c name:"c"
> user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308 name:"d"
>
> Any idea what's happening?
>
>
> Carlos Pérez Miguel
>
>
> 2013/3/27 Lanny Ripple 
>
>> Ah. TimeUUID.  Not as useful for you then but still something for the
>> toolbox.
>>
>> On Mar 27, 2013, at 8:42 AM, Lanny Ripple  wrote:
>>
>> > A type 4 UUID can be created from two Longs.  You could MD5 your
>> strings giving you 128 hashed bits and then make UUIDs out of that.  Using
>> Scala:
>> >
>> >   import java.nio.ByteBuffer
>> >   import java.security.MessageDigest
>> >   import java.util.UUID
>> >
>> >   val key = "Hello, World!"
>> >
>> >   val md = MessageDigest.getInstance("MD5")
>> >   val dig = md.digest(key.getBytes("UTF-8"))
>> >   val bb = ByteBuffer.wrap(dig)
>> >
>> >   val msb = bb.getLong
>> >   val lsb = bb.getLong
>> >
>> >   val uuid = new UUID(msb, lsb)
>> >
>> >
>> > On Mar 26, 2013, at 3:22 PM, aaron morton 
>> wrote:
>> >
>> >>> Any idea?
>> >> Not off the top of my head.
>> >>
>> >> Cheers
>> >>
>> >> -
>> >> Aaron Morton
>> >> Freelance Cassandra Consultant
>> >> New Zealand
>> >>
>> >> @aaronmorton
>> >> http://www.thelastpickle.com
>> >>
>> >> On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel 
>> wrote:
>> >>
>> >>> Yes it does. Thank you Aaron.
>> >>>
>> >>> Now I realized that the system keyspace uses string as keys, like
>> "Ring" or "ClusterName", and I don't know how to convert these type of keys
>> into UUID. Any idea?
>> >>>
>> >>>
>> >>> Carlos Pérez Miguel
>> >>>
>> >>>
>> >>> 2013/3/25 aaron morton 
>> >>> The best thing to do is start with a look at ByteOrderedPartitoner
>> and AbstractByteOrderedPartitioner.
>> >>>
>> >>> You'll want to create a new TimeUUIDToken extends Token and a
>> new UUIDPartitioner that extends AbstractPartitioner<>
>> >>>
>> >>> Usual disclaimer that ordered partitioners cause problems with load
>> balancing.
>> >>>
>> >>> Hope that helps.
>> >>>
>> >>> -
>> >>> Aaron Morton
>> >>> Freelance Cassandra Consultant
>> >>> New Zealand
>> >>>
>> >>> @aaronmorton
>> >>> http://www.thelastpickle.com
>> >>>
>> >>> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel 
>> wrote:
>> >>>
>>  Hi,
>> 
>>  I store in my system rows where the key is a UUID version1,
>> TimeUUID. I would like to maintain rows ordered by time. I know that in
>> this case, it is recomended to use an external CF where column names are
>> UUID ordered by time. But in my use case this is not possible, so I would
>> like to use a custom Partitioner in order to do this. If I use
>> By

Re: TimeUUID Order Partitioner

2013-03-27 Thread aaron morton
> That is the order I would expect to find if I read the CF, but if I do, I 
> obtain (with any client or library I've tried):
> 
What happens if you export sstables with sstable2json ?

Put some logging in Memtable.FlushRunnable.writeSortedContents to see the order 
the rows are written 

Cheers

-
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 28/03/2013, at 5:05 AM, Carlos Pérez Miguel  wrote:

> Thanks, Lanny. That is what I am doing.
> 
> Actually I'm having another problem. My UUIDOrderedPartitioner doesn't order 
> by time. Instead, it orders by byte order and I cannot find why. Which are 
> the functions that control ordering between tokens? I have implemented time 
> ordering in the "compareTo" function of my UUID token class, but it seems 
> that Cassandra is ignoring it. For example:
> 
> Let's suppouse that I have a Users CF where each row represents a user in a 
> cluster of 1 node. Rows are ordered by TimeUUID. I create some users in the 
> next order:
> 
> user a created with user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500
> user b created with user_id: f17f9ae8-96f4-11e2-98aa-421151417092
> user c created with user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c
> user d created with user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308
> user e created with user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e
> user f created with user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4
> user g created with user_id: 13036b86-96f5-11e2-80dd-566654c686cb
> user h created with user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0
> 
> That is the order I would expect to find if I read the CF, but if I do, I 
> obtain (with any client or library I've tried):
> 
> user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e name:"e"
> user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4 name:"f"
> user_id: 13036b86-96f5-11e2-80dd-566654c686cb name:"g"
> user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0 name:"h"
> user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500 name:"a"
> user_id: f17f9ae8-96f4-11e2-98aa-421151417092 name:"b"
> user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c name:"c"
> user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308 name:"d"
> 
> Any idea what's happening?
> 
> 
> Carlos Pérez Miguel
> 
> 
> 2013/3/27 Lanny Ripple 
> Ah. TimeUUID.  Not as useful for you then but still something for the toolbox.
> 
> On Mar 27, 2013, at 8:42 AM, Lanny Ripple  wrote:
> 
> > A type 4 UUID can be created from two Longs.  You could MD5 your strings 
> > giving you 128 hashed bits and then make UUIDs out of that.  Using Scala:
> >
> >   import java.nio.ByteBuffer
> >   import java.security.MessageDigest
> >   import java.util.UUID
> >
> >   val key = "Hello, World!"
> >
> >   val md = MessageDigest.getInstance("MD5")
> >   val dig = md.digest(key.getBytes("UTF-8"))
> >   val bb = ByteBuffer.wrap(dig)
> >
> >   val msb = bb.getLong
> >   val lsb = bb.getLong
> >
> >   val uuid = new UUID(msb, lsb)
> >
> >
> > On Mar 26, 2013, at 3:22 PM, aaron morton  wrote:
> >
> >>> Any idea?
> >> Not off the top of my head.
> >>
> >> Cheers
> >>
> >> -
> >> Aaron Morton
> >> Freelance Cassandra Consultant
> >> New Zealand
> >>
> >> @aaronmorton
> >> http://www.thelastpickle.com
> >>
> >> On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel  wrote:
> >>
> >>> Yes it does. Thank you Aaron.
> >>>
> >>> Now I realized that the system keyspace uses string as keys, like "Ring" 
> >>> or "ClusterName", and I don't know how to convert these type of keys into 
> >>> UUID. Any idea?
> >>>
> >>>
> >>> Carlos Pérez Miguel
> >>>
> >>>
> >>> 2013/3/25 aaron morton 
> >>> The best thing to do is start with a look at ByteOrderedPartitoner and 
> >>> AbstractByteOrderedPartitioner.
> >>>
> >>> You'll want to create a new TimeUUIDToken extends Token and a new 
> >>> UUIDPartitioner that extends AbstractPartitioner<>
> >>>
> >>> Usual disclaimer that ordered partitioners cause problems with load 
> >>> balancing.
> >>>
> >>> Hope that helps.
> >>>
> >>> -
> >>> Aaron Morton
> >>> Freelance Cassandra Consultant
> >>> New Zealand
> >>>
> >>> @aaronmorton
> >>> http://www.thelastpickle.com
> >>>
> >>> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel  
> >>> wrote:
> >>>
>  Hi,
> 
>  I store in my system rows where the key is a UUID version1, TimeUUID. I 
>  would like to maintain rows ordered by time. I know that in this case, 
>  it is recomended to use an external CF where column names are UUID 
>  ordered by time. But in my use case this is not possible, so I would 
>  like to use a custom Partitioner in order to do this. If I use 
>  ByteOrderedPartitioner rows are not correctly ordered because of the way 
>  a UUID stores the timestamp. What is needed in order to implement my own 
>  Partitioner?
> 
>  Thank you.
> 
>  Carlos Pérez Miguel
> >>>
> >>>
> >>
> >
> 
> 



Re: TimeUUID Order Partitioner

2013-03-27 Thread Carlos Pérez Miguel
Thanks, Lanny. That is what I am doing.

Actually I'm having another problem. My UUIDOrderedPartitioner doesn't
order by time. Instead, it orders by byte order and I cannot find why.
Which are the functions that control ordering between tokens? I have
implemented time ordering in the "compareTo" function of my UUID token
class, but it seems that Cassandra is ignoring it. For example:

Let's suppouse that I have a Users CF where each row represents a user in a
cluster of 1 node. Rows are ordered by TimeUUID. I create some users in the
next order:

user a created with user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500
user b created with user_id: f17f9ae8-96f4-11e2-98aa-421151417092
user c created with user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c
user d created with user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308
user e created with user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e
user f created with user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4
user g created with user_id: 13036b86-96f5-11e2-80dd-566654c686cb
user h created with user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0

That is the order I would expect to find if I read the CF, but if I do, I
obtain (with any client or library I've tried):

user_id: 058ec180-96f5-11e2-8c88-4aaf94e4f04e name:"e"
user_id: 0c5032ba-96f5-11e2-95a5-60a128c0b3f4 name:"f"
user_id: 13036b86-96f5-11e2-80dd-566654c686cb name:"g"
user_id: 19b245f6-96f5-11e2-9c8f-b315f455e5e0 name:"h"
user_id: eac850fa-96f4-11e2-9f22-72ad6af0e500 name:"a"
user_id: f17f9ae8-96f4-11e2-98aa-421151417092 name:"b"
user_id: f82fccfa-96f4-11e2-8d99-26f8461d074c name:"c"
user_id: fee21cec-96f4-11e2-945b-f9a2a2e32308 name:"d"

Any idea what's happening?


Carlos Pérez Miguel


2013/3/27 Lanny Ripple 

> Ah. TimeUUID.  Not as useful for you then but still something for the
> toolbox.
>
> On Mar 27, 2013, at 8:42 AM, Lanny Ripple  wrote:
>
> > A type 4 UUID can be created from two Longs.  You could MD5 your strings
> giving you 128 hashed bits and then make UUIDs out of that.  Using Scala:
> >
> >   import java.nio.ByteBuffer
> >   import java.security.MessageDigest
> >   import java.util.UUID
> >
> >   val key = "Hello, World!"
> >
> >   val md = MessageDigest.getInstance("MD5")
> >   val dig = md.digest(key.getBytes("UTF-8"))
> >   val bb = ByteBuffer.wrap(dig)
> >
> >   val msb = bb.getLong
> >   val lsb = bb.getLong
> >
> >   val uuid = new UUID(msb, lsb)
> >
> >
> > On Mar 26, 2013, at 3:22 PM, aaron morton 
> wrote:
> >
> >>> Any idea?
> >> Not off the top of my head.
> >>
> >> Cheers
> >>
> >> -
> >> Aaron Morton
> >> Freelance Cassandra Consultant
> >> New Zealand
> >>
> >> @aaronmorton
> >> http://www.thelastpickle.com
> >>
> >> On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel 
> wrote:
> >>
> >>> Yes it does. Thank you Aaron.
> >>>
> >>> Now I realized that the system keyspace uses string as keys, like
> "Ring" or "ClusterName", and I don't know how to convert these type of keys
> into UUID. Any idea?
> >>>
> >>>
> >>> Carlos Pérez Miguel
> >>>
> >>>
> >>> 2013/3/25 aaron morton 
> >>> The best thing to do is start with a look at ByteOrderedPartitoner and
> AbstractByteOrderedPartitioner.
> >>>
> >>> You'll want to create a new TimeUUIDToken extends Token and a
> new UUIDPartitioner that extends AbstractPartitioner<>
> >>>
> >>> Usual disclaimer that ordered partitioners cause problems with load
> balancing.
> >>>
> >>> Hope that helps.
> >>>
> >>> -
> >>> Aaron Morton
> >>> Freelance Cassandra Consultant
> >>> New Zealand
> >>>
> >>> @aaronmorton
> >>> http://www.thelastpickle.com
> >>>
> >>> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel 
> wrote:
> >>>
>  Hi,
> 
>  I store in my system rows where the key is a UUID version1, TimeUUID.
> I would like to maintain rows ordered by time. I know that in this case, it
> is recomended to use an external CF where column names are UUID ordered by
> time. But in my use case this is not possible, so I would like to use a
> custom Partitioner in order to do this. If I use ByteOrderedPartitioner
> rows are not correctly ordered because of the way a UUID stores the
> timestamp. What is needed in order to implement my own Partitioner?
> 
>  Thank you.
> 
>  Carlos Pérez Miguel
> >>>
> >>>
> >>
> >
>
>


Re: TimeUUID Order Partitioner

2013-03-27 Thread Lanny Ripple
Ah. TimeUUID.  Not as useful for you then but still something for the toolbox.

On Mar 27, 2013, at 8:42 AM, Lanny Ripple  wrote:

> A type 4 UUID can be created from two Longs.  You could MD5 your strings 
> giving you 128 hashed bits and then make UUIDs out of that.  Using Scala:
> 
>   import java.nio.ByteBuffer
>   import java.security.MessageDigest
>   import java.util.UUID
> 
>   val key = "Hello, World!"
> 
>   val md = MessageDigest.getInstance("MD5")
>   val dig = md.digest(key.getBytes("UTF-8"))
>   val bb = ByteBuffer.wrap(dig)
> 
>   val msb = bb.getLong
>   val lsb = bb.getLong
> 
>   val uuid = new UUID(msb, lsb)
> 
> 
> On Mar 26, 2013, at 3:22 PM, aaron morton  wrote:
> 
>>> Any idea?
>> Not off the top of my head.
>> 
>> Cheers
>> 
>> -
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>> 
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel  wrote:
>> 
>>> Yes it does. Thank you Aaron.
>>> 
>>> Now I realized that the system keyspace uses string as keys, like "Ring" or 
>>> "ClusterName", and I don't know how to convert these type of keys into 
>>> UUID. Any idea?
>>> 
>>> 
>>> Carlos Pérez Miguel
>>> 
>>> 
>>> 2013/3/25 aaron morton 
>>> The best thing to do is start with a look at ByteOrderedPartitoner and 
>>> AbstractByteOrderedPartitioner. 
>>> 
>>> You'll want to create a new TimeUUIDToken extends Token and a new 
>>> UUIDPartitioner that extends AbstractPartitioner<>
>>> 
>>> Usual disclaimer that ordered partitioners cause problems with load 
>>> balancing. 
>>> 
>>> Hope that helps. 
>>> 
>>> -
>>> Aaron Morton
>>> Freelance Cassandra Consultant
>>> New Zealand
>>> 
>>> @aaronmorton
>>> http://www.thelastpickle.com
>>> 
>>> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel  wrote:
>>> 
 Hi,
 
 I store in my system rows where the key is a UUID version1, TimeUUID. I 
 would like to maintain rows ordered by time. I know that in this case, it 
 is recomended to use an external CF where column names are UUID ordered by 
 time. But in my use case this is not possible, so I would like to use a 
 custom Partitioner in order to do this. If I use ByteOrderedPartitioner 
 rows are not correctly ordered because of the way a UUID stores the 
 timestamp. What is needed in order to implement my own Partitioner?
 
 Thank you.
 
 Carlos Pérez Miguel
>>> 
>>> 
>> 
> 



Re: TimeUUID Order Partitioner

2013-03-27 Thread Lanny Ripple
A type 4 UUID can be created from two Longs.  You could MD5 your strings giving 
you 128 hashed bits and then make UUIDs out of that.  Using Scala:
 
   import java.nio.ByteBuffer
   import java.security.MessageDigest
   import java.util.UUID

   val key = "Hello, World!"

   val md = MessageDigest.getInstance("MD5")
   val dig = md.digest(key.getBytes("UTF-8"))
   val bb = ByteBuffer.wrap(dig)

   val msb = bb.getLong
   val lsb = bb.getLong

   val uuid = new UUID(msb, lsb)


On Mar 26, 2013, at 3:22 PM, aaron morton  wrote:

>> Any idea?
> Not off the top of my head.
> 
> Cheers
> 
> -
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
> 
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel  wrote:
> 
>> Yes it does. Thank you Aaron.
>> 
>> Now I realized that the system keyspace uses string as keys, like "Ring" or 
>> "ClusterName", and I don't know how to convert these type of keys into UUID. 
>> Any idea?
>> 
>> 
>> Carlos Pérez Miguel
>> 
>> 
>> 2013/3/25 aaron morton 
>> The best thing to do is start with a look at ByteOrderedPartitoner and 
>> AbstractByteOrderedPartitioner. 
>> 
>> You'll want to create a new TimeUUIDToken extends Token and a new 
>> UUIDPartitioner that extends AbstractPartitioner<>
>> 
>> Usual disclaimer that ordered partitioners cause problems with load 
>> balancing. 
>> 
>> Hope that helps. 
>> 
>> -
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>> 
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel  wrote:
>> 
>>> Hi,
>>> 
>>> I store in my system rows where the key is a UUID version1, TimeUUID. I 
>>> would like to maintain rows ordered by time. I know that in this case, it 
>>> is recomended to use an external CF where column names are UUID ordered by 
>>> time. But in my use case this is not possible, so I would like to use a 
>>> custom Partitioner in order to do this. If I use ByteOrderedPartitioner 
>>> rows are not correctly ordered because of the way a UUID stores the 
>>> timestamp. What is needed in order to implement my own Partitioner?
>>> 
>>> Thank you.
>>> 
>>> Carlos Pérez Miguel
>> 
>> 
> 



Re: TimeUUID Order Partitioner

2013-03-26 Thread aaron morton
> Any idea?
Not off the top of my head.

Cheers

-
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 26/03/2013, at 2:13 AM, Carlos Pérez Miguel  wrote:

> Yes it does. Thank you Aaron.
> 
> Now I realized that the system keyspace uses string as keys, like "Ring" or 
> "ClusterName", and I don't know how to convert these type of keys into UUID. 
> Any idea?
> 
> 
> Carlos Pérez Miguel
> 
> 
> 2013/3/25 aaron morton 
> The best thing to do is start with a look at ByteOrderedPartitoner and 
> AbstractByteOrderedPartitioner. 
> 
> You'll want to create a new TimeUUIDToken extends Token and a new 
> UUIDPartitioner that extends AbstractPartitioner<>
> 
> Usual disclaimer that ordered partitioners cause problems with load 
> balancing. 
> 
> Hope that helps. 
> 
> -
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
> 
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel  wrote:
> 
>> Hi,
>> 
>> I store in my system rows where the key is a UUID version1, TimeUUID. I 
>> would like to maintain rows ordered by time. I know that in this case, it is 
>> recomended to use an external CF where column names are UUID ordered by 
>> time. But in my use case this is not possible, so I would like to use a 
>> custom Partitioner in order to do this. If I use ByteOrderedPartitioner rows 
>> are not correctly ordered because of the way a UUID stores the timestamp. 
>> What is needed in order to implement my own Partitioner?
>> 
>> Thank you.
>> 
>> Carlos Pérez Miguel
> 
> 



Re: TimeUUID Order Partitioner

2013-03-25 Thread Carlos Pérez Miguel
Yes it does. Thank you Aaron.

Now I realized that the system keyspace uses string as keys, like "Ring" or
"ClusterName", and I don't know how to convert these type of keys into
UUID. Any idea?


Carlos Pérez Miguel


2013/3/25 aaron morton 

> The best thing to do is start with a look at ByteOrderedPartitoner and
> AbstractByteOrderedPartitioner.
>
> You'll want to create a new TimeUUIDToken extends Token and a new
> UUIDPartitioner that extends AbstractPartitioner<>
>
> Usual disclaimer that ordered partitioners cause problems with load
> balancing.
>
> Hope that helps.
>
>-
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel 
> wrote:
>
> Hi,
>
> I store in my system rows where the key is a UUID version1, TimeUUID. I
> would like to maintain rows ordered by time. I know that in this case, it
> is recomended to use an external CF where column names are UUID ordered by
> time. But in my use case this is not possible, so I would like to use a
> custom Partitioner in order to do this. If I use ByteOrderedPartitioner
> rows are not correctly ordered because of the way a UUID stores the
> timestamp. What is needed in order to implement my own Partitioner?
>
> Thank you.
>
> Carlos Pérez Miguel
>
>
>


Re: TimeUUID Order Partitioner

2013-03-24 Thread aaron morton
The best thing to do is start with a look at ByteOrderedPartitoner and 
AbstractByteOrderedPartitioner. 

You'll want to create a new TimeUUIDToken extends Token and a new 
UUIDPartitioner that extends AbstractPartitioner<>

Usual disclaimer that ordered partitioners cause problems with load balancing. 

Hope that helps. 

-
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel  wrote:

> Hi,
> 
> I store in my system rows where the key is a UUID version1, TimeUUID. I would 
> like to maintain rows ordered by time. I know that in this case, it is 
> recomended to use an external CF where column names are UUID ordered by time. 
> But in my use case this is not possible, so I would like to use a custom 
> Partitioner in order to do this. If I use ByteOrderedPartitioner rows are not 
> correctly ordered because of the way a UUID stores the timestamp. What is 
> needed in order to implement my own Partitioner?
> 
> Thank you.
> 
> Carlos Pérez Miguel



Re: TimeUUID

2012-02-28 Thread Dave Brosius

  
  
Given that these rows are wanted to be time buckets, you would want
collisions, in fact that would be the standard way of working, so
IMO, the uuid just removes the ability to bucket data and would not
be wanted.



On 02/28/2012 10:30 AM, Paul Loy wrote:
In a multi server env, to avoid key collisions
  timeuuid may be the better choice.
  
  On Monday, February 27, 2012, Tamar Fraenkel wrote:
  
Hi!

  I have a column family where I use rows as "time
buckets". 
  What I do is take epoc time in seconds, and round it to 1
hour (taking the result of time_since_epoc_second divided by
3600).
  My key validation type is LongType.
  I wonder whether it is better to use TimeUUID or even
readable string representation for time?
  Thanks,
  


-- 

  
Tamar Fraenkel 
Senior Software Engineer, TOK Media 


  
ta...@tok-media.com
Tel:   +972 2 6409736 
Mob:  +972 54 8356490 
Fax:   +972 2 5612956 


  
  


  

  
   
  
  
  -- 
  Sent from my iPhone, sorry for my brevity.


  



Re: TimeUUID

2012-02-28 Thread Paul Loy
In a multi server env, to avoid key collisions timeuuid may be the better
choice.

On Monday, February 27, 2012, Tamar Fraenkel wrote:

> Hi!
>
> I have a column family where I use rows as "time buckets".
> What I do is take epoc time in seconds, and round it to 1 hour (taking the
> result of time_since_epoc_second divided by 3600).
> My key validation type is LongType.
> I wonder whether it is better to use TimeUUID or even readable string
> representation for time?
> Thanks,
>
> --
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> [image: Inline image 1]
>
> ta...@tok-media.com 
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>


-- 
Sent from my iPhone, sorry for my brevity.
<>

Re: TimeUUID

2012-02-28 Thread Tamar Fraenkel
Thanks, makes my life easier.
Tamar

On Tue, Feb 28, 2012 at 10:23 AM, aaron morton wrote:

> not a great deal of difference, personally I would stick with seconds
> since epoch (it is probably slightly faster).
>
> Cheers
>
> -
> Aaron Morton
> Freelance Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 28/02/2012, at 7:24 PM, Tamar Fraenkel wrote:
>
> Hi!
> I have a column family where I use rows as "time buckets".
> What I do is take epoc time in seconds, and round it to 1 hour (taking the
> result of time_since_epoc_second divided by 3600).
> My key validation type is LongType.
> I wonder whether it is better to use TimeUUID or even readable string
> representation for time?
> Thanks,
>
> --
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> 
>
>
> ta...@tok-media.com
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>
>


-- 
*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

ta...@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956
<>

Re: TimeUUID

2012-02-28 Thread aaron morton
not a great deal of difference, personally I would stick with seconds since 
epoch (it is probably slightly faster).

Cheers
 
-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 28/02/2012, at 7:24 PM, Tamar Fraenkel wrote:

> Hi!
> I have a column family where I use rows as "time buckets". 
> What I do is take epoc time in seconds, and round it to 1 hour (taking the 
> result of time_since_epoc_second divided by 3600).
> My key validation type is LongType.
> I wonder whether it is better to use TimeUUID or even readable string 
> representation for time?
> Thanks,
> 
> -- 
> Tamar Fraenkel 
> Senior Software Engineer, TOK Media 
> 
> 
> 
> ta...@tok-media.com
> Tel:   +972 2 6409736 
> Mob:  +972 54 8356490 
> Fax:   +972 2 5612956 
> 
> 
> 



Re: TimeUUID

2012-02-28 Thread R. Verlangen
For querying purposes it would be better to use readable strings because
you can really get information out of that.

TimeUUID is just a unique value based on time; but not only the time.

2012/2/28 Tamar Fraenkel 

> Hi!
> I have a column family where I use rows as "time buckets".
> What I do is take epoc time in seconds, and round it to 1 hour (taking the
> result of time_since_epoc_second divided by 3600).
> My key validation type is LongType.
> I wonder whether it is better to use TimeUUID or even readable string
> representation for time?
> Thanks,
>
> --
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> [image: Inline image 1]
>
> ta...@tok-media.com
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>
<>

Re: TimeUUID question

2011-01-07 Thread Roshan Dawrani
The thread here may help:
http://www.mail-archive.com/user@cassandra.apache.org/msg08393.html

On Fri, Jan 7, 2011 at 6:27 PM, Arijit Mukherjee  wrote:

> Hi
>
> I'm using the piece of code given in the FAQ
> (http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java)
> to convert a Date to UUID, and then trying to convert it back (using
> the example code given in Hector TimeUUIDUtils - convert the UUID to
> long (getTimeFromUUID) and then convert it to Date again). But the
> final Date is not equal to the original Date which I converted into a
> UUID. Is this something to do with the piece of code in the FAQ?
>
> Arijit
>
>
> --
> "And when the night is cloudy,
> There is still a light that shines on me,
> Shine on until tomorrow, let it be."
>



-- 
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani 
Skype: roshandawrani

   <#>
<#>
<#>   <#>


Re: TimeUUID makes me crazy

2010-10-19 Thread Sylvain Lebresne
In you first column family, you are using a UUID as a row key (your column
names are strings apparently (phone, addres)). The CompareWith directive
specify the comparator for *column names*. So you are providing strings where
you indicated Cassandra you'll provide UUID, hence the exceptions.

The sorting of rows is determined by the partitioner (and there is no
support for
TimeUUID sorting of rows).

--
Sylvain

On Mon, Oct 18, 2010 at 6:25 PM, cbert...@libero.it  wrote:
> I am getting crazy using TimeUUID in cassandra via Java. I've read the FAQ but
> it didn't help.
> Can I use a TimeUUID as ROW identifier? (if converted to string)
>
> I have a CF like this and SCF like these:
>
> 
> TIMEUUID OPECID (ROW) {
>             phone: 123
>             address: street xyz
> }
>
>  CompareSubcolumnsWith="BytesType" />
> String USERID (ROW) {
>            TIMEUUID OPECID (SuperColumnName)  {
>                                collection of columns;
>             }
> }
>
> In one situation the TimeUUID is a ROW identifier while in another is the
> SuperColumn name. I get many "UUID must be a 16 byte" when I try to read a 
> data
> that did not give any exception during his save.
>
> at a Time T0 this one works: mutator.writeColumns(UuidHelper.timeUuidFromBytes
> (OpecID).toString(), opecfamily, notNull); // (notnull contains a list of
> columns also opecstatus)
>
> Immediately after this one raise an exception: selector.getColumnFromRow
> (UuidHelper.timeUuidFromBytes(OpecID).toString(), opecfamily, "opecstatus",
> ConsistencyLevel.ONE)
>
> I hope that someone help me understanding it ...
>
>


R: Re: TimeUUID makes me crazy

2010-10-19 Thread cbert...@libero.it
I am using Pelops for Cassandra 0.6.x
The error that raise isInvalidRequestException(why:UUIDs must be exactly 16 
bytes)
For the UUID I am using the UuidHelper class provided. 


Re: TimeUUID makes me crazy

2010-10-18 Thread Aaron Morton
Whats the call stack for the error and what client you using ? Is the error client side or server side? Is there an error in the server side log?My guess is there is something wrong in the way your are creating the UUID for the colum and super column names, rather than for the key. You can use UUID for the key as a string (or byte array in 0.7) so a badly formatted value will not matter. AaronOn 19 Oct, 2010,at 05:25 AM, "cbert...@libero.it"  wrote:I am getting crazy using TimeUUID in cassandra via Java. I've read the FAQ but 
it didn't help.
Can I use a TimeUUID as ROW identifier? (if converted to string)

I have a CF like this and SCF like these:


TIMEUUID OPECID (ROW) {
 phone: 123
 address: street xyz
}


CompareSubcolumnsWith="BytesType" />
String USERID (ROW) {
TIMEUUID OPECID (SuperColumnName)  {
collection of columns;
 }
}

In one situation the TimeUUID is a ROW identifier while in another is the 
SuperColumn name. I get many "UUID must be a 16 byte" when I try to read a data 
that did not give any exception during his save.

at a Time T0 this one works: mutator.writeColumns(UuidHelper.timeUuidFromBytes
(OpecID).toString(), opecfamily, notNull); // (notnull contains a list of 
columns also opecstatus)

Immediately after this one raise an exception: selector.getColumnFromRow
(UuidHelper.timeUuidFromBytes(OpecID).toString(), opecfamily, "opecstatus", 
ConsistencyLevel.ONE)

I hope that someone help me understanding it ..



Re: TimeUUID vs Epoch

2010-08-13 Thread Mark

On 8/13/10 10:01 AM, Sylvain Lebresne wrote:

True, it's more annoying to do because you need to construct a UUID whose time
part is what you need and the rest of the bytes are zeros (excepted for the
version bit that should be one for the UUID to be valid if I remember
correctly).
And usually, UUID generator don't give you that, you'll have to 'do it
yourself',
which is annoying (but not very hard if you look a UUID version 1 layout).

--
Sylvain

On Fri, Aug 13, 2010 at 6:54 PM, Mark  wrote:
   

On 8/13/10 9:38 AM, Sylvain Lebresne wrote:
 

As long as time sorting is involved, you'll the same ordering if you
use Epoch/Long
or TimeUUID. The difference is between the ties. If when you insert
two values at
the exact same time, you want to have only one stay, then you want
LongType.
If however you don't want to merge such inserts, then you want TimeUUID
since
they assure you that even if generated at the exact same time, the key
will be different
(plus if your UUID generator is not too bad, it will give you better
precision than the
epoch/long one).

--
Sylvain

On Fri, Aug 13, 2010 at 6:32 PM, Markwrote:

   

I'm a little confused on when I should be using TimeUUID vs Epoch/Long
when
I want columns ordered by time. I know it sounds strange and the obvious
choice should be TimeUUID but I'm not sure why that would be preferred
over
just using the Epoch stamp?

The pretty much seem to accomplish the same thing however when using
Epoch I
can easily use a start/end range for querying across times. Can this be
accomplished using TimeUUID?

Would someone also explain how TimeUUID is actually sorted? Im confused
on
how its actually compared. Thanks!




 

So long story short you can give a start/end range when using TimeUUID?

For example I am storing a bunch of records keyed by the current date
"20100813". Each column is a TimeUUID. If I wanted to get all the columns
that between some arbitrary time.. say 6am - 9am I can get that?

Using Long I can just use a start of "12817044" and a finish of
"12817152" but Im unsure of how to represent that as a TimeUUID.

 
Thanks for the help. Im using UUID version 1 so Ill have to look into 
how this would be accomplished. Im using the SimpleUUID ruby gem so if 
anyone knows how this is done please chime in :)


Re: TimeUUID vs Epoch

2010-08-13 Thread Sylvain Lebresne
True, it's more annoying to do because you need to construct a UUID whose time
part is what you need and the rest of the bytes are zeros (excepted for the
version bit that should be one for the UUID to be valid if I remember
correctly).
And usually, UUID generator don't give you that, you'll have to 'do it
yourself',
which is annoying (but not very hard if you look a UUID version 1 layout).

--
Sylvain

On Fri, Aug 13, 2010 at 6:54 PM, Mark  wrote:
> On 8/13/10 9:38 AM, Sylvain Lebresne wrote:
>>
>> As long as time sorting is involved, you'll the same ordering if you
>> use Epoch/Long
>> or TimeUUID. The difference is between the ties. If when you insert
>> two values at
>> the exact same time, you want to have only one stay, then you want
>> LongType.
>> If however you don't want to merge such inserts, then you want TimeUUID
>> since
>> they assure you that even if generated at the exact same time, the key
>> will be different
>> (plus if your UUID generator is not too bad, it will give you better
>> precision than the
>> epoch/long one).
>>
>> --
>> Sylvain
>>
>> On Fri, Aug 13, 2010 at 6:32 PM, Mark  wrote:
>>
>>>
>>> I'm a little confused on when I should be using TimeUUID vs Epoch/Long
>>> when
>>> I want columns ordered by time. I know it sounds strange and the obvious
>>> choice should be TimeUUID but I'm not sure why that would be preferred
>>> over
>>> just using the Epoch stamp?
>>>
>>> The pretty much seem to accomplish the same thing however when using
>>> Epoch I
>>> can easily use a start/end range for querying across times. Can this be
>>> accomplished using TimeUUID?
>>>
>>> Would someone also explain how TimeUUID is actually sorted? Im confused
>>> on
>>> how its actually compared. Thanks!
>>>
>>>
>>>
>>>
>
> So long story short you can give a start/end range when using TimeUUID?
>
> For example I am storing a bunch of records keyed by the current date
> "20100813". Each column is a TimeUUID. If I wanted to get all the columns
> that between some arbitrary time.. say 6am - 9am I can get that?
>
> Using Long I can just use a start of "12817044" and a finish of
> "12817152" but Im unsure of how to represent that as a TimeUUID.
>


Re: TimeUUID vs Epoch

2010-08-13 Thread Mark

On 8/13/10 9:38 AM, Sylvain Lebresne wrote:

As long as time sorting is involved, you'll the same ordering if you
use Epoch/Long
or TimeUUID. The difference is between the ties. If when you insert
two values at
the exact same time, you want to have only one stay, then you want LongType.
If however you don't want to merge such inserts, then you want TimeUUID since
they assure you that even if generated at the exact same time, the key
will be different
(plus if your UUID generator is not too bad, it will give you better
precision than the
epoch/long one).

--
Sylvain

On Fri, Aug 13, 2010 at 6:32 PM, Mark  wrote:
   

I'm a little confused on when I should be using TimeUUID vs Epoch/Long when
I want columns ordered by time. I know it sounds strange and the obvious
choice should be TimeUUID but I'm not sure why that would be preferred over
just using the Epoch stamp?

The pretty much seem to accomplish the same thing however when using Epoch I
can easily use a start/end range for querying across times. Can this be
accomplished using TimeUUID?

Would someone also explain how TimeUUID is actually sorted? Im confused on
how its actually compared. Thanks!



 

So long story short you can give a start/end range when using TimeUUID?

For example I am storing a bunch of records keyed by the current date 
"20100813". Each column is a TimeUUID. If I wanted to get all the 
columns that between some arbitrary time.. say 6am - 9am I can get that?


Using Long I can just use a start of "12817044" and a finish of 
"12817152" but Im unsure of how to represent that as a TimeUUID.


Re: TimeUUID vs Epoch

2010-08-13 Thread Sylvain Lebresne
As long as time sorting is involved, you'll the same ordering if you
use Epoch/Long
or TimeUUID. The difference is between the ties. If when you insert
two values at
the exact same time, you want to have only one stay, then you want LongType.
If however you don't want to merge such inserts, then you want TimeUUID since
they assure you that even if generated at the exact same time, the key
will be different
(plus if your UUID generator is not too bad, it will give you better
precision than the
epoch/long one).

--
Sylvain

On Fri, Aug 13, 2010 at 6:32 PM, Mark  wrote:
> I'm a little confused on when I should be using TimeUUID vs Epoch/Long when
> I want columns ordered by time. I know it sounds strange and the obvious
> choice should be TimeUUID but I'm not sure why that would be preferred over
> just using the Epoch stamp?
>
> The pretty much seem to accomplish the same thing however when using Epoch I
> can easily use a start/end range for querying across times. Can this be
> accomplished using TimeUUID?
>
> Would someone also explain how TimeUUID is actually sorted? Im confused on
> how its actually compared. Thanks!
>
>
>


Re: TimeUUID

2010-03-16 Thread Jonathan Ellis
cli is a toy, and can't deal with binary values sanely.

On Tue, Mar 16, 2010 at 3:42 AM, shirish  wrote:
> Thank you, But I intend to insert values using the command line interface
> (cassandra-cli) I was actually asking on how to do this
>
>
>
> On Tue, Mar 16, 2010 at 1:52 PM, Peter Chang  wrote:
>>
>> http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java
>>
>> On Tue, Mar 16, 2010 at 1:09 AM, shirish  wrote:
>>>
>>> Hello,
>>>
>>> Could any one please point me to any resource or explain it how to use
>>> TimeUUID
>>> I have been trying to insert values in Keyspace1.StandardByUUID1. I get
>>> the following
>>>
>>> TimeUUID must be exactly 16 bytes.
>>>
>>> and when i give an exact 16 bytes value I get
>>>
>>> TimeUUID only makes sense with version 1 UUIDs
>>>
>>>
>>>
>>> thank you,
>>>
>>> cheers
>>> shirish
>>>
>>>
>>
>
>


Re: TimeUUID

2010-03-16 Thread shirish
Got it.

Thank you :)


On Tue, Mar 16, 2010 at 2:12 PM, shirish  wrote:

> Thank you, But I intend to insert values using the command line interface
> (cassandra-cli) I was actually asking on how to do this
>
>
>
> On Tue, Mar 16, 2010 at 1:52 PM, Peter Chang  wrote:
>
>> http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java
>>
>>
>> On Tue, Mar 16, 2010 at 1:09 AM, shirish wrote:
>>
>>> Hello,
>>>
>>> Could any one please point me to any resource or explain it how to use
>>> TimeUUID
>>> I have been trying to insert values in Keyspace1.StandardByUUID1. I get
>>> the following
>>>
>>> *TimeUUID must be exactly 16 bytes.
>>>
>>> *and when i give an exact 16 bytes value I get
>>>
>>> *TimeUUID only makes sense with version 1 UUIDs
>>>
>>>
>>>
>>> *thank you,
>>>
>>> cheers
>>> shirish
>>>
>>>
>>>
>>
>


Re: TimeUUID

2010-03-16 Thread shirish
Thank you, But I intend to insert values using the command line interface
(cassandra-cli) I was actually asking on how to do this



On Tue, Mar 16, 2010 at 1:52 PM, Peter Chang  wrote:

> http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java
>
>
> On Tue, Mar 16, 2010 at 1:09 AM, shirish  wrote:
>
>> Hello,
>>
>> Could any one please point me to any resource or explain it how to use
>> TimeUUID
>> I have been trying to insert values in Keyspace1.StandardByUUID1. I get
>> the following
>>
>> *TimeUUID must be exactly 16 bytes.
>>
>> *and when i give an exact 16 bytes value I get
>>
>> *TimeUUID only makes sense with version 1 UUIDs
>>
>>
>>
>> *thank you,
>>
>> cheers
>> shirish
>>
>>
>>
>


Re: TimeUUID

2010-03-16 Thread Peter Chang
http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java

On Tue, Mar 16, 2010 at 1:09 AM, shirish  wrote:

> Hello,
>
> Could any one please point me to any resource or explain it how to use
> TimeUUID
> I have been trying to insert values in Keyspace1.StandardByUUID1. I get the
> following
>
> *TimeUUID must be exactly 16 bytes.
>
> *and when i give an exact 16 bytes value I get
>
> *TimeUUID only makes sense with version 1 UUIDs
>
>
>
> *thank you,
>
> cheers
> shirish
>
>
>