hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject hadoop git commit: HDFS-9155. OEV should treat .XML files as XML even when the file name extension is uppercase (nijel via cmccabe)
Date Mon, 05 Oct 2015 20:03:03 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 a509413c9 -> 05b88080b


HDFS-9155. OEV should treat .XML files as XML even when the file name extension is uppercase
(nijel via cmccabe)

(cherry picked from commit 2fc2b50534c2052ed3f6f38f30d29d98d99fd10a)


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

Branch: refs/heads/branch-2
Commit: 05b88080b6898be635e953d74ca1b71d48e17a49
Parents: a509413
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Mon Oct 5 12:53:58 2015 -0700
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Mon Oct 5 13:02:55 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                  | 3 +++
 .../hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java    | 2 +-
 .../tools/offlineEditsViewer/TestOfflineEditsViewer.java     | 8 ++++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/05b88080/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 4669e3f..baad927 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -668,6 +668,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-8979. Clean up checkstyle warnings in hadoop-hdfs-client module.
     (Mingliang Liu via wheat9)
 
+    HDFS-9155. OEV should treat .XML files as XML even when the file name
+    extension is uppercase (nijel via cmccabe)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/05b88080/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
index cd1e73b..54b8511 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
@@ -136,7 +136,7 @@ public class OfflineEditsViewer extends Configured implements Tool {
         visitor = OfflineEditsVisitorFactory.getEditsVisitor(
             outputFileName, processor, flags.getPrintToScreen());
       }
-      boolean xmlInput = inputFileName.endsWith(".xml");
+      boolean xmlInput = inputFileName.toLowerCase().endsWith(".xml");
       OfflineEditsLoader loader = OfflineEditsLoaderFactory.
           createLoader(visitor, inputFileName, xmlInput, flags);
       loader.loadEdits();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/05b88080/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
index 2ad7b60..fbbbc29 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
@@ -100,10 +100,17 @@ public class TestOfflineEditsViewer {
     LOG.info("Generated edits=" + edits);
     String editsParsedXml = folder.newFile("editsParsed.xml").getAbsolutePath();
     String editsReparsed = folder.newFile("editsParsed").getAbsolutePath();
+    // capital case extension
+    String editsParsedXML_caseInSensitive =
+        folder.newFile("editsRecoveredParsed.XML").getAbsolutePath();
 
     // parse to XML then back to binary
     assertEquals(0, runOev(edits, editsParsedXml, "xml", false));
+    assertEquals(0, runOev(edits, editsParsedXML_caseInSensitive, "xml", false));
     assertEquals(0, runOev(editsParsedXml, editsReparsed, "binary", false));
+    assertEquals(0,
+        runOev(editsParsedXML_caseInSensitive, editsReparsed, "binary", false));
+
 
     // judgment time
     assertTrue("Edits " + edits + " should have all op codes",
@@ -115,6 +122,7 @@ public class TestOfflineEditsViewer {
         filesEqualIgnoreTrailingZeros(edits, editsReparsed));
   }
 
+
   @Test
   public void testRecoveryMode() throws IOException {
     // edits generated by nnHelper (MiniDFSCluster), should have all op codes


Mime
View raw message