Review Board 1.7.22


SQOOP-807 Sqoop2: Verify whether job object can be safely removed prior removing

Review Request #8803 - Created Jan. 2, 2013 and submitted

Jarek Cecho
SQOOP-807
Reviewers
Sqoop
sqoop-sqoop2
I've added proposed functionality.
I've added unit test + one unit test for similar function with Connection object.
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision c62730ccd077663c763ece7df0c044acd437ffcc New Change
[20] 714 lines
[+20] [+] public boolean existsJob(long id, Connection conn) {
715
    }
715
    }
716
  }
716
  }
717

    
   
717

   
718
  @Override
718
  @Override
719
  public boolean inUseJob(long jobId, Connection conn) {
719
  public boolean inUseJob(long jobId, Connection conn) {
720
    // TODO(jarcec): This method will need to be upgraded once submission
720
    MSubmission submission = findSubmissionLastForJob(jobId, conn);
721
    // engine will be in place as we can't remove "running" job.
721

   

    
   
722
    // We can't remove running job

    
   
723
    if(submission.getStatus().isRunning()) {

    
   
724
      return true;

    
   
725
    }

    
   
726

   
722
    return false;
727
    return false;
723
  }
728
  }
724

    
   
729

   
725
  /**
730
  /**
726
   * {@inheritDoc}
731
   * {@inheritDoc}
[+20] [20] 918 lines
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestConnectionHandling.java
Revision 4121be74364de33e0cae0aa1fb469a8c7d632922 New Change
 
repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java
Revision c0e7a313e887e1fbca244ca92f7cf8b8a1d44bd4 New Change
 
  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
  2. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestConnectionHandling.java: Loading...
  3. repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestJobHandling.java: Loading...