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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.20.1
    • 0.22.0
    • None
    • None
    • 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

            omalley Owen O'Malley
            marz Nathan Marz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: