Review Board 1.7.22


SQOOP-681 Split configuration in Generic JDBC connector between job and connection

Review Request #8057 - Created Nov. 14, 2012 and submitted

Jarek Cecho
SQOOP-681
Reviewers
Sqoop
sqoop-sqoop2
I've decoupled connection and import options and moved handling of output directory to the framework space rather than connector. Unfortunately I'm not able to get table name on framework level, so I've reverted to require this parameter from user in all cases.
Tests are passing and I've tested it on real cluster.
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java
Revision e991734ce579256826fb59b2338b554d9e06c119 New Change
[20] 23 lines
[+20]
24

    
   
24

   
25
  // Resource bundle name
25
  // Resource bundle name
26
  public static final String RESOURCE_BUNDLE_NAME =
26
  public static final String RESOURCE_BUNDLE_NAME =
27
      "generic-jdbc-connector-resources";
27
      "generic-jdbc-connector-resources";
28

    
   
28

   
29
  // Metadata constants

   
30

    
   

   
31
  // Connection form

   
32
  public static final String FORM_CONNECTION = "form-connection";

   
33

    
   

   
34
  // Connection form inputs

   
35
  public static final String INPUT_CONN_JDBCDRIVER = "inp-conn-jdbcdriver";

   
36
  public static final String INPUT_CONN_CONNECTSTRING =

   
37
      "inp-conn-connectstring";

   
38
  public static final String INPUT_CONN_USERNAME = "inp-conn-username";

   
39
  public static final String INPUT_CONN_PASSWORD = "inp-conn-password";

   
40
  public static final String INPUT_CONN_JDBCPROPS = "inp-conn-jdbc-properties";

   
41

    
   

   
42
  // Table form

   
43
  public static final String FORM_TABLE = "form-table";

   
44

    
   

   
45
  // Table form inputs

   
46
  public static final String INPUT_TBL_NAME = "inp-tbl-name";

   
47
  public static final String INPUT_TBL_SQL = "inp-tbl-sql";

   
48
  public static final String INPUT_TBL_COLUMNS = "inp-tbl-columns";

   
49
  public static final String INPUT_TBL_WAREHOUSE = "inp-tbl-warehouse";

   
50
  public static final String INPUT_TBL_DATADIR = "inp-tbl-datadir";

   
51
  public static final String INPUT_TBL_PCOL = "inp-tbl-pcol";

   
52
  public static final String INPUT_TBL_BOUNDARY = "inp-tbl-boundary";

   
53

    
   

   
54

    
   

   
55
  /*
29
  /*
56
   * All jdbc connector related configuration is prefixed with this:
30
   * All jdbc connector related configuration is prefixed with this:
57
   * <tt>org.apache.sqoop.jdbc.</tt>
31
   * <tt>org.apache.sqoop.jdbc.</tt>
58
   */
32
   */
59
  public static final String PREFIX_CONNECTOR_JDBC_CONFIG =
33
  public static final String PREFIX_CONNECTOR_JDBC_CONFIG =
[+20] [20] 18 lines
[+20]
78
      PREFIX_CONNECTOR_JDBC_CONFIG + "partition.maxvalue";
52
      PREFIX_CONNECTOR_JDBC_CONFIG + "partition.maxvalue";
79

    
   
53

   
80
  public static final String CONNECTOR_JDBC_DATA_SQL =
54
  public static final String CONNECTOR_JDBC_DATA_SQL =
81
      PREFIX_CONNECTOR_JDBC_CONFIG + "data.sql";
55
      PREFIX_CONNECTOR_JDBC_CONFIG + "data.sql";
82

    
   
56

   
83
  public static final String FILE_SEPARATOR = System.getProperty("file.separator");

   
84

    
   

   
85
  public static final String DEFAULT_WAREHOUSE = "/tmp/sqoop/warehouse/";

   
86

    
   

   
87
  public static final String DEFAULT_DATADIR = "DataStore";

   
88

    
   

   
89
  public static final String SQL_CONDITIONS_TOKEN = "${CONDITIONS}";
57
  public static final String SQL_CONDITIONS_TOKEN = "${CONDITIONS}";
90

    
   
58

   
91
  public static final String SQL_PARAMETER_MARKER = "?";
59
  public static final String SQL_PARAMETER_MARKER = "?";
92

    
   
60

   
93
  public static final String SUBQUERY_ALIAS = "SQOOP_SUBQUERY_ALIAS";
61
  public static final String SUBQUERY_ALIAS = "SQOOP_SUBQUERY_ALIAS";
94

    
   
62

   
95
  private GenericJdbcConnectorConstants() {
63
  private GenericJdbcConnectorConstants() {
96
    // Disable explicit object creation
64
    // Disable explicit object creation
97
  }
65
  }
98
}
66
}
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
Revision 9199e755fdd24352e7c696722a5fd5b755d373e9 New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
Revision 39f19f5c8b0fc48846dce4e0b0f57f4834f45cf1 New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ConnectionConfiguration.java
Revision 5057cf57b36298c69c9ac2b473673599100071e0 New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ExportJobConfiguration.java
Revision c32b0663de509fc921f4690f36ff6c4b562b0cae New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ExportTableForm.java
New File
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ImportJobConfiguration.java
Revision 11b1c5f54b59987ecda890a9fba307d0ba17dcfd New Change
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ImportTableForm.java
New File
 
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/TableForm.java
Revision 9eb6a013d695fd7ccd99f3aa544c8321ded32b8f New Change
 
connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestExportInitializer.java
Revision 8dbfb4bc5d0a55d0c92d002c656e936ede3fd0de New Change
 
connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java
Revision 0c7be4bfdd3e6a3ce44ab02c92113f8367bddd0c New Change
 
  1. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java: Loading...
  2. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java: Loading...
  3. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java: Loading...
  4. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ConnectionConfiguration.java: Loading...
  5. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ExportJobConfiguration.java: Loading...
  6. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ExportTableForm.java: Loading...
  7. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ImportJobConfiguration.java: Loading...
  8. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/ImportTableForm.java: Loading...
  9. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/configuration/TableForm.java: Loading...
  10. connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestExportInitializer.java: Loading...
  11. connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java: Loading...