Exemplo n.º 1
0
 /**
  * Marks job as finished and records job end time.
  */
 public void remove() {
   end_time = System.currentTimeMillis();
   if( state == JobState.RUNNING )
     state = JobState.DONE;
   // Overwrite handle - copy end_time, state, msg
   replaceByJobHandle();
 }
Exemplo n.º 2
0
 public void cancel(final String msg) {
   state = msg == null ? JobState.CANCELLED : JobState.CRASHED;
   if(state == JobState.CANCELLED)Log.info("Job " + self() + "("  + description + ") was cancelled.");
   exception = msg;
   // replace finished job by a job handle
   replaceByJobHandle();
   DKV.write_barrier();
   final Job job = this;
   H2O.submitTask(new H2OCountedCompleter() {
     @Override public void compute2() {
       job.onCancelled();
     }
   });
 }
Exemplo n.º 3
0
 private void cancel(final String msg, JobState resultingState) {
   if (resultingState == JobState.CANCELLED) {
     Log.info("Job " + self() + "(" + description + ") was cancelled.");
   } else {
     Log.err("Job " + self() + "(" + description + ") failed.");
     Log.err(msg);
   }
   exception = msg;
   state = resultingState;
   // replace finished job by a job handle
   replaceByJobHandle();
   DKV.write_barrier();
   final Job job = this;
   H2O.submitTask(
       new H2OCountedCompleter() {
         @Override
         public void compute2() {
           job.onCancelled();
         }
       });
 }