Hi

> That was a good point...  Turns out there is a configuration switch from
> Framing non-Framing for Cassandra {not the default}.  But, on the
> thrift+twisted side of the world it appears there is no easy
> configuration to use a non-Framed transport -- short of writing a whole
> stack.

Yes, that's right, you need the framed transport. That's because it's
impossible to process an entire message in a non-blocking way without either
a) a message delimiter (which Thrift doesn't have) or b) specifying the length
of every message (which is what framed transports do).

The reason that it's impossible is that messages may come in chunks of
different lengths, and you can't wait on a socket to get the whole message,
because that would block the entire server.

I'd be in favor of deprecating the non-framed transports, it's a bit weird
that developers have to foresee whether their servers will be accessed by
framed or non-framed clients.

Cheers.

>
> Thanks,
> --koblas
>
> Oliver Kennedy wrote:
>> I'm not familiar with the Cassandra interface, but from your wire
>> description it looks like Test 2 is using a FramedTransport around the
>> SocketTransport, while Test 1 is using just the SocketTransport.
>>
>> Are you initializing both in the same way?
>>
>> On Nov 5, 2009, at 12:31 AM, David Koblas wrote:
>>
>>> Running into a protocol error, what I've got working in some way
>>> shape or form:
>>>
>>> * Cassandra with a java thrift interface
>>> * Test #1 - python with the generic Client
>>> * Test #2 - python with the twisted Client
>>>
>>> What I noticed is that Cassandra is happy talking to program #1 --
>>> digging into the wire bits I see that the packet looks something like :
>>>   VERSION .. REQUST ...
>>> When I try getting things working with twiseted the protocol has
>>>   LEN .. VERSION .. REQUEST ...
>>>
>>> So, as far as I can tell you can write twisted thrift services as
>>> long as you have no desire for interop with any other thrift
>>> services?  Or is there some other tweeks I need to make a compatible
>>> transport.
>>>
>>> Thanks,
>>> --koblas
>>>
>>
>> ------------
>> Oliver Kennedy
>> http://hugin.nfshost.com/
>>
>> We are all agreed that your theory is crazy.  The question
>> which divides us is whether it is crazy enough to have a
>> chance of being correct.  My own feeling is that it is not
>> crazy enough.
>>                 -- Niels Bohr
>>
>


Reply via email to