Avro
  1. Avro
  2. AVRO-993

Add methods back to GenericDatumReader that were removed in AVRO-839

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0, 1.6.1
    • Fix Version/s: 1.6.2
    • Component/s: java
    • Labels:
      None

      Description

      As part of AVRO-839 three methods were moved from GenericDatumReader to GenericData:

      • newRecord(Object, Schema)
      • createFixed(Object old, Schema schema)
      • createFixed(Object, byte[], Schema)

      Although their visibility is protected, they are part of the public API because GenericDatumReader is public. Therefore these methods should have been deprecated before being removed. The removal of these methods caused PIG-2463.

      1. AVRO-993.patch
        2 kB
        James Baldassari
      2. AVRO-993-v2.patch
        2 kB
        James Baldassari

        Issue Links

          Activity

          Hide
          James Baldassari added a comment -

          Here's a patch for GenericDatumReader that adds the three missing methods back in with a deprecation warning. Internally they invoke the same methods on GenericData.

          Show
          James Baldassari added a comment - Here's a patch for GenericDatumReader that adds the three missing methods back in with a deprecation warning. Internally they invoke the same methods on GenericData.
          Hide
          Doug Cutting added a comment -

          +1 Patch looks good to me.

          We should probably roll a 1.6.2 release soon that includes this.

          Show
          Doug Cutting added a comment - +1 Patch looks good to me. We should probably roll a 1.6.2 release soon that includes this.
          Hide
          Scott Carey added a comment -

          Looks good. My only nit is to have the javadoc link to the actual replacement method.

          for example:

            /** 
             * Called to create an fixed value. May be overridden for alternate fixed
             * representations.  By default, returns {@link GenericFixed}.
             * @deprecated As of Avro 1.6.0 this method has been moved to 
             * {@link GenericData#createFixed(Object, byte[], Schema)}
             */
          
          Show
          Scott Carey added a comment - Looks good. My only nit is to have the javadoc link to the actual replacement method. for example: /** * Called to create an fixed value. May be overridden for alternate fixed * representations. By default, returns {@link GenericFixed}. * @deprecated As of Avro 1.6.0 this method has been moved to * {@link GenericData#createFixed(Object, byte[], Schema)} */
          Hide
          James Baldassari added a comment -

          Good point, Scott. Here's another version that includes the specific JavaDoc links you mentioned.

          Show
          James Baldassari added a comment - Good point, Scott. Here's another version that includes the specific JavaDoc links you mentioned.
          Hide
          Scott Carey added a comment -

          Looks good. +1

          Show
          Scott Carey added a comment - Looks good. +1
          Hide
          James Baldassari added a comment -

          I committed this.

          Show
          James Baldassari added a comment - I committed this.

            People

            • Assignee:
              James Baldassari
              Reporter:
              James Baldassari
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development