Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-6298

BytesWritable#getBytes is a bad name that leads to programming mistakes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.1
    • Fix Version/s: 0.22.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Pretty much everyone at Rapleaf who has worked with Hadoop has misused BytesWritable#getBytes at some point, not expecting the byte array to be padded. I think we can completely alleviate these programming mistakes by deprecating and renaming this method (again) to be more descriptive. I propose "getPaddedBytes()" or "getPaddedValue()". It would also be helpful to have a helper method "getNonPaddedValue()" that makes a copy into a non-padded byte array.

        Attachments

        1. h-6298.patch
          4 kB
          Owen O'Malley

          Activity

            People

            • Assignee:
              owen.omalley Owen O'Malley
              Reporter:
              marz Nathan Marz
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: