Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 83503 invoked from network); 8 Apr 2011 21:44:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2011 21:44:20 -0000 Received: (qmail 60841 invoked by uid 500); 8 Apr 2011 21:44:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 60813 invoked by uid 500); 8 Apr 2011 21:44:18 -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 60805 invoked by uid 99); 8 Apr 2011 21:44:18 -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 21:44:18 +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 21:44:13 +0000 Received: by vxg33 with SMTP id 33so3678754vxg.31 for ; Fri, 08 Apr 2011 14:43:52 -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=agaWqnXauQoQA8zGIAlY5Esaz3zbrZN18AqPVdVWsIU=; b=g2pGJVAxn40ulqBllQxLA7We4Heorvi932HWVzMRbDWy9vSOF9ZBWDR7tZvEr77reK s7nMWidneh+gdvBOAf/bgIHedJ5rDt5i9RwAQ2lfXWIEsDsg2JGXVh1TWw+rs8rDjpWa 1NgJexW2KBUXwNL1vTISqbmJJUSrjHBZtWZsE= 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=LTOxA5ZWvwBfBnm+j2AApJfeiDrZ9v/5W4e8CUAkPYEgulzcwi9iVKgFLyQovN0Y1q +Y0rTpJ9SzADh4CyNigXiRO50Sz7wapvyzjTRUgea9bREWnjesoBt7QAcy3HJvmkAsFj D3ogWTekckenbGNrrcsNlRlgNrK8PNdLgmBuM= MIME-Version: 1.0 Received: by 10.52.98.135 with SMTP id ei7mr682476vdb.229.1302299031968; Fri, 08 Apr 2011 14:43:51 -0700 (PDT) Received: by 10.220.99.67 with HTTP; Fri, 8 Apr 2011 14:43:51 -0700 (PDT) In-Reply-To: References: Date: Sat, 9 Apr 2011 00:43:51 +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=20cf307cfc68311af204a06f1fd6 --20cf307cfc68311af204a06f1fd6 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: quoted-printable 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 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 : > > 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 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> 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. > --20cf307cfc68311af204a06f1fd6 Content-Type: text/html; charset=KOI8-U Content-Transfer-Encoding: quoted-printable
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 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 <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 DaoHelper.getStr= ingCols(site);
> =9AMutator<UUID> mutator =3D HFactory.createMutator(keyspace, > UUIDSerializer.get());
> =9Afor (HColumn<?, ?> column : columns) {
> =9A=9A =9A =9A =9A =9Amutator.addInsertion(timeUUID, columnFamilyName,= column);
> =9A}
> I am new in Cassandra and i really want to understand how it works.So = please
> help me.

--20cf307cfc68311af204a06f1fd6--