[ https://issues.apache.org/jira/browse/HADOOP-19139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840732#comment-17840732 ]
ASF GitHub Bot commented on HADOOP-19139: ----------------------------------------- saxenapranav commented on code in PR #6699: URL: https://github.com/apache/hadoop/pull/6699#discussion_r1579186349 ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsNetworkStatistics.java: ########## @@ -231,7 +237,17 @@ public void testAbfsHttpResponseStatistics() throws IOException { // 1 read request = 1 connection and 1 get response expectedConnectionsMade++; expectedGetResponses++; - expectedBytesReceived += bytesWrittenToFile; + if (!getConfiguration().getHeadOptimizationForInputStream()) { + expectedBytesReceived += bytesWrittenToFile; + } else { + /* + * With head optimization enabled, the abfsInputStream is not aware + * of the contentLength and hence, it would only read data for which the range + * is provided. With the first remote call done, the inputStream will get + * aware of the contentLength and would be able to use it for further reads. + */ + expectedBytesReceived += 1; Review Comment: At this point, the inputStream is at position 0 and the read request from application is 1 Byte. If the read full-file optimization is enabled, the inputStream would attempt to read the first readBuffer block from the file, which would read the whole file as the fileContentLength is smaller than the readBuffer size. > [ABFS]: No GetPathStatus call for opening AbfsInputStream > --------------------------------------------------------- > > Key: HADOOP-19139 > URL: https://issues.apache.org/jira/browse/HADOOP-19139 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/azure > Reporter: Pranav Saxena > Assignee: Pranav Saxena > Priority: Major > Labels: pull-request-available > > Read API gives contentLen and etag of the path. This information would be > used in future calls on that inputStream. Prior information of eTag is of not > much importance. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org