sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1347112 - in /sqoop/trunk: build.xml src/java/com/cloudera/sqoop/manager/ImportJobContext.java src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java
Date Wed, 06 Jun 2012 20:49:36 GMT
Author: blee
Date: Wed Jun  6 20:49:36 2012
New Revision: 1347112

URL: http://svn.apache.org/viewvc?rev=1347112&view=rev
Log:
SQOOP-480  MS SQL server connector is incompatible with Sqoop-1.4

Modified:
    sqoop/trunk/build.xml
    sqoop/trunk/src/java/com/cloudera/sqoop/manager/ImportJobContext.java
    sqoop/trunk/src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java

Modified: sqoop/trunk/build.xml
URL: http://svn.apache.org/viewvc/sqoop/trunk/build.xml?rev=1347112&r1=1347111&r2=1347112&view=diff
==============================================================================
--- sqoop/trunk/build.xml (original)
+++ sqoop/trunk/build.xml Wed Jun  6 20:49:36 2012
@@ -248,6 +248,18 @@
   <property name="java.security.krb5.kdc"
             value="kdc0.ox.ac.uk:kdc1.ox.ac.uk"/>
 
+  <if>
+    <isset property="sqoop.test.msserver.connector.factory"/>
+    <then>
+      <echo message="Use ${sqoop.test.msserver.connector.factory}"/>
+    </then>
+    <else>
+      <echo message="Use built-in SQL server connector by default"/>
+      <property name="sqoop.test.msserver.connector.factory"
+                value="org.apache.sqoop.manager.DefaultManagerFactory"/>
+    </else>
+  </if>
+
   <!-- The classpath for compiling and running Sqoop -->
   <if>
     <isset property="hadoop.home" />
@@ -715,6 +727,9 @@
       <sysproperty key="sqoop.test.sqlserver.connectstring.host_url"
                    value="${sqoop.test.sqlserver.connectstring.host_url}"/>
 
+      <sysproperty key="sqoop.test.msserver.connector.factory"
+                   value="${sqoop.test.msserver.connector.factory}"/>
+
       <sysproperty key="java.security.krb5.realm"
                    value="${java.security.krb5.realm}"/>
 

Modified: sqoop/trunk/src/java/com/cloudera/sqoop/manager/ImportJobContext.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/com/cloudera/sqoop/manager/ImportJobContext.java?rev=1347112&r1=1347111&r2=1347112&view=diff
==============================================================================
--- sqoop/trunk/src/java/com/cloudera/sqoop/manager/ImportJobContext.java (original)
+++ sqoop/trunk/src/java/com/cloudera/sqoop/manager/ImportJobContext.java Wed Jun  6 20:49:36
2012
@@ -33,6 +33,10 @@ public class ImportJobContext
     super(table, jar, opts, destination);
   }
 
+  public void setConnManager(ConnManager mgr) {
+    super.setConnManager(mgr);
+  }
+
   public ConnManager getConnManager() {
     return (ConnManager)super.getConnManager();
   }

Modified: sqoop/trunk/src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java?rev=1347112&r1=1347111&r2=1347112&view=diff
==============================================================================
--- sqoop/trunk/src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java
(original)
+++ sqoop/trunk/src/test/com/cloudera/sqoop/manager/SQLServerManagerImportManualTest.java
Wed Jun  6 20:49:36 2012
@@ -30,8 +30,10 @@ import java.util.ArrayList;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IOUtils;
+import org.apache.sqoop.ConnFactory;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -77,9 +79,20 @@ public class SQLServerManagerImportManua
   static final String CONNECT_STRING = HOST_URL
               + ";databaseName=" + DATABASE_NAME;
 
+  static final String CONNECTOR_FACTORY = System.getProperty(
+      "sqoop.test.msserver.connector.factory",
+      ConnFactory.DEFAULT_FACTORY_CLASS_NAMES);
+
   // instance variables populated during setUp, used during tests
   private SQLServerManager manager;
 
+  private Configuration conf = new Configuration();
+
+  @Override
+  protected Configuration getConf() {
+    return conf;
+  }
+
   @Override
   protected boolean useHsqldbTestServer() {
     return false;
@@ -173,6 +186,11 @@ public class SQLServerManagerImportManua
       "3,Fred,15.0,marketing",
     };
 
+    // To test with Microsoft SQL server connector, copy the connector jar to
+    // sqoop.thirdparty.lib.dir and set sqoop.test.msserver.connector.factory
+    // to com.microsoft.sqoop.SqlServer.MSSQLServerManagerFactory. By default,
+    // the built-in SQL server connector is used.
+    conf.setStrings(ConnFactory.FACTORY_CLASS_NAMES_KEY, CONNECTOR_FACTORY);
     runSQLServerTest(expectedResults);
   }
 



Mime
View raw message