hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [11/19] hadoop git commit: HDFS-8665. Fix replication check in DFSTestUtils#waitForReplication.
Date Fri, 26 Jun 2015 21:39:06 GMT
HDFS-8665. Fix replication check in DFSTestUtils#waitForReplication.


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

Branch: refs/heads/HDFS-7240
Commit: ff0e5e572f5dcf7b49381cbe901360f6e171d423
Parents: aa5b15b
Author: Andrew Wang <wang@apache.org>
Authored: Thu Jun 25 17:29:24 2015 -0700
Committer: Andrew Wang <wang@apache.org>
Committed: Thu Jun 25 17:29:24 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                 | 2 ++
 .../src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java   | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ff0e5e57/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 01bb92d..dcedb9f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -672,6 +672,8 @@ Release 2.8.0 - UNRELEASED
     HDFS-8640. Make reserved RBW space visible through JMX. (kanaka kumar
     avvaru via Arpit Agarwal)
 
+    HDFS-8665. Fix replication check in DFSTestUtils#waitForReplication. (wang)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ff0e5e57/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
index 96fb669..89ee674 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
@@ -535,7 +535,14 @@ public class DFSTestUtil {
       public Boolean get() {
         try {
           FileStatus stat = dfs.getFileStatus(file);
-          return replication == stat.getReplication();
+          BlockLocation[] locs = dfs.getFileBlockLocations(stat, 0, stat
+              .getLen());
+          for (BlockLocation loc : locs) {
+            if (replication != loc.getHosts().length) {
+              return false;
+            }
+          }
+          return true;
         } catch (IOException e) {
           LOG.info("getFileStatus on path " + file + " failed!", e);
           return false;


Mime
View raw message