hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [08/13] hadoop git commit: HDFS-10291 TestShortCircuitLocalRead failing (stevel)
Date Wed, 20 Apr 2016 22:37:13 GMT
HDFS-10291 TestShortCircuitLocalRead failing (stevel)

(cherry picked from commit dd64769699ea4c85abdf9c590b9db680837e8b27)


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

Branch: refs/heads/YARN-3368
Commit: 11e53d259caaa349a2b3f84b05d6032107dc60a9
Parents: b37e391
Author: Steve Loughran <stevel@apache.org>
Authored: Mon Apr 18 10:26:35 2016 +0100
Committer: Wangda Tan <wangda@apache.org>
Committed: Wed Apr 20 15:36:46 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/11e53d25/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java
index f4fbebc..116dc88 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/shortcircuit/TestShortCircuitLocalRead.java
@@ -153,8 +153,11 @@ public class TestShortCircuitLocalRead {
     //Read a small number of bytes first.
     int nread = stm.read(actual, 0, 3);
     nread += stm.read(actual, nread, 2);
-    //Read across chunk boundary
-    nread += stm.read(actual, nread, 517);
+    int len = 517;
+    if (actual.length - nread >= len) {
+      //Read across chunk boundary
+      nread += stm.read(actual, nread, len);
+    }
     checkData(actual, readOffset, expected, nread, "A few bytes");
     //Now read rest of it
     while (nread < actual.length) {


Mime
View raw message