Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 19008 invoked from network); 6 Nov 2010 15:41:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Nov 2010 15:41:43 -0000 Received: (qmail 43258 invoked by uid 500); 6 Nov 2010 15:42:12 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 42580 invoked by uid 500); 6 Nov 2010 15:42:11 -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 42572 invoked by uid 99); 6 Nov 2010 15:42:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 15:42:11 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=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: domain of edlinuxguru@gmail.com designates 209.85.161.44 as permitted sender) Received: from [209.85.161.44] (HELO mail-fx0-f44.google.com) (209.85.161.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Nov 2010 15:42:07 +0000 Received: by fxm9 with SMTP id 9so3234727fxm.31 for ; Sat, 06 Nov 2010 08:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qw5N9kzbCoKhGwn2YNUM8LZAclx5tXfWuZBRZ/d47ng=; b=sLrtx8nXS/vpvdwN8fg4C1eeOU00bkXJvDTIQUC5kwxWTo5uUZEelvHR3eEjAlZV2O HIJ/AAU40P0UbwNGpueYBG7G6vY8oK7YvENfTV785w/ecxj0RHzMd81ClFeVygHu06LY H3pVktRldCMFcVqk8WbSV9MphkhOzqynOm+CY= 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 :content-type:content-transfer-encoding; b=w33BshfEtkaK1OSMtVakry5jQaZZ3hafJ/PZWI2JKcWkZyUSI8Mn3MO8MG6p8C1YGx wRoZPAE4fi37hof1hHt0qUE62the2mZf13tpqdTCPTSRvrpTSZkLlz3xVt8QIaraYNyJ KQd4pW942sgA4u1iqdhYinz/ap2PkK5xxFZzw= MIME-Version: 1.0 Received: by 10.223.96.136 with SMTP id h8mr2016814fan.80.1289058105525; Sat, 06 Nov 2010 08:41:45 -0700 (PDT) Received: by 10.223.103.199 with HTTP; Sat, 6 Nov 2010 08:41:45 -0700 (PDT) In-Reply-To: References: Date: Sat, 6 Nov 2010 11:41:45 -0400 Message-ID: Subject: Re: client connecting to 0.7 From: Edward Capriolo To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Nov 5, 2010 at 9:50 PM, CassUser CassUser wrot= e: > I agree and we will move to hector=A0 at some point, but we have some leg= acy > code we need to convert to the new api.=A0 What am I doing wrong in the c= ode I > posted? > > > On Fri, Nov 5, 2010 at 5:45 PM, Jonathan Ellis wrote: >> >> From Java you should be using Hector instead of messing around with >> raw Thrift. =A0There is a version for beta2 at >> https://github.com/rantav/hector/downloads >> >> docs are at >> http://www.riptano.com/sites/default/files/hector-v2-client-doc.pdf >> >> On Fri, Nov 5, 2010 at 6:28 PM, CassUser CassUser >> wrote: >> > Hey I'm testing a client on beta2 cassandra version 0.7. >> > >> > =A0=A0=A0=A0=A0=A0=A0 TFramedTransport transport =3D new TFramedTransp= ort(new >> > TSocket("my.ip", 9160)); >> > =A0=A0=A0=A0=A0=A0=A0 Cassandra.Client client =3D new Cassandra.Client= (new >> > TBinaryProtocol(transport)); >> > =A0=A0=A0=A0=A0=A0=A0 transport.open(); >> > =A0=A0=A0=A0=A0=A0=A0 System.out.println(client.describe_cluster_name(= )); >> > >> > Is giving me the following: >> > >> > org.apache.thrift.protocol.TProtocolException: Missing version in >> > readMessageBegin, old client? >> > =A0=A0=A0=A0=A0=A0=A0 at >> > >> > org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryPro= tocol.java:211) >> > =A0=A0=A0=A0=A0=A0=A0 at >> > >> > org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java= :2706) >> > =A0=A0=A0=A0=A0=A0=A0 at >> > >> > org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(= CustomTThreadPoolServer.java:167) >> > =A0=A0=A0=A0=A0=A0=A0 at >> > >> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu= tor.java:886) >> > =A0=A0=A0=A0=A0=A0=A0 at >> > >> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.= java:908) >> > =A0=A0=A0=A0=A0=A0=A0 at java.lang.Thread.run(Thread.java:662) >> > >> > I'm using the cassandra 0.7beta2 code on both client and server. >> > >> >> >> >> -- >> Jonathan Ellis >> Project Chair, Apache Cassandra >> co-founder of Riptano, the source for professional Cassandra support >> http://riptano.com > > Strange your code looks just like mine. Possibly check your configuration file and make sure you cluster is using framed mode. package hpcas.c03; import org.apache.cassandra.thrift.Cassandra; import org.apache.thrift.protocol.*; import org.apache.thrift.transport.*; public class FramedConnWrapper { private TTransport transport; private TProtocol proto; private TSocket socket; public FramedConnWrapper(String host, int port) { socket =3D new TSocket(host,port); transport =3D new TFramedTransport(socket); proto =3D new TBinaryProtocol(transport); } public void open() throws Exception { transport.open(); } public void close() throws Exception { transport.close(); socket.close(); } public Cassandra.Client getClient() { Cassandra.Client client =3D new Cassandra.Client(proto); return client; } }