Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13BEF100A8 for ; Thu, 20 Feb 2014 18:34:54 +0000 (UTC) Received: (qmail 13967 invoked by uid 500); 20 Feb 2014 18:34:52 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 13850 invoked by uid 500); 20 Feb 2014 18:34:51 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 13756 invoked by uid 99); 20 Feb 2014 18:34:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 18:34:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 18:34:47 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B04EF2388A4A; Thu, 20 Feb 2014 18:34:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1570295 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src: main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java main/java/org/apache/hadoop/hdfs/DFSUtil.java test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java Date: Thu, 20 Feb 2014 18:34:25 -0000 To: hdfs-commits@hadoop.apache.org From: jing9@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140220183425.B04EF2388A4A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jing9 Date: Thu Feb 20 18:34:24 2014 New Revision: 1570295 URL: http://svn.apache.org/r1570295 Log: HADOOP-10348. Deprecate hadoop.ssl.configuration in branch-2, and remove it in trunk. Contributed by Haohui Mai. Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java?rev=1570295&r1=1570294&r2=1570295&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSConfigKeys.java Thu Feb 20 18:34:24 2014 @@ -377,8 +377,6 @@ public class DFSConfigKeys extends Commo public static final int DFS_NAMENODE_SERVICE_HANDLER_COUNT_DEFAULT = 10; public static final String DFS_SUPPORT_APPEND_KEY = "dfs.support.append"; public static final boolean DFS_SUPPORT_APPEND_DEFAULT = true; - public static final String DFS_HTTPS_ENABLE_KEY = "dfs.https.enable"; - public static final boolean DFS_HTTPS_ENABLE_DEFAULT = false; public static final String DFS_HTTP_POLICY_KEY = "dfs.http.policy"; public static final String DFS_HTTP_POLICY_DEFAULT = HttpConfig.Policy.HTTP_ONLY.name(); public static final String DFS_DEFAULT_CHUNK_VIEW_SIZE_KEY = "dfs.default.chunk.view.size"; Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java?rev=1570295&r1=1570294&r2=1570295&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java Thu Feb 20 18:34:24 2014 @@ -1553,44 +1553,11 @@ public class DFSUtil { } /** - * Get http policy. Http Policy is chosen as follows: - *
    - *
  1. If hadoop.ssl.enabled is set, http endpoints are not started. Only - * https endpoints are started on configured https ports
  2. - *
  3. This configuration is overridden by dfs.https.enable configuration, if - * it is set to true. In that case, both http and https endpoints are stared.
  4. - *
  5. All the above configurations are overridden by dfs.http.policy - * configuration. With this configuration you can set http-only, https-only - * and http-and-https endpoints.
  6. - *
- * See hdfs-default.xml documentation for more details on each of the above - * configuration settings. + * Get http policy. */ public static HttpConfig.Policy getHttpPolicy(Configuration conf) { - String policyStr = conf.get(DFSConfigKeys.DFS_HTTP_POLICY_KEY); - if (policyStr == null) { - boolean https = conf.getBoolean(DFSConfigKeys.DFS_HTTPS_ENABLE_KEY, - DFSConfigKeys.DFS_HTTPS_ENABLE_DEFAULT); - - boolean hadoopSsl = conf.getBoolean( - CommonConfigurationKeys.HADOOP_SSL_ENABLED_KEY, - CommonConfigurationKeys.HADOOP_SSL_ENABLED_DEFAULT); - - if (hadoopSsl) { - LOG.warn(CommonConfigurationKeys.HADOOP_SSL_ENABLED_KEY - + " is deprecated. Please use " + DFSConfigKeys.DFS_HTTP_POLICY_KEY - + "."); - } - if (https) { - LOG.warn(DFSConfigKeys.DFS_HTTPS_ENABLE_KEY - + " is deprecated. Please use " + DFSConfigKeys.DFS_HTTP_POLICY_KEY - + "."); - } - - return (hadoopSsl || https) ? HttpConfig.Policy.HTTP_AND_HTTPS - : HttpConfig.Policy.HTTP_ONLY; - } - + String policyStr = conf.get(DFSConfigKeys.DFS_HTTP_POLICY_KEY, + DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT); HttpConfig.Policy policy = HttpConfig.Policy.fromString(policyStr); if (policy == null) { throw new HadoopIllegalArgumentException("Unregonized value '" Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java?rev=1570295&r1=1570294&r2=1570295&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java (original) +++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestHttpPolicy.java Thu Feb 20 18:34:24 2014 @@ -17,12 +17,8 @@ */ package org.apache.hadoop.hdfs; -import static org.apache.hadoop.http.HttpConfig.Policy.HTTP_AND_HTTPS; -import static org.apache.hadoop.http.HttpConfig.Policy.HTTP_ONLY; - import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.conf.Configuration; -import org.junit.Assert; import org.junit.Test; public final class TestHttpPolicy { @@ -33,22 +29,4 @@ public final class TestHttpPolicy { conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, "invalid"); DFSUtil.getHttpPolicy(conf); } - - @Test - public void testDeprecatedConfiguration() { - Configuration conf = new Configuration(false); - Assert.assertSame(HTTP_ONLY, DFSUtil.getHttpPolicy(conf)); - - conf.setBoolean(DFSConfigKeys.DFS_HTTPS_ENABLE_KEY, true); - Assert.assertSame(HTTP_AND_HTTPS, DFSUtil.getHttpPolicy(conf)); - - conf = new Configuration(false); - conf.setBoolean(DFSConfigKeys.HADOOP_SSL_ENABLED_KEY, true); - Assert.assertSame(HTTP_AND_HTTPS, DFSUtil.getHttpPolicy(conf)); - - conf = new Configuration(false); - conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, HTTP_ONLY.name()); - conf.setBoolean(DFSConfigKeys.DFS_HTTPS_ENABLE_KEY, true); - Assert.assertSame(HTTP_ONLY, DFSUtil.getHttpPolicy(conf)); - } }