sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2786: Sqoop2: If AUTHENTICATION_KERBEROS_KEYTAB is not found in the properties throw a meaningful exception
Date Thu, 21 Jan 2016 09:49:04 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 80b1790b9 -> 22b1a0513


SQOOP-2786: Sqoop2: If AUTHENTICATION_KERBEROS_KEYTAB is not found in the properties throw
a meaningful exception

(Abraham Fine via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: 22b1a05137ff9cc7e6c5a686ada65b53091b56f1
Parents: 80b1790
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Thu Jan 21 10:48:28 2016 +0100
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Thu Jan 21 10:48:28 2016 +0100

----------------------------------------------------------------------
 .../org/apache/sqoop/common/MapContext.java     | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/22b1a051/common/src/main/java/org/apache/sqoop/common/MapContext.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/common/MapContext.java b/common/src/main/java/org/apache/sqoop/common/MapContext.java
index 3167530..d89bde9 100644
--- a/common/src/main/java/org/apache/sqoop/common/MapContext.java
+++ b/common/src/main/java/org/apache/sqoop/common/MapContext.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.common;
 
+import org.apache.log4j.Logger;
 import org.apache.sqoop.classification.InterfaceAudience;
 import org.apache.sqoop.classification.InterfaceStability;
 
@@ -33,6 +34,8 @@ import java.util.regex.Pattern;
 @InterfaceStability.Unstable
 public class MapContext implements ImmutableContext {
 
+  private static final Logger LOG = Logger.getLogger(MapContext.class);
+
   private final Map<String, String> options;
 
   public MapContext(Map<String, String> options) {
@@ -48,7 +51,11 @@ public class MapContext implements ImmutableContext {
    */
   @Override
   public String getString(String key) {
-    return options.get(key);
+    String value = options.get(key);
+    if (value == null || value.trim().length() == 0) {
+      LOG.debug("Value not found in configuration for key: " + key);
+    }
+    return value;
   }
 
   @Override
@@ -80,6 +87,7 @@ public class MapContext implements ImmutableContext {
   @Override
   public long getLong(String key, long defaultValue) {
     if (!options.containsKey(key)) {
+      LOG.debug("Value not found in configuration for key: " + key);
       return defaultValue;
     }
 
@@ -94,6 +102,7 @@ public class MapContext implements ImmutableContext {
   @Override
   public int getInt(String key, int defaultValue) {
     if (!options.containsKey(key)) {
+      LOG.debug("Value not found in configuration for key: " + key);
       return defaultValue;
     }
 
@@ -116,6 +125,10 @@ public class MapContext implements ImmutableContext {
       }
     }
 
+    if (subProps.isEmpty()) {
+      LOG.debug("Value not found in configuration for prefix: " + prefix);
+    }
+
     return subProps;
   }
 
@@ -137,6 +150,11 @@ public class MapContext implements ImmutableContext {
         result.put(item, getString(item));
       }
     }
+
+    if (result.isEmpty()) {
+      LOG.debug("Value not found in configuration for regex: " + regex);
+    }
+
     return result;
   }
 


Mime
View raw message