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

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;

/**
 * TaskTracker status; contains details of individual tasks
 */
public class ThriftTaskTrackerStatus implements org.apache.thrift.TBase<ThriftTaskTrackerStatus, ThriftTaskTrackerStatus._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftTaskTrackerStatus");

  private static final org.apache.thrift.protocol.TField TRACKER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("trackerName", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField HTTP_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("httpPort", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField FAILURE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("failureCount", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField TASK_REPORTS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskReports", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField LAST_SEEN_FIELD_DESC = new org.apache.thrift.protocol.TField("lastSeen", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField MAX_MAP_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxMapTasks", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField MAX_REDUCE_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxReduceTasks", org.apache.thrift.protocol.TType.I32, (short)8);
  private static final org.apache.thrift.protocol.TField TOTAL_VIRTUAL_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("totalVirtualMemory", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField TOTAL_PHYSICAL_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("totalPhysicalMemory", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField AVAILABLE_SPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("availableSpace", org.apache.thrift.protocol.TType.I64, (short)13);
  private static final org.apache.thrift.protocol.TField MAP_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("mapCount", org.apache.thrift.protocol.TType.I32, (short)14);
  private static final org.apache.thrift.protocol.TField REDUCE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("reduceCount", org.apache.thrift.protocol.TType.I32, (short)15);

  public String trackerName; // required
  public String host; // required
  public int httpPort; // required
  public int failureCount; // required
  /**
   * List of the state of all tasks on this tracker
   */
  public List<ThriftTaskStatus> taskReports; // required
  /**
   * When did the JobTracker last hear from this TaskTracker?
   */
  public long lastSeen; // required
  /**
   * Maximum possible number of both task types
   */
  public int maxMapTasks; // required
  public int maxReduceTasks; // required
  /**
   * Main memory metrics, all in bytes
   */
  public long totalVirtualMemory; // required
  public long totalPhysicalMemory; // required
  public long availableSpace; // required
  /**
   * Currently running and unassigned map and reduce tasks
   */
  public int mapCount; // required
  public int reduceCount; // 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 {
    TRACKER_NAME((short)1, "trackerName"),
    HOST((short)2, "host"),
    HTTP_PORT((short)3, "httpPort"),
    FAILURE_COUNT((short)4, "failureCount"),
    /**
     * List of the state of all tasks on this tracker
     */
    TASK_REPORTS((short)5, "taskReports"),
    /**
     * When did the JobTracker last hear from this TaskTracker?
     */
    LAST_SEEN((short)6, "lastSeen"),
    /**
     * Maximum possible number of both task types
     */
    MAX_MAP_TASKS((short)7, "maxMapTasks"),
    MAX_REDUCE_TASKS((short)8, "maxReduceTasks"),
    /**
     * Main memory metrics, all in bytes
     */
    TOTAL_VIRTUAL_MEMORY((short)9, "totalVirtualMemory"),
    TOTAL_PHYSICAL_MEMORY((short)11, "totalPhysicalMemory"),
    AVAILABLE_SPACE((short)13, "availableSpace"),
    /**
     * Currently running and unassigned map and reduce tasks
     */
    MAP_COUNT((short)14, "mapCount"),
    REDUCE_COUNT((short)15, "reduceCount");

    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: // TRACKER_NAME
          return TRACKER_NAME;
        case 2: // HOST
          return HOST;
        case 3: // HTTP_PORT
          return HTTP_PORT;
        case 4: // FAILURE_COUNT
          return FAILURE_COUNT;
        case 5: // TASK_REPORTS
          return TASK_REPORTS;
        case 6: // LAST_SEEN
          return LAST_SEEN;
        case 7: // MAX_MAP_TASKS
          return MAX_MAP_TASKS;
        case 8: // MAX_REDUCE_TASKS
          return MAX_REDUCE_TASKS;
        case 9: // TOTAL_VIRTUAL_MEMORY
          return TOTAL_VIRTUAL_MEMORY;
        case 11: // TOTAL_PHYSICAL_MEMORY
          return TOTAL_PHYSICAL_MEMORY;
        case 13: // AVAILABLE_SPACE
          return AVAILABLE_SPACE;
        case 14: // MAP_COUNT
          return MAP_COUNT;
        case 15: // REDUCE_COUNT
          return REDUCE_COUNT;
        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 __HTTPPORT_ISSET_ID = 0;
  private static final int __FAILURECOUNT_ISSET_ID = 1;
  private static final int __LASTSEEN_ISSET_ID = 2;
  private static final int __MAXMAPTASKS_ISSET_ID = 3;
  private static final int __MAXREDUCETASKS_ISSET_ID = 4;
  private static final int __TOTALVIRTUALMEMORY_ISSET_ID = 5;
  private static final int __TOTALPHYSICALMEMORY_ISSET_ID = 6;
  private static final int __AVAILABLESPACE_ISSET_ID = 7;
  private static final int __MAPCOUNT_ISSET_ID = 8;
  private static final int __REDUCECOUNT_ISSET_ID = 9;
  private BitSet __isset_bit_vector = new BitSet(10);

  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.TRACKER_NAME, new org.apache.thrift.meta_data.FieldMetaData("trackerName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.HTTP_PORT, new org.apache.thrift.meta_data.FieldMetaData("httpPort", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.FAILURE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("failureCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.TASK_REPORTS, new org.apache.thrift.meta_data.FieldMetaData("taskReports", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftTaskStatus.class))));
    tmpMap.put(_Fields.LAST_SEEN, new org.apache.thrift.meta_data.FieldMetaData("lastSeen", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAX_MAP_TASKS, new org.apache.thrift.meta_data.FieldMetaData("maxMapTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MAX_REDUCE_TASKS, new org.apache.thrift.meta_data.FieldMetaData("maxReduceTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.TOTAL_VIRTUAL_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("totalVirtualMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TOTAL_PHYSICAL_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("totalPhysicalMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AVAILABLE_SPACE, new org.apache.thrift.meta_data.FieldMetaData("availableSpace", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAP_COUNT, new org.apache.thrift.meta_data.FieldMetaData("mapCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.REDUCE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("reduceCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftTaskTrackerStatus.class, metaDataMap);
  }

  public ThriftTaskTrackerStatus() {
  }

  public ThriftTaskTrackerStatus(
    String trackerName,
    String host,
    int httpPort,
    int failureCount,
    List<ThriftTaskStatus> taskReports,
    long lastSeen,
    int maxMapTasks,
    int maxReduceTasks,
    long totalVirtualMemory,
    long totalPhysicalMemory,
    long availableSpace,
    int mapCount,
    int reduceCount)
  {
    this();
    this.trackerName = trackerName;
    this.host = host;
    this.httpPort = httpPort;
    setHttpPortIsSet(true);
    this.failureCount = failureCount;
    setFailureCountIsSet(true);
    this.taskReports = taskReports;
    this.lastSeen = lastSeen;
    setLastSeenIsSet(true);
    this.maxMapTasks = maxMapTasks;
    setMaxMapTasksIsSet(true);
    this.maxReduceTasks = maxReduceTasks;
    setMaxReduceTasksIsSet(true);
    this.totalVirtualMemory = totalVirtualMemory;
    setTotalVirtualMemoryIsSet(true);
    this.totalPhysicalMemory = totalPhysicalMemory;
    setTotalPhysicalMemoryIsSet(true);
    this.availableSpace = availableSpace;
    setAvailableSpaceIsSet(true);
    this.mapCount = mapCount;
    setMapCountIsSet(true);
    this.reduceCount = reduceCount;
    setReduceCountIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ThriftTaskTrackerStatus(ThriftTaskTrackerStatus other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetTrackerName()) {
      this.trackerName = other.trackerName;
    }
    if (other.isSetHost()) {
      this.host = other.host;
    }
    this.httpPort = other.httpPort;
    this.failureCount = other.failureCount;
    if (other.isSetTaskReports()) {
      List<ThriftTaskStatus> __this__taskReports = new ArrayList<ThriftTaskStatus>();
      for (ThriftTaskStatus other_element : other.taskReports) {
        __this__taskReports.add(new ThriftTaskStatus(other_element));
      }
      this.taskReports = __this__taskReports;
    }
    this.lastSeen = other.lastSeen;
    this.maxMapTasks = other.maxMapTasks;
    this.maxReduceTasks = other.maxReduceTasks;
    this.totalVirtualMemory = other.totalVirtualMemory;
    this.totalPhysicalMemory = other.totalPhysicalMemory;
    this.availableSpace = other.availableSpace;
    this.mapCount = other.mapCount;
    this.reduceCount = other.reduceCount;
  }

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

  @Override
  public void clear() {
    this.trackerName = null;
    this.host = null;
    setHttpPortIsSet(false);
    this.httpPort = 0;
    setFailureCountIsSet(false);
    this.failureCount = 0;
    this.taskReports = null;
    setLastSeenIsSet(false);
    this.lastSeen = 0;
    setMaxMapTasksIsSet(false);
    this.maxMapTasks = 0;
    setMaxReduceTasksIsSet(false);
    this.maxReduceTasks = 0;
    setTotalVirtualMemoryIsSet(false);
    this.totalVirtualMemory = 0;
    setTotalPhysicalMemoryIsSet(false);
    this.totalPhysicalMemory = 0;
    setAvailableSpaceIsSet(false);
    this.availableSpace = 0;
    setMapCountIsSet(false);
    this.mapCount = 0;
    setReduceCountIsSet(false);
    this.reduceCount = 0;
  }

  public String getTrackerName() {
    return this.trackerName;
  }

  public ThriftTaskTrackerStatus setTrackerName(String trackerName) {
    this.trackerName = trackerName;
    return this;
  }

  public void unsetTrackerName() {
    this.trackerName = null;
  }

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

  public void setTrackerNameIsSet(boolean value) {
    if (!value) {
      this.trackerName = null;
    }
  }

  public String getHost() {
    return this.host;
  }

  public ThriftTaskTrackerStatus setHost(String host) {
    this.host = host;
    return this;
  }

  public void unsetHost() {
    this.host = null;
  }

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

  public void setHostIsSet(boolean value) {
    if (!value) {
      this.host = null;
    }
  }

  public int getHttpPort() {
    return this.httpPort;
  }

  public ThriftTaskTrackerStatus setHttpPort(int httpPort) {
    this.httpPort = httpPort;
    setHttpPortIsSet(true);
    return this;
  }

  public void unsetHttpPort() {
    __isset_bit_vector.clear(__HTTPPORT_ISSET_ID);
  }

  /** Returns true if field httpPort is set (has been assigned a value) and false otherwise */
  public boolean isSetHttpPort() {
    return __isset_bit_vector.get(__HTTPPORT_ISSET_ID);
  }

  public void setHttpPortIsSet(boolean value) {
    __isset_bit_vector.set(__HTTPPORT_ISSET_ID, value);
  }

  public int getFailureCount() {
    return this.failureCount;
  }

  public ThriftTaskTrackerStatus setFailureCount(int failureCount) {
    this.failureCount = failureCount;
    setFailureCountIsSet(true);
    return this;
  }

  public void unsetFailureCount() {
    __isset_bit_vector.clear(__FAILURECOUNT_ISSET_ID);
  }

  /** Returns true if field failureCount is set (has been assigned a value) and false otherwise */
  public boolean isSetFailureCount() {
    return __isset_bit_vector.get(__FAILURECOUNT_ISSET_ID);
  }

  public void setFailureCountIsSet(boolean value) {
    __isset_bit_vector.set(__FAILURECOUNT_ISSET_ID, value);
  }

  public int getTaskReportsSize() {
    return (this.taskReports == null) ? 0 : this.taskReports.size();
  }

  public java.util.Iterator<ThriftTaskStatus> getTaskReportsIterator() {
    return (this.taskReports == null) ? null : this.taskReports.iterator();
  }

  public void addToTaskReports(ThriftTaskStatus elem) {
    if (this.taskReports == null) {
      this.taskReports = new ArrayList<ThriftTaskStatus>();
    }
    this.taskReports.add(elem);
  }

  /**
   * List of the state of all tasks on this tracker
   */
  public List<ThriftTaskStatus> getTaskReports() {
    return this.taskReports;
  }

  /**
   * List of the state of all tasks on this tracker
   */
  public ThriftTaskTrackerStatus setTaskReports(List<ThriftTaskStatus> taskReports) {
    this.taskReports = taskReports;
    return this;
  }

  public void unsetTaskReports() {
    this.taskReports = null;
  }

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

  public void setTaskReportsIsSet(boolean value) {
    if (!value) {
      this.taskReports = null;
    }
  }

  /**
   * When did the JobTracker last hear from this TaskTracker?
   */
  public long getLastSeen() {
    return this.lastSeen;
  }

  /**
   * When did the JobTracker last hear from this TaskTracker?
   */
  public ThriftTaskTrackerStatus setLastSeen(long lastSeen) {
    this.lastSeen = lastSeen;
    setLastSeenIsSet(true);
    return this;
  }

  public void unsetLastSeen() {
    __isset_bit_vector.clear(__LASTSEEN_ISSET_ID);
  }

  /** Returns true if field lastSeen is set (has been assigned a value) and false otherwise */
  public boolean isSetLastSeen() {
    return __isset_bit_vector.get(__LASTSEEN_ISSET_ID);
  }

  public void setLastSeenIsSet(boolean value) {
    __isset_bit_vector.set(__LASTSEEN_ISSET_ID, value);
  }

  /**
   * Maximum possible number of both task types
   */
  public int getMaxMapTasks() {
    return this.maxMapTasks;
  }

  /**
   * Maximum possible number of both task types
   */
  public ThriftTaskTrackerStatus setMaxMapTasks(int maxMapTasks) {
    this.maxMapTasks = maxMapTasks;
    setMaxMapTasksIsSet(true);
    return this;
  }

  public void unsetMaxMapTasks() {
    __isset_bit_vector.clear(__MAXMAPTASKS_ISSET_ID);
  }

  /** Returns true if field maxMapTasks is set (has been assigned a value) and false otherwise */
  public boolean isSetMaxMapTasks() {
    return __isset_bit_vector.get(__MAXMAPTASKS_ISSET_ID);
  }

  public void setMaxMapTasksIsSet(boolean value) {
    __isset_bit_vector.set(__MAXMAPTASKS_ISSET_ID, value);
  }

  public int getMaxReduceTasks() {
    return this.maxReduceTasks;
  }

  public ThriftTaskTrackerStatus setMaxReduceTasks(int maxReduceTasks) {
    this.maxReduceTasks = maxReduceTasks;
    setMaxReduceTasksIsSet(true);
    return this;
  }

  public void unsetMaxReduceTasks() {
    __isset_bit_vector.clear(__MAXREDUCETASKS_ISSET_ID);
  }

  /** Returns true if field maxReduceTasks is set (has been assigned a value) and false otherwise */
  public boolean isSetMaxReduceTasks() {
    return __isset_bit_vector.get(__MAXREDUCETASKS_ISSET_ID);
  }

  public void setMaxReduceTasksIsSet(boolean value) {
    __isset_bit_vector.set(__MAXREDUCETASKS_ISSET_ID, value);
  }

  /**
   * Main memory metrics, all in bytes
   */
  public long getTotalVirtualMemory() {
    return this.totalVirtualMemory;
  }

  /**
   * Main memory metrics, all in bytes
   */
  public ThriftTaskTrackerStatus setTotalVirtualMemory(long totalVirtualMemory) {
    this.totalVirtualMemory = totalVirtualMemory;
    setTotalVirtualMemoryIsSet(true);
    return this;
  }

  public void unsetTotalVirtualMemory() {
    __isset_bit_vector.clear(__TOTALVIRTUALMEMORY_ISSET_ID);
  }

  /** Returns true if field totalVirtualMemory is set (has been assigned a value) and false otherwise */
  public boolean isSetTotalVirtualMemory() {
    return __isset_bit_vector.get(__TOTALVIRTUALMEMORY_ISSET_ID);
  }

  public void setTotalVirtualMemoryIsSet(boolean value) {
    __isset_bit_vector.set(__TOTALVIRTUALMEMORY_ISSET_ID, value);
  }

  public long getTotalPhysicalMemory() {
    return this.totalPhysicalMemory;
  }

  public ThriftTaskTrackerStatus setTotalPhysicalMemory(long totalPhysicalMemory) {
    this.totalPhysicalMemory = totalPhysicalMemory;
    setTotalPhysicalMemoryIsSet(true);
    return this;
  }

  public void unsetTotalPhysicalMemory() {
    __isset_bit_vector.clear(__TOTALPHYSICALMEMORY_ISSET_ID);
  }

  /** Returns true if field totalPhysicalMemory is set (has been assigned a value) and false otherwise */
  public boolean isSetTotalPhysicalMemory() {
    return __isset_bit_vector.get(__TOTALPHYSICALMEMORY_ISSET_ID);
  }

  public void setTotalPhysicalMemoryIsSet(boolean value) {
    __isset_bit_vector.set(__TOTALPHYSICALMEMORY_ISSET_ID, value);
  }

  public long getAvailableSpace() {
    return this.availableSpace;
  }

  public ThriftTaskTrackerStatus setAvailableSpace(long availableSpace) {
    this.availableSpace = availableSpace;
    setAvailableSpaceIsSet(true);
    return this;
  }

  public void unsetAvailableSpace() {
    __isset_bit_vector.clear(__AVAILABLESPACE_ISSET_ID);
  }

  /** Returns true if field availableSpace is set (has been assigned a value) and false otherwise */
  public boolean isSetAvailableSpace() {
    return __isset_bit_vector.get(__AVAILABLESPACE_ISSET_ID);
  }

  public void setAvailableSpaceIsSet(boolean value) {
    __isset_bit_vector.set(__AVAILABLESPACE_ISSET_ID, value);
  }

  /**
   * Currently running and unassigned map and reduce tasks
   */
  public int getMapCount() {
    return this.mapCount;
  }

  /**
   * Currently running and unassigned map and reduce tasks
   */
  public ThriftTaskTrackerStatus setMapCount(int mapCount) {
    this.mapCount = mapCount;
    setMapCountIsSet(true);
    return this;
  }

  public void unsetMapCount() {
    __isset_bit_vector.clear(__MAPCOUNT_ISSET_ID);
  }

  /** Returns true if field mapCount is set (has been assigned a value) and false otherwise */
  public boolean isSetMapCount() {
    return __isset_bit_vector.get(__MAPCOUNT_ISSET_ID);
  }

  public void setMapCountIsSet(boolean value) {
    __isset_bit_vector.set(__MAPCOUNT_ISSET_ID, value);
  }

  public int getReduceCount() {
    return this.reduceCount;
  }

  public ThriftTaskTrackerStatus setReduceCount(int reduceCount) {
    this.reduceCount = reduceCount;
    setReduceCountIsSet(true);
    return this;
  }

  public void unsetReduceCount() {
    __isset_bit_vector.clear(__REDUCECOUNT_ISSET_ID);
  }

  /** Returns true if field reduceCount is set (has been assigned a value) and false otherwise */
  public boolean isSetReduceCount() {
    return __isset_bit_vector.get(__REDUCECOUNT_ISSET_ID);
  }

  public void setReduceCountIsSet(boolean value) {
    __isset_bit_vector.set(__REDUCECOUNT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TRACKER_NAME:
      if (value == null) {
        unsetTrackerName();
      } else {
        setTrackerName((String)value);
      }
      break;

    case HOST:
      if (value == null) {
        unsetHost();
      } else {
        setHost((String)value);
      }
      break;

    case HTTP_PORT:
      if (value == null) {
        unsetHttpPort();
      } else {
        setHttpPort((Integer)value);
      }
      break;

    case FAILURE_COUNT:
      if (value == null) {
        unsetFailureCount();
      } else {
        setFailureCount((Integer)value);
      }
      break;

    case TASK_REPORTS:
      if (value == null) {
        unsetTaskReports();
      } else {
        setTaskReports((List<ThriftTaskStatus>)value);
      }
      break;

    case LAST_SEEN:
      if (value == null) {
        unsetLastSeen();
      } else {
        setLastSeen((Long)value);
      }
      break;

    case MAX_MAP_TASKS:
      if (value == null) {
        unsetMaxMapTasks();
      } else {
        setMaxMapTasks((Integer)value);
      }
      break;

    case MAX_REDUCE_TASKS:
      if (value == null) {
        unsetMaxReduceTasks();
      } else {
        setMaxReduceTasks((Integer)value);
      }
      break;

    case TOTAL_VIRTUAL_MEMORY:
      if (value == null) {
        unsetTotalVirtualMemory();
      } else {
        setTotalVirtualMemory((Long)value);
      }
      break;

    case TOTAL_PHYSICAL_MEMORY:
      if (value == null) {
        unsetTotalPhysicalMemory();
      } else {
        setTotalPhysicalMemory((Long)value);
      }
      break;

    case AVAILABLE_SPACE:
      if (value == null) {
        unsetAvailableSpace();
      } else {
        setAvailableSpace((Long)value);
      }
      break;

    case MAP_COUNT:
      if (value == null) {
        unsetMapCount();
      } else {
        setMapCount((Integer)value);
      }
      break;

    case REDUCE_COUNT:
      if (value == null) {
        unsetReduceCount();
      } else {
        setReduceCount((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TRACKER_NAME:
      return getTrackerName();

    case HOST:
      return getHost();

    case HTTP_PORT:
      return Integer.valueOf(getHttpPort());

    case FAILURE_COUNT:
      return Integer.valueOf(getFailureCount());

    case TASK_REPORTS:
      return getTaskReports();

    case LAST_SEEN:
      return Long.valueOf(getLastSeen());

    case MAX_MAP_TASKS:
      return Integer.valueOf(getMaxMapTasks());

    case MAX_REDUCE_TASKS:
      return Integer.valueOf(getMaxReduceTasks());

    case TOTAL_VIRTUAL_MEMORY:
      return Long.valueOf(getTotalVirtualMemory());

    case TOTAL_PHYSICAL_MEMORY:
      return Long.valueOf(getTotalPhysicalMemory());

    case AVAILABLE_SPACE:
      return Long.valueOf(getAvailableSpace());

    case MAP_COUNT:
      return Integer.valueOf(getMapCount());

    case REDUCE_COUNT:
      return Integer.valueOf(getReduceCount());

    }
    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 TRACKER_NAME:
      return isSetTrackerName();
    case HOST:
      return isSetHost();
    case HTTP_PORT:
      return isSetHttpPort();
    case FAILURE_COUNT:
      return isSetFailureCount();
    case TASK_REPORTS:
      return isSetTaskReports();
    case LAST_SEEN:
      return isSetLastSeen();
    case MAX_MAP_TASKS:
      return isSetMaxMapTasks();
    case MAX_REDUCE_TASKS:
      return isSetMaxReduceTasks();
    case TOTAL_VIRTUAL_MEMORY:
      return isSetTotalVirtualMemory();
    case TOTAL_PHYSICAL_MEMORY:
      return isSetTotalPhysicalMemory();
    case AVAILABLE_SPACE:
      return isSetAvailableSpace();
    case MAP_COUNT:
      return isSetMapCount();
    case REDUCE_COUNT:
      return isSetReduceCount();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_trackerName = true && this.isSetTrackerName();
    boolean that_present_trackerName = true && that.isSetTrackerName();
    if (this_present_trackerName || that_present_trackerName) {
      if (!(this_present_trackerName && that_present_trackerName))
        return false;
      if (!this.trackerName.equals(that.trackerName))
        return false;
    }

    boolean this_present_host = true && this.isSetHost();
    boolean that_present_host = true && that.isSetHost();
    if (this_present_host || that_present_host) {
      if (!(this_present_host && that_present_host))
        return false;
      if (!this.host.equals(that.host))
        return false;
    }

    boolean this_present_httpPort = true;
    boolean that_present_httpPort = true;
    if (this_present_httpPort || that_present_httpPort) {
      if (!(this_present_httpPort && that_present_httpPort))
        return false;
      if (this.httpPort != that.httpPort)
        return false;
    }

    boolean this_present_failureCount = true;
    boolean that_present_failureCount = true;
    if (this_present_failureCount || that_present_failureCount) {
      if (!(this_present_failureCount && that_present_failureCount))
        return false;
      if (this.failureCount != that.failureCount)
        return false;
    }

    boolean this_present_taskReports = true && this.isSetTaskReports();
    boolean that_present_taskReports = true && that.isSetTaskReports();
    if (this_present_taskReports || that_present_taskReports) {
      if (!(this_present_taskReports && that_present_taskReports))
        return false;
      if (!this.taskReports.equals(that.taskReports))
        return false;
    }

    boolean this_present_lastSeen = true;
    boolean that_present_lastSeen = true;
    if (this_present_lastSeen || that_present_lastSeen) {
      if (!(this_present_lastSeen && that_present_lastSeen))
        return false;
      if (this.lastSeen != that.lastSeen)
        return false;
    }

    boolean this_present_maxMapTasks = true;
    boolean that_present_maxMapTasks = true;
    if (this_present_maxMapTasks || that_present_maxMapTasks) {
      if (!(this_present_maxMapTasks && that_present_maxMapTasks))
        return false;
      if (this.maxMapTasks != that.maxMapTasks)
        return false;
    }

    boolean this_present_maxReduceTasks = true;
    boolean that_present_maxReduceTasks = true;
    if (this_present_maxReduceTasks || that_present_maxReduceTasks) {
      if (!(this_present_maxReduceTasks && that_present_maxReduceTasks))
        return false;
      if (this.maxReduceTasks != that.maxReduceTasks)
        return false;
    }

    boolean this_present_totalVirtualMemory = true;
    boolean that_present_totalVirtualMemory = true;
    if (this_present_totalVirtualMemory || that_present_totalVirtualMemory) {
      if (!(this_present_totalVirtualMemory && that_present_totalVirtualMemory))
        return false;
      if (this.totalVirtualMemory != that.totalVirtualMemory)
        return false;
    }

    boolean this_present_totalPhysicalMemory = true;
    boolean that_present_totalPhysicalMemory = true;
    if (this_present_totalPhysicalMemory || that_present_totalPhysicalMemory) {
      if (!(this_present_totalPhysicalMemory && that_present_totalPhysicalMemory))
        return false;
      if (this.totalPhysicalMemory != that.totalPhysicalMemory)
        return false;
    }

    boolean this_present_availableSpace = true;
    boolean that_present_availableSpace = true;
    if (this_present_availableSpace || that_present_availableSpace) {
      if (!(this_present_availableSpace && that_present_availableSpace))
        return false;
      if (this.availableSpace != that.availableSpace)
        return false;
    }

    boolean this_present_mapCount = true;
    boolean that_present_mapCount = true;
    if (this_present_mapCount || that_present_mapCount) {
      if (!(this_present_mapCount && that_present_mapCount))
        return false;
      if (this.mapCount != that.mapCount)
        return false;
    }

    boolean this_present_reduceCount = true;
    boolean that_present_reduceCount = true;
    if (this_present_reduceCount || that_present_reduceCount) {
      if (!(this_present_reduceCount && that_present_reduceCount))
        return false;
      if (this.reduceCount != that.reduceCount)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetTrackerName()).compareTo(typedOther.isSetTrackerName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTrackerName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.trackerName, typedOther.trackerName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHost()).compareTo(typedOther.isSetHost());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHost()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHttpPort()).compareTo(typedOther.isSetHttpPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHttpPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.httpPort, typedOther.httpPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFailureCount()).compareTo(typedOther.isSetFailureCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFailureCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failureCount, typedOther.failureCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskReports()).compareTo(typedOther.isSetTaskReports());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskReports()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskReports, typedOther.taskReports);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastSeen()).compareTo(typedOther.isSetLastSeen());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastSeen()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastSeen, typedOther.lastSeen);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxMapTasks()).compareTo(typedOther.isSetMaxMapTasks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxMapTasks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxMapTasks, typedOther.maxMapTasks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxReduceTasks()).compareTo(typedOther.isSetMaxReduceTasks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxReduceTasks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxReduceTasks, typedOther.maxReduceTasks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTotalVirtualMemory()).compareTo(typedOther.isSetTotalVirtualMemory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalVirtualMemory()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalVirtualMemory, typedOther.totalVirtualMemory);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTotalPhysicalMemory()).compareTo(typedOther.isSetTotalPhysicalMemory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalPhysicalMemory()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalPhysicalMemory, typedOther.totalPhysicalMemory);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAvailableSpace()).compareTo(typedOther.isSetAvailableSpace());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAvailableSpace()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.availableSpace, typedOther.availableSpace);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMapCount()).compareTo(typedOther.isSetMapCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMapCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapCount, typedOther.mapCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReduceCount()).compareTo(typedOther.isSetReduceCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReduceCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reduceCount, typedOther.reduceCount);
      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 {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
        break;
      }
      switch (field.id) {
        case 1: // TRACKER_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.trackerName = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // HOST
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.host = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // HTTP_PORT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.httpPort = iprot.readI32();
            setHttpPortIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // FAILURE_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.failureCount = iprot.readI32();
            setFailureCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // TASK_REPORTS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list35 = iprot.readListBegin();
              this.taskReports = new ArrayList<ThriftTaskStatus>(_list35.size);
              for (int _i36 = 0; _i36 < _list35.size; ++_i36)
              {
                ThriftTaskStatus _elem37; // required
                _elem37 = new ThriftTaskStatus();
                _elem37.read(iprot);
                this.taskReports.add(_elem37);
              }
              iprot.readListEnd();
            }
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // LAST_SEEN
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.lastSeen = iprot.readI64();
            setLastSeenIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // MAX_MAP_TASKS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.maxMapTasks = iprot.readI32();
            setMaxMapTasksIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // MAX_REDUCE_TASKS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.maxReduceTasks = iprot.readI32();
            setMaxReduceTasksIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // TOTAL_VIRTUAL_MEMORY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.totalVirtualMemory = iprot.readI64();
            setTotalVirtualMemoryIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // TOTAL_PHYSICAL_MEMORY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.totalPhysicalMemory = iprot.readI64();
            setTotalPhysicalMemoryIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 13: // AVAILABLE_SPACE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.availableSpace = iprot.readI64();
            setAvailableSpaceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 14: // MAP_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.mapCount = iprot.readI32();
            setMapCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 15: // REDUCE_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.reduceCount = iprot.readI32();
            setReduceCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

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

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

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.trackerName != null) {
      oprot.writeFieldBegin(TRACKER_NAME_FIELD_DESC);
      oprot.writeString(this.trackerName);
      oprot.writeFieldEnd();
    }
    if (this.host != null) {
      oprot.writeFieldBegin(HOST_FIELD_DESC);
      oprot.writeString(this.host);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(HTTP_PORT_FIELD_DESC);
    oprot.writeI32(this.httpPort);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(FAILURE_COUNT_FIELD_DESC);
    oprot.writeI32(this.failureCount);
    oprot.writeFieldEnd();
    if (this.taskReports != null) {
      oprot.writeFieldBegin(TASK_REPORTS_FIELD_DESC);
      {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.taskReports.size()));
        for (ThriftTaskStatus _iter38 : this.taskReports)
        {
          _iter38.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(LAST_SEEN_FIELD_DESC);
    oprot.writeI64(this.lastSeen);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MAX_MAP_TASKS_FIELD_DESC);
    oprot.writeI32(this.maxMapTasks);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MAX_REDUCE_TASKS_FIELD_DESC);
    oprot.writeI32(this.maxReduceTasks);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TOTAL_VIRTUAL_MEMORY_FIELD_DESC);
    oprot.writeI64(this.totalVirtualMemory);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TOTAL_PHYSICAL_MEMORY_FIELD_DESC);
    oprot.writeI64(this.totalPhysicalMemory);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(AVAILABLE_SPACE_FIELD_DESC);
    oprot.writeI64(this.availableSpace);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MAP_COUNT_FIELD_DESC);
    oprot.writeI32(this.mapCount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(REDUCE_COUNT_FIELD_DESC);
    oprot.writeI32(this.reduceCount);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("trackerName:");
    if (this.trackerName == null) {
      sb.append("null");
    } else {
      sb.append(this.trackerName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("host:");
    if (this.host == null) {
      sb.append("null");
    } else {
      sb.append(this.host);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("httpPort:");
    sb.append(this.httpPort);
    first = false;
    if (!first) sb.append(", ");
    sb.append("failureCount:");
    sb.append(this.failureCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("taskReports:");
    if (this.taskReports == null) {
      sb.append("null");
    } else {
      sb.append(this.taskReports);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("lastSeen:");
    sb.append(this.lastSeen);
    first = false;
    if (!first) sb.append(", ");
    sb.append("maxMapTasks:");
    sb.append(this.maxMapTasks);
    first = false;
    if (!first) sb.append(", ");
    sb.append("maxReduceTasks:");
    sb.append(this.maxReduceTasks);
    first = false;
    if (!first) sb.append(", ");
    sb.append("totalVirtualMemory:");
    sb.append(this.totalVirtualMemory);
    first = false;
    if (!first) sb.append(", ");
    sb.append("totalPhysicalMemory:");
    sb.append(this.totalPhysicalMemory);
    first = false;
    if (!first) sb.append(", ");
    sb.append("availableSpace:");
    sb.append(this.availableSpace);
    first = false;
    if (!first) sb.append(", ");
    sb.append("mapCount:");
    sb.append(this.mapCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("reduceCount:");
    sb.append(this.reduceCount);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
  }

  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_bit_vector = new BitSet(1);
      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);
    }
  }

}

