Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 58743 invoked from network); 6 Apr 2010 16:36:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Apr 2010 16:36:49 -0000 Received: (qmail 42436 invoked by uid 500); 6 Apr 2010 16:36:48 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 42383 invoked by uid 500); 6 Apr 2010 16:36:48 -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 42375 invoked by uid 99); 6 Apr 2010 16:36:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 16:36:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [76.13.13.79] (HELO n2c.bullet.mail.ac4.yahoo.com) (76.13.13.79) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 06 Apr 2010 16:36:38 +0000 Received: from [74.6.228.94] by n2.bullet.mail.ac4.yahoo.com with NNFMP; 06 Apr 2010 16:36:16 -0000 Received: from [67.195.9.82] by t1.bullet.mail.ac4.yahoo.com with NNFMP; 06 Apr 2010 16:36:16 -0000 Received: from [98.137.27.210] by t2.bullet.mail.gq1.yahoo.com with NNFMP; 06 Apr 2010 16:36:16 -0000 Received: from [127.0.0.1] by omp120.mail.gq1.yahoo.com with NNFMP; 06 Apr 2010 16:36:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 721959.27853.bm@omp120.mail.gq1.yahoo.com Received: (qmail 38436 invoked by uid 60001); 6 Apr 2010 16:36:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1270571776; bh=HysVFAprz9ew/+ZCJBRmxriFTGinnrOlwJSQONyOm1A=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=2JkihiH7asNLg1+5iY/Lk3wlRVicOCc67eXzDFhYz8HaftMp3tXe9uh3U17XRekcxkhPQPHNdsPdS3HgvJhZxc9187Bojci6OeGxgSXfm4YuUJihfYkPeORt52hfyrIsH99pNatC/YKx4syO6zwIj39zMAN5X8sbk70AO27yiCc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=cU2cJ0/DNKXfmk3iOD+9wicWqlk1v2gjQEgf57lXtSUd81b6jALPCtwrM2BJ9y7uKYQLK4UjUVdCSWtxROfYFhuyk+h/RQtri1ceb+jhUw2lhHVzZVbZd3LvW+v/oGSq3d60ghxvAJxA3lutS0uIABOKmpcrwZasv8uhxWrVSF4=; Message-ID: <602969.37492.qm@web110614.mail.gq1.yahoo.com> X-YMail-OSG: V9BGXcwVM1mAtRi3sDL06Osj6Quof85s3BYrAcvHUO7FwBJ 1eFN4vZydd8zZTHfW02v2zlrTWGaRKvkJdc_vCsXYNopw8E8x40umNqoHnSE yYZN74BvHIM7hG6NUKxIyODSLZ2dxaYBeH3HSEUYsdpckLbbuQTtnk3cnA1T oSrFSCecyCSGgszEW1nEd7APeLjk_nWzg_PEU846wOX.2oosLKZSC7kd_8an ZB4cGrSePQ3OjZ4Sq.Zx2BUpv_Q4O7qx.c2RcG5GN1lq_TLRelenmBBttNL4 kGtCZ4s_x6VSyJud3.ghMFJq4OmzIyAPslfLP2qGqaFnSMfsltF2Chtw- Received: from [216.205.224.64] by web110614.mail.gq1.yahoo.com via HTTP; Tue, 06 Apr 2010 09:36:16 PDT X-Mailer: YahooMailRC/324.3 YahooMailWebService/0.8.100.260964 Date: Tue, 6 Apr 2010 09:36:16 -0700 (PDT) From: Chris Beaumont Reply-To: Chris Beaumont Subject: odd problem retrieving binary values using C++ To: user@cassandra.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Hi all... I am having a pretty tough time retrieving binary values out of my DB... I am using cassandra 0.5.1 on Centos 5.4 with java 1.6.0-19 Here is the simple test I am trying to run in C++ /* snip initialization */ { transport->open(); ColumnPath new_col; new_col.__isset.column = true; /* this is required! */ new_col.column_family.assign("Standard2"); new_col.super_column.assign(""); new_col.column.assign("testing"); char *data_cstr="this\0 is\0 data!"; std::string data; data.assign(data_cstr, 15); printf("Data '%s' has length %lu\n", data.c_str(), data.length()); // This properly returns 15 client.insert("Keyspace1","newone",new_col,data,55,ONE); ColumnOrSuperColumn ret_val; client.get(ret_val,"Keyspace1","newone",new_col,ONE); printf("Column name retrieved is: %s\n", ret_val.column.name.c_str()); printf("Value in column retrieved is: %s\n", ret_val.column.value.c_str()); // This only ever returns 'this' (i.e., everything before the first \0) // I understand null termination in %s... see below printf("Value has length %lu\n", ret_val.column.value.length()); // and this gives me 4 transport->close(); } /* snip the rest too! */ Am I missing something major in proceeding this way? I have tried GDB and eventually all I get back is a string containing 'this'. Here is the dumped content of Keyspace1/Standard2-1-Data.db... od -c /u01/cassandra/data/Keyspace1/Standard2-1-Data.db 0000000 \0 - 1 1 5 5 7 1 6 5 7 6 3 3 4 2 0000020 7 0 7 9 0 1 4 5 2 8 3 5 8 0 2 3 0000040 7 5 1 9 9 5 2 8 : n e w o n e \0 0000060 \0 \0 264 \0 \0 \0 U \0 \0 \0 003 254 355 \0 005 s 0000100 r \0 020 j a v a . u t i l . B i t 0000120 S e t n 375 210 ~ 9 4 253 ! 003 \0 001 [ \0 0000140 004 b i t s t \0 002 [ J x p u r \0 002 0000160 [ J x 004 265 022 261 u 223 002 \0 \0 x p \0 0000200 \0 \0 001 \0 202 \b \0 \0 \0 \0 \0 x \0 \0 \0 " 0000220 \0 \a t e s t i n g \0 \a t e s t i 0000240 n g \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000260 \0 % 200 \0 \0 \0 200 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000300 \0 001 \0 \a t e s t i n g \0 \0 \0 \0 \0 0000320 \0 \0 \0 7 \0 \0 \0 017 t h i s \0 i s 0000340 \0 d a t a ! 0000347 This shows that the data is stored properly to the db file. # bin/cassandra-cli -host localhost Connected to localhost/9160 Welcome to cassandra CLI. cassandra> get Keyspace1.Standard2['newone'] => (column=testing, value=this is data!, timestamp=55) Returned 1 results. Shows the same thing! It's there !!! I would lean towards a Thrift interface problem... In any case... I'd be thankful if someone had a pointer/workaround to this show-stopper of mine... Best Chris.