sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [08/14] sqoop git commit: SQOOP-1748: Sqoop2: Client throws NPE when misconfigured for Kerberos
Date Sat, 22 Nov 2014 01:43:53 GMT
SQOOP-1748: Sqoop2: Client throws NPE when misconfigured for Kerberos

(Richard Zhou via Abraham Elmahrek)


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

Branch: refs/heads/cdh5-1.99.4
Commit: 81e75fb5f239a63a1dbb7447686fd73108a27782
Parents: 1558d94
Author: Abraham Elmahrek <abraham@elmahrek.com>
Authored: Mon Nov 17 21:30:49 2014 -0800
Committer: Abraham Elmahrek <abraham@elmahrek.com>
Committed: Wed Nov 19 13:51:57 2014 -0800

----------------------------------------------------------------------
 client/src/main/java/org/apache/sqoop/client/ClientError.java  | 3 +++
 .../java/org/apache/sqoop/client/request/ResourceRequest.java  | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/81e75fb5/client/src/main/java/org/apache/sqoop/client/ClientError.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/ClientError.java b/client/src/main/java/org/apache/sqoop/client/ClientError.java
index cd1edfe..eb24346 100644
--- a/client/src/main/java/org/apache/sqoop/client/ClientError.java
+++ b/client/src/main/java/org/apache/sqoop/client/ClientError.java
@@ -32,6 +32,9 @@ public enum ClientError implements ErrorCode {
 
   /** Given connector is not known to the server **/
   CLIENT_0003("Connector do not exists"),
+
+  /** The system was not able to find valid Kerberos tikcet cache (kinit). */
+  CLIENT_0004("Unable to find valid Kerberos ticket cache (kinit)");
   ;
 
   private final String message;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/81e75fb5/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
index 028444c..db16107 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
@@ -114,14 +114,16 @@ public class ResourceRequest {
 
           throw new SqoopException(ClientError.CLIENT_0001, ex.getThrowable());
         }
+      } else {
+        throw new SqoopException(ClientError.CLIENT_0000);
       }
       return result.toString();
     } catch (IOException ex) {
       LOG.trace("ERROR: ", ex);
-      return "";
+      throw new SqoopException(ClientError.CLIENT_0000, ex);
     } catch (AuthenticationException ex) {
       LOG.trace("ERROR: ", ex);
-      return "";
+      throw new SqoopException(ClientError.CLIENT_0004, ex);
     } finally {
       try {
         if (wr != null) {


Mime
View raw message