private void killTaskFromCommandLine(RunningJob job, TaskAttemptID taskid, JobTracker jt) throws IOException { job.killTask(taskid, false); // wait till the kill happens while (jt.getTaskStatus(taskid).getRunState() != TaskStatus.State.KILLED) { try { Thread.sleep(10); } catch (InterruptedException ie) {} } } // kill the task by losing the tracker
/** * Kill indicated task attempt. * * @param taskId the id of the task to be terminated. * @throws IOException */ public void killTask(TaskAttemptID taskId) throws IOException { ensureState(JobState.RUNNING); info.killTask(org.apache.hadoop.mapred.TaskAttemptID.downgrade(taskId), false); }
/** * Fail indicated task attempt. * * @param taskId the id of the task to be terminated. * @throws IOException */ public void failTask(TaskAttemptID taskId) throws IOException { ensureState(JobState.RUNNING); info.killTask(org.apache.hadoop.mapred.TaskAttemptID.downgrade(taskId), true); }
runningJob.killTask(entry.getKey(), false);
public void setup(Context context) { JobClient jobClient; RunningJob runningJob; try { jobClient = new JobClient((JobConf)context.getConfiguration()); runningJob = jobClient.getJob((JobID)(context.getJobId()); //mapred.JobID! } catch (IOException e) { System.out.println("IO Exception"); } try { System.out.println(propertyName); session = FindPath.createSession("localhost",3250, EncodingConstants.en_ISO_8859_1); session.open(); } catch { System.out.println("error"); runningJob.killTask((TaskAttemptID)context.getTaskAttemptID(), true);// cast as mapred.TaskAttemptID } }
for (TaskAttemptID t : runningTasks) { LOG.info(new Date() + " Killed task : " + t); rJob.killTask(t, fail); if (count++ > runningTasks.size()/2) { //kill 50% break; for (TaskAttemptID t : runningTasks) { LOG.info(new Date() + " Killed task : " + t); rJob.killTask(t, fail); if (count++ > runningTasks.size()/2) { //kill 50% break;
for (TaskAttemptID t : runningTasks) { LOG.info(new Date() + " Killed task : " + t); rJob.killTask(t, fail); if (count++ > runningTasks.size()/2) { //kill 50% break; for (TaskAttemptID t : runningTasks) { LOG.info(new Date() + " Killed task : " + t); rJob.killTask(t, fail); if (count++ > runningTasks.size()/2) { //kill 50% break;