Review Board 1.7.22


Sqoop2: Introduce synchronous job submission to Client API

Review Request #10869 - Created April 30, 2013 and updated

Vasanth kumar RJ
SQOOP-985
Reviewers
Sqoop
sqoop-sqoop2
Synchronous job submission to Client API.
Done
client/src/main/java/org/apache/sqoop/client/SqoopClient.java
Revision f9137bb New Change
[20] 341 lines
[+20] [+] public Status updateJob(MJob job) {
342
  public void deleteJob(long jid) {
342
  public void deleteJob(long jid) {
343
    requests.deleteJob(jid);
343
    requests.deleteJob(jid);
344
  }
344
  }
345

    
   
345

   
346
  /**
346
  /**
347
   * Start job with given id.
347
   * Start synchronous or asynchronous job with given id.
348
   *
348
   *
349
   * @param jid Job id
349
   * @param jid Job id

    
   
350
   * @param sync Set true for synchronous job submission

    
   
351
   * @param pollTimeOut On synchronous submission, polling interval to sqoop server
350
   * @return
352
   * @return

    
   
353
   * @throws InterruptedException
351
   */
354
   */
352
  public MSubmission startSubmission(long jid) {
355
  public MSubmission startSubmission(long jid, boolean sync, Long pollTimeOut) throws InterruptedException {

    
   
356
    if(!sync) {
353
    return requests.createSubmission(jid).getSubmission();
357
      return requests.createSubmission(jid).getSubmission();
354
  }
358
    }

    
   
359
    if(pollTimeOut == null || pollTimeOut < 0) {

    
   
360
      pollTimeOut = 10000L;

    
   
361
    }

    
   
362
    MSubmission submission = requests.createSubmission(jid).getSubmission();

    
   
363
    while(submission.getStatus().isRunning()) {

    
   
364
      Thread.sleep(pollTimeOut);

    
   
365
      submission = getSubmissionStatus(jid);

    
   
366
    }

    
   
367
    return submission;

    
   
368
  }
355

    
   
369

   
356
  /**
370
  /**
357
   * Stop job with given id.
371
   * Stop job with given id.
358
   *
372
   *
359
   * @param jid Job id
373
   * @param jid Job id
[+20] [20] 46 lines
client/src/main/java/org/apache/sqoop/client/shell/SubmissionStartFunction.java
Revision f68ac11 New Change
 
docs/src/site/sphinx/ClientAPI.rst
Revision a9d39fb New Change
 
test/src/test/java/org/apache/sqoop/integration/connector/jdbc/generic/TableImportTest.java
Revision adcfbaf New Change
 
  1. client/src/main/java/org/apache/sqoop/client/SqoopClient.java: Loading...
  2. client/src/main/java/org/apache/sqoop/client/shell/SubmissionStartFunction.java: Loading...
  3. docs/src/site/sphinx/ClientAPI.rst: Loading...
  4. test/src/test/java/org/apache/sqoop/integration/connector/jdbc/generic/TableImportTest.java: Loading...