Review Board 1.7.22


Sqoop2: Upgrade: Add framework upgrader

Review Request #10883 - Created May 1, 2013 and submitted

Hari Shreedharan
SQOOP-998
Reviewers
Sqoop
sqoop-sqoop2
Added framework upgrade code. I know some of this can be refactored to remove the code duplication with the connector upgrade. I will look into that at a later stage.
Manually tested.
core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java
Revision 1a6d427 New Change
[20] 18 lines
[+20]
19

    
   
19

   
20
import org.apache.log4j.Logger;
20
import org.apache.log4j.Logger;
21
import org.apache.sqoop.common.MapContext;
21
import org.apache.sqoop.common.MapContext;
22
import org.apache.sqoop.common.SqoopException;
22
import org.apache.sqoop.common.SqoopException;
23
import org.apache.sqoop.connector.ConnectorManager;
23
import org.apache.sqoop.connector.ConnectorManager;

    
   
24
import org.apache.sqoop.connector.spi.MetadataUpgrader;
24
import org.apache.sqoop.connector.spi.SqoopConnector;
25
import org.apache.sqoop.connector.spi.SqoopConnector;
25
import org.apache.sqoop.core.SqoopConfiguration;
26
import org.apache.sqoop.core.SqoopConfiguration;
26
import org.apache.sqoop.framework.configuration.ConnectionConfiguration;
27
import org.apache.sqoop.framework.configuration.ConnectionConfiguration;
27
import org.apache.sqoop.framework.configuration.ExportJobConfiguration;
28
import org.apache.sqoop.framework.configuration.ExportJobConfiguration;
28
import org.apache.sqoop.framework.configuration.ImportJobConfiguration;
29
import org.apache.sqoop.framework.configuration.ImportJobConfiguration;
[+20] [20] 103 lines
[+20] [+] public static void setInstance(FrameworkManager newInstance) {
132
   * Validator instance
133
   * Validator instance
133
   */
134
   */
134
  private final Validator validator;
135
  private final Validator validator;
135

    
   
136

   
136
  /**
137
  /**

    
   
138
   * Upgrader instance

    
   
139
   */

    
   
140
  private final MetadataUpgrader upgrader;

    
   
141

   

    
   
142
  /**
137
   * Configured submission engine instance
143
   * Configured submission engine instance
138
   */
144
   */
139
  private SubmissionEngine submissionEngine;
145
  private SubmissionEngine submissionEngine;
140

    
   
146

   
141
  /**
147
  /**
[+20] [20] 74 lines
[+20] [+] public String getNotificationBaseUrl() {
216
      FormUtils.toForms(getJobConfigurationClass(MJob.Type.EXPORT))));
222
      FormUtils.toForms(getJobConfigurationClass(MJob.Type.EXPORT))));
217
    mFramework = new MFramework(connectionForms, jobForms);
223
    mFramework = new MFramework(connectionForms, jobForms);
218

    
   
224

   
219
    // Build validator
225
    // Build validator
220
    validator = new FrameworkValidator();
226
    validator = new FrameworkValidator();

    
   
227

   

    
   
228
    // Build upgrader

    
   
229
    upgrader = new FrameworkMetadataUpgrader();
221
  }
230
  }
222

    
   
231

   
223
  public synchronized void initialize() {
232
  public synchronized void initialize() {
224
    LOG.trace("Begin submission engine manager initialization");
233
    LOG.trace("Begin submission engine manager initialization");
225
    MapContext context = SqoopConfiguration.getInstance().getContext();
234
    MapContext context = SqoopConfiguration.getInstance().getContext();
[+20] [20] 87 lines
[+20] [+] public synchronized void destroy() {
313

    
   
322

   
314
  public Validator getValidator() {
323
  public Validator getValidator() {
315
    return validator;
324
    return validator;
316
  }
325
  }
317

    
   
326

   

    
   
327
  public MetadataUpgrader getMetadataUpgrader() {

    
   
328
    return upgrader;

    
   
329
  }

    
   
330

   
318
  public Class getConnectionConfigurationClass() {
331
  public Class getConnectionConfigurationClass() {
319
    return ConnectionConfiguration.class;
332
    return ConnectionConfiguration.class;
320
  }
333
  }
321

    
   
334

   
322
  public Class getJobConfigurationClass(MJob.Type jobType) {
335
  public Class getJobConfigurationClass(MJob.Type jobType) {
[+20] [20] 317 lines
core/src/main/java/org/apache/sqoop/framework/FrameworkMetadataUpgrader.java
New File
 
core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java
Revision b2259ce New Change
 
core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryHandler.java
Revision 1f88b6d New Change
 
core/src/main/java/org/apache/sqoop/repository/Repository.java
Revision 7a7e884 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision 556241e New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Revision 2e5abb8 New Change
 
  1. core/src/main/java/org/apache/sqoop/framework/FrameworkManager.java: Loading...
  2. core/src/main/java/org/apache/sqoop/framework/FrameworkMetadataUpgrader.java: Loading...
  3. core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java: Loading...
  4. core/src/main/java/org/apache/sqoop/repository/JdbcRepositoryHandler.java: Loading...
  5. core/src/main/java/org/apache/sqoop/repository/Repository.java: Loading...
  6. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  7. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...