You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by as...@apache.org on 2015/05/08 19:30:07 UTC
hadoop git commit: HDFS-7559. Create unit test to automatically
compare HDFS related classes and hdfs-default.xml. (Ray Chiang via asuresh)
Repository: hadoop
Updated Branches:
refs/heads/trunk f0f5e3c07 -> 3cefc02af
HDFS-7559. Create unit test to automatically compare HDFS related classes and hdfs-default.xml. (Ray Chiang via asuresh)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3cefc02a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3cefc02a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3cefc02a
Branch: refs/heads/trunk
Commit: 3cefc02af73faa12a6edce904b98ba543167bec5
Parents: f0f5e3c
Author: Arun Suresh <as...@apache.org>
Authored: Fri May 8 10:29:38 2015 -0700
Committer: Arun Suresh <as...@apache.org>
Committed: Fri May 8 10:29:38 2015 -0700
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +
.../hadoop/tools/TestHdfsConfigFields.java | 80 ++++++++++++++++++++
2 files changed, 83 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/3cefc02a/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 f0483f7..e22f961 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -522,6 +522,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8207. Improper log message when blockreport interval compared with
initial delay. (Brahma Reddy Battula and Ashish Singhi via ozawa)
+ HDFS-7559. Create unit test to automatically compare HDFS related classes
+ and hdfs-default.xml. (Ray Chiang via asuresh)
+
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
http://git-wip-us.apache.org/repos/asf/hadoop/blob/3cefc02a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestHdfsConfigFields.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestHdfsConfigFields.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestHdfsConfigFields.java
new file mode 100644
index 0000000..0e75d81
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestHdfsConfigFields.java
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdfs.tools;
+
+import java.util.HashSet;
+
+import org.apache.hadoop.conf.TestConfigurationFieldsBase;
+import org.apache.hadoop.hdfs.DFSConfigKeys;
+
+/**
+ * Unit test class to compare the following MR Configuration classes:
+ * <p></p>
+ * {@link org.apache.hadoop.hdfs.DFSConfigKeys}
+ * <p></p>
+ * against hdfs-default.xml for missing properties. Currently only
+ * throws an error if the class is missing a property.
+ * <p></p>
+ * Refer to {@link org.apache.hadoop.conf.TestConfigurationFieldsBase}
+ * for how this class works.
+ */
+public class TestHdfsConfigFields extends TestConfigurationFieldsBase {
+
+ @Override
+ public void initializeMemberVariables() {
+ xmlFilename = new String("hdfs-default.xml");
+ configurationClasses = new Class[] { DFSConfigKeys.class };
+
+ // Set error modes
+ errorIfMissingConfigProps = true;
+ errorIfMissingXmlProps = false;
+
+ // Allocate
+ xmlPropsToSkipCompare = new HashSet<String>();
+ xmlPrefixToSkipCompare = new HashSet<String>();
+
+ // Used in native code fuse_connect.c
+ xmlPropsToSkipCompare.add("hadoop.fuse.timer.period");
+ xmlPropsToSkipCompare.add("hadoop.fuse.connection.timeout");
+
+ // Used dynamically as part of DFSConfigKeys.DFS_NAMENODE_EDITS_PLUGIN_PREFIX
+ xmlPropsToSkipCompare.add("dfs.namenode.edits.journal-plugin.qjournal");
+
+ // Example (not real) property in hdfs-default.xml
+ xmlPropsToSkipCompare.add("dfs.ha.namenodes.EXAMPLENAMESERVICE");
+
+ // Defined in org.apache.hadoop.fs.CommonConfigurationKeys
+ xmlPropsToSkipCompare.add("hadoop.user.group.metrics.percentiles.intervals");
+
+ // Used oddly by DataNode to create new config String
+ xmlPropsToSkipCompare.add("hadoop.hdfs.configuration.version");
+
+ // Kept in the NfsConfiguration class in the hadoop-hdfs-nfs module
+ xmlPrefixToSkipCompare.add("nfs");
+
+ // Not a hardcoded property. Used by SaslRpcClient
+ xmlPrefixToSkipCompare.add("dfs.namenode.kerberos.principal.pattern");
+
+ // Skip comparing in branch-2. Removed in trunk with HDFS-7985.
+ xmlPropsToSkipCompare.add("dfs.webhdfs.enabled");
+
+ // Some properties have moved to HdfsClientConfigKeys
+ xmlPropsToSkipCompare.add("dfs.client.short.circuit.replica.stale.threshold.ms");
+ }
+}