示例#1
0
文件: Job.java 项目: shjgiser/h2o
 /**
  * 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();
 }
示例#2
0
文件: Job.java 项目: shjgiser/h2o
 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();
     }
   });
 }
示例#3
0
文件: Job.java 项目: chouclee/h2o
 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();
         }
       });
 }