hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject hadoop git commit: HDFS-8584. NPE in distcp when ssl configuration file does not exist in class path. Contributed by Surendra Singh Lilhore.
Date Tue, 12 Jan 2016 01:19:12 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 8172921f6 -> a9cbfd717


HDFS-8584. NPE in distcp when ssl configuration file does not exist in class path. Contributed
by Surendra Singh Lilhore.

(cherry picked from commit c2e2e134555010ec28da296bcfef4ba2613a5c6c)


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

Branch: refs/heads/branch-2.8
Commit: a9cbfd717c3d0cc4e353eff4281df10b5ac3756d
Parents: 8172921
Author: Xiaoyu Yao <xyao@apache.org>
Authored: Mon Jan 11 16:59:46 2016 -0800
Committer: Xiaoyu Yao <xyao@apache.org>
Committed: Mon Jan 11 17:16:43 2016 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt              |  3 +++
 .../src/main/java/org/apache/hadoop/tools/DistCp.java    | 11 +++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a9cbfd71/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 0328998..1ee3379 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1648,6 +1648,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9639. Inconsistent Logging in BootstrapStandby. (Xiaobing Zhou via
     Arpit Agarwal)
 
+    HDFS-8584. NPE in distcp when ssl configuration file does not exist in
+    class path. (Surendra Singh Lilhore via Xiaoyu Yao)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a9cbfd71/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
index f919d21..9db2b1b 100644
--- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
+++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.tools;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.Random;
 
 import org.apache.commons.logging.Log;
@@ -270,8 +271,14 @@ public class DistCp extends Configured implements Tool {
    */
   private void setupSSLConfig(Job job) throws IOException  {
     Configuration configuration = job.getConfiguration();
-    Path sslConfigPath = new Path(configuration.
-        getResource(inputOptions.getSslConfigurationFile()).toString());
+    URL sslFileUrl = configuration.getResource(inputOptions
+        .getSslConfigurationFile());
+    if (sslFileUrl == null) {
+      throw new IOException(
+          "Given ssl configuration file doesn't exist in class path : "
+              + inputOptions.getSslConfigurationFile());
+    }
+    Path sslConfigPath = new Path(sslFileUrl.toString());
 
     addSSLFilesToDistCache(job, sslConfigPath);
     configuration.set(DistCpConstants.CONF_LABEL_SSL_CONF, sslConfigPath.getName());


Mime
View raw message