Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 27994 invoked from network); 23 Apr 2010 17:39:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Apr 2010 17:39:35 -0000 Received: (qmail 62345 invoked by uid 500); 23 Apr 2010 15:52:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 62331 invoked by uid 500); 23 Apr 2010 15:52:55 -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 62323 invoked by uid 99); 23 Apr 2010 15:52:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 15:52:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of MJones@imagehawk.com designates 67.63.148.114 as permitted sender) Received: from [67.63.148.114] (HELO ihedge.imagehawk.com) (67.63.148.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 15:52:48 +0000 Received: from ihcomm.ImageHawk.local (192.168.21.2) by mail.imagehawk.com (192.168.21.3) with Microsoft SMTP Server (TLS) id 8.0.813.0; Fri, 23 Apr 2010 10:52:59 -0500 Received: from ihcomm.ImageHawk.local ([192.168.20.2]) by ihcomm.ImageHawk.local ([192.168.20.2]) with mapi; Fri, 23 Apr 2010 10:49:28 -0500 From: Mark Jones To: "user@cassandra.apache.org" Date: Fri, 23 Apr 2010 10:51:56 -0500 Subject: RE: How to insert a row with a TimeUUIDType column in C++ Thread-Topic: How to insert a row with a TimeUUIDType column in C++ Thread-Index: Acri9RrqMcNOkdvYRxa8nfi2BlnGQQAB6y1w Message-ID: References: <1272016790.4661.114.camel@neptune> <1272034714.4661.124.camel@neptune> In-Reply-To: <1272034714.4661.124.camel@neptune> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org std::string strUUID(uuid, 16) will do the right thing for you. -----Original Message----- From: Olivier Rosello [mailto:orosello@corp.free.fr] Sent: Friday, April 23, 2010 9:59 AM To: user@cassandra.apache.org Subject: Re: How to insert a row with a TimeUUIDType column in C++ Le vendredi 23 avril 2010 =E0 08:30 -0500, Jonathan Ellis a =E9crit : > want to look for a C++ library that deals > with UUIDs. Cassandra or Thrift aren't Tank you for the response. That's not the problem for me. The problem is that new_col.column type is string. uint8_t uuid[17]; uuid_generate_time(uuid); // returns a 16 bytes uuid v1 uuid[16] =3D 0; ColumnPath new_col; new_col.__isset.column =3D true; /* this is required! */ new_col.column_family.assign("Incoming"); new_col.column.assign((char *)uuid); client.insert("MyKeyspace", "somekey", new_col, "Random Value", time(NULL), ONE); This works, except that sometimes, there are \0 bytes in uuid, so to column.assign get a string shorter than 16 bytes... My question is : how could I attribute the 16 bytes of uuid to column without using a string ? :) Cheers, Olivier -- Olivier Rosello -+- Free Mobile -+- orosello@corp.free.fr -+- 1231, avenue du mondial 98 - 34000 Montpellier Tel : +33 4 34 67 89 08 -+-