You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mathias Herberts (JIRA)" <ji...@apache.org> on 2010/10/06 21:30:33 UTC

[jira] Created: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Provide a helper method to determine the TProtocol used to serialize some data.
-------------------------------------------------------------------------------

                 Key: THRIFT-947
                 URL: https://issues.apache.org/jira/browse/THRIFT-947
             Project: Thrift
          Issue Type: New Feature
          Components: Java - Library
            Reporter: Mathias Herberts
            Priority: Minor


In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.

The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Commented: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918653#action_12918653 ] 

Bryan Duxbury commented on THRIFT-947:
--------------------------------------

This is kind of interesting. One bit of reasoning you have in there could be improved: if the data ends with a }, then it cannot be compact protocol, since compact protocol will always end on a 0 byte.

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Commented: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922732#action_12922732 ] 

Mathias Herberts commented on THRIFT-947:
-----------------------------------------

The unit tests actually make sure that the guessProtocolFactory method applies the correct heuristic, it uses custom filled byte[] for that purpose and not serialized objects as the number of objects to define would be too important.

If someone has a better idea for testing this s/he's more than welcome to contribute.

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1, THRIFT-947-2, THRIFT-947-3
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Closed: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-947.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.6
         Assignee: Mathias Herberts

Awesome. I just committed this.

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Assignee: Mathias Herberts
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: THRIFT-947-1, THRIFT-947-2, THRIFT-947-3
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Commented: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918654#action_12918654 ] 

Mathias Herberts commented on THRIFT-947:
-----------------------------------------

Then this solves the first case, two comment lines can be deleted :-)

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Updated: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-947:
------------------------------------

    Attachment: THRIFT-947-1

Adds a guessProtocolFactory method to TProtocolUtil which implements a heuristic to determine the TProtocol from serialized data.


> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Updated: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-947:
------------------------------------

    Attachment: THRIFT-947-2

Second patch with fast path to TBinaryProtocol is the last byte is not 0.

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1, THRIFT-947-2
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Commented: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922626#action_12922626 ] 

Bryan Duxbury commented on THRIFT-947:
--------------------------------------

Dare I ask for a testcase?

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1, THRIFT-947-2
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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


[jira] Updated: (THRIFT-947) Provide a helper method to determine the TProtocol used to serialize some data.

Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathias Herberts updated THRIFT-947:
------------------------------------

    Attachment: THRIFT-947-3

New patch with unit tests included.

> Provide a helper method to determine the TProtocol used to serialize some data.
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-947
>                 URL: https://issues.apache.org/jira/browse/THRIFT-947
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Mathias Herberts
>            Priority: Minor
>         Attachments: THRIFT-947-1, THRIFT-947-2, THRIFT-947-3
>
>
> In order to deserialize thrift structures previously serialized, you currently need to know the TProtocol used for serialization.
> The proposed new feature offers a method which applies a heuristic to determine the TProtocol used from the serialized data.

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