Re: How to insert "Empty" timeuuid by Cql

2016-10-19 Thread Stefania Alborghetti
a-driver-3-0-0- >> released#unset-values >> >> They are only available starting with protocol version 4 however. >> >> On Thu, Oct 20, 2016 at 10:19 AM, Lijun Huang wrote: >> >>> Hi Vladimir, >>> >>> Indeed, that's a little weird, I t

Re: How to insert "Empty" timeuuid by Cql

2016-10-19 Thread Lijun Huang
imir, >> >> Indeed, that's a little weird, I think it is like a empty string: '' but >> is a timeuuid value. We have many such records that inserted by Astyanax >> API, when we select it in cqlsh, it is like as below, note the column4 is >> timeuuid, it

Re: How to insert "Empty" timeuuid by Cql

2016-10-19 Thread Stefania Alborghetti
a little weird, I think it is like a empty string: '' but > is a timeuuid value. We have many such records that inserted by Astyanax > API, when we select it in cqlsh, it is like as below, note the column4 is > timeuuid, it is not null or some value, just "empty". &g

Re: How to insert "Empty" timeuuid by Cql

2016-10-19 Thread Lijun Huang
Hi Vladimir, Indeed, that's a little weird, I think it is like a empty string: '' but is a timeuuid value. We have many such records that inserted by Astyanax API, when we select it in cqlsh, it is like as below, note the column4 is timeuuid, it is not null or some value, jus

Re: How to insert "Empty" timeuuid by Cql

2016-10-19 Thread Vladimir Yudovin
Hi, what does it exactly mean 'empty timeuuid'? UUID takes 16 bytes for storage, so it should be either null, or some value. Do you mean 'zero' UUID? Best regards, Vladimir Yudovin, Winguzone - Hosted Cloud Cassandra Launch your cluster in minutes. On Wed,

How to insert "Empty" timeuuid by Cql

2016-10-19 Thread coderhlj
timeuuid like below, but now we can only insert null timeuuid by cql command but not empty one. Is there any cql function to insert an empty timeuuid like by Astyanax? And this cause a tough problem is that we can not delete the record by specifying the primary key, like: *delete from "Foo" whe

Re: Convert timeuuid in timestamp programmatically

2015-11-16 Thread Marlon Patrick
;> I'm interested in convert a timeuuid already generated in a timestamp, >> similar to dateOf function of the Cassandra, but in Java code. The your >> sugestion is for generate a timeuuid. >> >> 2015-11-15 19:42 GMT-03:00 Dongfeng Lu : >> >>> You can use lo

Re: Convert timeuuid in timestamp programmatically

2015-11-16 Thread Laing, Michael
http://www.tutorialspoint.com/java/util/uuid_timestamp.htm On Mon, Nov 16, 2015 at 7:38 AM, Marlon Patrick wrote: > Hi Donfeng, > > I'm interested in convert a timeuuid already generated in a timestamp, > similar to dateOf function of the Cassandra, but in Java code. The your &

Re: Convert timeuuid in timestamp programmatically

2015-11-16 Thread Marlon Patrick
Hi Donfeng, I'm interested in convert a timeuuid already generated in a timestamp, similar to dateOf function of the Cassandra, but in Java code. The your sugestion is for generate a timeuuid. 2015-11-15 19:42 GMT-03:00 Dongfeng Lu : > You can use long java.util.UUID.timestamp(). &g

Re: Convert timeuuid in timestamp programmatically

2015-11-15 Thread Dongfeng Lu
You can use long java.util.UUID.timestamp(). On Sunday, November 15, 2015 9:20 AM, Marlon Patrick wrote: Hi guys, Is there any way to convert a timeuuid in timestamp (dateOf) programmatically using DataStax java driver? -- Atenciosamente, Marlon Patrick

Convert timeuuid in timestamp programmatically

2015-11-15 Thread Marlon Patrick
Hi guys, Is there any way to convert a timeuuid in timestamp (dateOf) programmatically using DataStax java driver? -- Atenciosamente, Marlon Patrick

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#

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 INS

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

2014-03-28 Thread Andy Atj2
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

RE: filter using timeuuid column type

2013-11-05 Thread John Lumby
> Date: Tue, 5 Nov 2013 23:20:37 +0100 > Subject: Re: filter using timeuuid column type > From: t...@drillster.com > To: user@cassandra.apache.org > > This is because time2 is not part of the primary key. Only the primary > key column(s

Re: filter using timeuuid column type

2013-11-05 Thread Tom van den Berge
Nov 4, 2013 at 11:29 AM, Turi, Ferenc (GE Power & Water, Non-GE) < ferenc.t...@ge.com> wrote: > Hi, > > > > Is it possible to filter records by using timeuuid column types in case > the column is not part of the primary key? > > > > I tried the followings: &

filter using timeuuid column type

2013-11-04 Thread Turi, Ferenc (GE Power & Water, Non-GE)
Hi, Is it possible to filter records by using timeuuid column types in case the column is not part of the primary key? I tried the followings: [cqlsh 3.1.2 | Cassandra 1.2.10.1 | CQL spec 3.0.0 | Thrift protocol 19.36.0] CREATE TABLE timeuuid_test2( row_key text, time timeuuid, time2 timeuuid

Re: paging through a table with timeuuid primary key

2013-10-01 Thread Jimmy Lin
ok found out the problem.. i was using something like: select * from log where token(mykey) > token(maxTimeuuid(x)) limit 100; instead I should just simply use select * from log where token(mykey) > token(key_from_last_result) limit 100; the fake timeuuid although represent the tim

Re: paging through a table with timeuuid primary key

2013-10-01 Thread Jimmy Lin
use a timeuuid, because the ordering that the partitioner enforce will not be one that is meaningful (due to the timeuuid layout). So can't ues token on a timeuuid key? On Tue, Oct 1, 2013 at 9:18 AM, Jan Algermissen wrote: > Maybe you are hitting the problem that your 'p

Re: paging through a table with timeuuid primary key

2013-10-01 Thread Jan Algermissen
with 1.2 for now for a while. > > So I am looking for the old fashion way to do the pagination correctly. > > I think i follow most of the articles on how to paging through a table, but > maybe have some silly gap that don't give me the correct behavior or it is > tim

Re: paging through a table with timeuuid primary key

2013-10-01 Thread Jimmy Lin
unfortunately, i have to stick with 1.2 for now for a while. So I am looking for the old fashion way to do the pagination correctly. I think i follow most of the articles on how to paging through a table, but maybe have some silly gap that don't give me the correct behavior or it is timeuui

Re: paging through a table with timeuuid primary key

2013-10-01 Thread David Ward
e a table like the following: > > > > CREATE TABLE log ( > > mykey timeuuid, > > type text, > > msg text, > > primary key(mykey, type) > > ); > > > > I want to page through all the results from the table using > > Have you considered the

Re: paging through a table with timeuuid primary key

2013-10-01 Thread Jan Algermissen
Jimmy, On 01.10.2013, at 17:26, Jimmy Lin wrote: > i have a table like the following: > > CREATE TABLE log ( > mykey timeuuid, > type text, > msg text, > primary key(mykey, type) > ); > > I want to page through all the results from the table using Have y

paging through a table with timeuuid primary key

2013-10-01 Thread Jimmy Lin
i have a table like the following: CREATE TABLE log ( mykey timeuuid, type text, msg text, primary key(mykey, type) ); I want to page through all the results from the table using select * from log where token(mykey) > token(maxTimeuuid(x)) limit 100; (where xxx is 0 for the first qu

Re: cql throw error when secondary timeuuid field use dateof()

2013-08-12 Thread Aaron Morton
- > 2013-08-12 02:46:41+0200 > > Thanks, > Saravanan > > From: Saravanan > To: "user@cassandra.apache.org" > Sent: Monday, August 12, 2013 3:13 AM > Subject: cql throw error when secondary timeuuid field use dateof() > >

Re: cql throw error when secondary timeuuid field use dateof()

2013-08-11 Thread Saravanan
ow error when secondary timeuuid field use dateof() Hi, I am trying to create a comments table. Which has primary key timeuuid and secondary field which also has timeuuid. when I do query using funtion dateof() it throws error and i needed to reconnect again. But that query don't work at

cql throw error when secondary timeuuid field use dateof()

2013-08-11 Thread Saravanan
Hi, I am trying to create a comments table. Which has primary key timeuuid and secondary field which also has timeuuid. when I do query using funtion dateof() it throws error and i needed to reconnect again. But that query don't work at all. cqlsh:demodb> select id,dateof(search_da

Re: timeuuid and cql3 query

2013-06-21 Thread Ryan, Brent
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 wit

Re: timeuuid and cql3 query

2013-06-21 Thread Eric Stevens
27;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 cluste

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 wid

Re: timeuuid and cql3 query

2013-06-19 Thread Sylvain Lebresne
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,

Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
n 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_se

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

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 "ByteOr

Re: timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
to: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 th

Re: timeuuid and cql3 query

2013-06-19 Thread Sylvain Lebresne
gt; 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,

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 ( >

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

timeuuid and cql3 query

2013-06-19 Thread Ryan, Brent
s as it seems like a bug. Here's the table: CREATE TABLE count3 ( counter text, ts timeuuid, key1 text, value int, PRIMARY KEY ((counter, ts)) ) It has data like so: cqlsh:Statistics> select counter,dateof(ts),key1,value from count3; counter | dateof(ts) | key1 | va

Re: TimeUUID Order Partitioner

2013-03-28 Thread Carlos Pérez Miguel
ng 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 > t

Re: TimeUUID Order Partitioner

2013-03-27 Thread aaron morton
sandra 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-72ad6af0e

Re: TimeUUID Order Partitioner

2013-03-27 Thread Carlos Pérez Miguel
"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 wi

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: > &

Re: TimeUUID Order Partitioner

2013-03-27 Thread Lanny Ripple
Partitioner<> >> >> Usual disclaimer that ordered partitioners cause problems with load >> balancing. >> >> Hope that helps. >> >> - >> Aaron Morton >> Freelance Cassandra Consultant >> New Zealand >> >&

Re: TimeUUID Order Partitioner

2013-03-26 Thread aaron morton
; 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, >> >>

Re: TimeUUID Order Partitioner

2013-03-25 Thread Carlos Pérez Miguel
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, > >

Re: TimeUUID Order Partitioner

2013-03-24 Thread aaron morton
s 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

TimeUUID Order Partitioner

2013-03-24 Thread Carlos Pérez Miguel
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

Re: TimeUUID

2012-02-28 Thread Dave Brosius
: 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

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 (

Re: TimeUUID

2012-02-28 Thread Tamar Fraenkel
; 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 > > > &

Re: TimeUUID

2012-02-28 Thread aaron morton
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 reada

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"

TimeUUID

2012-02-27 Thread 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 reada

Re: range slice with TimeUUID column names

2011-11-13 Thread Mick Semb Wever
On Thu, 2011-11-10 at 22:35 -0800, footh wrote: > > UUID startId = new UUID(UUIDGen.createTime(start), > UUIDGen.getClockSeqAndNode()); > UUID finishId = new UUID(UUIDGen.createTime(finish), > UUIDGen.getClockSeqAndNode()); You have got comparator_type = TimeUUIDType ? ~mck -- "The old law

Re: range slice with TimeUUID column names

2011-11-11 Thread footh
any results. -- View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/range-slice-with-TimeUUID-column-names-tp6984467p6985963.html Sent from the cassandra-u...@incubator.apache.org mailing list archive at Nabble.com.

range slice with TimeUUID column names

2011-11-10 Thread footh
I am using Hector to do a range query for a column family that uses TimeUUIDs as column names.  However, I'm not sure how to create the "range".  I figured I'd create some UUIDs using the com.eaio.uuid library with timestamps for the range I was interested in.  When trying this, I don't get any

Re: When does it make sense to use TimeUUID?

2011-06-15 Thread chovatia jaydeep
Hi Sameer, One example is, store all the tweets for a given user in a Column Family, where row key is user name/user id and column name is of TimeUUID type that  represents tweet arrival time. User would generally like to see the tweets sorted based on its arrival time. So TimeUUID will help

Re: When does it make sense to use TimeUUID?

2011-06-14 Thread Sameer Farooqui
Cool, thanks for the Clarification, Kevin. On Tue, Jun 14, 2011 at 5:43 PM, Kevin wrote: > Correction. TimeUUID comparisons FIRST compare the time-based portion, > then go on to the other portion. > > > On Tue, Jun 14, 2011 at 5:41 PM, Kevin wrote: > TimeUUIDs should be

RE: When does it make sense to use TimeUUID?

2011-06-14 Thread Kevin
Correction. TimeUUID comparisons FIRST compare the time-based portion, then go on to the other portion. From: Sameer Farooqui [mailto:cassandral...@gmail.com] Sent: Tuesday, June 14, 2011 8:16 PM To: user@cassandra.apache.org Subject: When does it make sense to use TimeUUID? I would like

RE: When does it make sense to use TimeUUID?

2011-06-14 Thread Kevin
TimeUUIDs should be used for data that is time-based and requires uniqueness. TimeUUID comparisons compare the time-based portion of the UUID. So no, you do not need to know the MAC addresses. In fact, for languages that cannot get to that low of a level to access a MAC address (like Java

When does it make sense to use TimeUUID?

2011-06-14 Thread Sameer Farooqui
the MAC of the generating computer in order to do a column slice, right? When does it make sense to use TimeUUID vs just a time string like 20110130141500 and comparator type UTF8? - Sameer

Re: Sorting in time order without using TimeUUID type column names

2011-02-05 Thread Bill Speirs
You can specify reverse order through the API when you slice the cols so I don't think you need to write a comparator. Bill- On Feb 4, 2011 9:45 PM, "Aditya Narayan" wrote: Thanks Aaron, Yes I can put the column names without using the userId in the timeline row, and when I want to retrieve the

Re: Sorting in time order without using TimeUUID type column names

2011-02-04 Thread Aditya Narayan
heir due time.) >>> >>> *The* solution is write a custom comparator. >>> Have a look at http://www.datastax.com/docs/0.7/data_model/column_families >>> and http://www.sodeso.nl/?p=421 for instance. >>> >>> As a side note, the fact that the

Re: Sorting in time order without using TimeUUID type column names

2011-02-04 Thread aaron morton
order would be that much of a problem, since you can always >> do slice queries in reversed order. But even then, asciiType is not a very >> satisfying solution as you would have to be careful about the padding of >> your >> timestamp for it to work correctly. So again, custom comparator is the way >> to go. >>> >>> Basically I am trying to avoid 16 bytes long timeUUID first because >>> they are too long and the above defined key pattern is guaranteeing me >>> a unique key/Id for the reminder row always. >>> >>> >>> Thanks >>> Aditya Narayan >> >> -- >> Sylvain

Re: Sorting in time order without using TimeUUID type column names

2011-02-03 Thread Aditya Narayan
tion as you would have to be careful about the padding of > your > timestamp for it to work correctly. So again, custom comparator is the way > to go. >> >> Basically I am trying to avoid 16 bytes long timeUUID first because >> they are too long and the above defined key pattern is guaranteeing me >> a unique key/Id for the reminder row always. >> >> >> Thanks >> Aditya Narayan > > -- > Sylvain

Re: Sorting in time order without using TimeUUID type column names

2011-02-03 Thread Aditya Narayan
you would have to be careful about the padding of > your > timestamp for it to work correctly. So again, custom comparator is the way > to go. >> >> Basically I am trying to avoid 16 bytes long timeUUID first because >> they are too long and the above defined key pattern is guaranteeing me >> a unique key/Id for the reminder row always. >> >> >> Thanks >> Aditya Narayan > > -- > Sylvain

Re: Sorting in time order without using TimeUUID type column names

2011-02-03 Thread Sylvain Lebresne
o slice queries in reversed order. But even then, asciiType is not a very satisfying solution as you would have to be careful about the padding of your timestamp for it to work correctly. So again, custom comparator is the way to go. Basically I am trying to avoid 16 bytes long timeUUID first becau

Sorting in time order without using TimeUUID type column names

2011-02-03 Thread Aditya Narayan
timeline in the order of their due time.) Basically I am trying to avoid 16 bytes long timeUUID first because they are too long and the above defined key pattern is guaranteeing me a unique key/Id for the reminder row always. Thanks Aditya Narayan

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 t

TimeUUID question

2011-01-07 Thread Arijit Mukherjee
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

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-05 Thread Roshan Dawrani
Hi Patricio, Some thoughts inline. 2011/1/6 Patricio Echagüe > Roshan, the first 64 bits does contain the version. The method > UUID.timestamp() indeed takes it out before returning. You are right in that > point. I based my comment on the UUID spec. > I know 64 bits have the version, but time

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-05 Thread Patricio Echagüe
Roshan, the first 64 bits does contain the version. The method UUID.timestamp() indeed takes it out before returning. You are right in that point. I based my comment on the UUID spec. What I am not convinced is that the framework should provide support to create an almost identical UUID where only

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-05 Thread Roshan Dawrani
Hi Patricio, Thanks for your comment. Replying inline. 2011/1/5 Patricio Echagüe > Roshan, just a comment in your solution. The time returned is not a simple > long. It also contains some bits indicating the version. I don't think so. The version bits from the most significant 64 bits of the

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-05 Thread Patricio Echagüe
>> === > >>> > >>> I have to create the timestamp() equivalent of my time UUIDs so I can > >>> send it to my UI client, for which it will be simpler to compare "long" > >>> timestamp tha

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-05 Thread Nate McCall
t; send it to my UI client, for which it will be simpler to compare "long" >>> timestamp than comparing UUIDs. Then for the "long" timestamp chosen by the >>> client, I need to re-create the equivalent time UUID and go and filter the >>> data from

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Roshan Dawrani
ss.com/ >> Twitter: @roshandawrani <http://twitter.com/roshandawrani> >> Skype: roshandawrani >> >> On Wed, Jan 5, 2011 at 1:32 AM, Victor Kabdebon < >> victor.kabde...@gmail.com> wrote: >> >>> Hi Roshan, >>> >>> Sorry I

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Roshan Dawrani
lt;http://twitter.com/roshandawrani> > Skype: roshandawrani > > On Wed, Jan 5, 2011 at 1:32 AM, Victor Kabdebon > wrote: > >> Hi Roshan, >> >> Sorry I misunderstood your problem.It is weird that it doesn't work, it >> works for me... >>

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Roshan Dawrani
ndawrani> Skype: roshandawrani On Wed, Jan 5, 2011 at 1:32 AM, Victor Kabdebon wrote: > Hi Roshan, > > Sorry I misunderstood your problem.It is weird that it doesn't work, it > works for me... > As Patricio pointed out use hector "standard" way of creating TimeUUID

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Patricio Echagüe
In Hector framework, take a look at TimeUUIDUtils.java You can create a UUID using TimeUUIDUtils.getTimeUUID(long time); or TimeUUIDUtils.getTimeUUID(ClockResolution clock) and later on, TimeUUIDUtils.getTimeFromUUID(..) or just UUID.timestamp(); There are some example in TimeUUIDUtilsTest.jav

Re: Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Roshan Dawrani
Hello Victor, It is actually not that I need the 2 UUIDs to be exactly same - they need to be same timestamp wise. So, what I need is to extract the timestamp portion from a time UUID (say, U1) and then later in the cycle, use the same long timestamp value to re-create a UUID (say, U2) that is eq

Converting a TimeUUID to a long (timestamp) and vice-versa

2011-01-04 Thread Roshan Dawrani
Hi, I am having a little difficulty converting a time UUID to its timestamp equivalent and back. Can someone please help? Here is what I am trying. Is it not the right way to do it? === UUID someUUID = TimeUUIDUtils.getUniqueTimeUUID

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Roshan Dawrani
;>> This silly question is retrieved back with apology. There couldn't be >>>>> anything easier to handle at the application level. >>>>> >>>>> rgds, >>>>> Roshan >>>>> >>>>> >>>>> On Mon,

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Tyler Hobbs
2010 at 6:12 AM, Roshan Dawrani >> > wrote: >>> >>>> This silly question is retrieved back with apology. There couldn't be >>>> anything easier to handle at the application level. >>>> >>>> rgds, >>>> Roshan >>&g

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Narendra Sharma
rieved back with apology. There couldn't be >>> anything easier to handle at the application level. >>> >>> rgds, >>> Roshan >>> >>> >>> On Mon, Dec 27, 2010 at 9:04 AM, Roshan Dawrani >> > wrote: >>> >>>

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Roshan Dawrani
t; On Mon, Dec 27, 2010 at 9:04 AM, Roshan Dawrani >> wrote: >> >>> Hi, >>> I have the following 2 column families - one being used to store full >>> rows for an entity and other is an index table for having the TimeUUID >>> sorted row keys. >>

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Narendra Sharma
x27;t be > anything easier to handle at the application level. > > rgds, > Roshan > > > On Mon, Dec 27, 2010 at 9:04 AM, Roshan Dawrani > wrote: > >> Hi, >> I have the following 2 column families - one being used to store full rows >> for an entity and other

Re: I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-27 Thread Roshan Dawrani
an entity and other is an index table for having the TimeUUID sorted row > keys. > > I am able to query the TimeUUID columns under the super column fine. But > now I need to go to main CF and get the data and I want the rows in the same > time order as the keys. > > I am using M

Re: Retrieving TimeUUID sub-columns in reverse order

2010-12-26 Thread Jonathan Ellis
==== >> > >> > And this is the structure of the SCF: >> > ==== >> > "key1" : >> >   "superCol1": >> >      

Re: Retrieving TimeUUID sub-columns in reverse order

2010-12-26 Thread Roshan Dawrani
(ComparatorType.TIMEUUIDTYPE) > > > > > > And this is the structure of the SCF: > > ==== > > "key1" : > > "supe

Re: Retrieving TimeUUID sub-columns in reverse order

2010-12-26 Thread Jonathan Ellis
ype.SUPER) > cfDef.setSubComparatorType(ComparatorType.TIMEUUIDTYPE) > > > And this is the structure of the SCF: > > "key1" : >

I have TimeUUID sorted keys. Can I get the range query return rows in the same order as sorted keys?

2010-12-26 Thread Roshan Dawrani
Hi, I have the following 2 column families - one being used to store full rows for an entity and other is an index table for having the TimeUUID sorted row keys. I am able to query the TimeUUID columns under the super column fine. But now I need to go to main CF and get the data and I want the

Re: Retrieving TimeUUID sub-columns in reverse order

2010-12-26 Thread Roshan Dawrani
Type.SUPER) cfDef.setSubComparatorType(ComparatorType.TIMEUUIDTYPE) And this is the structure of the SCF: "key1" : "superCol1":

Re: Retrieving TimeUUID sub-columns in reverse order

2010-12-26 Thread Ran Tavory
Roshan, in cassandra.yaml did you define compare_subcolumns_with for the SCF? The subcolumn names are the timeuuid, not the subcolumn values, right? On Sun, Dec 26, 2010 at 9:14 AM, Roshan Dawrani wrote: > Hi, > > I have a super ColumnFamily that has a few super columns, with each h

Retrieving TimeUUID sub-columns in reverse order

2010-12-25 Thread Roshan Dawrani
Hi, I have a super ColumnFamily that has a few super columns, with each having a growing list of sub-columns where column name is a TimeUUID, so the sub-columns get stored chronologically (oldest to newest) When I retrieve this data, can I somehow retrieve the sub-columns in reverse order

strange issue with timeUUID columns

2010-12-22 Thread Roland Gude
Hi, I am experiencing a strange issue when using TimeUUID as columnkeys. I am storing a number of events with timeUUId as key in a row. Later I try to query for a slice of that row with a given lower bound timeUUID and upperBoundTimeUUID (constructed as described in the wiki) If I inserted the

Re: TimeUUID makes me crazy

2010-10-19 Thread Sylvain Lebresne
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. &

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
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

TimeUUID makes me crazy

2010-10-18 Thread cbert...@libero.it
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

  1   2   >