/// <summary>Set current phase of this task.</summary> /// <param name="phase">phase of this task</param> public virtual void SetPhase(TaskStatus.Phase phase) { TaskStatus.Phase oldPhase = GetPhase(); if (oldPhase != phase) { // sort phase started if (phase == TaskStatus.Phase.Sort) { if (oldPhase == TaskStatus.Phase.Map) { SetMapFinishTime(Runtime.CurrentTimeMillis()); } else { SetShuffleFinishTime(Runtime.CurrentTimeMillis()); } } else { if (phase == TaskStatus.Phase.Reduce) { SetSortFinishTime(Runtime.CurrentTimeMillis()); } } this.phase = phase; } }
public _TaskStatus_187(int maxSize, TaskAttemptID baseArg1, float baseArg2, int baseArg3 , TaskStatus.State baseArg4, string baseArg5, string baseArg6, string baseArg7, TaskStatus.Phase baseArg8, Counters baseArg9) : base(baseArg1, baseArg2, baseArg3, baseArg4, baseArg5, baseArg6, baseArg7, baseArg8 , baseArg9) { this.maxSize = maxSize; }
/// <summary> /// Update specific fields of task status /// This update is done in JobTracker when a cleanup attempt of task /// reports its status. /// </summary> /// <remarks> /// Update specific fields of task status /// This update is done in JobTracker when a cleanup attempt of task /// reports its status. Then update only specific fields, not all. /// </remarks> /// <param name="runState"/> /// <param name="progress"/> /// <param name="state"/> /// <param name="phase"/> /// <param name="finishTime"/> internal virtual void StatusUpdate(TaskStatus.State runState, float progress, string state, TaskStatus.Phase phase, long finishTime) { lock (this) { SetRunState(runState); SetProgress(progress); SetStateString(state); SetPhase(phase); if (finishTime > 0) { SetFinishTime(finishTime); } } }
public TaskStatus(TaskAttemptID taskid, float progress, int numSlots, TaskStatus.State runState, string diagnosticInfo, string stateString, string taskTracker, TaskStatus.Phase phase, Counters counters) { this.taskid = taskid; this.progress = progress; this.numSlots = numSlots; this.runState = runState; SetDiagnosticInfo(diagnosticInfo); SetStateString(stateString); this.taskTracker = taskTracker; this.phase = phase; this.counters = counters; this.includeAllCounters = true; }
/// <exception cref="System.IO.IOException"/> public virtual void ReadFields(DataInput @in) { this.taskid.ReadFields(@in); SetProgress(@in.ReadFloat()); this.numSlots = @in.ReadInt(); this.runState = WritableUtils.ReadEnum <TaskStatus.State>(@in); SetDiagnosticInfo(StringInterner.WeakIntern(Text.ReadString(@in))); SetStateString(StringInterner.WeakIntern(Text.ReadString(@in))); this.phase = WritableUtils.ReadEnum <TaskStatus.Phase>(@in); this.startTime = @in.ReadLong(); this.finishTime = @in.ReadLong(); counters = new Counters(); this.includeAllCounters = @in.ReadBoolean(); this.outputSize = @in.ReadLong(); counters.ReadFields(@in); nextRecordRange.ReadFields(@in); }
/// <summary>Update the status of the task.</summary> /// <param name="status">updated status</param> internal virtual void StatusUpdate(Org.Apache.Hadoop.Mapred.TaskStatus status) { lock (this) { SetProgress(status.GetProgress()); this.runState = status.GetRunState(); SetStateString(status.GetStateString()); this.nextRecordRange = status.GetNextRecordRange(); SetDiagnosticInfo(status.GetDiagnosticInfo()); if (status.GetStartTime() > 0) { this.SetStartTime(status.GetStartTime()); } if (status.GetFinishTime() > 0) { this.SetFinishTime(status.GetFinishTime()); } this.phase = status.GetPhase(); this.counters = status.GetCounters(); this.outputSize = status.outputSize; } }
public static Phase ToYarn(TaskStatus.Phase phase) { switch (phase) { case TaskStatus.Phase.Starting: { return(Phase.Starting); } case TaskStatus.Phase.Map: { return(Phase.Map); } case TaskStatus.Phase.Shuffle: { return(Phase.Shuffle); } case TaskStatus.Phase.Sort: { return(Phase.Sort); } case TaskStatus.Phase.Reduce: { return(Phase.Reduce); } case TaskStatus.Phase.Cleanup: { return(Phase.Cleanup); } } throw new YarnRuntimeException("Unrecognized Phase: " + phase); }
public MapTaskStatus(TaskAttemptID taskid, float progress, int numSlots, TaskStatus.State runState, string diagnosticInfo, string stateString, string taskTracker, TaskStatus.Phase phase, Counters counters) : base(taskid, progress, numSlots, runState, diagnosticInfo, stateString, taskTracker , phase, counters) { }
internal static Org.Apache.Hadoop.Mapred.TaskStatus CreateTaskStatus(bool isMap, TaskAttemptID taskId, float progress, int numSlots, TaskStatus.State runState, string diagnosticInfo, string stateString, string taskTracker, TaskStatus.Phase phase, Counters counters) { return((isMap) ? new MapTaskStatus(taskId, progress, numSlots, runState, diagnosticInfo , stateString, taskTracker, phase, counters) : new ReduceTaskStatus(taskId, progress , numSlots, runState, diagnosticInfo, stateString, taskTracker, phase, counters)); }
////////////////////////////////////////////////////////////////////////////// // Factory-like methods to create/read/write appropriate TaskStatus objects ////////////////////////////////////////////////////////////////////////////// /// <exception cref="System.IO.IOException"/> internal static Org.Apache.Hadoop.Mapred.TaskStatus CreateTaskStatus(DataInput @in , TaskAttemptID taskId, float progress, int numSlots, TaskStatus.State runState, string diagnosticInfo, string stateString, string taskTracker, TaskStatus.Phase phase, Counters counters) { bool isMap = @in.ReadBoolean(); return(CreateTaskStatus(isMap, taskId, progress, numSlots, runState, diagnosticInfo , stateString, taskTracker, phase, counters)); }