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

FSDataInputStream/FSInputStream to implement getFileLength()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.0
    • Fix Version/s: None
    • Component/s: fs, fs/s3
    • Labels:
      None

      Description

      server-side transcoding, predicate-pushdown filtering in storage, client-side decryption can all result in an input stream shorter or longer than the file size as measured in getFileStatus/listFiles/listStatus.

      Assuming the length is known once open() returns, the FSDataInputStream can return the length of the data, which can then be used for accurate seeks within the data.

      • requires the streams to know their length; easy to check (hasCapabilities), or make the new method return an Optional<Long>, but caller will need to (a) look for this if present and (b) fall back.
      • Could be rolled out for all our own clients/connectors, would take time for others

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: