Review Board 1.7.22


SQOOP-845 Sqoop2: Improve Generic JDBC validator

Review Request #9070 - Created Jan. 23, 2013 and submitted

Jarek Cecho
SQOOP-845
Reviewers
Sqoop
sqoop-sqoop2
I've improved the validator and move there some logic that was in initializer.
Unit tests seems to be passing and I tried simple import on real cluster.
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
Revision 531dd2e9b7215bd1d3825fe7018b10d32e774db5 New Change
[20] 55 lines
[+20] [+] public void initialize(MutableContext context, ConnectionConfiguration connection, ExportJobConfiguration job) {
56
    String driver = connectionConfig.connection.jdbcDriver;
56
    String driver = connectionConfig.connection.jdbcDriver;
57
    String url = connectionConfig.connection.connectionString;
57
    String url = connectionConfig.connection.connectionString;
58
    String username = connectionConfig.connection.username;
58
    String username = connectionConfig.connection.username;
59
    String password = connectionConfig.connection.password;
59
    String password = connectionConfig.connection.password;
60

    
   
60

   
61
    if (driver == null) {
61
    assert driver != null;
62
      throw new SqoopException(
62
    assert url != null;
63
          GenericJdbcConnectorError.GENERIC_JDBC_CONNECTOR_0012,

   
64
          "JDBC Driver");

   
65
    }

   
66

    
   

   
67
    if (url == null) {

   
68
      throw new SqoopException(

   
69
          GenericJdbcConnectorError.GENERIC_JDBC_CONNECTOR_0012,

   
70
          "Connection string");

   
71
    }

   
72

    
   
63

   
73
    executor = new GenericJdbcExecutor(driver, url, username, password);
64
    executor = new GenericJdbcExecutor(driver, url, username, password);
74
  }
65
  }
75

    
   
66

   
76
  private void configureTableProperties(MutableContext context, ConnectionConfiguration connectionConfig, ExportJobConfiguration jobConfig) {
67
  private void configureTableProperties(MutableContext context, ConnectionConfiguration connectionConfig, ExportJobConfiguration jobConfig) {
[+20] [20] 67 lines
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
Revision c6336fabbdc2074206c31c541c5dfc2c0cb3d908 New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcValidator.java
Revision 5ba1aae12e457c70e2b8fdc6d530a8ee0b8be421 New Change
 
  1. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java: Loading...
  2. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java: Loading...
  3. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcValidator.java: Loading...