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-2089: Sqoop2: Clone configuration object instead of overwriting global
Date Fri, 20 Feb 2015 17:28:03 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 70a08a029 -> 2597a4e9c


SQOOP-2089: Sqoop2: Clone configuration object instead of overwriting global

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

Branch: refs/heads/sqoop2
Commit: 2597a4e9cee9b98b27e8b666750c4254183a5646
Parents: 70a08a0
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Fri Feb 20 09:27:31 2015 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Fri Feb 20 09:27:31 2015 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java | 8 +++++---
 .../java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/2597a4e9/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java
b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java
index 353c1f2..6754536 100644
--- a/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java
+++ b/connector/connector-hdfs/src/main/java/org/apache/sqoop/connector/hdfs/HdfsUtils.java
@@ -36,12 +36,14 @@ public class HdfsUtils {
    * @return Configuration object.
    */
   public static Configuration configureURI(Configuration conf, LinkConfiguration linkConfiguration)
{
+    Configuration newConf = new Configuration(conf);
+
     if (linkConfiguration.linkConfig.uri != null) {
-      conf.set("fs.default.name", linkConfiguration.linkConfig.uri);
-      conf.set("fs.defaultFS", linkConfiguration.linkConfig.uri);
+      newConf.set("fs.default.name", linkConfiguration.linkConfig.uri);
+      newConf.set("fs.defaultFS", linkConfiguration.linkConfig.uri);
     }
 
-    return conf;
+    return newConf;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2597a4e9/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java
----------------------------------------------------------------------
diff --git a/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java
b/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java
index 8eefe05..310eadc 100644
--- a/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java
+++ b/connector/connector-hdfs/src/test/java/org/apache/sqoop/connector/hdfs/TestHdfsUtils.java
@@ -42,7 +42,7 @@ public class TestHdfsUtils {
 
     linkConfiguration.linkConfig.uri = TEST_URI;
 
-    assertEquals(conf, HdfsUtils.configureURI(conf, linkConfiguration));
+    conf = HdfsUtils.configureURI(conf, linkConfiguration);
     assertEquals(TEST_URI, conf.get("fs.default.name"));
     assertEquals(TEST_URI, conf.get("fs.defaultFS"));
   }


Mime
View raw message