HDDS-627. OzoneFS read from an MR Job throws 
java.lang.ArrayIndexOutOfBoundsException. Contributed by Mukul Kumar Singh.


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

Branch: refs/heads/HDFS-13891
Commit: c05b260069511f2993a67683555ed2e1aea49a0a
Parents: 6dcfef7
Author: Xiaoyu Yao <[email protected]>
Authored: Thu Oct 11 15:02:18 2018 -0700
Committer: Xiaoyu Yao <[email protected]>
Committed: Thu Oct 11 15:08:22 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c05b2600/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java
----------------------------------------------------------------------
diff --git 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java
 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java
index 2b10578..2f17035 100644
--- 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java
+++ 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ChunkGroupInputStream.java
@@ -129,7 +129,8 @@ public class ChunkGroupInputStream extends InputStream 
implements Seekable {
       totalReadLen += numBytesRead;
       off += numBytesRead;
       len -= numBytesRead;
-      if (current.getRemaining() <= 0) {
+      if (current.getRemaining() <= 0 &&
+        ((currentStreamIndex + 1) < streamEntries.size())) {
         currentStreamIndex += 1;
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to