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

Restore ability to set Text to empty byte array

    XMLWordPrintableJSON

Details

    Description

      In org.apache.hadoop.io.Text:clear() method, the comments show that we can free the bytes by call set(new byte[0]), but it's not going to work now. Maybe we can follow this comments.

       

       

      // org.apache.hadoop.io.Text 
      
      /**
       * Clear the string to empty.
       *
       * <em>Note</em>: For performance reasons, this call does not clear the
       * underlying byte array that is retrievable via {@link #getBytes()}.
       * In order to free the byte-array memory, call {@link #set(byte[])}
       * with an empty byte array (For example, <code>new byte[0]</code>).
       */
      public void clear() {
        length = 0;
        textLength = -1;
      }
      

       

       

      Attachments

        Issue Links

          Activity

            People

              lalapala gaozhan ding
              lalapala gaozhan ding
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 10m
                  4h 10m