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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]