Review Board 1.7.22


Sqoop2: Generic JDBC Connector should have one static instance of validator

Review Request #10820 - Created April 28, 2013 and updated

Vasanth kumar RJ
SQOOP-1012
Reviewers
Sqoop
sqoop-sqoop2
Created a static generic JDBC connector instance.
Done

Diff revision 2 (Latest)

1 2
1 2

  1. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java: Loading...
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java
Revision 11c10de New Change
[20] 30 lines
[+20]
31
import org.apache.sqoop.model.MJob;
31
import org.apache.sqoop.model.MJob;
32
import org.apache.sqoop.validation.Validator;
32
import org.apache.sqoop.validation.Validator;
33

    
   
33

   
34
public class GenericJdbcConnector extends SqoopConnector {
34
public class GenericJdbcConnector extends SqoopConnector {
35

    
   
35

   

    
   
36
  private static GenericJdbcValidator genericJdbcValidator = new GenericJdbcValidator();

    
   
37

   
36
  private static final Importer IMPORTER = new Importer(
38
  private static final Importer IMPORTER = new Importer(
37
      GenericJdbcImportInitializer.class,
39
      GenericJdbcImportInitializer.class,
38
      GenericJdbcImportPartitioner.class,
40
      GenericJdbcImportPartitioner.class,
39
      GenericJdbcImportExtractor.class,
41
      GenericJdbcImportExtractor.class,
40
      GenericJdbcImportDestroyer.class);
42
      GenericJdbcImportDestroyer.class);
[+20] [20] 48 lines
[+20] [+] public Importer getImporter() {
89
    return EXPORTER;
91
    return EXPORTER;
90
  }
92
  }
91

    
   
93

   
92
  @Override
94
  @Override
93
  public Validator getValidator() {
95
  public Validator getValidator() {
94
    // TODO(jarcec): Cache this object eventually
96
    return genericJdbcValidator;
95
    return new GenericJdbcValidator();

   
96
  }
97
  }
97

    
   
98

   
98
  @Override
99
  @Override
99
  public MetadataUpgrader getMetadataUpgrader() {
100
  public MetadataUpgrader getMetadataUpgrader() {
100
    return new GenericJdbcConnectorMetadataUpgrader();
101
    return new GenericJdbcConnectorMetadataUpgrader();
101
  }
102
  }
102

    
   
103

   
103
}
104
}
  1. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java: Loading...