hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject git commit: HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file path separator. Contributed by Chris Nauroth.
Date Fri, 12 Sep 2014 04:02:51 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 efa9ab363 -> 993ede4db


HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file path separator.
Contributed by Chris Nauroth.

(cherry picked from commit d6ce26986e79d770bc7588649373f2ae3bf15f94)


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

Branch: refs/heads/branch-2
Commit: 993ede4db39f16ca36ff5e1e7ca6ae6b738ae667
Parents: efa9ab3
Author: cnauroth <cnauroth@apache.org>
Authored: Thu Sep 11 20:58:15 2014 -0700
Committer: cnauroth <cnauroth@apache.org>
Committed: Thu Sep 11 20:58:54 2014 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                    | 3 +++
 .../hdfs/server/datanode/TestDataNodeRollingUpgrade.java       | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/993ede4d/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 ffaf4de..8ac8dc3 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -496,6 +496,9 @@ Release 2.6.0 - UNRELEASED
     HDFS-7042. Upgrade fails for Windows HA cluster due to file locks held during
     rename in JournalNode. (cnauroth)
 
+    HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file
+    path separator. (cnauroth)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/993ede4d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeRollingUpgrade.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeRollingUpgrade.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeRollingUpgrade.java
index befb298..7fd8398 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeRollingUpgrade.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeRollingUpgrade.java
@@ -157,7 +157,9 @@ public class TestDataNodeRollingUpgrade {
   }
 
   private boolean isBlockFileInPrevious(File blockFile) {
-    Pattern blockFilePattern = Pattern.compile("^(.*/current/.*/)(current)(/.*)$");
+    Pattern blockFilePattern = Pattern.compile(String.format(
+      "^(.*%1$scurrent%1$s.*%1$s)(current)(%1$s.*)$",
+      Pattern.quote(File.separator)));
     Matcher matcher = blockFilePattern.matcher(blockFile.toString());
     String previousFileName = matcher.replaceFirst("$1" + "previous" + "$3");
     return ((new File(previousFileName)).exists());
@@ -355,7 +357,7 @@ public class TestDataNodeRollingUpgrade {
       assertTrue(isBlockFileInPrevious(blockFiles[1]));
       assertFalse(isTrashRootPresent());
 
-      // Rollback and ensure that neither block file exists in trash or previous.
+      // Finalize and ensure that neither block file exists in trash or previous.
       finalizeRollingUpgrade();
       assertFalse(isTrashRootPresent());
       assertFalse(isBlockFileInPrevious(blockFiles[0]));


Mime
View raw message