Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5762

BlockReaderLocal doesn't return -1 on EOF when doing zero-length reads

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.3.0
    • None
    • None

    Description

      Unlike the other block readers, BlockReaderLocal currently doesn't return -1 on EOF when doing zero-length reads. This behavior, in turn, propagates to the DFSInputStream. BlockReaderLocal should do this, so that client can determine whether the file is at an end by doing a zero-length read and checking for -1.

      One place this shows up is in libhdfs, which does such a 0-length read to determine if direct (i.e., ByteBuffer) reads are supported.

      Attachments

        1. HDFS-5762.002.patch
          7 kB
          Colin McCabe
        2. HDFS-5762.001.patch
          6 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: