Review Board 1.7.22


SQOOP-646 Provide support for "set" metadata in Sqoop 2

Review Request #7942 - Created Nov. 8, 2012 and submitted

Jarek Cecho
SQOOP-646
Reviewers
Sqoop
sqoop-sqoop2
I've added new metadata type MEnumInput that is based on java Enum class.
I've provided some unit tests and also performed testing on real cluster.

Diff revision 2 (Latest)

1 2
1 2

  1. client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java: Loading...
  2. client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java: Loading...
  3. common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java: Loading...
  4. common/src/main/java/org/apache/sqoop/model/FormUtils.java: Loading...
  5. common/src/main/java/org/apache/sqoop/model/MEnumInput.java: Loading...
  6. common/src/main/java/org/apache/sqoop/model/MInput.java: Loading...
  7. common/src/main/java/org/apache/sqoop/model/MInputType.java: Loading...
  8. common/src/main/java/org/apache/sqoop/model/MIntegerInput.java: Loading...
  9. common/src/main/java/org/apache/sqoop/model/MMapInput.java: Loading...
  10. common/src/main/java/org/apache/sqoop/model/MStringInput.java: Loading...
  11. common/src/main/java/org/apache/sqoop/model/ModelError.java: Loading...
  12. common/src/main/java/org/apache/sqoop/utils/ClassUtils.java: Loading...
  13. common/src/main/java/org/apache/sqoop/utils/StringUtils.java: Loading...
  14. common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java: Loading...
  15. common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java: Loading...
  16. core/src/main/java/org/apache/sqoop/framework/configuration/ExportJobConfiguration.java: Loading...
  17. core/src/main/java/org/apache/sqoop/framework/configuration/ImportJobConfiguration.java: Loading...
  18. core/src/main/java/org/apache/sqoop/framework/configuration/StorageType.java: Loading...
  19. core/src/main/resources/framework-resources.properties: Loading...
  20. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  21. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java: Loading...
  22. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...
client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
Revision 96abd42a039cae8a2518f6707cbf49ee6151cc68 New Change
[20] 14 lines
[+20]
15
 * See the License for the specific language governing permissions and
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
16
 * limitations under the License.
17
 */
17
 */
18
package org.apache.sqoop.client.utils;
18
package org.apache.sqoop.client.utils;
19

    
   
19

   

    
   
20
import org.apache.sqoop.model.MEnumInput;
20
import org.apache.sqoop.model.MForm;
21
import org.apache.sqoop.model.MForm;
21
import org.apache.sqoop.model.MFramework;
22
import org.apache.sqoop.model.MFramework;
22
import org.apache.sqoop.model.MInput;
23
import org.apache.sqoop.model.MInput;
23
import org.apache.sqoop.model.MInputType;
24
import org.apache.sqoop.model.MInputType;
24
import org.apache.sqoop.model.MJobForms;
25
import org.apache.sqoop.model.MJobForms;
25
import org.apache.sqoop.model.MStringInput;
26
import org.apache.sqoop.model.MStringInput;

    
   
27
import org.apache.sqoop.utils.StringUtils;
26
import org.codehaus.groovy.tools.shell.IO;
28
import org.codehaus.groovy.tools.shell.IO;
27

    
   
29

   
28
import java.util.Iterator;
30
import java.util.Iterator;
29
import java.util.List;
31
import java.util.List;
30
import java.util.ResourceBundle;
32
import java.util.ResourceBundle;
[+20] [20] 68 lines
[+20] [+] public static void displayFormsMetadata(IO io,
99
        if (input.getType() == MInputType.STRING) {
101
        if (input.getType() == MInputType.STRING) {
100
          io.out.print("        Mask: ");
102
          io.out.print("        Mask: ");
101
          io.out.println(((MStringInput)input).isMasked());
103
          io.out.println(((MStringInput)input).isMasked());
102
          io.out.print("        Size: ");
104
          io.out.print("        Size: ");
103
          io.out.println(((MStringInput)input).getMaxLength());
105
          io.out.println(((MStringInput)input).getMaxLength());

    
   
106
        } else if(input.getType() == MInputType.ENUM) {

    
   
107
          io.out.print("        Possible values: ");

    
   
108
          io.out.println(StringUtils.join(((MEnumInput)input).getValues(), ","));
104
        }
109
        }
105
      }
110
      }
106
    }
111
    }
107
  }
112
  }
108

    
   
113

   
[+20] [20] 27 lines
client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
Revision 55d1cc00c080afce6ebc0a9c71a88710a0863ec6 New Change
 
common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
Revision 70fa8bf08f843e084d0b45c7b562eca1d955c020 New Change
 
common/src/main/java/org/apache/sqoop/model/FormUtils.java
Revision ee927189fc84bfc2b076faffb07a2b8ac8552db4 New Change
 
common/src/main/java/org/apache/sqoop/model/MEnumInput.java
New File
 
common/src/main/java/org/apache/sqoop/model/MInput.java
Revision 2a87531ee7729d41c4537d714cec23db74053c8f New Change
 
common/src/main/java/org/apache/sqoop/model/MInputType.java
Revision 80163493bdab6d69edbda7bb08649c36341427f9 New Change
 
common/src/main/java/org/apache/sqoop/model/MIntegerInput.java
Revision 26477cc25bd9509d36f5e305929e2b717d24b849 New Change
 
common/src/main/java/org/apache/sqoop/model/MMapInput.java
Revision de44d3f626bfff4b47d42d6af3985e98b302066c New Change
 
common/src/main/java/org/apache/sqoop/model/MStringInput.java
Revision 04afb389553557b8c3c2bc2fbe0edb4e35617b4b New Change
 
common/src/main/java/org/apache/sqoop/model/ModelError.java
Revision d3467c068d5ab9e741473d6c000cfd66cd8ae845 New Change
 
common/src/main/java/org/apache/sqoop/utils/ClassUtils.java
Revision b63fce2aae67261cc5d98f73aae326101f91f27c New Change
 
common/src/main/java/org/apache/sqoop/utils/StringUtils.java
New File
 
common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java
Revision f0b0742d7451f88ad5fe52ffb0f39e232cd5c01f New Change
 
common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java
New File
 
core/src/main/java/org/apache/sqoop/framework/configuration/ExportJobConfiguration.java
Revision 9da513350ef80aca565f258ed3763f7ddd927688 New Change
 
core/src/main/java/org/apache/sqoop/framework/configuration/ImportJobConfiguration.java
Revision de8ddbca44ea68a502ecbcad8061391d96ba1e28 New Change
 
core/src/main/java/org/apache/sqoop/framework/configuration/StorageType.java
New File
 
core/src/main/resources/framework-resources.properties
Revision 9f194690467c181c6ce8fa6c813d16b3f2a93115 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision 7006273546a893f790df7cbf9d4e6f09cb4a7911 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
Revision 1f10674604789b3def23cdef5fdbdc09c16fe5b0 New Change
 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Revision 930544572d794d5ac8e01bac432a007e75ea1571 New Change
 
  1. client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java: Loading...
  2. client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java: Loading...
  3. common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java: Loading...
  4. common/src/main/java/org/apache/sqoop/model/FormUtils.java: Loading...
  5. common/src/main/java/org/apache/sqoop/model/MEnumInput.java: Loading...
  6. common/src/main/java/org/apache/sqoop/model/MInput.java: Loading...
  7. common/src/main/java/org/apache/sqoop/model/MInputType.java: Loading...
  8. common/src/main/java/org/apache/sqoop/model/MIntegerInput.java: Loading...
  9. common/src/main/java/org/apache/sqoop/model/MMapInput.java: Loading...
  10. common/src/main/java/org/apache/sqoop/model/MStringInput.java: Loading...
  11. common/src/main/java/org/apache/sqoop/model/ModelError.java: Loading...
  12. common/src/main/java/org/apache/sqoop/utils/ClassUtils.java: Loading...
  13. common/src/main/java/org/apache/sqoop/utils/StringUtils.java: Loading...
  14. common/src/test/java/org/apache/sqoop/utils/TestClassUtils.java: Loading...
  15. common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java: Loading...
  16. core/src/main/java/org/apache/sqoop/framework/configuration/ExportJobConfiguration.java: Loading...
  17. core/src/main/java/org/apache/sqoop/framework/configuration/ImportJobConfiguration.java: Loading...
  18. core/src/main/java/org/apache/sqoop/framework/configuration/StorageType.java: Loading...
  19. core/src/main/resources/framework-resources.properties: Loading...
  20. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  21. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java: Loading...
  22. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...