Exception {
TaskInfo taskInfo = null;
TaskID tID = null;
TTTaskInfo [] ttTaskinfo = null;
String pid = null;
TTProtocol ttIns = null;
TTClient ttClientIns = null;
int counter = 0;
JobConf jobConf = new JobConf(conf);
jobConf.setJobName("Message Display");
jobConf.setJarByClass(GenerateTaskChildProcess.class);
jobConf.setMapperClass(GenerateTaskChildProcess.StrDisplayMapper.class);
jobConf.setNumMapTasks(1);
jobConf.setNumReduceTasks(0);
jobConf.setMaxMapAttempts(1);
cleanup(outputDir, conf);
FileInputFormat.setInputPaths(jobConf, inputDir);
FileOutputFormat.setOutputPath(jobConf, outputDir);
JTClient jtClient = cluster.getJTClient();
JobClient client = jtClient.getClient();
JTProtocol wovenClient = cluster.getJTClient().getProxy();
RunningJob runJob = client.submitJob(jobConf);
JobID id = runJob.getID();
JobInfo jInfo = wovenClient.getJobInfo(id);
Assert.assertNotNull("Job information is null",jInfo);
Assert.assertTrue("Job has not been started for 1 min.",
jtClient.isJobStarted(id));
JobStatus[] jobStatus = client.getAllJobs();
String userName = jobStatus[0].getUsername();
TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
for (TaskInfo taskinfo : taskInfos) {
if (!taskinfo.isSetupOrCleanup()) {
taskInfo = taskinfo;
break;
}
}
Assert.assertTrue("Task has not been started for 1 min.",
jtClient.isTaskStarted(taskInfo));
tID = TaskID.downgrade(taskInfo.getTaskID());
TaskAttemptID tAttID = new TaskAttemptID(tID,0);
FinishTaskControlAction action = new FinishTaskControlAction(tID);
Collection<TTClient> ttClients = cluster.getTTClients();
for (TTClient ttClient : ttClients) {
TTProtocol tt = ttClient.getProxy();
tt.sendAction(action);
ttTaskinfo = tt.getTasks();
for (TTTaskInfo tttInfo : ttTaskinfo) {
if (!tttInfo.isTaskCleanupTask()) {
pid = tttInfo.getPid();
ttClientIns = ttClient;
ttIns = tt;