Review Board 1.7.22


SQOOP-696 Client command submission status will finish gracefully when executed for non existing job

Review Request #8424 - Created Dec. 7, 2012 and submitted

Jarek Cecho
SQOOP-696
Reviewers
Sqoop
sqoop-sqoop2
I've added simple checking if the job do exists.
Unit tests seems to be passing.
core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java
Revision 2d4d76bc71b6612db4764391b575dbafedf58d72 New Change
[20] 409 lines
[+20] [+] public Object doIt(Connection conn) {
410
  @Override
410
  @Override
411
  public MSubmission findSubmissionLastForJob(final long jobId) {
411
  public MSubmission findSubmissionLastForJob(final long jobId) {
412
    return (MSubmission) doWithConnection(new DoWithConnection() {
412
    return (MSubmission) doWithConnection(new DoWithConnection() {
413
      @Override
413
      @Override
414
      public Object doIt(Connection conn) {
414
      public Object doIt(Connection conn) {

    
   
415
        if(!handler.existsJob(jobId, conn)) {

    
   
416
          throw new SqoopException(RepositoryError.JDBCREPO_0020,

    
   
417
            "Invalid id: " + jobId);

    
   
418
        }
415
        return handler.findSubmissionLastForJob(jobId, conn);
419
        return handler.findSubmissionLastForJob(jobId, conn);
416
      }
420
      }
417
    });
421
    });
418
  }
422
  }
419
}
423
}
  1. core/src/main/java/org/apache/sqoop/repository/JdbcRepository.java: Loading...