hadoop-ozone-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ayushsax...@apache.org
Subject [hadoop-ozone] branch master updated: HDDS-2786. ITestOzoneContractSeek zero byte file failures (#384)
Date Sun, 22 Dec 2019 15:20:16 GMT
This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new a457616  HDDS-2786. ITestOzoneContractSeek zero byte file failures (#384)
a457616 is described below

commit a4576160c27c0d0b0015d3b0f0413d30ac4339b1
Author: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
AuthorDate: Sun Dec 22 16:20:08 2019 +0100

    HDDS-2786. ITestOzoneContractSeek zero byte file failures (#384)
---
 .../java/org/apache/hadoop/ozone/client/io/KeyInputStream.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyInputStream.java
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyInputStream.java
index 0ed61bf..17b44de 100644
--- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyInputStream.java
+++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyInputStream.java
@@ -207,12 +207,12 @@ public class KeyInputStream extends InputStream implements Seekable
{
   @Override
   public synchronized void seek(long pos) throws IOException {
     checkOpen();
+    if (pos == 0 && length == 0) {
+      // It is possible for length and pos to be zero in which case
+      // seek should return instead of throwing exception
+      return;
+    }
     if (pos < 0 || pos > length) {
-      if (pos == 0) {
-        // It is possible for length and pos to be zero in which case
-        // seek should return instead of throwing exception
-        return;
-      }
       throw new EOFException(
           "EOF encountered at pos: " + pos + " for key: " + key);
     }


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


Mime
View raw message