Review Board 1.7.22


SQOOP-650: Add ability to name mapreduce job generated by Sqoop

Review Request #7706 - Created Oct. 23, 2012 and submitted

Jarek Cecho
SQOOP-650
Reviewers
Sqoop
sqoop-trunk
I've added new extra parameter and made sure that it will be propagated to all places where Sqoop is creating mapreduce job.
I've tested it on real hadoop cluster. I did not included any test cases as I'm not sure how to actually test this automatically.
src/java/org/apache/sqoop/SqoopOptions.java
Revision 92c99962ae2276c1481657dfbeda4f14dfe7e8fc New Change
[20] 84 lines
[+20] [+] public String toString() {
85
  // loadProperties() and writeProperties() methods. Then add command-line
85
  // loadProperties() and writeProperties() methods. Then add command-line
86
  // arguments in the appropriate tools. The names of all command-line args
86
  // arguments in the appropriate tools. The names of all command-line args
87
  // are stored as constants in BaseSqoopTool.
87
  // are stored as constants in BaseSqoopTool.
88

    
   
88

   
89
  @StoredAsProperty("verbose") private boolean verbose;
89
  @StoredAsProperty("verbose") private boolean verbose;

    
   
90

   

    
   
91
  @StoredAsProperty("mapreduce.job.name") private String mapreduceJobName;

    
   
92

   
90
  @StoredAsProperty("db.connect.string") private String connectString;
93
  @StoredAsProperty("db.connect.string") private String connectString;
91
  @StoredAsProperty("db.table") private String tableName;
94
  @StoredAsProperty("db.table") private String tableName;
92
  private String [] columns; // Array stored as db.column.list.
95
  private String [] columns; // Array stored as db.column.list.
93
  @StoredAsProperty("db.username") private String username;
96
  @StoredAsProperty("db.username") private String username;
94
  @StoredAsProperty("db.export.staging.table") private String stagingTableName;
97
  @StoredAsProperty("db.export.staging.table") private String stagingTableName;
[+20] [20] 959 lines
[+20] [+] private String securePasswordEntry() {
1054
      LOG.error("Oozie with sqoop.metastore.client.record.password disabled.");
1057
      LOG.error("Oozie with sqoop.metastore.client.record.password disabled.");
1055
      LOG.error("But this configuration is not supported because Sqoop can't");
1058
      LOG.error("But this configuration is not supported because Sqoop can't");
1056
      LOG.error("prompt the user to enter the password while being executed");
1059
      LOG.error("prompt the user to enter the password while being executed");
1057
      LOG.error("as Oozie tasks. Please enable sqoop.metastore.client.record");
1060
      LOG.error("as Oozie tasks. Please enable sqoop.metastore.client.record");
1058
      LOG.error(".password in sqoop-site.xml, or provide the password");
1061
      LOG.error(".password in sqoop-site.xml, or provide the password");
1059
      LOG.error("explictly using --password in the command tag of the Oozie");
1062
      LOG.error("explicitly using --password in the command tag of the Oozie");
1060
      LOG.error("workflow file.");
1063
      LOG.error("workflow file.");
1061
      return null;
1064
      return null;
1062
    }
1065
    }
1063
  }
1066
  }
1064

    
   
1067

   
1065
  /**
1068
  /**
1066
   * Set the password in this SqoopOptions from the console without printing
1069
   * Set the password in this SqoopOptions from the console without printing
1067
   * characters.
1070
   * characters.
1068
   */
1071
   */
1069
  public void setPasswordFromConsole() {
1072
  public void setPasswordFromConsole() {
1070
    this.password = securePasswordEntry();
1073
    this.password = securePasswordEntry();
1071
  }
1074
  }
1072

    
   
1075

   

    
   
1076
  public String getMapreduceJobName() {

    
   
1077
    return mapreduceJobName;

    
   
1078
  }

    
   
1079

   

    
   
1080
  public void setMapreduceJobName(String mapredJobName) {

    
   
1081
    this.mapreduceJobName = mapredJobName;

    
   
1082
  }

    
   
1083

   
1073
  public void setPassword(String pass) {
1084
  public void setPassword(String pass) {
1074
    this.password = pass;
1085
    this.password = pass;
1075
  }
1086
  }
1076

    
   
1087

   
1077
  public boolean isDirect() {
1088
  public boolean isDirect() {
[+20] [20] 879 lines
src/java/org/apache/sqoop/mapreduce/ExportJobBase.java
Revision b9eaa834ecacdfcac300827dc7e187aec862661a New Change
 
src/java/org/apache/sqoop/mapreduce/ImportJobBase.java
Revision efc2c373366c86a2fcb28290979e18781cbc8995 New Change
 
src/java/org/apache/sqoop/tool/BaseSqoopTool.java
Revision 0c9cda610ccde6bd249f48fd438c88c94a239632 New Change
 
src/java/org/apache/sqoop/tool/ExportTool.java
Revision 494887d8c973048c4e3f6003e4f83e5baf8cff50 New Change
 
src/java/org/apache/sqoop/tool/ImportTool.java
Revision 415b315cf64bda65d110d60f33f3ee5cf2496292 New Change
 
  1. src/java/org/apache/sqoop/SqoopOptions.java: Loading...
  2. src/java/org/apache/sqoop/mapreduce/ExportJobBase.java: Loading...
  3. src/java/org/apache/sqoop/mapreduce/ImportJobBase.java: Loading...
  4. src/java/org/apache/sqoop/tool/BaseSqoopTool.java: Loading...
  5. src/java/org/apache/sqoop/tool/ExportTool.java: Loading...
  6. src/java/org/apache/sqoop/tool/ImportTool.java: Loading...