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

Implementations of InputStream.read(buffer, offset, bytes) to exit 0 if bytes==0

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.8.0
    • fs, io
    • None

    Description

      HDFS-10277 showed that HDFS was return -1 on read(buf[], 0, 0) when there was no data left in the stream; Java IO says

      If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte.

      Review the implementations of {{IOStream.(buffer, offset, bytes)} and, where necessary and considered safe, add a fast exit if the length is 0.

      Attachments

        1. HDFS-13017-001.patch
          5 kB
          Steve Loughran
        2. HADOOP-13017-002.patch
          6 kB
          Steve Loughran

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: