/** {@inheritDoc} */ @Override public void onKernalStart(boolean active) throws IgniteCheckedException { super.onKernalStart(active); if (hctx == null) return; for (HadoopComponent c : hctx.components()) c.onKernalStart(); }
/** {@inheritDoc} */ @Override public Void call() throws IgniteCheckedException { ctx = job.getTaskContext(info); return ctx.runAsJobOwner(new Callable<Void>() { @Override public Void call() throws Exception { call0(); return null; } }); }
/** * Gets name for the task class loader. Task class loader * @param info The task info. * @param prefix Get only prefix (without task type and number) * @return The class loader name. */ public static String nameForTask(HadoopTaskInfo info, boolean prefix) { if (prefix) return "hadoop-task-" + info.jobId() + "-"; else return "hadoop-task-" + info.jobId() + "-" + info.type() + "-" + info.taskNumber(); }
/** {@inheritDoc} */ @Override public boolean hasCombiner() { return info().hasCombiner(); }
/** {@inheritDoc} */ @Override public boolean hasReducer() { return info().hasReducer(); }
/** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { jobId = new HadoopJobId(); jobId.readExternal(in); }
/** {@inheritDoc} */ @Override public boolean nextKey() throws IOException, InterruptedException { if (cancelled) throw new HadoopTaskCancelledException("Task cancelled."); return input.next(); }
/** * Parse user libs. * * @return Parsed libs search patterns. * @throws IOException If failed. */ public static Collection<SearchDirectory> parseUserLibs() throws IOException { return parseUserLibs(systemOrEnv(HADOOP_USER_LIBS, null)); }
/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof HadoopTaskInfo)) return false; HadoopTaskInfo that = (HadoopTaskInfo)o; return attempt == that.attempt && taskNum == that.taskNum && jobId.equals(that.jobId) && type == that.type; }
/** {@inheritDoc} */ @Override public void close() throws IgniteCheckedException { ser.close(); } }
/** {@inheritDoc} */ @Override public void cancel() { cancelled = true; HadoopTask t = task; if (t != null) t.cancel(); }
/** {@inheritDoc} */ @Override public HadoopJobId run(ComputeJobContext jobCtx, Hadoop hadoop, HadoopProtocolTaskArguments args) { return hadoop.nextJobId(); } }
/** * Callback invoked from mapper thread when map is finished. * * @throws IgniteCheckedException If failed. */ public void onMapperFinished() throws IgniteCheckedException { if (output instanceof HadoopMapperAwareTaskOutput) ((HadoopMapperAwareTaskOutput)output).onMapperFinished(); } }
/** * @param jobInfo Job info. * @param mem Memory. */ protected HadoopMultimapBase(HadoopJobInfo jobInfo, GridUnsafeMemory mem) { assert jobInfo != null; assert mem != null; this.mem = mem; pageSize = get(jobInfo, SHUFFLE_OFFHEAP_PAGE_SIZE, DFLT_OFFHEAP_PAGE_SIZE); }
/** * Cancel the executed task. */ public void cancel() { cancelled = true; if (ctx != null) ctx.cancel(); }
@Override public Object call() throws Exception { res.hosts(); return null; } }, AssertionError.class, null);