TJvmMemoryPool.java

/**
 * Autogenerated by Thrift Compiler (0.16.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"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TJvmMemoryPool implements org.apache.thrift.TBase<TJvmMemoryPool, TJvmMemoryPool._Fields>, java.io.Serializable, Cloneable, Comparable<TJvmMemoryPool> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TJvmMemoryPool");

  private static final org.apache.thrift.protocol.TField COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("committed", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField INIT_FIELD_DESC = new org.apache.thrift.protocol.TField("init", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("max", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField USED_FIELD_DESC = new org.apache.thrift.protocol.TField("used", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField PEAK_COMMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("peak_committed", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField PEAK_INIT_FIELD_DESC = new org.apache.thrift.protocol.TField("peak_init", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField PEAK_MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("peak_max", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField PEAK_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("peak_used", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)9);

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

  public long committed; // required
  public long init; // required
  public long max; // required
  public long used; // required
  public long peak_committed; // required
  public long peak_init; // required
  public long peak_max; // required
  public long peak_used; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String name; // 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 {
    COMMITTED((short)1, "committed"),
    INIT((short)2, "init"),
    MAX((short)3, "max"),
    USED((short)4, "used"),
    PEAK_COMMITTED((short)5, "peak_committed"),
    PEAK_INIT((short)6, "peak_init"),
    PEAK_MAX((short)7, "peak_max"),
    PEAK_USED((short)8, "peak_used"),
    NAME((short)9, "name");

    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: // COMMITTED
          return COMMITTED;
        case 2: // INIT
          return INIT;
        case 3: // MAX
          return MAX;
        case 4: // USED
          return USED;
        case 5: // PEAK_COMMITTED
          return PEAK_COMMITTED;
        case 6: // PEAK_INIT
          return PEAK_INIT;
        case 7: // PEAK_MAX
          return PEAK_MAX;
        case 8: // PEAK_USED
          return PEAK_USED;
        case 9: // NAME
          return NAME;
        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;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __COMMITTED_ISSET_ID = 0;
  private static final int __INIT_ISSET_ID = 1;
  private static final int __MAX_ISSET_ID = 2;
  private static final int __USED_ISSET_ID = 3;
  private static final int __PEAK_COMMITTED_ISSET_ID = 4;
  private static final int __PEAK_INIT_ISSET_ID = 5;
  private static final int __PEAK_MAX_ISSET_ID = 6;
  private static final int __PEAK_USED_ISSET_ID = 7;
  private byte __isset_bitfield = 0;
  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.COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("committed", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INIT, new org.apache.thrift.meta_data.FieldMetaData("init", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAX, new org.apache.thrift.meta_data.FieldMetaData("max", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.USED, new org.apache.thrift.meta_data.FieldMetaData("used", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PEAK_COMMITTED, new org.apache.thrift.meta_data.FieldMetaData("peak_committed", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PEAK_INIT, new org.apache.thrift.meta_data.FieldMetaData("peak_init", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PEAK_MAX, new org.apache.thrift.meta_data.FieldMetaData("peak_max", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PEAK_USED, new org.apache.thrift.meta_data.FieldMetaData("peak_used", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TJvmMemoryPool.class, metaDataMap);
  }

  public TJvmMemoryPool() {
  }

  public TJvmMemoryPool(
    long committed,
    long init,
    long max,
    long used,
    long peak_committed,
    long peak_init,
    long peak_max,
    long peak_used,
    java.lang.String name)
  {
    this();
    this.committed = committed;
    setCommittedIsSet(true);
    this.init = init;
    setInitIsSet(true);
    this.max = max;
    setMaxIsSet(true);
    this.used = used;
    setUsedIsSet(true);
    this.peak_committed = peak_committed;
    setPeakCommittedIsSet(true);
    this.peak_init = peak_init;
    setPeakInitIsSet(true);
    this.peak_max = peak_max;
    setPeakMaxIsSet(true);
    this.peak_used = peak_used;
    setPeakUsedIsSet(true);
    this.name = name;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TJvmMemoryPool(TJvmMemoryPool other) {
    __isset_bitfield = other.__isset_bitfield;
    this.committed = other.committed;
    this.init = other.init;
    this.max = other.max;
    this.used = other.used;
    this.peak_committed = other.peak_committed;
    this.peak_init = other.peak_init;
    this.peak_max = other.peak_max;
    this.peak_used = other.peak_used;
    if (other.isSetName()) {
      this.name = other.name;
    }
  }

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

  @Override
  public void clear() {
    setCommittedIsSet(false);
    this.committed = 0;
    setInitIsSet(false);
    this.init = 0;
    setMaxIsSet(false);
    this.max = 0;
    setUsedIsSet(false);
    this.used = 0;
    setPeakCommittedIsSet(false);
    this.peak_committed = 0;
    setPeakInitIsSet(false);
    this.peak_init = 0;
    setPeakMaxIsSet(false);
    this.peak_max = 0;
    setPeakUsedIsSet(false);
    this.peak_used = 0;
    this.name = null;
  }

  public long getCommitted() {
    return this.committed;
  }

  public TJvmMemoryPool setCommitted(long committed) {
    this.committed = committed;
    setCommittedIsSet(true);
    return this;
  }

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

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

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

  public long getInit() {
    return this.init;
  }

  public TJvmMemoryPool setInit(long init) {
    this.init = init;
    setInitIsSet(true);
    return this;
  }

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

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

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

  public long getMax() {
    return this.max;
  }

  public TJvmMemoryPool setMax(long max) {
    this.max = max;
    setMaxIsSet(true);
    return this;
  }

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

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

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

  public long getUsed() {
    return this.used;
  }

  public TJvmMemoryPool setUsed(long used) {
    this.used = used;
    setUsedIsSet(true);
    return this;
  }

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

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

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

  public long getPeakCommitted() {
    return this.peak_committed;
  }

  public TJvmMemoryPool setPeakCommitted(long peak_committed) {
    this.peak_committed = peak_committed;
    setPeakCommittedIsSet(true);
    return this;
  }

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

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

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

  public long getPeakInit() {
    return this.peak_init;
  }

  public TJvmMemoryPool setPeakInit(long peak_init) {
    this.peak_init = peak_init;
    setPeakInitIsSet(true);
    return this;
  }

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

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

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

  public long getPeakMax() {
    return this.peak_max;
  }

  public TJvmMemoryPool setPeakMax(long peak_max) {
    this.peak_max = peak_max;
    setPeakMaxIsSet(true);
    return this;
  }

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

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

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

  public long getPeakUsed() {
    return this.peak_used;
  }

  public TJvmMemoryPool setPeakUsed(long peak_used) {
    this.peak_used = peak_used;
    setPeakUsedIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getName() {
    return this.name;
  }

  public TJvmMemoryPool setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

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

    case INIT:
      if (value == null) {
        unsetInit();
      } else {
        setInit((java.lang.Long)value);
      }
      break;

    case MAX:
      if (value == null) {
        unsetMax();
      } else {
        setMax((java.lang.Long)value);
      }
      break;

    case USED:
      if (value == null) {
        unsetUsed();
      } else {
        setUsed((java.lang.Long)value);
      }
      break;

    case PEAK_COMMITTED:
      if (value == null) {
        unsetPeakCommitted();
      } else {
        setPeakCommitted((java.lang.Long)value);
      }
      break;

    case PEAK_INIT:
      if (value == null) {
        unsetPeakInit();
      } else {
        setPeakInit((java.lang.Long)value);
      }
      break;

    case PEAK_MAX:
      if (value == null) {
        unsetPeakMax();
      } else {
        setPeakMax((java.lang.Long)value);
      }
      break;

    case PEAK_USED:
      if (value == null) {
        unsetPeakUsed();
      } else {
        setPeakUsed((java.lang.Long)value);
      }
      break;

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((java.lang.String)value);
      }
      break;

    }
  }

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

    case INIT:
      return getInit();

    case MAX:
      return getMax();

    case USED:
      return getUsed();

    case PEAK_COMMITTED:
      return getPeakCommitted();

    case PEAK_INIT:
      return getPeakInit();

    case PEAK_MAX:
      return getPeakMax();

    case PEAK_USED:
      return getPeakUsed();

    case NAME:
      return getName();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case COMMITTED:
      return isSetCommitted();
    case INIT:
      return isSetInit();
    case MAX:
      return isSetMax();
    case USED:
      return isSetUsed();
    case PEAK_COMMITTED:
      return isSetPeakCommitted();
    case PEAK_INIT:
      return isSetPeakInit();
    case PEAK_MAX:
      return isSetPeakMax();
    case PEAK_USED:
      return isSetPeakUsed();
    case NAME:
      return isSetName();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_committed = true;
    boolean that_present_committed = true;
    if (this_present_committed || that_present_committed) {
      if (!(this_present_committed && that_present_committed))
        return false;
      if (this.committed != that.committed)
        return false;
    }

    boolean this_present_init = true;
    boolean that_present_init = true;
    if (this_present_init || that_present_init) {
      if (!(this_present_init && that_present_init))
        return false;
      if (this.init != that.init)
        return false;
    }

    boolean this_present_max = true;
    boolean that_present_max = true;
    if (this_present_max || that_present_max) {
      if (!(this_present_max && that_present_max))
        return false;
      if (this.max != that.max)
        return false;
    }

    boolean this_present_used = true;
    boolean that_present_used = true;
    if (this_present_used || that_present_used) {
      if (!(this_present_used && that_present_used))
        return false;
      if (this.used != that.used)
        return false;
    }

    boolean this_present_peak_committed = true;
    boolean that_present_peak_committed = true;
    if (this_present_peak_committed || that_present_peak_committed) {
      if (!(this_present_peak_committed && that_present_peak_committed))
        return false;
      if (this.peak_committed != that.peak_committed)
        return false;
    }

    boolean this_present_peak_init = true;
    boolean that_present_peak_init = true;
    if (this_present_peak_init || that_present_peak_init) {
      if (!(this_present_peak_init && that_present_peak_init))
        return false;
      if (this.peak_init != that.peak_init)
        return false;
    }

    boolean this_present_peak_max = true;
    boolean that_present_peak_max = true;
    if (this_present_peak_max || that_present_peak_max) {
      if (!(this_present_peak_max && that_present_peak_max))
        return false;
      if (this.peak_max != that.peak_max)
        return false;
    }

    boolean this_present_peak_used = true;
    boolean that_present_peak_used = true;
    if (this_present_peak_used || that_present_peak_used) {
      if (!(this_present_peak_used && that_present_peak_used))
        return false;
      if (this.peak_used != that.peak_used)
        return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    return true;
  }

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

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

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

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

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

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

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

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

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

    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
    if (isSetName())
      hashCode = hashCode * 8191 + name.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCommitted(), other.isSetCommitted());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCommitted()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.committed, other.committed);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetInit(), other.isSetInit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.init, other.init);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMax(), other.isSetMax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max, other.max);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUsed(), other.isSetUsed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUsed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.used, other.used);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPeakCommitted(), other.isSetPeakCommitted());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPeakCommitted()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.peak_committed, other.peak_committed);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPeakInit(), other.isSetPeakInit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPeakInit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.peak_init, other.peak_init);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPeakMax(), other.isSetPeakMax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPeakMax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.peak_max, other.peak_max);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPeakUsed(), other.isSetPeakUsed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPeakUsed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.peak_used, other.peak_used);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

  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("TJvmMemoryPool(");
    boolean first = true;

    sb.append("committed:");
    sb.append(this.committed);
    first = false;
    if (!first) sb.append(", ");
    sb.append("init:");
    sb.append(this.init);
    first = false;
    if (!first) sb.append(", ");
    sb.append("max:");
    sb.append(this.max);
    first = false;
    if (!first) sb.append(", ");
    sb.append("used:");
    sb.append(this.used);
    first = false;
    if (!first) sb.append(", ");
    sb.append("peak_committed:");
    sb.append(this.peak_committed);
    first = false;
    if (!first) sb.append(", ");
    sb.append("peak_init:");
    sb.append(this.peak_init);
    first = false;
    if (!first) sb.append(", ");
    sb.append("peak_max:");
    sb.append(this.peak_max);
    first = false;
    if (!first) sb.append(", ");
    sb.append("peak_used:");
    sb.append(this.peak_used);
    first = false;
    if (!first) sb.append(", ");
    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'committed' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'init' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'max' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'used' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'peak_committed' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'peak_init' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'peak_max' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'peak_used' because it's a primitive and you chose the non-beans generator.
    if (name == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
    }
    // 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 TJvmMemoryPoolStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TJvmMemoryPoolStandardScheme getScheme() {
      return new TJvmMemoryPoolStandardScheme();
    }
  }

  private static class TJvmMemoryPoolStandardScheme extends org.apache.thrift.scheme.StandardScheme<TJvmMemoryPool> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TJvmMemoryPool 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: // COMMITTED
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.committed = iprot.readI64();
              struct.setCommittedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // INIT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.init = iprot.readI64();
              struct.setInitIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MAX
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.max = iprot.readI64();
              struct.setMaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // USED
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.used = iprot.readI64();
              struct.setUsedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PEAK_COMMITTED
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.peak_committed = iprot.readI64();
              struct.setPeakCommittedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PEAK_INIT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.peak_init = iprot.readI64();
              struct.setPeakInitIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PEAK_MAX
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.peak_max = iprot.readI64();
              struct.setPeakMaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // PEAK_USED
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.peak_used = iprot.readI64();
              struct.setPeakUsedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(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.isSetCommitted()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'committed' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetInit()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'init' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetMax()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'max' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetUsed()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'used' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetPeakCommitted()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'peak_committed' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetPeakInit()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'peak_init' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetPeakMax()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'peak_max' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetPeakUsed()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'peak_used' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(COMMITTED_FIELD_DESC);
      oprot.writeI64(struct.committed);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INIT_FIELD_DESC);
      oprot.writeI64(struct.init);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MAX_FIELD_DESC);
      oprot.writeI64(struct.max);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(USED_FIELD_DESC);
      oprot.writeI64(struct.used);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PEAK_COMMITTED_FIELD_DESC);
      oprot.writeI64(struct.peak_committed);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PEAK_INIT_FIELD_DESC);
      oprot.writeI64(struct.peak_init);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PEAK_MAX_FIELD_DESC);
      oprot.writeI64(struct.peak_max);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PEAK_USED_FIELD_DESC);
      oprot.writeI64(struct.peak_used);
      oprot.writeFieldEnd();
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TJvmMemoryPoolTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TJvmMemoryPoolTupleScheme getScheme() {
      return new TJvmMemoryPoolTupleScheme();
    }
  }

  private static class TJvmMemoryPoolTupleScheme extends org.apache.thrift.scheme.TupleScheme<TJvmMemoryPool> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TJvmMemoryPool struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.committed);
      oprot.writeI64(struct.init);
      oprot.writeI64(struct.max);
      oprot.writeI64(struct.used);
      oprot.writeI64(struct.peak_committed);
      oprot.writeI64(struct.peak_init);
      oprot.writeI64(struct.peak_max);
      oprot.writeI64(struct.peak_used);
      oprot.writeString(struct.name);
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TJvmMemoryPool struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.committed = iprot.readI64();
      struct.setCommittedIsSet(true);
      struct.init = iprot.readI64();
      struct.setInitIsSet(true);
      struct.max = iprot.readI64();
      struct.setMaxIsSet(true);
      struct.used = iprot.readI64();
      struct.setUsedIsSet(true);
      struct.peak_committed = iprot.readI64();
      struct.setPeakCommittedIsSet(true);
      struct.peak_init = iprot.readI64();
      struct.setPeakInitIsSet(true);
      struct.peak_max = iprot.readI64();
      struct.setPeakMaxIsSet(true);
      struct.peak_used = iprot.readI64();
      struct.setPeakUsedIsSet(true);
      struct.name = iprot.readString();
      struct.setNameIsSet(true);
    }
  }

  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();
  }
}