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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTaskId(), other.isSetTaskId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTaskType(), other.isSetTaskType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskType, other.taskType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTaskAttributes(), other.isSetTaskAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskAttributes, other.taskAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTaskCounters(), other.isSetTaskCounters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskCounters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskCounters, other.taskCounters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOperatorGraph(), other.isSetOperatorGraph());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperatorGraph()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatorGraph, other.operatorGraph);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOperatorList(), other.isSetOperatorList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperatorList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatorList, other.operatorList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDone(), other.isSetDone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDone()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.done, other.done);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStarted(), other.isSetStarted());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStarted()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.started, other.started);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java