hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/3] hadoop git commit: HADOOP-15042. Azure PageBlobInputStream.skip() can return negative value when numberOfPagesRemaining is 0. Contributed by Rajesh Balamohan
Date Tue, 28 Nov 2017 11:58:11 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 3d73d2f09 -> 5c37a0b84
  refs/heads/branch-3.0 72d0be964 -> 8bf74f325
  refs/heads/trunk 94bed5047 -> 0ea182d0f


HADOOP-15042. Azure PageBlobInputStream.skip() can return negative value when numberOfPagesRemaining
is 0.
Contributed by Rajesh Balamohan


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0ea182d0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0ea182d0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0ea182d0

Branch: refs/heads/trunk
Commit: 0ea182d0faa35c726dcb37249d48786bfc8ca04c
Parents: 94bed50
Author: Steve Loughran <stevel@apache.org>
Authored: Tue Nov 28 11:52:59 2017 +0000
Committer: Steve Loughran <stevel@apache.org>
Committed: Tue Nov 28 11:52:59 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/azure/PageBlobInputStream.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0ea182d0/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/PageBlobInputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/PageBlobInputStream.java
b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/PageBlobInputStream.java
index 097201b..aaac490 100644
--- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/PageBlobInputStream.java
+++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/PageBlobInputStream.java
@@ -343,9 +343,9 @@ final class PageBlobInputStream extends InputStream {
 
     // Skip over whole pages as necessary without retrieving them from the
     // server.
-    long pagesToSkipOver = Math.min(
+    long pagesToSkipOver = Math.max(0, Math.min(
         n / PAGE_DATA_SIZE,
-        numberOfPagesRemaining - 1);
+        numberOfPagesRemaining - 1));
     numberOfPagesRemaining -= pagesToSkipOver;
     currentOffsetInBlob += pagesToSkipOver * PAGE_SIZE;
     skipped += pagesToSkipOver * PAGE_DATA_SIZE;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message