From c05b260069511f2993a67683555ed2e1aea49a0a Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Thu, 11 Oct 2018 15:02:18 -0700 Subject: [PATCH] HDDS-627. OzoneFS read from an MR Job throws java.lang.ArrayIndexOutOfBoundsException. Contributed by Mukul Kumar Singh. --- .../apache/hadoop/ozone/client/io/ChunkGroupInputStream.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2b10578824..2f17035036 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 synchronized int read(byte[] b, int off, int len) throws IOException { totalReadLen += numBytesRead; off += numBytesRead; len -= numBytesRead; - if (current.getRemaining() <= 0) { + if (current.getRemaining() <= 0 && + ((currentStreamIndex + 1) < streamEntries.size())) { currentStreamIndex += 1; } }