Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB66710A12 for ; Tue, 13 Jan 2015 15:33:30 +0000 (UTC) Received: (qmail 89609 invoked by uid 500); 13 Jan 2015 15:33:31 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 89452 invoked by uid 500); 13 Jan 2015 15:33:31 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 89321 invoked by uid 99); 13 Jan 2015 15:33:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2015 15:33:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 757839AF0DA; Tue, 13 Jan 2015 15:33:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zhz@apache.org To: common-commits@hadoop.apache.org Date: Tue, 13 Jan 2015 15:33:32 -0000 Message-Id: In-Reply-To: <46784a12b3034f6491bddc532bdc2e8f@git.apache.org> References: <46784a12b3034f6491bddc532bdc2e8f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/14] hadoop git commit: YARN-2957. Create unit test to automatically compare YarnConfiguration and yarn-default.xml. (rchiang via rkanter) YARN-2957. Create unit test to automatically compare YarnConfiguration and yarn-default.xml. (rchiang via rkanter) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6ee81a7a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6ee81a7a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6ee81a7a Branch: refs/heads/HDFS-EC Commit: 6ee81a7aee240a2b5ae45401b7a118f346f15948 Parents: 3e29d9b Author: Robert Kanter Authored: Mon Jan 12 11:57:57 2015 -0800 Committer: Zhe Zhang Committed: Tue Jan 13 07:33:16 2015 -0800 ---------------------------------------------------------------------- hadoop-yarn-project/CHANGES.txt | 3 + .../yarn/conf/TestYarnConfigurationFields.java | 106 +++++++++++++++++++ 2 files changed, 109 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/6ee81a7a/hadoop-yarn-project/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 153760c..f849960 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -177,6 +177,9 @@ Release 2.7.0 - UNRELEASED YARN-2956. Added missing links in YARN documentation. (Masatake Iwasaki via jianhe) + YARN-2957. Create unit test to automatically compare YarnConfiguration + and yarn-default.xml. (rchiang via rkanter) + OPTIMIZATIONS BUG FIXES http://git-wip-us.apache.org/repos/asf/hadoop/blob/6ee81a7a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java new file mode 100644 index 0000000..9075d9f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java @@ -0,0 +1,106 @@ +/** + * 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.yarn.conf; + +import java.util.HashSet; + +import org.apache.hadoop.conf.TestConfigurationFieldsBase; + +/** + * Unit test class to compare + * {@link org.apache.hadoop.yarn.conf.YarnConfiguration} and + * yarn-default.xml for missing properties. Currently only throws an error + * if the class is missing a property. + *

+ * Refer to {@link org.apache.hadoop.conf.TestConfigurationFieldsBase} + * for how this class works. + */ +public class TestYarnConfigurationFields extends TestConfigurationFieldsBase { + + @Override + public void initializeMemberVariables() { + xmlFilename = new String("yarn-default.xml"); + configurationClasses = new Class[] { YarnConfiguration.class }; + + + // Allocate for usage + configurationPropsToSkipCompare = new HashSet(); + + // Set error modes + errorIfMissingConfigProps = true; + errorIfMissingXmlProps = false; + + // Specific properties to skip + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_RM_CONFIGURATION_PROVIDER_CLASS); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_CLIENT_FAILOVER_PROXY_PROVIDER); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_IPC_RECORD_FACTORY_CLASS); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_IPC_CLIENT_FACTORY_CLASS); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_IPC_SERVER_FACTORY_CLASS); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_IPC_RPC_IMPL); + configurationPropsToSkipCompare + .add(YarnConfiguration.DEFAULT_RM_SCHEDULER); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONCLIENT_PROTOCOL); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONMASTER_PROTOCOL); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGEMENT_PROTOCOL); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCE_LOCALIZER); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCEMANAGER_ADMINISTRATION_PROTOCOL); + configurationPropsToSkipCompare + .add(YarnConfiguration + .YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCETRACKER_PROTOCOL); + + // Allocate for usage + xmlPropsToSkipCompare = new HashSet(); + xmlPrefixToSkipCompare = new HashSet(); + + // Should probably be moved from yarn-default.xml to mapred-default.xml + xmlPropsToSkipCompare.add("mapreduce.job.hdfs-servers"); + xmlPropsToSkipCompare.add("mapreduce.job.jar"); + + // Possibly obsolete, but unable to verify 100% + xmlPropsToSkipCompare.add("yarn.nodemanager.aux-services.mapreduce_shuffle.class"); + xmlPropsToSkipCompare.add("yarn.resourcemanager.container.liveness-monitor.interval-ms"); + + // Used in the XML file as a variable reference internal to the XML file + xmlPropsToSkipCompare.add("yarn.nodemanager.hostname"); + xmlPropsToSkipCompare.add("yarn.timeline-service.hostname"); + + // Currently defined in TimelineAuthenticationFilterInitializer + xmlPrefixToSkipCompare.add("yarn.timeline-service.http-authentication"); + + // Currently defined in RegistryConstants + xmlPrefixToSkipCompare.add("hadoop.registry"); + } + +}