From common-commits-return-87947-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Sep 14 22:09:41 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B7349180647 for ; Fri, 14 Sep 2018 22:09:40 +0200 (CEST) Received: (qmail 45090 invoked by uid 500); 14 Sep 2018 20:09:39 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 45081 invoked by uid 99); 14 Sep 2018 20:09:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2018 20:09:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 892E3E004F; Fri, 14 Sep 2018 20:09:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nanda@apache.org To: common-commits@hadoop.apache.org Message-Id: <86a64531d91e4a199cec727f1e9998b7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDDS-454. TestChunkStreams#testErrorReadGroupInputStream & TestChunkStreams#testReadGroupInputStream are failing. Contributed by chencan. Date: Fri, 14 Sep 2018 20:09:39 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/trunk c1df3084f -> 5470de420 HDDS-454. TestChunkStreams#testErrorReadGroupInputStream & TestChunkStreams#testReadGroupInputStream are failing. Contributed by chencan. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5470de42 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5470de42 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5470de42 Branch: refs/heads/trunk Commit: 5470de420b2660e3042a5fec566ecc6b0d8ff93a Parents: c1df308 Author: Nanda kumar Authored: Sat Sep 15 01:38:13 2018 +0530 Committer: Nanda kumar Committed: Sat Sep 15 01:38:57 2018 +0530 ---------------------------------------------------------------------- .../org/apache/hadoop/ozone/om/TestChunkStreams.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/5470de42/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestChunkStreams.java ---------------------------------------------------------------------- diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestChunkStreams.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestChunkStreams.java index 7ce916a..7ff9d63 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestChunkStreams.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestChunkStreams.java @@ -121,6 +121,7 @@ public class TestChunkStreams { int tempOffset = offset; ChunkInputStream in = new ChunkInputStream(null, null, null, new ArrayList<>(), null) { + private long pos = 0; private ByteArrayInputStream in = new ByteArrayInputStream(buf, tempOffset, 100); @@ -131,7 +132,7 @@ public class TestChunkStreams { @Override public long getPos() throws IOException { - throw new UnsupportedOperationException(); + return pos; } @Override @@ -147,7 +148,9 @@ public class TestChunkStreams { @Override public int read(byte[] b, int off, int len) throws IOException { - return in.read(b, off, len); + int readLen = in.read(b, off, len); + pos += readLen; + return readLen; } }; inputStreams.add(in); @@ -175,6 +178,7 @@ public class TestChunkStreams { int tempOffset = offset; ChunkInputStream in = new ChunkInputStream(null, null, null, new ArrayList<>(), null) { + private long pos = 0; private ByteArrayInputStream in = new ByteArrayInputStream(buf, tempOffset, 100); @@ -185,7 +189,7 @@ public class TestChunkStreams { @Override public long getPos() throws IOException { - throw new UnsupportedOperationException(); + return pos; } @Override @@ -201,7 +205,9 @@ public class TestChunkStreams { @Override public int read(byte[] b, int off, int len) throws IOException { - return in.read(b, off, len); + int readLen = in.read(b, off, len); + pos += readLen; + return readLen; } }; inputStreams.add(in); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org