You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/04/09 23:48:13 UTC

[jira] Updated: (THRIFT-236) Structs should be serialized in a consistent order

     [ https://issues.apache.org/jira/browse/THRIFT-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-236:
---------------------------------

    Attachment: thrift-236-v4.patch

Ok, in this version of Alex's patch, I make the use of struct->get_sorted_members() explicit for only the struct writer. This patch only affects the Java library at the moment. 

> Structs should be serialized in a consistent order
> --------------------------------------------------
>
>                 Key: THRIFT-236
>                 URL: https://issues.apache.org/jira/browse/THRIFT-236
>             Project: Thrift
>          Issue Type: Improvement
>            Reporter: Bryan Duxbury
>            Assignee: Alexander Shigin
>             Fix For: 0.1
>
>         Attachments: sort-fields.diff, thrift-236-v4.patch, thrift-236.patch, thrift-consistent-order-v2.patch, thrift-consistent-order-v3.patch, thrift-consistent-order.patch
>
>
> As it stands right now, Ruby generated structs will be serialized in arbitrary order (due to storage of metadata in a hash). This leads to different binary encoding for the same struct values. Ideally, it should be the same for any two serializations of equivalent structs, and between languages if possible. 
> The two approaches that seem to make the most sense are in lowest-to-highest field id order, and in IDL-defined order. What do people think of this idea, and which approach would be preferred?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.