/**
 * Autogenerated by Thrift Compiler (0.9.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.thriftfs.jobtracker.api;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Describes the current state of a single attempt
 */
public class ThriftTaskStatus implements org.apache.thrift.TBase<ThriftTaskStatus, ThriftTaskStatus._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftTaskStatus");

  private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskID", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField PROGRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("progress", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
  private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField DIAGNOSTIC_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("diagnosticInfo", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField STATE_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("stateString", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField TASK_TRACKER_FIELD_DESC = new org.apache.thrift.protocol.TField("taskTracker", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField FINISH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("finishTime", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField OUTPUT_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("outputSize", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField PHASE_FIELD_DESC = new org.apache.thrift.protocol.TField("phase", org.apache.thrift.protocol.TType.I32, (short)10);
  private static final org.apache.thrift.protocol.TField COUNTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("counters", org.apache.thrift.protocol.TType.STRUCT, (short)11);
  private static final org.apache.thrift.protocol.TField SHUFFLE_FINISH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffleFinishTime", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField SORT_FINISH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("sortFinishTime", org.apache.thrift.protocol.TType.I64, (short)13);
  private static final org.apache.thrift.protocol.TField MAP_FINISH_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("mapFinishTime", org.apache.thrift.protocol.TType.I64, (short)14);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new ThriftTaskStatusStandardSchemeFactory());
    schemes.put(TupleScheme.class, new ThriftTaskStatusTupleSchemeFactory());
  }

  public ThriftTaskAttemptID taskID; // required
  public double progress; // required
  /**
   * 
   * @see ThriftTaskState
   */
  public ThriftTaskState state; // required
  public String diagnosticInfo; // required
  public String stateString; // required
  public String taskTracker; // required
  public long startTime; // required
  public long finishTime; // required
  public long outputSize; // required
  /**
   * 
   * @see ThriftTaskPhase
   */
  public ThriftTaskPhase phase; // required
  public ThriftGroupList counters; // required
  public long shuffleFinishTime; // required
  public long sortFinishTime; // required
  public long mapFinishTime; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    TASK_ID((short)1, "taskID"),
    PROGRESS((short)2, "progress"),
    /**
     * 
     * @see ThriftTaskState
     */
    STATE((short)3, "state"),
    DIAGNOSTIC_INFO((short)4, "diagnosticInfo"),
    STATE_STRING((short)5, "stateString"),
    TASK_TRACKER((short)6, "taskTracker"),
    START_TIME((short)7, "startTime"),
    FINISH_TIME((short)8, "finishTime"),
    OUTPUT_SIZE((short)9, "outputSize"),
    /**
     * 
     * @see ThriftTaskPhase
     */
    PHASE((short)10, "phase"),
    COUNTERS((short)11, "counters"),
    SHUFFLE_FINISH_TIME((short)12, "shuffleFinishTime"),
    SORT_FINISH_TIME((short)13, "sortFinishTime"),
    MAP_FINISH_TIME((short)14, "mapFinishTime");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TASK_ID
          return TASK_ID;
        case 2: // PROGRESS
          return PROGRESS;
        case 3: // STATE
          return STATE;
        case 4: // DIAGNOSTIC_INFO
          return DIAGNOSTIC_INFO;
        case 5: // STATE_STRING
          return STATE_STRING;
        case 6: // TASK_TRACKER
          return TASK_TRACKER;
        case 7: // START_TIME
          return START_TIME;
        case 8: // FINISH_TIME
          return FINISH_TIME;
        case 9: // OUTPUT_SIZE
          return OUTPUT_SIZE;
        case 10: // PHASE
          return PHASE;
        case 11: // COUNTERS
          return COUNTERS;
        case 12: // SHUFFLE_FINISH_TIME
          return SHUFFLE_FINISH_TIME;
        case 13: // SORT_FINISH_TIME
          return SORT_FINISH_TIME;
        case 14: // MAP_FINISH_TIME
          return MAP_FINISH_TIME;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PROGRESS_ISSET_ID = 0;
  private static final int __STARTTIME_ISSET_ID = 1;
  private static final int __FINISHTIME_ISSET_ID = 2;
  private static final int __OUTPUTSIZE_ISSET_ID = 3;
  private static final int __SHUFFLEFINISHTIME_ISSET_ID = 4;
  private static final int __SORTFINISHTIME_ISSET_ID = 5;
  private static final int __MAPFINISHTIME_ISSET_ID = 6;
  private byte __isset_bitfield = 0;
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskID", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftTaskAttemptID.class)));
    tmpMap.put(_Fields.PROGRESS, new org.apache.thrift.meta_data.FieldMetaData("progress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ThriftTaskState.class)));
    tmpMap.put(_Fields.DIAGNOSTIC_INFO, new org.apache.thrift.meta_data.FieldMetaData("diagnosticInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.STATE_STRING, new org.apache.thrift.meta_data.FieldMetaData("stateString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TASK_TRACKER, new org.apache.thrift.meta_data.FieldMetaData("taskTracker", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.FINISH_TIME, new org.apache.thrift.meta_data.FieldMetaData("finishTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.OUTPUT_SIZE, new org.apache.thrift.meta_data.FieldMetaData("outputSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PHASE, new org.apache.thrift.meta_data.FieldMetaData("phase", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ThriftTaskPhase.class)));
    tmpMap.put(_Fields.COUNTERS, new org.apache.thrift.meta_data.FieldMetaData("counters", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftGroupList.class)));
    tmpMap.put(_Fields.SHUFFLE_FINISH_TIME, new org.apache.thrift.meta_data.FieldMetaData("shuffleFinishTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SORT_FINISH_TIME, new org.apache.thrift.meta_data.FieldMetaData("sortFinishTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAP_FINISH_TIME, new org.apache.thrift.meta_data.FieldMetaData("mapFinishTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftTaskStatus.class, metaDataMap);
  }

  public ThriftTaskStatus() {
  }

  public ThriftTaskStatus(
    ThriftTaskAttemptID taskID,
    double progress,
    ThriftTaskState state,
    String diagnosticInfo,
    String stateString,
    String taskTracker,
    long startTime,
    long finishTime,
    long outputSize,
    ThriftTaskPhase phase,
    ThriftGroupList counters,
    long shuffleFinishTime,
    long sortFinishTime,
    long mapFinishTime)
  {
    this();
    this.taskID = taskID;
    this.progress = progress;
    setProgressIsSet(true);
    this.state = state;
    this.diagnosticInfo = diagnosticInfo;
    this.stateString = stateString;
    this.taskTracker = taskTracker;
    this.startTime = startTime;
    setStartTimeIsSet(true);
    this.finishTime = finishTime;
    setFinishTimeIsSet(true);
    this.outputSize = outputSize;
    setOutputSizeIsSet(true);
    this.phase = phase;
    this.counters = counters;
    this.shuffleFinishTime = shuffleFinishTime;
    setShuffleFinishTimeIsSet(true);
    this.sortFinishTime = sortFinishTime;
    setSortFinishTimeIsSet(true);
    this.mapFinishTime = mapFinishTime;
    setMapFinishTimeIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ThriftTaskStatus(ThriftTaskStatus other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetTaskID()) {
      this.taskID = new ThriftTaskAttemptID(other.taskID);
    }
    this.progress = other.progress;
    if (other.isSetState()) {
      this.state = other.state;
    }
    if (other.isSetDiagnosticInfo()) {
      this.diagnosticInfo = other.diagnosticInfo;
    }
    if (other.isSetStateString()) {
      this.stateString = other.stateString;
    }
    if (other.isSetTaskTracker()) {
      this.taskTracker = other.taskTracker;
    }
    this.startTime = other.startTime;
    this.finishTime = other.finishTime;
    this.outputSize = other.outputSize;
    if (other.isSetPhase()) {
      this.phase = other.phase;
    }
    if (other.isSetCounters()) {
      this.counters = new ThriftGroupList(other.counters);
    }
    this.shuffleFinishTime = other.shuffleFinishTime;
    this.sortFinishTime = other.sortFinishTime;
    this.mapFinishTime = other.mapFinishTime;
  }

  public ThriftTaskStatus deepCopy() {
    return new ThriftTaskStatus(this);
  }

  @Override
  public void clear() {
    this.taskID = null;
    setProgressIsSet(false);
    this.progress = 0.0;
    this.state = null;
    this.diagnosticInfo = null;
    this.stateString = null;
    this.taskTracker = null;
    setStartTimeIsSet(false);
    this.startTime = 0;
    setFinishTimeIsSet(false);
    this.finishTime = 0;
    setOutputSizeIsSet(false);
    this.outputSize = 0;
    this.phase = null;
    this.counters = null;
    setShuffleFinishTimeIsSet(false);
    this.shuffleFinishTime = 0;
    setSortFinishTimeIsSet(false);
    this.sortFinishTime = 0;
    setMapFinishTimeIsSet(false);
    this.mapFinishTime = 0;
  }

  public ThriftTaskAttemptID getTaskID() {
    return this.taskID;
  }

  public ThriftTaskStatus setTaskID(ThriftTaskAttemptID taskID) {
    this.taskID = taskID;
    return this;
  }

  public void unsetTaskID() {
    this.taskID = null;
  }

  /** Returns true if field taskID is set (has been assigned a value) and false otherwise */
  public boolean isSetTaskID() {
    return this.taskID != null;
  }

  public void setTaskIDIsSet(boolean value) {
    if (!value) {
      this.taskID = null;
    }
  }

  public double getProgress() {
    return this.progress;
  }

  public ThriftTaskStatus setProgress(double progress) {
    this.progress = progress;
    setProgressIsSet(true);
    return this;
  }

  public void unsetProgress() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESS_ISSET_ID);
  }

  /** Returns true if field progress is set (has been assigned a value) and false otherwise */
  public boolean isSetProgress() {
    return EncodingUtils.testBit(__isset_bitfield, __PROGRESS_ISSET_ID);
  }

  public void setProgressIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESS_ISSET_ID, value);
  }

  /**
   * 
   * @see ThriftTaskState
   */
  public ThriftTaskState getState() {
    return this.state;
  }

  /**
   * 
   * @see ThriftTaskState
   */
  public ThriftTaskStatus setState(ThriftTaskState state) {
    this.state = state;
    return this;
  }

  public void unsetState() {
    this.state = null;
  }

  /** Returns true if field state is set (has been assigned a value) and false otherwise */
  public boolean isSetState() {
    return this.state != null;
  }

  public void setStateIsSet(boolean value) {
    if (!value) {
      this.state = null;
    }
  }

  public String getDiagnosticInfo() {
    return this.diagnosticInfo;
  }

  public ThriftTaskStatus setDiagnosticInfo(String diagnosticInfo) {
    this.diagnosticInfo = diagnosticInfo;
    return this;
  }

  public void unsetDiagnosticInfo() {
    this.diagnosticInfo = null;
  }

  /** Returns true if field diagnosticInfo is set (has been assigned a value) and false otherwise */
  public boolean isSetDiagnosticInfo() {
    return this.diagnosticInfo != null;
  }

  public void setDiagnosticInfoIsSet(boolean value) {
    if (!value) {
      this.diagnosticInfo = null;
    }
  }

  public String getStateString() {
    return this.stateString;
  }

  public ThriftTaskStatus setStateString(String stateString) {
    this.stateString = stateString;
    return this;
  }

  public void unsetStateString() {
    this.stateString = null;
  }

  /** Returns true if field stateString is set (has been assigned a value) and false otherwise */
  public boolean isSetStateString() {
    return this.stateString != null;
  }

  public void setStateStringIsSet(boolean value) {
    if (!value) {
      this.stateString = null;
    }
  }

  public String getTaskTracker() {
    return this.taskTracker;
  }

  public ThriftTaskStatus setTaskTracker(String taskTracker) {
    this.taskTracker = taskTracker;
    return this;
  }

  public void unsetTaskTracker() {
    this.taskTracker = null;
  }

  /** Returns true if field taskTracker is set (has been assigned a value) and false otherwise */
  public boolean isSetTaskTracker() {
    return this.taskTracker != null;
  }

  public void setTaskTrackerIsSet(boolean value) {
    if (!value) {
      this.taskTracker = null;
    }
  }

  public long getStartTime() {
    return this.startTime;
  }

  public ThriftTaskStatus setStartTime(long startTime) {
    this.startTime = startTime;
    setStartTimeIsSet(true);
    return this;
  }

  public void unsetStartTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
  }

  /** Returns true if field startTime is set (has been assigned a value) and false otherwise */
  public boolean isSetStartTime() {
    return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID);
  }

  public void setStartTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
  }

  public long getFinishTime() {
    return this.finishTime;
  }

  public ThriftTaskStatus setFinishTime(long finishTime) {
    this.finishTime = finishTime;
    setFinishTimeIsSet(true);
    return this;
  }

  public void unsetFinishTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FINISHTIME_ISSET_ID);
  }

  /** Returns true if field finishTime is set (has been assigned a value) and false otherwise */
  public boolean isSetFinishTime() {
    return EncodingUtils.testBit(__isset_bitfield, __FINISHTIME_ISSET_ID);
  }

  public void setFinishTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FINISHTIME_ISSET_ID, value);
  }

  public long getOutputSize() {
    return this.outputSize;
  }

  public ThriftTaskStatus setOutputSize(long outputSize) {
    this.outputSize = outputSize;
    setOutputSizeIsSet(true);
    return this;
  }

  public void unsetOutputSize() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OUTPUTSIZE_ISSET_ID);
  }

  /** Returns true if field outputSize is set (has been assigned a value) and false otherwise */
  public boolean isSetOutputSize() {
    return EncodingUtils.testBit(__isset_bitfield, __OUTPUTSIZE_ISSET_ID);
  }

  public void setOutputSizeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OUTPUTSIZE_ISSET_ID, value);
  }

  /**
   * 
   * @see ThriftTaskPhase
   */
  public ThriftTaskPhase getPhase() {
    return this.phase;
  }

  /**
   * 
   * @see ThriftTaskPhase
   */
  public ThriftTaskStatus setPhase(ThriftTaskPhase phase) {
    this.phase = phase;
    return this;
  }

  public void unsetPhase() {
    this.phase = null;
  }

  /** Returns true if field phase is set (has been assigned a value) and false otherwise */
  public boolean isSetPhase() {
    return this.phase != null;
  }

  public void setPhaseIsSet(boolean value) {
    if (!value) {
      this.phase = null;
    }
  }

  public ThriftGroupList getCounters() {
    return this.counters;
  }

  public ThriftTaskStatus setCounters(ThriftGroupList counters) {
    this.counters = counters;
    return this;
  }

  public void unsetCounters() {
    this.counters = null;
  }

  /** Returns true if field counters is set (has been assigned a value) and false otherwise */
  public boolean isSetCounters() {
    return this.counters != null;
  }

  public void setCountersIsSet(boolean value) {
    if (!value) {
      this.counters = null;
    }
  }

  public long getShuffleFinishTime() {
    return this.shuffleFinishTime;
  }

  public ThriftTaskStatus setShuffleFinishTime(long shuffleFinishTime) {
    this.shuffleFinishTime = shuffleFinishTime;
    setShuffleFinishTimeIsSet(true);
    return this;
  }

  public void unsetShuffleFinishTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHUFFLEFINISHTIME_ISSET_ID);
  }

  /** Returns true if field shuffleFinishTime is set (has been assigned a value) and false otherwise */
  public boolean isSetShuffleFinishTime() {
    return EncodingUtils.testBit(__isset_bitfield, __SHUFFLEFINISHTIME_ISSET_ID);
  }

  public void setShuffleFinishTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHUFFLEFINISHTIME_ISSET_ID, value);
  }

  public long getSortFinishTime() {
    return this.sortFinishTime;
  }

  public ThriftTaskStatus setSortFinishTime(long sortFinishTime) {
    this.sortFinishTime = sortFinishTime;
    setSortFinishTimeIsSet(true);
    return this;
  }

  public void unsetSortFinishTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SORTFINISHTIME_ISSET_ID);
  }

  /** Returns true if field sortFinishTime is set (has been assigned a value) and false otherwise */
  public boolean isSetSortFinishTime() {
    return EncodingUtils.testBit(__isset_bitfield, __SORTFINISHTIME_ISSET_ID);
  }

  public void setSortFinishTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SORTFINISHTIME_ISSET_ID, value);
  }

  public long getMapFinishTime() {
    return this.mapFinishTime;
  }

  public ThriftTaskStatus setMapFinishTime(long mapFinishTime) {
    this.mapFinishTime = mapFinishTime;
    setMapFinishTimeIsSet(true);
    return this;
  }

  public void unsetMapFinishTime() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAPFINISHTIME_ISSET_ID);
  }

  /** Returns true if field mapFinishTime is set (has been assigned a value) and false otherwise */
  public boolean isSetMapFinishTime() {
    return EncodingUtils.testBit(__isset_bitfield, __MAPFINISHTIME_ISSET_ID);
  }

  public void setMapFinishTimeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAPFINISHTIME_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TASK_ID:
      if (value == null) {
        unsetTaskID();
      } else {
        setTaskID((ThriftTaskAttemptID)value);
      }
      break;

    case PROGRESS:
      if (value == null) {
        unsetProgress();
      } else {
        setProgress((Double)value);
      }
      break;

    case STATE:
      if (value == null) {
        unsetState();
      } else {
        setState((ThriftTaskState)value);
      }
      break;

    case DIAGNOSTIC_INFO:
      if (value == null) {
        unsetDiagnosticInfo();
      } else {
        setDiagnosticInfo((String)value);
      }
      break;

    case STATE_STRING:
      if (value == null) {
        unsetStateString();
      } else {
        setStateString((String)value);
      }
      break;

    case TASK_TRACKER:
      if (value == null) {
        unsetTaskTracker();
      } else {
        setTaskTracker((String)value);
      }
      break;

    case START_TIME:
      if (value == null) {
        unsetStartTime();
      } else {
        setStartTime((Long)value);
      }
      break;

    case FINISH_TIME:
      if (value == null) {
        unsetFinishTime();
      } else {
        setFinishTime((Long)value);
      }
      break;

    case OUTPUT_SIZE:
      if (value == null) {
        unsetOutputSize();
      } else {
        setOutputSize((Long)value);
      }
      break;

    case PHASE:
      if (value == null) {
        unsetPhase();
      } else {
        setPhase((ThriftTaskPhase)value);
      }
      break;

    case COUNTERS:
      if (value == null) {
        unsetCounters();
      } else {
        setCounters((ThriftGroupList)value);
      }
      break;

    case SHUFFLE_FINISH_TIME:
      if (value == null) {
        unsetShuffleFinishTime();
      } else {
        setShuffleFinishTime((Long)value);
      }
      break;

    case SORT_FINISH_TIME:
      if (value == null) {
        unsetSortFinishTime();
      } else {
        setSortFinishTime((Long)value);
      }
      break;

    case MAP_FINISH_TIME:
      if (value == null) {
        unsetMapFinishTime();
      } else {
        setMapFinishTime((Long)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TASK_ID:
      return getTaskID();

    case PROGRESS:
      return Double.valueOf(getProgress());

    case STATE:
      return getState();

    case DIAGNOSTIC_INFO:
      return getDiagnosticInfo();

    case STATE_STRING:
      return getStateString();

    case TASK_TRACKER:
      return getTaskTracker();

    case START_TIME:
      return Long.valueOf(getStartTime());

    case FINISH_TIME:
      return Long.valueOf(getFinishTime());

    case OUTPUT_SIZE:
      return Long.valueOf(getOutputSize());

    case PHASE:
      return getPhase();

    case COUNTERS:
      return getCounters();

    case SHUFFLE_FINISH_TIME:
      return Long.valueOf(getShuffleFinishTime());

    case SORT_FINISH_TIME:
      return Long.valueOf(getSortFinishTime());

    case MAP_FINISH_TIME:
      return Long.valueOf(getMapFinishTime());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case TASK_ID:
      return isSetTaskID();
    case PROGRESS:
      return isSetProgress();
    case STATE:
      return isSetState();
    case DIAGNOSTIC_INFO:
      return isSetDiagnosticInfo();
    case STATE_STRING:
      return isSetStateString();
    case TASK_TRACKER:
      return isSetTaskTracker();
    case START_TIME:
      return isSetStartTime();
    case FINISH_TIME:
      return isSetFinishTime();
    case OUTPUT_SIZE:
      return isSetOutputSize();
    case PHASE:
      return isSetPhase();
    case COUNTERS:
      return isSetCounters();
    case SHUFFLE_FINISH_TIME:
      return isSetShuffleFinishTime();
    case SORT_FINISH_TIME:
      return isSetSortFinishTime();
    case MAP_FINISH_TIME:
      return isSetMapFinishTime();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof ThriftTaskStatus)
      return this.equals((ThriftTaskStatus)that);
    return false;
  }

  public boolean equals(ThriftTaskStatus that) {
    if (that == null)
      return false;

    boolean this_present_taskID = true && this.isSetTaskID();
    boolean that_present_taskID = true && that.isSetTaskID();
    if (this_present_taskID || that_present_taskID) {
      if (!(this_present_taskID && that_present_taskID))
        return false;
      if (!this.taskID.equals(that.taskID))
        return false;
    }

    boolean this_present_progress = true;
    boolean that_present_progress = true;
    if (this_present_progress || that_present_progress) {
      if (!(this_present_progress && that_present_progress))
        return false;
      if (this.progress != that.progress)
        return false;
    }

    boolean this_present_state = true && this.isSetState();
    boolean that_present_state = true && that.isSetState();
    if (this_present_state || that_present_state) {
      if (!(this_present_state && that_present_state))
        return false;
      if (!this.state.equals(that.state))
        return false;
    }

    boolean this_present_diagnosticInfo = true && this.isSetDiagnosticInfo();
    boolean that_present_diagnosticInfo = true && that.isSetDiagnosticInfo();
    if (this_present_diagnosticInfo || that_present_diagnosticInfo) {
      if (!(this_present_diagnosticInfo && that_present_diagnosticInfo))
        return false;
      if (!this.diagnosticInfo.equals(that.diagnosticInfo))
        return false;
    }

    boolean this_present_stateString = true && this.isSetStateString();
    boolean that_present_stateString = true && that.isSetStateString();
    if (this_present_stateString || that_present_stateString) {
      if (!(this_present_stateString && that_present_stateString))
        return false;
      if (!this.stateString.equals(that.stateString))
        return false;
    }

    boolean this_present_taskTracker = true && this.isSetTaskTracker();
    boolean that_present_taskTracker = true && that.isSetTaskTracker();
    if (this_present_taskTracker || that_present_taskTracker) {
      if (!(this_present_taskTracker && that_present_taskTracker))
        return false;
      if (!this.taskTracker.equals(that.taskTracker))
        return false;
    }

    boolean this_present_startTime = true;
    boolean that_present_startTime = true;
    if (this_present_startTime || that_present_startTime) {
      if (!(this_present_startTime && that_present_startTime))
        return false;
      if (this.startTime != that.startTime)
        return false;
    }

    boolean this_present_finishTime = true;
    boolean that_present_finishTime = true;
    if (this_present_finishTime || that_present_finishTime) {
      if (!(this_present_finishTime && that_present_finishTime))
        return false;
      if (this.finishTime != that.finishTime)
        return false;
    }

    boolean this_present_outputSize = true;
    boolean that_present_outputSize = true;
    if (this_present_outputSize || that_present_outputSize) {
      if (!(this_present_outputSize && that_present_outputSize))
        return false;
      if (this.outputSize != that.outputSize)
        return false;
    }

    boolean this_present_phase = true && this.isSetPhase();
    boolean that_present_phase = true && that.isSetPhase();
    if (this_present_phase || that_present_phase) {
      if (!(this_present_phase && that_present_phase))
        return false;
      if (!this.phase.equals(that.phase))
        return false;
    }

    boolean this_present_counters = true && this.isSetCounters();
    boolean that_present_counters = true && that.isSetCounters();
    if (this_present_counters || that_present_counters) {
      if (!(this_present_counters && that_present_counters))
        return false;
      if (!this.counters.equals(that.counters))
        return false;
    }

    boolean this_present_shuffleFinishTime = true;
    boolean that_present_shuffleFinishTime = true;
    if (this_present_shuffleFinishTime || that_present_shuffleFinishTime) {
      if (!(this_present_shuffleFinishTime && that_present_shuffleFinishTime))
        return false;
      if (this.shuffleFinishTime != that.shuffleFinishTime)
        return false;
    }

    boolean this_present_sortFinishTime = true;
    boolean that_present_sortFinishTime = true;
    if (this_present_sortFinishTime || that_present_sortFinishTime) {
      if (!(this_present_sortFinishTime && that_present_sortFinishTime))
        return false;
      if (this.sortFinishTime != that.sortFinishTime)
        return false;
    }

    boolean this_present_mapFinishTime = true;
    boolean that_present_mapFinishTime = true;
    if (this_present_mapFinishTime || that_present_mapFinishTime) {
      if (!(this_present_mapFinishTime && that_present_mapFinishTime))
        return false;
      if (this.mapFinishTime != that.mapFinishTime)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  public int compareTo(ThriftTaskStatus other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    ThriftTaskStatus typedOther = (ThriftTaskStatus)other;

    lastComparison = Boolean.valueOf(isSetTaskID()).compareTo(typedOther.isSetTaskID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskID, typedOther.taskID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProgress()).compareTo(typedOther.isSetProgress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProgress()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progress, typedOther.progress);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetState()).compareTo(typedOther.isSetState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, typedOther.state);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDiagnosticInfo()).compareTo(typedOther.isSetDiagnosticInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDiagnosticInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.diagnosticInfo, typedOther.diagnosticInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStateString()).compareTo(typedOther.isSetStateString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStateString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stateString, typedOther.stateString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskTracker()).compareTo(typedOther.isSetTaskTracker());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskTracker()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskTracker, typedOther.taskTracker);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(typedOther.isSetStartTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, typedOther.startTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFinishTime()).compareTo(typedOther.isSetFinishTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFinishTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.finishTime, typedOther.finishTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOutputSize()).compareTo(typedOther.isSetOutputSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutputSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputSize, typedOther.outputSize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPhase()).compareTo(typedOther.isSetPhase());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPhase()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phase, typedOther.phase);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCounters()).compareTo(typedOther.isSetCounters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCounters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.counters, typedOther.counters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetShuffleFinishTime()).compareTo(typedOther.isSetShuffleFinishTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShuffleFinishTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shuffleFinishTime, typedOther.shuffleFinishTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSortFinishTime()).compareTo(typedOther.isSetSortFinishTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSortFinishTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sortFinishTime, typedOther.sortFinishTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMapFinishTime()).compareTo(typedOther.isSetMapFinishTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMapFinishTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapFinishTime, typedOther.mapFinishTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("ThriftTaskStatus(");
    boolean first = true;

    sb.append("taskID:");
    if (this.taskID == null) {
      sb.append("null");
    } else {
      sb.append(this.taskID);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("progress:");
    sb.append(this.progress);
    first = false;
    if (!first) sb.append(", ");
    sb.append("state:");
    if (this.state == null) {
      sb.append("null");
    } else {
      sb.append(this.state);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("diagnosticInfo:");
    if (this.diagnosticInfo == null) {
      sb.append("null");
    } else {
      sb.append(this.diagnosticInfo);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("stateString:");
    if (this.stateString == null) {
      sb.append("null");
    } else {
      sb.append(this.stateString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("taskTracker:");
    if (this.taskTracker == null) {
      sb.append("null");
    } else {
      sb.append(this.taskTracker);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("startTime:");
    sb.append(this.startTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("finishTime:");
    sb.append(this.finishTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("outputSize:");
    sb.append(this.outputSize);
    first = false;
    if (!first) sb.append(", ");
    sb.append("phase:");
    if (this.phase == null) {
      sb.append("null");
    } else {
      sb.append(this.phase);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("counters:");
    if (this.counters == null) {
      sb.append("null");
    } else {
      sb.append(this.counters);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("shuffleFinishTime:");
    sb.append(this.shuffleFinishTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("sortFinishTime:");
    sb.append(this.sortFinishTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("mapFinishTime:");
    sb.append(this.mapFinishTime);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (taskID != null) {
      taskID.validate();
    }
    if (counters != null) {
      counters.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ThriftTaskStatusStandardSchemeFactory implements SchemeFactory {
    public ThriftTaskStatusStandardScheme getScheme() {
      return new ThriftTaskStatusStandardScheme();
    }
  }

  private static class ThriftTaskStatusStandardScheme extends StandardScheme<ThriftTaskStatus> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftTaskStatus struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // TASK_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.taskID = new ThriftTaskAttemptID();
              struct.taskID.read(iprot);
              struct.setTaskIDIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PROGRESS
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.progress = iprot.readDouble();
              struct.setProgressIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // STATE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.state = ThriftTaskState.findByValue(iprot.readI32());
              struct.setStateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DIAGNOSTIC_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.diagnosticInfo = iprot.readString();
              struct.setDiagnosticInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // STATE_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.stateString = iprot.readString();
              struct.setStateStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // TASK_TRACKER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.taskTracker = iprot.readString();
              struct.setTaskTrackerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // START_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startTime = iprot.readI64();
              struct.setStartTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // FINISH_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.finishTime = iprot.readI64();
              struct.setFinishTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // OUTPUT_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.outputSize = iprot.readI64();
              struct.setOutputSizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // PHASE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.phase = ThriftTaskPhase.findByValue(iprot.readI32());
              struct.setPhaseIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // COUNTERS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.counters = new ThriftGroupList();
              struct.counters.read(iprot);
              struct.setCountersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // SHUFFLE_FINISH_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.shuffleFinishTime = iprot.readI64();
              struct.setShuffleFinishTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // SORT_FINISH_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.sortFinishTime = iprot.readI64();
              struct.setSortFinishTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // MAP_FINISH_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.mapFinishTime = iprot.readI64();
              struct.setMapFinishTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, ThriftTaskStatus struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.taskID != null) {
        oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
        struct.taskID.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(PROGRESS_FIELD_DESC);
      oprot.writeDouble(struct.progress);
      oprot.writeFieldEnd();
      if (struct.state != null) {
        oprot.writeFieldBegin(STATE_FIELD_DESC);
        oprot.writeI32(struct.state.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.diagnosticInfo != null) {
        oprot.writeFieldBegin(DIAGNOSTIC_INFO_FIELD_DESC);
        oprot.writeString(struct.diagnosticInfo);
        oprot.writeFieldEnd();
      }
      if (struct.stateString != null) {
        oprot.writeFieldBegin(STATE_STRING_FIELD_DESC);
        oprot.writeString(struct.stateString);
        oprot.writeFieldEnd();
      }
      if (struct.taskTracker != null) {
        oprot.writeFieldBegin(TASK_TRACKER_FIELD_DESC);
        oprot.writeString(struct.taskTracker);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(START_TIME_FIELD_DESC);
      oprot.writeI64(struct.startTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FINISH_TIME_FIELD_DESC);
      oprot.writeI64(struct.finishTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(OUTPUT_SIZE_FIELD_DESC);
      oprot.writeI64(struct.outputSize);
      oprot.writeFieldEnd();
      if (struct.phase != null) {
        oprot.writeFieldBegin(PHASE_FIELD_DESC);
        oprot.writeI32(struct.phase.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.counters != null) {
        oprot.writeFieldBegin(COUNTERS_FIELD_DESC);
        struct.counters.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SHUFFLE_FINISH_TIME_FIELD_DESC);
      oprot.writeI64(struct.shuffleFinishTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SORT_FINISH_TIME_FIELD_DESC);
      oprot.writeI64(struct.sortFinishTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MAP_FINISH_TIME_FIELD_DESC);
      oprot.writeI64(struct.mapFinishTime);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ThriftTaskStatusTupleSchemeFactory implements SchemeFactory {
    public ThriftTaskStatusTupleScheme getScheme() {
      return new ThriftTaskStatusTupleScheme();
    }
  }

  private static class ThriftTaskStatusTupleScheme extends TupleScheme<ThriftTaskStatus> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ThriftTaskStatus struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTaskID()) {
        optionals.set(0);
      }
      if (struct.isSetProgress()) {
        optionals.set(1);
      }
      if (struct.isSetState()) {
        optionals.set(2);
      }
      if (struct.isSetDiagnosticInfo()) {
        optionals.set(3);
      }
      if (struct.isSetStateString()) {
        optionals.set(4);
      }
      if (struct.isSetTaskTracker()) {
        optionals.set(5);
      }
      if (struct.isSetStartTime()) {
        optionals.set(6);
      }
      if (struct.isSetFinishTime()) {
        optionals.set(7);
      }
      if (struct.isSetOutputSize()) {
        optionals.set(8);
      }
      if (struct.isSetPhase()) {
        optionals.set(9);
      }
      if (struct.isSetCounters()) {
        optionals.set(10);
      }
      if (struct.isSetShuffleFinishTime()) {
        optionals.set(11);
      }
      if (struct.isSetSortFinishTime()) {
        optionals.set(12);
      }
      if (struct.isSetMapFinishTime()) {
        optionals.set(13);
      }
      oprot.writeBitSet(optionals, 14);
      if (struct.isSetTaskID()) {
        struct.taskID.write(oprot);
      }
      if (struct.isSetProgress()) {
        oprot.writeDouble(struct.progress);
      }
      if (struct.isSetState()) {
        oprot.writeI32(struct.state.getValue());
      }
      if (struct.isSetDiagnosticInfo()) {
        oprot.writeString(struct.diagnosticInfo);
      }
      if (struct.isSetStateString()) {
        oprot.writeString(struct.stateString);
      }
      if (struct.isSetTaskTracker()) {
        oprot.writeString(struct.taskTracker);
      }
      if (struct.isSetStartTime()) {
        oprot.writeI64(struct.startTime);
      }
      if (struct.isSetFinishTime()) {
        oprot.writeI64(struct.finishTime);
      }
      if (struct.isSetOutputSize()) {
        oprot.writeI64(struct.outputSize);
      }
      if (struct.isSetPhase()) {
        oprot.writeI32(struct.phase.getValue());
      }
      if (struct.isSetCounters()) {
        struct.counters.write(oprot);
      }
      if (struct.isSetShuffleFinishTime()) {
        oprot.writeI64(struct.shuffleFinishTime);
      }
      if (struct.isSetSortFinishTime()) {
        oprot.writeI64(struct.sortFinishTime);
      }
      if (struct.isSetMapFinishTime()) {
        oprot.writeI64(struct.mapFinishTime);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ThriftTaskStatus struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(14);
      if (incoming.get(0)) {
        struct.taskID = new ThriftTaskAttemptID();
        struct.taskID.read(iprot);
        struct.setTaskIDIsSet(true);
      }
      if (incoming.get(1)) {
        struct.progress = iprot.readDouble();
        struct.setProgressIsSet(true);
      }
      if (incoming.get(2)) {
        struct.state = ThriftTaskState.findByValue(iprot.readI32());
        struct.setStateIsSet(true);
      }
      if (incoming.get(3)) {
        struct.diagnosticInfo = iprot.readString();
        struct.setDiagnosticInfoIsSet(true);
      }
      if (incoming.get(4)) {
        struct.stateString = iprot.readString();
        struct.setStateStringIsSet(true);
      }
      if (incoming.get(5)) {
        struct.taskTracker = iprot.readString();
        struct.setTaskTrackerIsSet(true);
      }
      if (incoming.get(6)) {
        struct.startTime = iprot.readI64();
        struct.setStartTimeIsSet(true);
      }
      if (incoming.get(7)) {
        struct.finishTime = iprot.readI64();
        struct.setFinishTimeIsSet(true);
      }
      if (incoming.get(8)) {
        struct.outputSize = iprot.readI64();
        struct.setOutputSizeIsSet(true);
      }
      if (incoming.get(9)) {
        struct.phase = ThriftTaskPhase.findByValue(iprot.readI32());
        struct.setPhaseIsSet(true);
      }
      if (incoming.get(10)) {
        struct.counters = new ThriftGroupList();
        struct.counters.read(iprot);
        struct.setCountersIsSet(true);
      }
      if (incoming.get(11)) {
        struct.shuffleFinishTime = iprot.readI64();
        struct.setShuffleFinishTimeIsSet(true);
      }
      if (incoming.get(12)) {
        struct.sortFinishTime = iprot.readI64();
        struct.setSortFinishTimeIsSet(true);
      }
      if (incoming.get(13)) {
        struct.mapFinishTime = iprot.readI64();
        struct.setMapFinishTimeIsSet(true);
      }
    }
  }

}

