From user-return-15569-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Fri Apr 08 22:32:32 2011 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 45061 invoked from network); 8 Apr 2011 22:32:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2011 22:32:32 -0000 Received: (qmail 11027 invoked by uid 500); 8 Apr 2011 22:32:30 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 11006 invoked by uid 500); 8 Apr 2011 22:32:30 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 10998 invoked by uid 99); 8 Apr 2011 22:32:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 22:32:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sylkaalex@gmail.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vx0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 22:32:25 +0000 Received: by vxg33 with SMTP id 33so3702609vxg.31 for ; Fri, 08 Apr 2011 15:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BVslEwgyXbmfa6T8jvhmcYHOOYqS/5ZXatnW62azqLY=; b=mHo33H8yApsoIgVahZJxgZGgpFo4oGHNl/98O0QWmGHCAIAqi17X5jim0IDoojNEA6 P7bLPsOWvF+xOdnlB1lkFgqdaf+lHf+QJS98eWYEY1zjrJgJWpi2FJ2KC3BTG0xUJTUp hUb1mPOzpfke6dxHOmt2ox2NqqRcGPz4i8aHc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kSO9HqFCaJHSu8PWMk1pz2gOUUDMhJZCYihJQ1GzPrVEvS7Kllo/04KGhL52s0qayD 9fVldAkyQduM2bK8O8Um2Akcq3V7g/vcyLyJgxi5Fr4la0VIPhOBE+t8r9WNm+JqEGNy +2J+PKsd1Z5r45p1amSXQz1zySZdLjFIYo4UU= MIME-Version: 1.0 Received: by 10.52.18.11 with SMTP id s11mr4045813vdd.269.1302301924458; Fri, 08 Apr 2011 15:32:04 -0700 (PDT) Received: by 10.220.99.67 with HTTP; Fri, 8 Apr 2011 15:32:04 -0700 (PDT) In-Reply-To: References: Date: Sat, 9 Apr 2011 01:32:04 +0300 Message-ID: Subject: Re: Problem with UUID From: =?KOI8-U?B?78zFy9PBzsTSIPPJzMvB?= To: Ed Anuff Cc: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf3054a1139901bd04a06fcb75 --20cf3054a1139901bd04a06fcb75 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: quoted-printable Thanks that you try to help me, but i still get error message InvalidRequestException(why:TimeUUID should be 16 or 0 bytes (3)) This code UUID timeUUID =3D getTimeUUID(); doesn't solve my problem. 9 =CB=D7=A6=D4=CE=D1 2011 =D2. 01:16 Ed Anuff =CE=C1=D0=C9= =D3=C1=D7: > Oops, I should have been more clear. You have this code: > > UUID timeUUID =3D getTimeUUID().randomUUID(); > > what you need is this code: > > UUID timeUUID =3D getTimeUUID(); > > What I meant by not understanding the error message was that I thought > the TimeUUIDType gave a different error message than the one your're > seeing when you put a random UUID into a time UUID CF. Try the above > fix and see if it makes the problem go away. > > Ed > > 2011/4/8 Patrick Julien : > > I think this is what you're looking for > > > > http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java > > > > 2011/4/8 =EF=CC=C5=CB=D3=C1=CE=C4=D2 =F3=C9=CC=CB=C1 : > >> > >> Then how i can generate correct time UUID key in java ? > >> > >> 8 =CB=D7=A6=D4=CE=D1 2011 =D2. 22:58 Ed Anuff =CE=C1=D0= =C9=D3=C1=D7: > >>> > >>> Hmm, if you're really doing this, you're not getting a time uuid: > >>> > >>> UUID timeUUID =3D getTimeUUID().randomUUID(); > >>> > >>> That call to randomUUID() is invoking the static randomUUID() method > >>> in java.util.UUID which is generating a non-time random uuid. I'm no= t > >>> sure why you're getting that error message though. > >>> > >>> Ed > >>> > >>> 2011/4/8 =EF=CC=C5=CB=D3=C1=CE=C4=D2 =F3=C9=CC=CB=C1 : > >>> > Hi everyone, > >>> > I have column family called site sorted > >>> > by org.apache.cassandra.db.marshal.TimeUUIDType. > >>> > When I try to save some data using hector i get next > >>> > message InvalidRequestException(why:TimeUUID should be 16 or 0 byte= s > >>> > (3)). > >>> > My Cassandra version 0.7.0 > >>> > > >>> > This is snippets of my code: > >>> > public static java.util.UUID getTimeUUID() { > >>> > return java.util.UUID.fromString(new > com.eaio.uuid.UUID().toString()); > >>> > } > >>> > UUID timeUUID =3D getTimeUUID().randomUUID(); > >>> > List> columns =3D > DaoHelper.getStringCols(site); > >>> > Mutator mutator =3D HFactory.createMutator(keyspace, > >>> > UUIDSerializer.get()); > >>> > for (HColumn column : columns) { > >>> > mutator.addInsertion(timeUUID, columnFamilyName, column); > >>> > } > >>> > I am new in Cassandra and i really want to understand how it works.= So > >>> > please > >>> > help me. > >> > >> > > > --20cf3054a1139901bd04a06fcb75 Content-Type: text/html; charset=KOI8-U Content-Transfer-Encoding: quoted-printable Thanks that you try to help me,=9A but i still get error message InvalidReq= uestException(why:TimeUUID should be 16 or 0 bytes (3))
This code UUID t= imeUUID =3D getTimeUUID(); doesn't solve my problem.

9 =CB=D7=A6=D4=CE=D1 2011 =D2. 01:16 Ed Anuff <ed@anuff.com> =CE=C1=D0=C9=D3=C1=D7:=
Oops, I should have been more clear. =9AYou have this code:

UUID timeUUID =3D getTimeUUID().randomUUID();

what you need is this code:

UUID timeUUID =3D getTimeUUID();

What I meant by not understanding the error message was that I thought
the TimeUUIDType gave a different error message than the one your're seeing when you put a random UUID into a time UUID CF. =9ATry the above
fix and see if it makes the problem go away.

Ed

2011/4/8 Patrick Julien <pjulien@gm= ail.com>:
> I think this is what you're look= ing for
>
> http://wiki.apache.org/cassandra/FAQ#working_wit= h_timeuuid_in_java
>
> 2011/4/8 =EF=CC=C5=CB=D3=C1=CE=C4=D2 =F3=C9=CC=CB=C1 <sylkaalex@gmail.com>:
>>
>> Then how i can generate correct time UUID key in java ?
>>
>> 8 =CB=D7=A6=D4=CE=D1 2011 =D2. 22:58 Ed Anuff <ed@anuff.com> =CE=C1=D0=C9=D3=C1=D7:
>>>
>>> Hmm, if you're really doing this, you're not getting a= time uuid:
>>>
>>> =9AUUID timeUUID =3D getTimeUUID().randomUUID();
>>>
>>> That call to randomUUID() is invoking the static randomUUID() = method
>>> in java.util.UUID which is generating a non-time random uuid. = =9AI'm not
>>> sure why you're getting that error message though.
>>>
>>> Ed
>>>
>>> 2011/4/8 =EF=CC=C5=CB=D3=C1=CE=C4=D2 =F3=C9=CC=CB=C1 <sylkaalex@gmail.com>:
>>> > Hi everyone,
>>> > I have column family called site sorted
>>> > by=9Aorg.apache.cassandra.db.marshal.TimeUUIDType.
>>> > When I try to save some data using hector i get next
>>> > message=9AInvalidRequestException(why:TimeUUID should be = 16 or 0 bytes
>>> > (3)).
>>> > My Cassandra version 0.7.0
>>> >
>>> > This is snippets of my code:
>>> > public static java.util.UUID getTimeUUID() {
>>> > return java.util.UUID.fromString(new com.eaio.uuid.UUID()= .toString());
>>> > }
>>> > UUID timeUUID =3D getTimeUUID().randomUUID();
>>> > List<HColumn<String, String>> columns =3D Dao= Helper.getStringCols(site);
>>> > =9AMutator<UUID> mutator =3D HFactory.createMutator= (keyspace,
>>> > UUIDSerializer.get());
>>> > =9Afor (HColumn<?, ?> column : columns) {
>>> > =9A=9A =9A =9A =9A =9Amutator.addInsertion(timeUUID, colu= mnFamilyName, column);
>>> > =9A}
>>> > I am new in Cassandra and i really want to understand how= it works.So
>>> > please
>>> > help me.
>>
>>
>

--20cf3054a1139901bd04a06fcb75--