TActiveTabletStat.java

/**
 * Autogenerated by Thrift Compiler (0.24.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
public class TActiveTabletStat implements org.apache.thrift.TBase<TActiveTabletStat, TActiveTabletStat._Fields>, java.io.Serializable, Cloneable, Comparable<TActiveTabletStat> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TActiveTabletStat");

  private static final org.apache.thrift.protocol.TField TABLET_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tablet_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField SCAN_COUNT_DELTA_FIELD_DESC = new org.apache.thrift.protocol.TField("scan_count_delta", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField LOAD_COUNT_DELTA_FIELD_DESC = new org.apache.thrift.protocol.TField("load_count_delta", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField LAST_QUERY_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("last_query_time_ms", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField LAST_LOAD_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("last_load_time_ms", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField DELTA_WINDOW_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("delta_window_ms", org.apache.thrift.protocol.TType.I64, (short)6);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TActiveTabletStatStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TActiveTabletStatTupleSchemeFactory();

  public long tablet_id; // required
  public long scan_count_delta; // optional
  public long load_count_delta; // optional
  public long last_query_time_ms; // optional
  public long last_load_time_ms; // optional
  public long delta_window_ms; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    TABLET_ID((short)1, "tablet_id"),
    SCAN_COUNT_DELTA((short)2, "scan_count_delta"),
    LOAD_COUNT_DELTA((short)3, "load_count_delta"),
    LAST_QUERY_TIME_MS((short)4, "last_query_time_ms"),
    LAST_LOAD_TIME_MS((short)5, "last_load_time_ms"),
    DELTA_WINDOW_MS((short)6, "delta_window_ms");

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

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TABLET_ID
          return TABLET_ID;
        case 2: // SCAN_COUNT_DELTA
          return SCAN_COUNT_DELTA;
        case 3: // LOAD_COUNT_DELTA
          return LOAD_COUNT_DELTA;
        case 4: // LAST_QUERY_TIME_MS
          return LAST_QUERY_TIME_MS;
        case 5: // LAST_LOAD_TIME_MS
          return LAST_LOAD_TIME_MS;
        case 6: // DELTA_WINDOW_MS
          return DELTA_WINDOW_MS;
        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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

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

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

    @Override
    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __TABLET_ID_ISSET_ID = 0;
  private static final int __SCAN_COUNT_DELTA_ISSET_ID = 1;
  private static final int __LOAD_COUNT_DELTA_ISSET_ID = 2;
  private static final int __LAST_QUERY_TIME_MS_ISSET_ID = 3;
  private static final int __LAST_LOAD_TIME_MS_ISSET_ID = 4;
  private static final int __DELTA_WINDOW_MS_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  private static final _Fields[] optionals = {_Fields.SCAN_COUNT_DELTA,_Fields.LOAD_COUNT_DELTA,_Fields.LAST_QUERY_TIME_MS,_Fields.LAST_LOAD_TIME_MS,_Fields.DELTA_WINDOW_MS};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TABLET_ID, new org.apache.thrift.meta_data.FieldMetaData("tablet_id", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "TTabletId")));
    tmpMap.put(_Fields.SCAN_COUNT_DELTA, new org.apache.thrift.meta_data.FieldMetaData("scan_count_delta", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LOAD_COUNT_DELTA, new org.apache.thrift.meta_data.FieldMetaData("load_count_delta", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LAST_QUERY_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("last_query_time_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LAST_LOAD_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("last_load_time_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DELTA_WINDOW_MS, new org.apache.thrift.meta_data.FieldMetaData("delta_window_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TActiveTabletStat.class, metaDataMap);
  }

  public TActiveTabletStat() {
  }

  public TActiveTabletStat(
    long tablet_id)
  {
    this();
    this.tablet_id = tablet_id;
    setTabletIdIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TActiveTabletStat(TActiveTabletStat other) {
    __isset_bitfield = other.__isset_bitfield;
    this.tablet_id = other.tablet_id;
    this.scan_count_delta = other.scan_count_delta;
    this.load_count_delta = other.load_count_delta;
    this.last_query_time_ms = other.last_query_time_ms;
    this.last_load_time_ms = other.last_load_time_ms;
    this.delta_window_ms = other.delta_window_ms;
  }

  @Override
  public TActiveTabletStat deepCopy() {
    return new TActiveTabletStat(this);
  }

  @Override
  public void clear() {
    setTabletIdIsSet(false);
    this.tablet_id = 0;
    setScanCountDeltaIsSet(false);
    this.scan_count_delta = 0;
    setLoadCountDeltaIsSet(false);
    this.load_count_delta = 0;
    setLastQueryTimeMsIsSet(false);
    this.last_query_time_ms = 0;
    setLastLoadTimeMsIsSet(false);
    this.last_load_time_ms = 0;
    setDeltaWindowMsIsSet(false);
    this.delta_window_ms = 0;
  }

  public long getTabletId() {
    return this.tablet_id;
  }

  public TActiveTabletStat setTabletId(long tablet_id) {
    this.tablet_id = tablet_id;
    setTabletIdIsSet(true);
    return this;
  }

  public void unsetTabletId() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TABLET_ID_ISSET_ID);
  }

  /** Returns true if field tablet_id is set (has been assigned a value) and false otherwise */
  public boolean isSetTabletId() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TABLET_ID_ISSET_ID);
  }

  public void setTabletIdIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TABLET_ID_ISSET_ID, value);
  }

  public long getScanCountDelta() {
    return this.scan_count_delta;
  }

  public TActiveTabletStat setScanCountDelta(long scan_count_delta) {
    this.scan_count_delta = scan_count_delta;
    setScanCountDeltaIsSet(true);
    return this;
  }

  public void unsetScanCountDelta() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCAN_COUNT_DELTA_ISSET_ID);
  }

  /** Returns true if field scan_count_delta is set (has been assigned a value) and false otherwise */
  public boolean isSetScanCountDelta() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCAN_COUNT_DELTA_ISSET_ID);
  }

  public void setScanCountDeltaIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCAN_COUNT_DELTA_ISSET_ID, value);
  }

  public long getLoadCountDelta() {
    return this.load_count_delta;
  }

  public TActiveTabletStat setLoadCountDelta(long load_count_delta) {
    this.load_count_delta = load_count_delta;
    setLoadCountDeltaIsSet(true);
    return this;
  }

  public void unsetLoadCountDelta() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LOAD_COUNT_DELTA_ISSET_ID);
  }

  /** Returns true if field load_count_delta is set (has been assigned a value) and false otherwise */
  public boolean isSetLoadCountDelta() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LOAD_COUNT_DELTA_ISSET_ID);
  }

  public void setLoadCountDeltaIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LOAD_COUNT_DELTA_ISSET_ID, value);
  }

  public long getLastQueryTimeMs() {
    return this.last_query_time_ms;
  }

  public TActiveTabletStat setLastQueryTimeMs(long last_query_time_ms) {
    this.last_query_time_ms = last_query_time_ms;
    setLastQueryTimeMsIsSet(true);
    return this;
  }

  public void unsetLastQueryTimeMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LAST_QUERY_TIME_MS_ISSET_ID);
  }

  /** Returns true if field last_query_time_ms is set (has been assigned a value) and false otherwise */
  public boolean isSetLastQueryTimeMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LAST_QUERY_TIME_MS_ISSET_ID);
  }

  public void setLastQueryTimeMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LAST_QUERY_TIME_MS_ISSET_ID, value);
  }

  public long getLastLoadTimeMs() {
    return this.last_load_time_ms;
  }

  public TActiveTabletStat setLastLoadTimeMs(long last_load_time_ms) {
    this.last_load_time_ms = last_load_time_ms;
    setLastLoadTimeMsIsSet(true);
    return this;
  }

  public void unsetLastLoadTimeMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LAST_LOAD_TIME_MS_ISSET_ID);
  }

  /** Returns true if field last_load_time_ms is set (has been assigned a value) and false otherwise */
  public boolean isSetLastLoadTimeMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LAST_LOAD_TIME_MS_ISSET_ID);
  }

  public void setLastLoadTimeMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LAST_LOAD_TIME_MS_ISSET_ID, value);
  }

  public long getDeltaWindowMs() {
    return this.delta_window_ms;
  }

  public TActiveTabletStat setDeltaWindowMs(long delta_window_ms) {
    this.delta_window_ms = delta_window_ms;
    setDeltaWindowMsIsSet(true);
    return this;
  }

  public void unsetDeltaWindowMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DELTA_WINDOW_MS_ISSET_ID);
  }

  /** Returns true if field delta_window_ms is set (has been assigned a value) and false otherwise */
  public boolean isSetDeltaWindowMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DELTA_WINDOW_MS_ISSET_ID);
  }

  public void setDeltaWindowMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DELTA_WINDOW_MS_ISSET_ID, value);
  }

  @Override
  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TABLET_ID:
      if (value == null) {
        unsetTabletId();
      } else {
        setTabletId((java.lang.Long)value);
      }
      break;

    case SCAN_COUNT_DELTA:
      if (value == null) {
        unsetScanCountDelta();
      } else {
        setScanCountDelta((java.lang.Long)value);
      }
      break;

    case LOAD_COUNT_DELTA:
      if (value == null) {
        unsetLoadCountDelta();
      } else {
        setLoadCountDelta((java.lang.Long)value);
      }
      break;

    case LAST_QUERY_TIME_MS:
      if (value == null) {
        unsetLastQueryTimeMs();
      } else {
        setLastQueryTimeMs((java.lang.Long)value);
      }
      break;

    case LAST_LOAD_TIME_MS:
      if (value == null) {
        unsetLastLoadTimeMs();
      } else {
        setLastLoadTimeMs((java.lang.Long)value);
      }
      break;

    case DELTA_WINDOW_MS:
      if (value == null) {
        unsetDeltaWindowMs();
      } else {
        setDeltaWindowMs((java.lang.Long)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case TABLET_ID:
      return getTabletId();

    case SCAN_COUNT_DELTA:
      return getScanCountDelta();

    case LOAD_COUNT_DELTA:
      return getLoadCountDelta();

    case LAST_QUERY_TIME_MS:
      return getLastQueryTimeMs();

    case LAST_LOAD_TIME_MS:
      return getLastLoadTimeMs();

    case DELTA_WINDOW_MS:
      return getDeltaWindowMs();

    }
    throw new java.lang.IllegalStateException();
  }

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

    switch (field) {
    case TABLET_ID:
      return isSetTabletId();
    case SCAN_COUNT_DELTA:
      return isSetScanCountDelta();
    case LOAD_COUNT_DELTA:
      return isSetLoadCountDelta();
    case LAST_QUERY_TIME_MS:
      return isSetLastQueryTimeMs();
    case LAST_LOAD_TIME_MS:
      return isSetLastLoadTimeMs();
    case DELTA_WINDOW_MS:
      return isSetDeltaWindowMs();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TActiveTabletStat)
      return this.equals((TActiveTabletStat)that);
    return false;
  }

  public boolean equals(TActiveTabletStat that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_tablet_id = true;
    boolean that_present_tablet_id = true;
    if (this_present_tablet_id || that_present_tablet_id) {
      if (!(this_present_tablet_id && that_present_tablet_id))
        return false;
      if (this.tablet_id != that.tablet_id)
        return false;
    }

    boolean this_present_scan_count_delta = true && this.isSetScanCountDelta();
    boolean that_present_scan_count_delta = true && that.isSetScanCountDelta();
    if (this_present_scan_count_delta || that_present_scan_count_delta) {
      if (!(this_present_scan_count_delta && that_present_scan_count_delta))
        return false;
      if (this.scan_count_delta != that.scan_count_delta)
        return false;
    }

    boolean this_present_load_count_delta = true && this.isSetLoadCountDelta();
    boolean that_present_load_count_delta = true && that.isSetLoadCountDelta();
    if (this_present_load_count_delta || that_present_load_count_delta) {
      if (!(this_present_load_count_delta && that_present_load_count_delta))
        return false;
      if (this.load_count_delta != that.load_count_delta)
        return false;
    }

    boolean this_present_last_query_time_ms = true && this.isSetLastQueryTimeMs();
    boolean that_present_last_query_time_ms = true && that.isSetLastQueryTimeMs();
    if (this_present_last_query_time_ms || that_present_last_query_time_ms) {
      if (!(this_present_last_query_time_ms && that_present_last_query_time_ms))
        return false;
      if (this.last_query_time_ms != that.last_query_time_ms)
        return false;
    }

    boolean this_present_last_load_time_ms = true && this.isSetLastLoadTimeMs();
    boolean that_present_last_load_time_ms = true && that.isSetLastLoadTimeMs();
    if (this_present_last_load_time_ms || that_present_last_load_time_ms) {
      if (!(this_present_last_load_time_ms && that_present_last_load_time_ms))
        return false;
      if (this.last_load_time_ms != that.last_load_time_ms)
        return false;
    }

    boolean this_present_delta_window_ms = true && this.isSetDeltaWindowMs();
    boolean that_present_delta_window_ms = true && that.isSetDeltaWindowMs();
    if (this_present_delta_window_ms || that_present_delta_window_ms) {
      if (!(this_present_delta_window_ms && that_present_delta_window_ms))
        return false;
      if (this.delta_window_ms != that.delta_window_ms)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(tablet_id);

    hashCode = hashCode * 8191 + ((isSetScanCountDelta()) ? 131071 : 524287);
    if (isSetScanCountDelta())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(scan_count_delta);

    hashCode = hashCode * 8191 + ((isSetLoadCountDelta()) ? 131071 : 524287);
    if (isSetLoadCountDelta())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(load_count_delta);

    hashCode = hashCode * 8191 + ((isSetLastQueryTimeMs()) ? 131071 : 524287);
    if (isSetLastQueryTimeMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(last_query_time_ms);

    hashCode = hashCode * 8191 + ((isSetLastLoadTimeMs()) ? 131071 : 524287);
    if (isSetLastLoadTimeMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(last_load_time_ms);

    hashCode = hashCode * 8191 + ((isSetDeltaWindowMs()) ? 131071 : 524287);
    if (isSetDeltaWindowMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(delta_window_ms);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTabletId(), other.isSetTabletId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTabletId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablet_id, other.tablet_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetScanCountDelta(), other.isSetScanCountDelta());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScanCountDelta()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan_count_delta, other.scan_count_delta);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLoadCountDelta(), other.isSetLoadCountDelta());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoadCountDelta()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.load_count_delta, other.load_count_delta);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLastQueryTimeMs(), other.isSetLastQueryTimeMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastQueryTimeMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.last_query_time_ms, other.last_query_time_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLastLoadTimeMs(), other.isSetLastLoadTimeMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastLoadTimeMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.last_load_time_ms, other.last_load_time_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDeltaWindowMs(), other.isSetDeltaWindowMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeltaWindowMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delta_window_ms, other.delta_window_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  @Override
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  @Override
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TActiveTabletStat(");
    boolean first = true;

    sb.append("tablet_id:");
    sb.append(this.tablet_id);
    first = false;
    if (isSetScanCountDelta()) {
      if (!first) sb.append(", ");
      sb.append("scan_count_delta:");
      sb.append(this.scan_count_delta);
      first = false;
    }
    if (isSetLoadCountDelta()) {
      if (!first) sb.append(", ");
      sb.append("load_count_delta:");
      sb.append(this.load_count_delta);
      first = false;
    }
    if (isSetLastQueryTimeMs()) {
      if (!first) sb.append(", ");
      sb.append("last_query_time_ms:");
      sb.append(this.last_query_time_ms);
      first = false;
    }
    if (isSetLastLoadTimeMs()) {
      if (!first) sb.append(", ");
      sb.append("last_load_time_ms:");
      sb.append(this.last_load_time_ms);
      first = false;
    }
    if (isSetDeltaWindowMs()) {
      if (!first) sb.append(", ");
      sb.append("delta_window_ms:");
      sb.append(this.delta_window_ms);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'tablet_id' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

  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, java.lang.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 TActiveTabletStatStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TActiveTabletStatStandardScheme getScheme() {
      return new TActiveTabletStatStandardScheme();
    }
  }

  private static class TActiveTabletStatStandardScheme extends org.apache.thrift.scheme.StandardScheme<TActiveTabletStat> {

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TActiveTabletStat struct) throws org.apache.thrift.TException {
      iprot.incrementRecursionDepth();
      try {
        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: // TABLET_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.tablet_id = iprot.readI64();
                struct.setTabletIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SCAN_COUNT_DELTA
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.scan_count_delta = iprot.readI64();
                struct.setScanCountDeltaIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // LOAD_COUNT_DELTA
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.load_count_delta = iprot.readI64();
                struct.setLoadCountDeltaIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // LAST_QUERY_TIME_MS
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.last_query_time_ms = iprot.readI64();
                struct.setLastQueryTimeMsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // LAST_LOAD_TIME_MS
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.last_load_time_ms = iprot.readI64();
                struct.setLastLoadTimeMsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // DELTA_WINDOW_MS
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.delta_window_ms = iprot.readI64();
                struct.setDeltaWindowMsIsSet(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
        if (!struct.isSetTabletId()) {
          throw new org.apache.thrift.protocol.TProtocolException("Required field 'tablet_id' was not found in serialized data! Struct: " + toString());
        }
        struct.validate();
      } finally {
        iprot.decrementRecursionDepth();
      }
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TABLET_ID_FIELD_DESC);
      oprot.writeI64(struct.tablet_id);
      oprot.writeFieldEnd();
      if (struct.isSetScanCountDelta()) {
        oprot.writeFieldBegin(SCAN_COUNT_DELTA_FIELD_DESC);
        oprot.writeI64(struct.scan_count_delta);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLoadCountDelta()) {
        oprot.writeFieldBegin(LOAD_COUNT_DELTA_FIELD_DESC);
        oprot.writeI64(struct.load_count_delta);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLastQueryTimeMs()) {
        oprot.writeFieldBegin(LAST_QUERY_TIME_MS_FIELD_DESC);
        oprot.writeI64(struct.last_query_time_ms);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLastLoadTimeMs()) {
        oprot.writeFieldBegin(LAST_LOAD_TIME_MS_FIELD_DESC);
        oprot.writeI64(struct.last_load_time_ms);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDeltaWindowMs()) {
        oprot.writeFieldBegin(DELTA_WINDOW_MS_FIELD_DESC);
        oprot.writeI64(struct.delta_window_ms);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TActiveTabletStatTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TActiveTabletStatTupleScheme getScheme() {
      return new TActiveTabletStatTupleScheme();
    }
  }

  private static class TActiveTabletStatTupleScheme extends org.apache.thrift.scheme.TupleScheme<TActiveTabletStat> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TActiveTabletStat struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.tablet_id);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetScanCountDelta()) {
        optionals.set(0);
      }
      if (struct.isSetLoadCountDelta()) {
        optionals.set(1);
      }
      if (struct.isSetLastQueryTimeMs()) {
        optionals.set(2);
      }
      if (struct.isSetLastLoadTimeMs()) {
        optionals.set(3);
      }
      if (struct.isSetDeltaWindowMs()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetScanCountDelta()) {
        oprot.writeI64(struct.scan_count_delta);
      }
      if (struct.isSetLoadCountDelta()) {
        oprot.writeI64(struct.load_count_delta);
      }
      if (struct.isSetLastQueryTimeMs()) {
        oprot.writeI64(struct.last_query_time_ms);
      }
      if (struct.isSetLastLoadTimeMs()) {
        oprot.writeI64(struct.last_load_time_ms);
      }
      if (struct.isSetDeltaWindowMs()) {
        oprot.writeI64(struct.delta_window_ms);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TActiveTabletStat struct) throws org.apache.thrift.TException {
      prot.incrementRecursionDepth();
      try {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        struct.tablet_id = iprot.readI64();
        struct.setTabletIdIsSet(true);
        java.util.BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.scan_count_delta = iprot.readI64();
          struct.setScanCountDeltaIsSet(true);
        }
        if (incoming.get(1)) {
          struct.load_count_delta = iprot.readI64();
          struct.setLoadCountDeltaIsSet(true);
        }
        if (incoming.get(2)) {
          struct.last_query_time_ms = iprot.readI64();
          struct.setLastQueryTimeMsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.last_load_time_ms = iprot.readI64();
          struct.setLastLoadTimeMsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.delta_window_ms = iprot.readI64();
          struct.setDeltaWindowMsIsSet(true);
        }
      } finally {
        prot.decrementRecursionDepth();
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}