[ 
https://issues.apache.org/jira/browse/HADOOP-17527?focusedWorklogId=556439&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-556439
 ]

ASF GitHub Bot logged work on HADOOP-17527:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Feb/21 16:27
            Start Date: 23/Feb/21 16:27
    Worklog Time Spent: 10m 
      Work Description: bilaharith commented on a change in pull request #2698:
URL: https://github.com/apache/hadoop/pull/2698#discussion_r581177965



##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemRandomRead.java
##########
@@ -203,23 +203,36 @@ public void testSkipBounds() throws Exception {
 
       assertTrue(testFileLength > 0);
 
-      skipped = inputStream.skip(testFileLength);
-      assertEquals(testFileLength, skipped);
+      //test skip to EOF with correct input skip count
+      assertEquals("Position should be 0", 0, inputStream.getPos());
+      inputStream.skip(testFileLength - 1);
+      assertEquals("Position should be EOF", testFileLength - 1,
+          inputStream.getPos());
 
-      intercept(EOFException.class,
-              new Callable<Long>() {
-                @Override
-                public Long call() throws Exception {
-                  return inputStream.skip(1);
-                }
-              }
-      );
       long elapsedTimeMs = timer.elapsedTimeMs();
       assertTrue(
-              String.format(
-                      "There should not be any network I/O 
(elapsedTimeMs=%1$d).",
-                      elapsedTimeMs),
-              elapsedTimeMs < MAX_ELAPSEDTIMEMS);
+          String.format(
+              "There should not be any network I/O (elapsedTimeMs=%1$d).",
+              elapsedTimeMs),
+          elapsedTimeMs < MAX_ELAPSEDTIMEMS);
+
+      //test negative skip from last valid position
+      skipped = inputStream.skip(-testFileLength+1);

Review comment:
       spacing




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 556439)
    Time Spent: 3.5h  (was: 3h 20m)

> ABFS: Fix boundary conditions in InputStream seek and skip
> ----------------------------------------------------------
>
>                 Key: HADOOP-17527
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17527
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>    Affects Versions: 3.3.0
>            Reporter: Sumangala Patki
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Modify AbfsInputStream seek method to throw EOF exception on seek to 
> contentLength for a non-empty file. With this change, it will no longer be 
> possible for the inputstream position (as obtained by getPos() API) to be 
> moved to contentlength manually, except post reading the last byte.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to