/** {@inheritDoc} */ @Override public boolean nextKey() throws IOException, InterruptedException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); return input.next(); }
/** {@inheritDoc} */ @Override public void collect(Object key, Object val) throws IOException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); super.collect(key, val); } };
/** {@inheritDoc} */ @Override public boolean nextKeyValue() throws IOException, InterruptedException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); return reader.nextKeyValue(); }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public void write(Object key, Object val) throws IOException, InterruptedException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); if (writer != null) writer.write(key, val); else { try { output.write(key, val); } catch (IgniteCheckedException e) { throw new IOException(e); } } }
/** * @param perfCntr Performance counter. * @throws IgniteCheckedException If failed. */ private void runTask(HadoopPerformanceCounter perfCntr) throws IgniteCheckedException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); try (HadoopTaskOutput out = createOutputInternal(ctx); HadoopTaskInput in = createInputInternal(ctx)) { ctx.input(in); ctx.output(out); perfCntr.onTaskStart(ctx.taskInfo(), U.currentTimeMillis()); ctx.run(); } }
HadoopTaskCancelledException err = new HadoopTaskCancelledException("Job cancelled.");
/** {@inheritDoc} */ @Override public void run() throws IgniteCheckedException { ClassLoader oldLdr = HadoopCommonUtils.setContextClassLoader(jobConf().getClassLoader()); try { try { task = createTask(); } catch (Throwable e) { if (e instanceof Error) throw e; throw transformException(e); } if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); try { task.run(this); } catch (Throwable e) { if (e instanceof Error) throw e; throw transformException(e); } } finally { task = null; HadoopCommonUtils.restoreContextClassLoader(oldLdr); } }
while (reader.next(key, val)) { if (isCancelled()) throw new HadoopTaskCancelledException("Map task cancelled.");
while (input.next()) { if (isCancelled()) throw new HadoopTaskCancelledException("Reduce task cancelled.");