You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2013/09/08 00:41:53 UTC

[jira] [Comment Edited] (THRIFT-2159) Serializer/Deserializer for Go

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

Jens Geyer edited comment on THRIFT-2159 at 9/7/13 10:40 PM:
-------------------------------------------------------------

Got it. The problem is, that most of the code in json/simple json readers relies on testing p.reader.Buffered() > 0 is enough. But that's not true, because there is nothing Buffered() unless a Read() or at least a Peek() happens. So the code basically tries to process an empty []byte, thus fails.

It does work when used with the RPC part, because p.reader.Read() is indeed called during ReadMessageBegin(), but not with the deserializer

=> THRIFT-2174
                
      was (Author: jensg):
    Got it. The problem is, that most of the code in json/simple json readers relies on testing p.reader.Buffered() > 0 is enough. But that's not true, because there is nothing Buffered() unless a Read() or at least a Peek() happens. So the code basically tries to process an empty []byte, thus fails.

It does work when used with the RPC part, because p.reader.Read() is indeed called during ReadMessageBegin(), but not with the deserializer
                  
> Serializer/Deserializer for Go
> ------------------------------
>
>                 Key: THRIFT-2159
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2159
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Go - Library
>    Affects Versions: 1.0
>         Environment: Linux x64. Go v1.1.1
>            Reporter: Justin Judd
>             Fix For: 1.0
>
>         Attachments: thrift_serialize_deserialize.patch
>
>
> Java and Python provide means to serialize and deserialize Thrift structs. (Java: http://techxample.blogspot.com/2011/12/thrift-serialization-and.html; Python: http://wiki.apache.org/thrift/ThriftUsagePython and https://github.com/flamholz/py-thrift-validation-example/blob/master/util/serialization.py)
> This capability can be provided to 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira