sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-1971: Sqoop2: strURL may not be initialized when calling addDelegationToken
Date Fri, 09 Jan 2015 07:54:25 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 8d25d1fed -> aeab9150b


SQOOP-1971: Sqoop2: strURL may not be initialized when calling addDelegationToken

(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/aeab9150
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/aeab9150
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/aeab9150

Branch: refs/heads/sqoop2
Commit: aeab9150b2d4af5cf3b0f596a1d181bd7914edd3
Parents: 8d25d1f
Author: Abraham Elmahrek <abe@apache.org>
Authored: Thu Jan 8 23:53:15 2015 -0800
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Thu Jan 8 23:53:15 2015 -0800

----------------------------------------------------------------------
 .../org/apache/sqoop/client/request/ResourceRequest.java    | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/aeab9150/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 ce6a9e5..aa5fd35 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
@@ -49,7 +49,6 @@ import java.util.Locale;
 public class ResourceRequest {
   private static final Logger LOG = Logger.getLogger(ResourceRequest.class);
   private DelegationTokenAuthenticatedURL.Token authToken;
-  private String strURL;
 
   public ResourceRequest() {
     this.authToken = new DelegationTokenAuthenticatedURL.Token();
@@ -58,7 +57,6 @@ public class ResourceRequest {
   public ResourceRequest(DelegationTokenAuthenticatedURL.Token token) {
     this.authToken = token == null ? new DelegationTokenAuthenticatedURL.Token() : token;
   }
-
   protected String doHttpRequest(String strURL, String method) {
     return doHttpRequest(strURL, method, "");
   }
@@ -67,7 +65,6 @@ public class ResourceRequest {
     DataOutputStream wr = null;
     BufferedReader reader = null;
     try {
-      this.strURL = strURL;
       URL url = new URL(strURL);
       HttpURLConnection conn = new DelegationTokenAuthenticatedURL().openConnection(url,
authToken);
 
@@ -183,10 +180,10 @@ public class ResourceRequest {
     return doHttpRequest(url, HttpMethod.DELETE);
   }
 
-  public Token<?>[] addDelegationTokens(String renewer,
+  public Token<?>[] addDelegationTokens(String strURL, String renewer,
                                         Credentials credentials) throws IOException {
     Token<?>[] tokens = null;
-    Text dtService = getDelegationTokenService();
+    Text dtService = getDelegationTokenService(strURL);
     Token<?> token = credentials.getToken(dtService);
     if (token == null) {
       URL url = new URL(strURL);
@@ -212,7 +209,7 @@ public class ResourceRequest {
     return tokens;
   }
 
-  private Text getDelegationTokenService() throws IOException {
+  private Text getDelegationTokenService(String strURL) throws IOException {
     URL url = new URL(strURL);
     InetSocketAddress addr = new InetSocketAddress(url.getHost(),
             url.getPort());


Mime
View raw message