You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by CassUser CassUser <ca...@gmail.com> on 2010/11/06 00:28:27 UTC

client connecting to 0.7

Hey I'm testing a client on beta2 cassandra version 0.7.

        TFramedTransport transport = new TFramedTransport(new
TSocket("my.ip", 9160));
        Cassandra.Client client = new Cassandra.Client(new
TBinaryProtocol(transport));
        transport.open();
        System.out.println(client.describe_cluster_name());

Is giving me the following:

org.apache.thrift.protocol.TProtocolException: Missing version in
readMessageBegin, old client?
        at
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:211)
        at
org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2706)
        at
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:167)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

I'm using the cassandra 0.7beta2 code on both client and server.

Re: client connecting to 0.7

Posted by CassUser CassUser <ca...@gmail.com>.
Thanks Edward,

It was in fact the server config file.  I thought i was missing the
thrift_framed_transport property, but I don't see that in the Config.java
file.  Setting thrift_framed_transport_size_in_mb to something other than 0
enables framed on the server.  Also mentioned here
http://wiki.apache.org/cassandra/StorageConfiguration. Must have missed that
property after we converted old config.  :)


On Sat, Nov 6, 2010 at 8:41 AM, Edward Capriolo <ed...@gmail.com>wrote:

> On Fri, Nov 5, 2010 at 9:50 PM, CassUser CassUser <ca...@gmail.com>
> wrote:
> > I agree and we will move to hector  at some point, but we have some
> legacy
> > code we need to convert to the new api.  What am I doing wrong in the
> code I
> > posted?
> >
> >
> > On Fri, Nov 5, 2010 at 5:45 PM, Jonathan Ellis <jb...@gmail.com>
> wrote:
> >>
> >> From Java you should be using Hector instead of messing around with
> >> raw Thrift.  There 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 <ca...@gmail.com>
> >> wrote:
> >> > Hey I'm testing a client on beta2 cassandra version 0.7.
> >> >
> >> >         TFramedTransport transport = new TFramedTransport(new
> >> > TSocket("my.ip", 9160));
> >> >         Cassandra.Client client = new Cassandra.Client(new
> >> > TBinaryProtocol(transport));
> >> >         transport.open();
> >> >         System.out.println(client.describe_cluster_name());
> >> >
> >> > Is giving me the following:
> >> >
> >> > org.apache.thrift.protocol.TProtocolException: Missing version in
> >> > readMessageBegin, old client?
> >> >         at
> >> >
> >> >
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:211)
> >> >         at
> >> >
> >> >
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2706)
> >> >         at
> >> >
> >> >
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:167)
> >> >         at
> >> >
> >> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> >> >         at
> >> >
> >> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> >> >         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 = new TSocket(host,port);
>        transport = new TFramedTransport(socket);
>        proto = 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 = new Cassandra.Client(proto);
>        return client;
>    }
> }
>

Re: client connecting to 0.7

Posted by Edward Capriolo <ed...@gmail.com>.
On Fri, Nov 5, 2010 at 9:50 PM, CassUser CassUser <ca...@gmail.com> wrote:
> I agree and we will move to hector  at some point, but we have some legacy
> code we need to convert to the new api.  What am I doing wrong in the code I
> posted?
>
>
> On Fri, Nov 5, 2010 at 5:45 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>>
>> From Java you should be using Hector instead of messing around with
>> raw Thrift.  There 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 <ca...@gmail.com>
>> wrote:
>> > Hey I'm testing a client on beta2 cassandra version 0.7.
>> >
>> >         TFramedTransport transport = new TFramedTransport(new
>> > TSocket("my.ip", 9160));
>> >         Cassandra.Client client = new Cassandra.Client(new
>> > TBinaryProtocol(transport));
>> >         transport.open();
>> >         System.out.println(client.describe_cluster_name());
>> >
>> > Is giving me the following:
>> >
>> > org.apache.thrift.protocol.TProtocolException: Missing version in
>> > readMessageBegin, old client?
>> >         at
>> >
>> > org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:211)
>> >         at
>> >
>> > org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2706)
>> >         at
>> >
>> > org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:167)
>> >         at
>> >
>> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> >         at
>> >
>> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> >         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 = new TSocket(host,port);
        transport = new TFramedTransport(socket);
        proto = 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 = new Cassandra.Client(proto);
        return client;
    }
}

Re: client connecting to 0.7

Posted by CassUser CassUser <ca...@gmail.com>.
I agree and we will move to hector  at some point, but we have some legacy
code we need to convert to the new api.  What am I doing wrong in the code I
posted?


On Fri, Nov 5, 2010 at 5:45 PM, Jonathan Ellis <jb...@gmail.com> wrote:

> From Java you should be using Hector instead of messing around with
> raw Thrift.  There 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 <ca...@gmail.com>
> wrote:
> > Hey I'm testing a client on beta2 cassandra version 0.7.
> >
> >         TFramedTransport transport = new TFramedTransport(new
> > TSocket("my.ip", 9160));
> >         Cassandra.Client client = new Cassandra.Client(new
> > TBinaryProtocol(transport));
> >         transport.open();
> >         System.out.println(client.describe_cluster_name());
> >
> > Is giving me the following:
> >
> > org.apache.thrift.protocol.TProtocolException: Missing version in
> > readMessageBegin, old client?
> >         at
> >
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:211)
> >         at
> >
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2706)
> >         at
> >
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:167)
> >         at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> >         at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> >         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
>

Re: client connecting to 0.7

Posted by Jonathan Ellis <jb...@gmail.com>.
>From Java you should be using Hector instead of messing around with
raw Thrift.  There 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 <ca...@gmail.com> wrote:
> Hey I'm testing a client on beta2 cassandra version 0.7.
>
>         TFramedTransport transport = new TFramedTransport(new
> TSocket("my.ip", 9160));
>         Cassandra.Client client = new Cassandra.Client(new
> TBinaryProtocol(transport));
>         transport.open();
>         System.out.println(client.describe_cluster_name());
>
> Is giving me the following:
>
> org.apache.thrift.protocol.TProtocolException: Missing version in
> readMessageBegin, old client?
>         at
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:211)
>         at
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2706)
>         at
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:167)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         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