You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Scott Banachowski (JIRA)" <ji...@apache.org> on 2009/06/20 21:36:07 UTC

[jira] Created: (AVRO-59) proposal to make some C++ object APIs more generic

proposal to make some C++ object APIs more generic
--------------------------------------------------

                 Key: AVRO-59
                 URL: https://issues.apache.org/jira/browse/AVRO-59
             Project: Avro
          Issue Type: Improvement
          Components: c++
            Reporter: Scott Banachowski


This is a patch I made for the serializer.  In the original version, the Serializer object has functions like putInt(), putLong(),..., i.e. each put* function has a different name.  

This is not convenient for generic template code, because each type requires a different function call.  I moved the Serializer code to a class called Writer, that has only putValue overridden for each type, e.g. putValue(int32_t), putValue(int64_t), putValue(bool) etc.

Generic code, such as in AvroSerializer.hh can use the generic API.  To preserve the explicit calls, Serializer still exists, but has become a thin wrapper for Writer.  The explicit calls are still useful for when you don't want implicit conversion to accidentally choose the wrong type.



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


[jira] Commented: (AVRO-59) proposal to make some C++ object APIs more generic

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722824#action_12722824 ] 

Doug Cutting commented on AVRO-59:
----------------------------------

This looks like a good direction to me.

> proposal to make some C++ object APIs more generic
> --------------------------------------------------
>
>                 Key: AVRO-59
>                 URL: https://issues.apache.org/jira/browse/AVRO-59
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Scott Banachowski
>         Attachments: AVRO-59.patch
>
>
> This is a patch I made for the serializer.  In the original version, the Serializer object has functions like putInt(), putLong(),..., i.e. each put* function has a different name.  
> This is not convenient for generic template code, because each type requires a different function call.  I moved the Serializer code to a class called Writer, that has only putValue overridden for each type, e.g. putValue(int32_t), putValue(int64_t), putValue(bool) etc.
> Generic code, such as in AvroSerializer.hh can use the generic API.  To preserve the explicit calls, Serializer still exists, but has become a thin wrapper for Writer.  The explicit calls are still useful for when you don't want implicit conversion to accidentally choose the wrong type.

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


[jira] Updated: (AVRO-59) proposal to make some C++ object APIs more generic

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

Doug Cutting updated AVRO-59:
-----------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.0
           Status: Resolved  (was: Patch Available)

I just committed this.  Thanks, Scott!

> proposal to make some C++ object APIs more generic
> --------------------------------------------------
>
>                 Key: AVRO-59
>                 URL: https://issues.apache.org/jira/browse/AVRO-59
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Scott Banachowski
>            Assignee: Scott Banachowski
>             Fix For: 1.0.0
>
>         Attachments: AVRO-59.patch
>
>
> This is a patch I made for the serializer.  In the original version, the Serializer object has functions like putInt(), putLong(),..., i.e. each put* function has a different name.  
> This is not convenient for generic template code, because each type requires a different function call.  I moved the Serializer code to a class called Writer, that has only putValue overridden for each type, e.g. putValue(int32_t), putValue(int64_t), putValue(bool) etc.
> Generic code, such as in AvroSerializer.hh can use the generic API.  To preserve the explicit calls, Serializer still exists, but has become a thin wrapper for Writer.  The explicit calls are still useful for when you don't want implicit conversion to accidentally choose the wrong type.

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


[jira] Updated: (AVRO-59) proposal to make some C++ object APIs more generic

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

Doug Cutting updated AVRO-59:
-----------------------------

    Assignee: Scott Banachowski
      Status: Patch Available  (was: Open)

> proposal to make some C++ object APIs more generic
> --------------------------------------------------
>
>                 Key: AVRO-59
>                 URL: https://issues.apache.org/jira/browse/AVRO-59
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Scott Banachowski
>            Assignee: Scott Banachowski
>         Attachments: AVRO-59.patch
>
>
> This is a patch I made for the serializer.  In the original version, the Serializer object has functions like putInt(), putLong(),..., i.e. each put* function has a different name.  
> This is not convenient for generic template code, because each type requires a different function call.  I moved the Serializer code to a class called Writer, that has only putValue overridden for each type, e.g. putValue(int32_t), putValue(int64_t), putValue(bool) etc.
> Generic code, such as in AvroSerializer.hh can use the generic API.  To preserve the explicit calls, Serializer still exists, but has become a thin wrapper for Writer.  The explicit calls are still useful for when you don't want implicit conversion to accidentally choose the wrong type.

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


[jira] Updated: (AVRO-59) proposal to make some C++ object APIs more generic

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

Scott Banachowski updated AVRO-59:
----------------------------------

    Attachment: AVRO-59.patch

Here is the patch.  Currently the changes are only applied to the serializer side, but the same can be applied to the parser side since they are symmetric. 

I will likewise change the parser side if people think this is a reasonable approach.


> proposal to make some C++ object APIs more generic
> --------------------------------------------------
>
>                 Key: AVRO-59
>                 URL: https://issues.apache.org/jira/browse/AVRO-59
>             Project: Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Scott Banachowski
>         Attachments: AVRO-59.patch
>
>
> This is a patch I made for the serializer.  In the original version, the Serializer object has functions like putInt(), putLong(),..., i.e. each put* function has a different name.  
> This is not convenient for generic template code, because each type requires a different function call.  I moved the Serializer code to a class called Writer, that has only putValue overridden for each type, e.g. putValue(int32_t), putValue(int64_t), putValue(bool) etc.
> Generic code, such as in AvroSerializer.hh can use the generic API.  To preserve the explicit calls, Serializer still exists, but has become a thin wrapper for Writer.  The explicit calls are still useful for when you don't want implicit conversion to accidentally choose the wrong type.

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