[ 
https://issues.apache.org/jira/browse/THRIFT-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997171#comment-12997171
 ] 

Kirk Peterson edited comment on THRIFT-538 at 2/20/11 5:51 PM:
---------------------------------------------------------------

The length function of the Data.ByteString.Lazy package used on line 74 returns 
an 8 byte integer (Int64) for the frame length, where in the Java 
TFramedTransport class (see: line 156) is using a 4 byte integer to encode the 
frame length: transport_.write(i32buf, 0, 4).

We see this again on line 84 we're using Data.byteString.Lazy's decode to 
convert the 4 bytes read in on line 83 into an Int representation of the size 
of the frame to be used as the length parameter of tRead on line 87, haskell 
Int's are 8 bytes in length, where in TFramedTransport line 129 we see another 
case of expecting a 4 byte encoding of the frame length: 
transport_.readAll(i32buf, 0, 4);

Cassandra 0.7 has switched to using TFramedTransport in it's Thrift daemon, 
which this module (as of revision 1072638) will not work with.
I've attached a diff that changes lines 74 and 84 to use Data.Int's Int32, 
which I have working then tested against cassandra 0.7.2.

      was (Author: necrobious):
    The length function of the Data.ByteString.Lazy package used on line 74 
returns an 8 byte integer (Int64) for the frame length, where in the Java 
TFramedTransport class (see: line 156) is using a 4 byte integer to encode the 
frame length: transport_.write(i32buf, 0, 4).

We see this again on line 84 we're using Data.byteString.Lazy's decode to 
convert the 4 bytes read in on line 83 into an Int representation of the size 
of the frame to be used as the length parameter of tRead on line 87, where in 
TFramedTransport line 129 we see another case of expecting a 4 byte encoding of 
the frame length: transport_.readAll(i32buf, 0, 4);

Cassandra 0.7 has switched to using TFramedTransport in it's Thrift daemon, 
which this module (as of revision 1072638) will not work with.
I've attached a diff that changes lines 74 and 84 to use Data.Int's Int32, 
which I have working then tested against cassandra 0.7.2.
  
> missing support for framed transport
> ------------------------------------
>
>                 Key: THRIFT-538
>                 URL: https://issues.apache.org/jira/browse/THRIFT-538
>             Project: Thrift
>          Issue Type: Wish
>          Components: Cocoa - Library, Haskell - Library
>            Reporter: Eric Evans
>            Assignee: Christian Lavoie
>         Attachments: Framed-Int32.diff, Framed.hs
>
>
> It is somewhat frustrating when writing an application to have to choose a 
> transport that will ultimately create compatibility issues for one or more 
> otherwise supported languages. This is currently the case because some 
> clients require a framed transport (i.e. Twisted), while others lack an 
> implementation of one (i.e. Haskell, Cocoa, etc).
> If every language supported the framed transport, it would even be possible 
> to make framed the only option. :)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to