[ https://issues.apache.org/jira/browse/HDFS-8885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715163#comment-14715163 ]
Chris Nauroth commented on HDFS-8885: ------------------------------------- bq. ...{{getInputStream()}} is called in the constructor of {{ByteRangeInputStream}}... Yes, thank you. I missed this while reviewing. That means we don't need to worry about case 1. Case 2 is still a potential issue if a caller calls {{seek}} right before {{available}}. If the file length has changed between calls on the stream (such as due to a concurrent writer), the value returned by {{available}} would be inaccurate. Because of case 2 and case 3, I still recommend calling {{getInputStream}}. > ByteRangeInputStream used in webhdfs does not override available() > ------------------------------------------------------------------ > > Key: HDFS-8885 > URL: https://issues.apache.org/jira/browse/HDFS-8885 > Project: Hadoop HDFS > Issue Type: Bug > Components: webhdfs > Affects Versions: 2.7.1 > Reporter: Shradha Revankar > Assignee: Shradha Revankar > Priority: Minor > Attachments: HDFS-8885.000.patch, HDFS-8885.001.patch > > > ByteRangeInputStream has to override the method {{available()}} , the super > class implementation returns 0. Clients using the method {{available()}} to > rely on available bytes information will end up with errors during reads if > WebhdfsFileSystem is used. -- This message was sent by Atlassian JIRA (v6.3.4#6332)