Exemple #1
0
 public void invoke() {
   init();
   start(new H2OEmptyCompleter());
   JobState status = exec();
   if(status == JobState.DONE)
     remove();
 }
Exemple #2
0
 @Override
 public void invoke() {
   init();
   start(new H2OEmptyCompleter()); // mark job started
   exec(); // execute the implementation
   remove(); // remove the job
 }
Exemple #3
0
 /**
  * Forks computation of this job.
  *
  * <p>The call does not block.</p>
  * @return always returns this job.
  */
 public Job fork() {
   init();
   H2OCountedCompleter task = new H2OCountedCompleter() {
     @Override public void compute2() {
       Throwable t = null;
       try {
         JobState status = Job.this.exec();
         if(status == JobState.DONE)
           Job.this.remove();
       } catch (Throwable t_) {
         t = t_;
         if(!(t instanceof ExpectedExceptionForDebug))
           Log.err(t);
       } finally {
         tryComplete();
       }
       if(t != null)
         Job.this.cancel(t);
     }
   };
   start(task);
   H2O.submitTask(task);
   return this;
 }
Exemple #4
0
 /**
  * Forks computation of this job.
  *
  * <p>The call does not block.
  *
  * @return always returns this job.
  */
 public Job fork() {
   init();
   H2OCountedCompleter task =
       new H2OCountedCompleter() {
         @Override
         public void compute2() {
           try {
             try {
               // Exec always waits till the end of computation
               Job.this.exec();
               Job.this.remove();
             } catch (Throwable t) {
               if (!(t instanceof ExpectedExceptionForDebug)) Log.err(t);
               Job.this.cancel(t);
             }
           } finally {
             tryComplete();
           }
         }
       };
   start(task);
   H2O.submitTask(task);
   return this;
 }