Uploaded image for project: 'Avro'
  1. Avro
  2. AVRO-970

(Java) Allow users to implement their own Codecs

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.3
    • Fix Version/s: 1.7.4
    • Component/s: java
    • Labels:
    • Release Note:
      Made Codec public in order to allow custom implementations.

      Description

      Currently the base class for all codecs (Codec) is not public which makes it
      impossible to write own codecs.

      1. AVRO-970.patch
        10 kB
        Rui Pereira
      2. AVRO-970.patch1
        10 kB
        Rui Pereira

        Activity

        Hide
        cutting Doug Cutting added a comment -

        I think this was kept private originally out of concern that the API might not be stable. But CodecFactory is public, so it doesn't make much sense for Codec to be private. I'm +1 for making this change. Would you like to provide a patch? Should we add a test that implements a Codec in a different package, perhaps one that just performs a bitwise-NOT of the data?

        Show
        cutting Doug Cutting added a comment - I think this was kept private originally out of concern that the API might not be stable. But CodecFactory is public, so it doesn't make much sense for Codec to be private. I'm +1 for making this change. Would you like to provide a patch? Should we add a test that implements a Codec in a different package, perhaps one that just performs a bitwise-NOT of the data?
        Hide
        syshex Rui Pereira added a comment -

        Performed modifications as specified in the previous comment. Had to modify the three implementations of Codec in order to allow extend and override of new method signatures. Added JUnit test and Custom codec implementation in test subpackage.

        Hope everything is fine, please review patch.

        Show
        syshex Rui Pereira added a comment - Performed modifications as specified in the previous comment. Had to modify the three implementations of Codec in order to allow extend and override of new method signatures. Added JUnit test and Custom codec implementation in test subpackage. Hope everything is fine, please review patch.
        Hide
        cutting Doug Cutting added a comment -

        We ought to remove the javadoc comment in Codec.java that states it's an internal API. Other than that this looks good to me.

        Unless someone objects, I'll commit this soon.

        Show
        cutting Doug Cutting added a comment - We ought to remove the javadoc comment in Codec.java that states it's an internal API. Other than that this looks good to me. Unless someone objects, I'll commit this soon.
        Hide
        syshex Rui Pereira added a comment -

        Same as before but without the javadoc comment in Codec.java that stated it's an internal API

        Show
        syshex Rui Pereira added a comment - Same as before but without the javadoc comment in Codec.java that stated it's an internal API
        Hide
        cutting Doug Cutting added a comment -

        I committed this. Thanks, Rui!

        Show
        cutting Doug Cutting added a comment - I committed this. Thanks, Rui!

          People

          • Assignee:
            syshex Rui Pereira
            Reporter:
            nimmervoll Peter Nimmervoll
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development