Review Board 1.7.22


Sqoop 1196: Support for arbitrary compression codec

Review Request #14087 - Created Sept. 11, 2013 and submitted

Raghav Gautam
sqoop-1196
Reviewers
Sqoop
sqoop-sqoop2
Adding support for arbitrary compression codec for import jobs
- Added unit tests
- Manually tested
- All tests pass
core/src/main/java/org/apache/sqoop/framework/FrameworkValidator.java
Revision d72b9f8 New Change
[20] 18 lines
[+20]
19

    
   
19

   
20
import org.apache.sqoop.framework.configuration.ConnectionConfiguration;
20
import org.apache.sqoop.framework.configuration.ConnectionConfiguration;
21
import org.apache.sqoop.framework.configuration.ExportJobConfiguration;
21
import org.apache.sqoop.framework.configuration.ExportJobConfiguration;
22
import org.apache.sqoop.framework.configuration.ImportJobConfiguration;
22
import org.apache.sqoop.framework.configuration.ImportJobConfiguration;
23
import org.apache.sqoop.framework.configuration.InputForm;
23
import org.apache.sqoop.framework.configuration.InputForm;

    
   
24
import org.apache.sqoop.framework.configuration.OutputCompression;
24
import org.apache.sqoop.framework.configuration.OutputForm;
25
import org.apache.sqoop.framework.configuration.OutputForm;
25
import org.apache.sqoop.framework.configuration.ThrottlingForm;
26
import org.apache.sqoop.framework.configuration.ThrottlingForm;
26
import org.apache.sqoop.model.MJob;
27
import org.apache.sqoop.model.MJob;
27
import org.apache.sqoop.validation.Status;
28
import org.apache.sqoop.validation.Status;
28
import org.apache.sqoop.validation.Validation;
29
import org.apache.sqoop.validation.Validation;
[+20] [20] 52 lines
[+20] [+] private void validateInputForm(Validation validation, InputForm input) {
81

    
   
82

   
82
  private void validateOutputForm(Validation validation, OutputForm output) {
83
  private void validateOutputForm(Validation validation, OutputForm output) {
83
    if(output.outputDirectory == null || output.outputDirectory.isEmpty()) {
84
    if(output.outputDirectory == null || output.outputDirectory.isEmpty()) {
84
      validation.addMessage(Status.UNACCEPTABLE, "output", "outputDirectory", "Output directory is empty");
85
      validation.addMessage(Status.UNACCEPTABLE, "output", "outputDirectory", "Output directory is empty");
85
    }
86
    }

    
   
87
    if(output.customCompression != null &&

    
   
88
      output.customCompression.trim().length() > 0  &&

    
   
89
      output.compression != OutputCompression.CUSTOM) {

    
   
90
      validation.addMessage(Status.UNACCEPTABLE, "output", "compression",

    
   
91
        "custom compression should be blank as " + output.compression + " is being used.");

    
   
92
    }

    
   
93
    if(output.compression == OutputCompression.CUSTOM &&

    
   
94
      (output.customCompression == null ||

    
   
95
        output.customCompression.trim().length() == 0)

    
   
96
      ) {

    
   
97
      validation.addMessage(Status.UNACCEPTABLE, "output", "compression",

    
   
98
        "custom compression is blank.");

    
   
99
    }
86
  }
100
  }
87

    
   
101

   
88
  private void validateThrottingForm(Validation validation, ThrottlingForm throttling) {
102
  private void validateThrottingForm(Validation validation, ThrottlingForm throttling) {
89
    if(throttling.extractors != null && throttling.extractors < 1) {
103
    if(throttling.extractors != null && throttling.extractors < 1) {
90
      validation.addMessage(Status.UNACCEPTABLE, "throttling", "extractors", "You need to specify more than one extractor");
104
      validation.addMessage(Status.UNACCEPTABLE, "throttling", "extractors", "You need to specify more than one extractor");
91
    }
105
    }
92

    
   
106

   
93
    if(throttling.loaders != null && throttling.loaders < 1) {
107
    if(throttling.loaders != null && throttling.loaders < 1) {
94
      validation.addMessage(Status.UNACCEPTABLE, "throttling", "loaders", "You need to specify more than one loader");
108
      validation.addMessage(Status.UNACCEPTABLE, "throttling", "loaders", "You need to specify more than one loader");
95
    }
109
    }
96
  }
110
  }
97
}
111
}
core/src/main/java/org/apache/sqoop/framework/configuration/OutputCompression.java
Revision 3b5ffc5 New Change
 
core/src/main/java/org/apache/sqoop/framework/configuration/OutputForm.java
Revision 18eeab3 New Change
 
core/src/main/resources/framework-resources.properties
Revision a3d3330 New Change
 
core/src/test/java/org/apache/sqoop/framework/TestFrameworkValidator.java
Revision 9e1997a New Change
 
execution/mapreduce/src/main/java/org/apache/sqoop/execution/mapreduce/MapreduceExecutionEngine.java
Revision 392007d New Change
 
execution/mapreduce/src/test/java/org/apache/sqoop/execution/mapreduce/MapreduceExecutionEngineTest.java
Revision 19f5a22 New Change
 
  1. core/src/main/java/org/apache/sqoop/framework/FrameworkValidator.java: Loading...
  2. core/src/main/java/org/apache/sqoop/framework/configuration/OutputCompression.java: Loading...
  3. core/src/main/java/org/apache/sqoop/framework/configuration/OutputForm.java: Loading...
  4. core/src/main/resources/framework-resources.properties: Loading...
  5. core/src/test/java/org/apache/sqoop/framework/TestFrameworkValidator.java: Loading...
  6. execution/mapreduce/src/main/java/org/apache/sqoop/execution/mapreduce/MapreduceExecutionEngine.java: Loading...
  7. execution/mapreduce/src/test/java/org/apache/sqoop/execution/mapreduce/MapreduceExecutionEngineTest.java: Loading...