cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruben de Laat <ru...@logic-labs.nl>
Subject Re: Calls block when using Thrift API
Date Sun, 29 Aug 2010 15:28:23 GMT
Just for the people looking to run Cassandra embedded and access
directly (not via Thrift/Avro).

This works:

StorageService.instance.initServer();

And then just use the StorageProxy for data access.

I have no idea if this is the right way, but is works.

Kind regards,
Ruben


On Fri, Aug 27, 2010 at 8:18 PM, Ruben de Laat <ruben@logic-labs.nl> wrote:
> Thank you Ran, that's working! Should have tried that as well.
>
> There is a difference in the log's, embedded shows:
> INFO 20:16:31,796 Binding thrift service to localhost/127.0.0.1:9160
>
> Batch-file-started one:
> INFO thrift.CassandraDaemon: Listening for thrift clients...
>
> So maybe different classes are being used for thrift commication based
> on how the server is started.
>
> As soon as I figure that out I'll post it.
>
> On Fri, Aug 27, 2010 at 7:57 PM, Ran Tavory <rantav@gmail.com> wrote:
>> did you try connecting to a real cassandra instance, not an embedded one?
>> I use an embedded one for testing and it works, but just to narrow down your
>> problem.
>>
>> On Fri, Aug 27, 2010 at 6:13 PM, Ruben de Laat <ruben@logic-labs.nl> wrote:
>>>
>>> Hi,
>>>
>>> I am new to cassandra, so maybe I am missing something obvious...
>>> Version: Latest nightly build (2010-08-23_13-57-40), but same results
>>> with 0.7.0b1
>>>
>>> Server code (default configuration file):
>>>
>>> System.setProperty("cassandra.config", "conf/cassandra.yaml");
>>> EmbeddedCassandraService embeddedCassandraService = new
>>> EmbeddedCassandraService();
>>> embeddedCassandraService.init();
>>>
>>> Client code:
>>>
>>> Socket socket = new Socket("127.0.0.1", 9160);
>>> TSocket transport = new TSocket(socket);
>>> TBinaryProtocol tBinaryProtocol = new TBinaryProtocol(transport);
>>> Client client = new Client(tBinaryProtocol);
>>> System.out.println(client.describe_cluster_name());
>>>
>>> The problem is that it hangs/blocks on the
>>> "client.describe_cluster_name()" call, actually it hangs on any call I
>>> have tried.
>>> I was first trying with the Pelops client, but that one is using the
>>> Thrift API as well, so this is narrowed down.
>>>
>>> I have already tried multiple different combination of creating the
>>> client (different transports).
>>> I have also tried with "thrift_framed_transport_size_in_mb: 0"
>>> disabling framed transports.
>>>
>>> Starting the client without a running server gives a proper
>>> "Connection refused", so some sort of connection is definitely made.
>>>
>>> Thanks and Kind regards,
>>> Ruben
>>
>>
>

Mime
View raw message