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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.8.0
    • Component/s: fs, io
    • Labels:
      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. HADOOP-13017-002.patch
          6 kB
          Steve Loughran
        2. HDFS-13017-001.patch
          5 kB
          Steve Loughran

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: