Review Board 1.7.22


SQOOP-1036 Sqoop2: JobClient.getCounters can return NULL

Review Request #10995 - Created May 8, 2013 and submitted

Jarek Cecho
SQOOP-1036
Reviewers
Sqoop
sqoop-sqoop2
I've added proper if(is null) statement.
Unit and Integration tests seems to be passing.
submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java
Revision 6607885ac609f49a0dd67440de64b6f18d4910f6 New Change
[20] 399 lines
[+20] [+] protected SubmissionStatus convertMapreduceState(int status) {
400
   * @return Appropriate Sqoop counters
400
   * @return Appropriate Sqoop counters
401
   */
401
   */
402
  private Counters convertMapreduceCounters(org.apache.hadoop.mapred.Counters hadoopCounters) {
402
  private Counters convertMapreduceCounters(org.apache.hadoop.mapred.Counters hadoopCounters) {
403
    Counters sqoopCounters = new Counters();
403
    Counters sqoopCounters = new Counters();
404

    
   
404

   

    
   
405
    if(hadoopCounters == null) {

    
   
406
      return sqoopCounters;

    
   
407
    }

    
   
408

   
405
    for(org.apache.hadoop.mapred.Counters.Group hadoopGroup : hadoopCounters) {
409
    for(org.apache.hadoop.mapred.Counters.Group hadoopGroup : hadoopCounters) {
406
      CounterGroup sqoopGroup = new CounterGroup(hadoopGroup.getName());
410
      CounterGroup sqoopGroup = new CounterGroup(hadoopGroup.getName());
407
      for(org.apache.hadoop.mapred.Counters.Counter hadoopCounter : hadoopGroup) {
411
      for(org.apache.hadoop.mapred.Counters.Counter hadoopCounter : hadoopGroup) {
408
        Counter sqoopCounter = new Counter(hadoopCounter.getName(), hadoopCounter.getValue());
412
        Counter sqoopCounter = new Counter(hadoopCounter.getName(), hadoopCounter.getValue());
409
        sqoopGroup.addCounter(sqoopCounter);
413
        sqoopGroup.addCounter(sqoopCounter);
[+20] [20] 17 lines
  1. submission/mapreduce/src/main/java/org/apache/sqoop/submission/mapreduce/MapreduceSubmissionEngine.java: Loading...