From user-return-3979-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Tue Apr 06 17:14:56 2010 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 69858 invoked from network); 6 Apr 2010 17:14:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Apr 2010 17:14:56 -0000 Received: (qmail 90013 invoked by uid 500); 6 Apr 2010 17:14:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 89995 invoked by uid 500); 6 Apr 2010 17:14:56 -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 89987 invoked by uid 99); 6 Apr 2010 17:14:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 17:14:56 +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 (athena.apache.org: local policy) Received: from [76.13.13.74] (HELO n4b.bullet.mail.ac4.yahoo.com) (76.13.13.74) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 06 Apr 2010 17:14:46 +0000 Received: from [74.6.228.95] by n4.bullet.mail.ac4.yahoo.com with NNFMP; 06 Apr 2010 17:14:25 -0000 Received: from [67.195.9.81] by t2.bullet.mail.ac4.yahoo.com with NNFMP; 06 Apr 2010 17:14:25 -0000 Received: from [98.137.27.221] by t1.bullet.mail.gq1.yahoo.com with NNFMP; 06 Apr 2010 17:14:25 -0000 Received: from [127.0.0.1] by omp131.mail.gq1.yahoo.com with NNFMP; 06 Apr 2010 17:14:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 499671.25259.bm@omp131.mail.gq1.yahoo.com Received: (qmail 61068 invoked by uid 60001); 6 Apr 2010 17:14:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1270574065; bh=BZpeb2awm+PshK2kTsAZjNdjn83ByMygzqxFYKPVMgY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=YcqA2YqCLG4B78gkhVAkzdwHvWF1qJKYY9mTHK/NYUZSyFt+SfYUZZzbURRUYNABuCXjyG8ehNnm7Y8vQuH4fV/yfSt3Kyj+Z3cYfiCnHZtJKFuJoq5uzfP5tbEHMLQZpBPlT5fsCwewzaK/tPkWP63ueYeDshkMVZtGA0A3riA= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=t04bcVlH/aGzay3cAWT8HiYPi+Y37Y36U5XNWlbBaCAhZMc1zuSLLEXTc4kxs7aWRF+lmgwRAr0IgMHvQZfNQOaIVVExQDd33J6kH6V8AGiMdLMzrlEUQNSg4RWSefCN++ZImkWVqSDMtQvN1Yyp5lQiDT0Sydn5uQ0b91GQXIA=; Message-ID: <354581.60644.qm@web110614.mail.gq1.yahoo.com> X-YMail-OSG: QDL14Y0VM1k57rEF8cJKNRQhmjVw8NZNd8SiXaCc64niQK7 lYGmmETnQe_YgwHGRsJGq1M4OdnlKznbHVuoct2dvePvPmTytvztT9pYKZTP yLd0KJShX2m6wppUzB1tTLb.VwIAE2XOo53lm7vVvGqRX4hqbh.6oR57XfoD J66fqUtbTKCuoUmgjg8PEqlOohwoU6C5m8lVeBoGBv5WZjF74sTHGBbXmTW6 wvziydUA4xyiZ5NW1IbzYlQMQ7dgTctEQbEcv6qEyrvfd.oa27QQE_p1cOlf mj_sQkxbkXKD4iONdXdsyxKBP2A.vfMw0aB0wuK5F_MHUwi697dzcudsYPnm AKI.uDpEpglBGlXW6FVAtr6eR6Xs- Received: from [216.205.224.64] by web110614.mail.gq1.yahoo.com via HTTP; Tue, 06 Apr 2010 10:14:25 PDT X-Mailer: YahooMailRC/324.3 YahooMailWebService/0.8.100.260964 References: <602969.37492.qm@web110614.mail.gq1.yahoo.com> Date: Tue, 6 Apr 2010 10:14:25 -0700 (PDT) From: Chris Beaumont Reply-To: Chris Beaumont Subject: Re: odd problem retrieving binary values using C++ To: user@cassandra.apache.org In-Reply-To: <602969.37492.qm@web110614.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii mmmh... well... wasn't long before I figured out the problem sits between the chair and the keyboard!!! I had a bad case of copy/paste dealing with super-columns and multiple rows in the actual code (original post was wayyyyyyy stripped). Everything is fine and returning the proper buffer size (as long as I refer to the right variable that was !) Apologies for the long and silly original post... Chris. ----- Original Message ---- From: Chris Beaumont To: user@cassandra.apache.org Sent: Tue, April 6, 2010 9:36:16 AM Subject: odd problem retrieving binary values using C++ 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.