From user-return-27442-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Jul 5 22:41:34 2012 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3975ED9EF for ; Thu, 5 Jul 2012 22:41:34 +0000 (UTC) Received: (qmail 53729 invoked by uid 500); 5 Jul 2012 22:41:31 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 53705 invoked by uid 500); 5 Jul 2012 22:41:31 -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 53697 invoked by uid 99); 5 Jul 2012 22:41:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 22:41:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lilyevsky@mooncapital.com designates 38.105.147.185 as permitted sender) Received: from [38.105.147.185] (HELO mcm-exch-hc.MoonCapital.Corp) (38.105.147.185) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 22:41:25 +0000 Received: from mcm-exch-mb.MoonCapital.Corp ([::1]) by mcm-exch-hc.MoonCapital.Corp ([10.5.1.85]) with mapi; Thu, 5 Jul 2012 18:40:57 -0400 From: Leonid Ilyevsky To: "'user@cassandra.apache.org'" Date: Thu, 5 Jul 2012 18:40:56 -0400 Subject: Composite key in thrift java api Thread-Topic: Composite key in thrift java api Thread-Index: Ac1ZGEVTEpL7qWhWSRSGYCO/Jud4agBoVM2wABDLChA= Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_A663AF0EC22BAB47966CA61D63C01B385606D231mcmexchmbMoonCa_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_A663AF0EC22BAB47966CA61D63C01B385606D231mcmexchmbMoonCa_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I need to create a ByteBuffer instance containing the proper composite key,= based on the values of the components of the key. I am going to use it for= update operation. I tried to simply concatenate the buffers corresponding to the components, = but I am not sure this is correct, because I am getting exception that come= s from the server : InvalidRequestException(why:Not enough bytes to read value of component 0) In the server log I see this: org.apache.thrift.transport.TTransportException: Cannot read. Remote side h= as closed. Tried to read 4 bytes, but only got 0 bytes. (This is often indi= cative of an internal error on the server side. Please check your server lo= gs.) (I believe here when it says "server side" it actually means client, becaus= e it is the server's log). Seems like the buffer that my client sends is too short. I suspect there i= s a way in thrift to do it properly, but I don't know how. Looks like Hector has a Composite class that maybe can help, but at this po= int I would really prefer to do it in Cassandra itself, without Hector. Thanks! Leonid ________________________________ This email, along with any attachments, is confidential and may be legally = privileged or otherwise protected from disclosure. Any unauthorized dissemi= nation, copying or use of the contents of this email is strictly prohibited= and may be in violation of law. If you are not the intended recipient, any= disclosure, copying, forwarding or distribution of this email is strictly = prohibited and this email and any attachments should be deleted immediately= . This email and any attachments do not constitute an offer to sell or a so= licitation of an offer to purchase any interest in any investment vehicle s= ponsored by Moon Capital Management LP ("Moon Capital"). Moon Capital does = not provide legal, accounting or tax advice. Any statement regarding legal,= accounting or tax matters was not intended or written to be relied upon by= any person as advice. Moon Capital does not waive confidentiality or privi= lege as a result of this email. --_000_A663AF0EC22BAB47966CA61D63C01B385606D231mcmexchmbMoonCa_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I need to create a ByteBuffer instance containing the proper= composite key, based on the values of the components of the key. I am goin= g to use it for update operation.

I tried to simply concatenate the buffers corresponding to t= he components, but I am not sure this is correct, because I am getting exce= ption that comes from the server :

 

InvalidRequestException(why:Not enough bytes to read value o= f component 0)

 

In the server log I see this:

 

org.apache.thrift.transport.TTransportException: Cannot read= . Remote side has closed. Tried to read 4 bytes, but only got 0 bytes. (Thi= s is often indicative of an internal error on the server side. Please check your server logs.)

 

(I believe here when it says “server side” it ac= tually means client, because it is the server’s log).

 

Seems like the buffer that my client sends is too short. &nb= sp;I suspect there is a way in thrift to do it properly, but I don’t = know how.

Looks like Hector has a Composite class that maybe can help,= but at this point I would really prefer to do it in Cassandra itself, with= out Hector.

 

Thanks!

 

Leonid

 



This email, along with any a= ttachments, is confidential and may be legally privileged or otherwise prot= ected from disclosure. Any unauthorized dissemination, copying or use of th= e contents of this email is strictly prohibited and may be in violation of law. If you are not the intended recipient, any= disclosure, copying, forwarding or distribution of this email is strictly = prohibited and this email and any attachments should be deleted immediately= . This email and any attachments do not constitute an offer to sell or a solicitation of an offer to purcha= se any interest in any investment vehicle sponsored by Moon Capital Managem= ent LP (“Moon Capital”). Moon Capital does not provide legal, a= ccounting or tax advice. Any statement regarding legal, accounting or tax matters was not intended or written to be relied = upon by any person as advice. Moon Capital does not waive confidentiality o= r privilege as a result of this email.
--_000_A663AF0EC22BAB47966CA61D63C01B385606D231mcmexchmbMoonCa_--