/// <summary>Constructor.</summary> /// <remarks> /// Constructor. eventId should be created externally and incremented /// per event for each job. /// </remarks> /// <param name="eventId"> /// event id, event id should be unique and assigned in /// incrementally, starting from 0. /// </param> /// <param name="taskId">task id</param> /// <param name="status">task's status</param> /// <param name="taskTrackerHttp">task tracker's host:port for http.</param> public TaskCompletionEvent(int eventId, TaskAttemptID taskId, int idWithinJob, bool isMap, TaskCompletionEvent.Status status, string taskTrackerHttp) { this.taskId = taskId; this.idWithinJob = idWithinJob; this.isMap = isMap; this.eventId = eventId; this.status = status; this.taskTrackerHttp = taskTrackerHttp; }
/// <exception cref="System.IO.IOException"/> public virtual void ReadFields(DataInput @in) { taskId.ReadFields(@in); idWithinJob = WritableUtils.ReadVInt(@in); isMap = @in.ReadBoolean(); status = WritableUtils.ReadEnum <TaskCompletionEvent.Status>(@in); taskTrackerHttp = WritableUtils.ReadString(@in); taskRunTime = WritableUtils.ReadVInt(@in); eventId = WritableUtils.ReadVInt(@in); }
public override void TestFailingMapper() { Log.Info("\n\n\nStarting uberized testFailingMapper()."); if (!(new FilePath(MiniMRYarnCluster.Appjar)).Exists()) { Log.Info("MRAppJar " + MiniMRYarnCluster.Appjar + " not found. Not running test." ); return; } Job job = RunFailingMapperJob(); // should be able to get diags for single task attempt... TaskID taskID = new TaskID(job.GetJobID(), TaskType.Map, 0); TaskAttemptID aId = new TaskAttemptID(taskID, 0); System.Console.Out.WriteLine("Diagnostics for " + aId + " :"); foreach (string diag in job.GetTaskDiagnostics(aId)) { System.Console.Out.WriteLine(diag); } // ...but not for second (shouldn't exist: uber-AM overrode max attempts) bool secondTaskAttemptExists = true; try { aId = new TaskAttemptID(taskID, 1); System.Console.Out.WriteLine("Diagnostics for " + aId + " :"); foreach (string diag_1 in job.GetTaskDiagnostics(aId)) { System.Console.Out.WriteLine(diag_1); } } catch (Exception) { secondTaskAttemptExists = false; } NUnit.Framework.Assert.AreEqual(false, secondTaskAttemptExists); TaskCompletionEvent[] events = job.GetTaskCompletionEvents(0, 2); NUnit.Framework.Assert.AreEqual(1, events.Length); // TIPFAILED if it comes from the AM, FAILED if it comes from the JHS TaskCompletionEvent.Status status = events[0].GetStatus(); NUnit.Framework.Assert.IsTrue(status == TaskCompletionEvent.Status.Failed || status == TaskCompletionEvent.Status.Tipfailed); NUnit.Framework.Assert.AreEqual(JobStatus.State.Failed, job.GetJobState()); }
/// <summary>Constructor.</summary> /// <remarks> /// Constructor. eventId should be created externally and incremented /// per event for each job. /// </remarks> /// <param name="eventId"> /// event id, event id should be unique and assigned in /// incrementally, starting from 0. /// </param> /// <param name="taskId">task id</param> /// <param name="status">task's status</param> /// <param name="taskTrackerHttp">task tracker's host:port for http.</param> public TaskCompletionEvent(int eventId, TaskAttemptID taskId, int idWithinJob, bool isMap, TaskCompletionEvent.Status status, string taskTrackerHttp) : base(eventId, taskId, idWithinJob, isMap, TaskCompletionEvent.Status.ValueOf(status .ToString()), taskTrackerHttp) { }
public virtual void SetTaskStatus(TaskCompletionEvent.Status status) { base.SetTaskStatus(TaskCompletionEvent.Status.ValueOf(status.ToString())); }
/// <summary>Set task status.</summary> /// <param name="status"/> protected internal virtual void SetTaskStatus(TaskCompletionEvent.Status status) { this.status = status; }