Review Board 1.7.22


SQOOP-1236 Sqoop2: Sqoop2: Classpath generated by Submission enginue should contain only unique elements

Review Request #15639 - Created Nov. 18, 2013 and updated

Jarek Cecho
SQOOP-1236
Reviewers
Sqoop
sqoop-sqoop2
Added code that will ensure that only unique entries will be present in the classpath. I've also used StringUtils.join() to merge all the entries for use (instead of home made version of the same).
Unit tests seems to be passing.
core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java
Revision 53d003980a172e4e0acf18630a3496909c17cb5c New Change
[20] 155 lines
[+20] [+] public void setConnector(SqoopConnector connector) {
156
  public List<String> getJars() {
156
  public List<String> getJars() {
157
    return jars;
157
    return jars;
158
  }
158
  }
159

    
   
159

   
160
  public void addJar(String jar) {
160
  public void addJar(String jar) {

    
   
161
    if(!jars.contains(jar)) {
161
    jars.add(jar);
162
      jars.add(jar);
162
  }
163
    }

    
   
164
  }
163

    
   
165

   
164
  public void addJarForClass(Class klass) {
166
  public void addJarForClass(Class klass) {
165
    jars.add(ClassUtils.jarForClass(klass));
167
    addJar(ClassUtils.jarForClass(klass));
166
  }
168
  }
167

    
   
169

   
168
  public void addJars(List<String> jars) {
170
  public void addJars(List<String> jars) {
169
    this.jars.addAll(jars);
171
    for(String j : jars) {

    
   
172
      addJar(j);

    
   
173
    }
170
  }
174
  }
171

    
   
175

   
172
  public CallbackBase getConnectorCallbacks() {
176
  public CallbackBase getConnectorCallbacks() {
173
    return connectorCallbacks;
177
    return connectorCallbacks;
174
  }
178
  }
[+20] [20] 77 lines
core/src/test/java/org/apache/sqoop/framework/TestSubmissionRequest.java
New File
 
submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
Revision 6fc485b66ea8c33d09d172675a104954d570f3a7 New Change
 
  1. core/src/main/java/org/apache/sqoop/framework/SubmissionRequest.java: Loading...
  2. core/src/test/java/org/apache/sqoop/framework/TestSubmissionRequest.java: Loading...
  3. submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java: Loading...