TQueryStatsResult.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 TQueryStatsResult implements org.apache.thrift.TBase<TQueryStatsResult, TQueryStatsResult._Fields>, java.io.Serializable, Cloneable, Comparable<TQueryStatsResult> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TQueryStatsResult");

  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField SIMPLE_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("simple_result", org.apache.thrift.protocol.TType.MAP, (short)2);
  private static final org.apache.thrift.protocol.TField TABLE_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("table_stats", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField TABLE_VERBOS_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("table_verbos_stats", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField TABLET_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("tablet_stats", org.apache.thrift.protocol.TType.MAP, (short)5);

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

  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStatus status; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.Long> simple_result; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TTableQueryStats> table_stats; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TTableIndexQueryStats> table_verbos_stats; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Long,java.lang.Long> tablet_stats; // 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 {
    STATUS((short)1, "status"),
    SIMPLE_RESULT((short)2, "simple_result"),
    TABLE_STATS((short)3, "table_stats"),
    TABLE_VERBOS_STATS((short)4, "table_verbos_stats"),
    TABLET_STATS((short)5, "tablet_stats");

    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: // STATUS
          return STATUS;
        case 2: // SIMPLE_RESULT
          return SIMPLE_RESULT;
        case 3: // TABLE_STATS
          return TABLE_STATS;
        case 4: // TABLE_VERBOS_STATS
          return TABLE_VERBOS_STATS;
        case 5: // TABLET_STATS
          return TABLET_STATS;
        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 _Fields optionals[] = {_Fields.STATUS,_Fields.SIMPLE_RESULT,_Fields.TABLE_STATS,_Fields.TABLE_VERBOS_STATS,_Fields.TABLET_STATS};
  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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TStatus.class)));
    tmpMap.put(_Fields.SIMPLE_RESULT, new org.apache.thrift.meta_data.FieldMetaData("simple_result", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
    tmpMap.put(_Fields.TABLE_STATS, new org.apache.thrift.meta_data.FieldMetaData("table_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, TTableQueryStats.class))));
    tmpMap.put(_Fields.TABLE_VERBOS_STATS, new org.apache.thrift.meta_data.FieldMetaData("table_verbos_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, TTableIndexQueryStats.class))));
    tmpMap.put(_Fields.TABLET_STATS, new org.apache.thrift.meta_data.FieldMetaData("tablet_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
            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(TQueryStatsResult.class, metaDataMap);
  }

  public TQueryStatsResult() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TQueryStatsResult(TQueryStatsResult other) {
    if (other.isSetStatus()) {
      this.status = new org.apache.doris.thrift.TStatus(other.status);
    }
    if (other.isSetSimpleResult()) {
      java.util.Map<java.lang.String,java.lang.Long> __this__simple_result = new java.util.HashMap<java.lang.String,java.lang.Long>(other.simple_result);
      this.simple_result = __this__simple_result;
    }
    if (other.isSetTableStats()) {
      java.util.List<TTableQueryStats> __this__table_stats = new java.util.ArrayList<TTableQueryStats>(other.table_stats.size());
      for (TTableQueryStats other_element : other.table_stats) {
        __this__table_stats.add(new TTableQueryStats(other_element));
      }
      this.table_stats = __this__table_stats;
    }
    if (other.isSetTableVerbosStats()) {
      java.util.List<TTableIndexQueryStats> __this__table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>(other.table_verbos_stats.size());
      for (TTableIndexQueryStats other_element : other.table_verbos_stats) {
        __this__table_verbos_stats.add(new TTableIndexQueryStats(other_element));
      }
      this.table_verbos_stats = __this__table_verbos_stats;
    }
    if (other.isSetTabletStats()) {
      java.util.Map<java.lang.Long,java.lang.Long> __this__tablet_stats = new java.util.HashMap<java.lang.Long,java.lang.Long>(other.tablet_stats);
      this.tablet_stats = __this__tablet_stats;
    }
  }

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

  @Override
  public void clear() {
    this.status = null;
    this.simple_result = null;
    this.table_stats = null;
    this.table_verbos_stats = null;
    this.tablet_stats = null;
  }

  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TStatus getStatus() {
    return this.status;
  }

  public TQueryStatsResult setStatus(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStatus status) {
    this.status = status;
    return this;
  }

  public void unsetStatus() {
    this.status = null;
  }

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

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

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

  public void putToSimpleResult(java.lang.String key, long val) {
    if (this.simple_result == null) {
      this.simple_result = new java.util.HashMap<java.lang.String,java.lang.Long>();
    }
    this.simple_result.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.Long> getSimpleResult() {
    return this.simple_result;
  }

  public TQueryStatsResult setSimpleResult(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.Long> simple_result) {
    this.simple_result = simple_result;
    return this;
  }

  public void unsetSimpleResult() {
    this.simple_result = null;
  }

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

  public void setSimpleResultIsSet(boolean value) {
    if (!value) {
      this.simple_result = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<TTableQueryStats> getTableStatsIterator() {
    return (this.table_stats == null) ? null : this.table_stats.iterator();
  }

  public void addToTableStats(TTableQueryStats elem) {
    if (this.table_stats == null) {
      this.table_stats = new java.util.ArrayList<TTableQueryStats>();
    }
    this.table_stats.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TTableQueryStats> getTableStats() {
    return this.table_stats;
  }

  public TQueryStatsResult setTableStats(@org.apache.thrift.annotation.Nullable java.util.List<TTableQueryStats> table_stats) {
    this.table_stats = table_stats;
    return this;
  }

  public void unsetTableStats() {
    this.table_stats = null;
  }

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

  public void setTableStatsIsSet(boolean value) {
    if (!value) {
      this.table_stats = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<TTableIndexQueryStats> getTableVerbosStatsIterator() {
    return (this.table_verbos_stats == null) ? null : this.table_verbos_stats.iterator();
  }

  public void addToTableVerbosStats(TTableIndexQueryStats elem) {
    if (this.table_verbos_stats == null) {
      this.table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>();
    }
    this.table_verbos_stats.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TTableIndexQueryStats> getTableVerbosStats() {
    return this.table_verbos_stats;
  }

  public TQueryStatsResult setTableVerbosStats(@org.apache.thrift.annotation.Nullable java.util.List<TTableIndexQueryStats> table_verbos_stats) {
    this.table_verbos_stats = table_verbos_stats;
    return this;
  }

  public void unsetTableVerbosStats() {
    this.table_verbos_stats = null;
  }

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

  public void setTableVerbosStatsIsSet(boolean value) {
    if (!value) {
      this.table_verbos_stats = null;
    }
  }

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

  public void putToTabletStats(long key, long val) {
    if (this.tablet_stats == null) {
      this.tablet_stats = new java.util.HashMap<java.lang.Long,java.lang.Long>();
    }
    this.tablet_stats.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.Long,java.lang.Long> getTabletStats() {
    return this.tablet_stats;
  }

  public TQueryStatsResult setTabletStats(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Long,java.lang.Long> tablet_stats) {
    this.tablet_stats = tablet_stats;
    return this;
  }

  public void unsetTabletStats() {
    this.tablet_stats = null;
  }

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

  public void setTabletStatsIsSet(boolean value) {
    if (!value) {
      this.tablet_stats = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((org.apache.doris.thrift.TStatus)value);
      }
      break;

    case SIMPLE_RESULT:
      if (value == null) {
        unsetSimpleResult();
      } else {
        setSimpleResult((java.util.Map<java.lang.String,java.lang.Long>)value);
      }
      break;

    case TABLE_STATS:
      if (value == null) {
        unsetTableStats();
      } else {
        setTableStats((java.util.List<TTableQueryStats>)value);
      }
      break;

    case TABLE_VERBOS_STATS:
      if (value == null) {
        unsetTableVerbosStats();
      } else {
        setTableVerbosStats((java.util.List<TTableIndexQueryStats>)value);
      }
      break;

    case TABLET_STATS:
      if (value == null) {
        unsetTabletStats();
      } else {
        setTabletStats((java.util.Map<java.lang.Long,java.lang.Long>)value);
      }
      break;

    }
  }

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

    case SIMPLE_RESULT:
      return getSimpleResult();

    case TABLE_STATS:
      return getTableStats();

    case TABLE_VERBOS_STATS:
      return getTableVerbosStats();

    case TABLET_STATS:
      return getTabletStats();

    }
    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 STATUS:
      return isSetStatus();
    case SIMPLE_RESULT:
      return isSetSimpleResult();
    case TABLE_STATS:
      return isSetTableStats();
    case TABLE_VERBOS_STATS:
      return isSetTableVerbosStats();
    case TABLET_STATS:
      return isSetTabletStats();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_simple_result = true && this.isSetSimpleResult();
    boolean that_present_simple_result = true && that.isSetSimpleResult();
    if (this_present_simple_result || that_present_simple_result) {
      if (!(this_present_simple_result && that_present_simple_result))
        return false;
      if (!this.simple_result.equals(that.simple_result))
        return false;
    }

    boolean this_present_table_stats = true && this.isSetTableStats();
    boolean that_present_table_stats = true && that.isSetTableStats();
    if (this_present_table_stats || that_present_table_stats) {
      if (!(this_present_table_stats && that_present_table_stats))
        return false;
      if (!this.table_stats.equals(that.table_stats))
        return false;
    }

    boolean this_present_table_verbos_stats = true && this.isSetTableVerbosStats();
    boolean that_present_table_verbos_stats = true && that.isSetTableVerbosStats();
    if (this_present_table_verbos_stats || that_present_table_verbos_stats) {
      if (!(this_present_table_verbos_stats && that_present_table_verbos_stats))
        return false;
      if (!this.table_verbos_stats.equals(that.table_verbos_stats))
        return false;
    }

    boolean this_present_tablet_stats = true && this.isSetTabletStats();
    boolean that_present_tablet_stats = true && that.isSetTabletStats();
    if (this_present_tablet_stats || that_present_tablet_stats) {
      if (!(this_present_tablet_stats && that_present_tablet_stats))
        return false;
      if (!this.tablet_stats.equals(that.tablet_stats))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
    if (isSetStatus())
      hashCode = hashCode * 8191 + status.hashCode();

    hashCode = hashCode * 8191 + ((isSetSimpleResult()) ? 131071 : 524287);
    if (isSetSimpleResult())
      hashCode = hashCode * 8191 + simple_result.hashCode();

    hashCode = hashCode * 8191 + ((isSetTableStats()) ? 131071 : 524287);
    if (isSetTableStats())
      hashCode = hashCode * 8191 + table_stats.hashCode();

    hashCode = hashCode * 8191 + ((isSetTableVerbosStats()) ? 131071 : 524287);
    if (isSetTableVerbosStats())
      hashCode = hashCode * 8191 + table_verbos_stats.hashCode();

    hashCode = hashCode * 8191 + ((isSetTabletStats()) ? 131071 : 524287);
    if (isSetTabletStats())
      hashCode = hashCode * 8191 + tablet_stats.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSimpleResult(), other.isSetSimpleResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSimpleResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.simple_result, other.simple_result);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTableStats(), other.isSetTableStats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableStats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_stats, other.table_stats);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTableVerbosStats(), other.isSetTableVerbosStats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableVerbosStats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_verbos_stats, other.table_verbos_stats);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTabletStats(), other.isSetTabletStats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTabletStats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablet_stats, other.tablet_stats);
      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("TQueryStatsResult(");
    boolean first = true;

    if (isSetStatus()) {
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        sb.append(this.status);
      }
      first = false;
    }
    if (isSetSimpleResult()) {
      if (!first) sb.append(", ");
      sb.append("simple_result:");
      if (this.simple_result == null) {
        sb.append("null");
      } else {
        sb.append(this.simple_result);
      }
      first = false;
    }
    if (isSetTableStats()) {
      if (!first) sb.append(", ");
      sb.append("table_stats:");
      if (this.table_stats == null) {
        sb.append("null");
      } else {
        sb.append(this.table_stats);
      }
      first = false;
    }
    if (isSetTableVerbosStats()) {
      if (!first) sb.append(", ");
      sb.append("table_verbos_stats:");
      if (this.table_verbos_stats == null) {
        sb.append("null");
      } else {
        sb.append(this.table_verbos_stats);
      }
      first = false;
    }
    if (isSetTabletStats()) {
      if (!first) sb.append(", ");
      sb.append("tablet_stats:");
      if (this.tablet_stats == null) {
        sb.append("null");
      } else {
        sb.append(this.tablet_stats);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

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

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      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 TQueryStatsResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TQueryStatsResultStandardScheme getScheme() {
      return new TQueryStatsResultStandardScheme();
    }
  }

  private static class TQueryStatsResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TQueryStatsResult> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryStatsResult 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: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.status = new org.apache.doris.thrift.TStatus();
              struct.status.read(iprot);
              struct.setStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SIMPLE_RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map530 = iprot.readMapBegin();
                struct.simple_result = new java.util.HashMap<java.lang.String,java.lang.Long>(2*_map530.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key531;
                long _val532;
                for (int _i533 = 0; _i533 < _map530.size; ++_i533)
                {
                  _key531 = iprot.readString();
                  _val532 = iprot.readI64();
                  struct.simple_result.put(_key531, _val532);
                }
                iprot.readMapEnd();
              }
              struct.setSimpleResultIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TABLE_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list534 = iprot.readListBegin();
                struct.table_stats = new java.util.ArrayList<TTableQueryStats>(_list534.size);
                @org.apache.thrift.annotation.Nullable TTableQueryStats _elem535;
                for (int _i536 = 0; _i536 < _list534.size; ++_i536)
                {
                  _elem535 = new TTableQueryStats();
                  _elem535.read(iprot);
                  struct.table_stats.add(_elem535);
                }
                iprot.readListEnd();
              }
              struct.setTableStatsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TABLE_VERBOS_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list537 = iprot.readListBegin();
                struct.table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>(_list537.size);
                @org.apache.thrift.annotation.Nullable TTableIndexQueryStats _elem538;
                for (int _i539 = 0; _i539 < _list537.size; ++_i539)
                {
                  _elem538 = new TTableIndexQueryStats();
                  _elem538.read(iprot);
                  struct.table_verbos_stats.add(_elem538);
                }
                iprot.readListEnd();
              }
              struct.setTableVerbosStatsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // TABLET_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map540 = iprot.readMapBegin();
                struct.tablet_stats = new java.util.HashMap<java.lang.Long,java.lang.Long>(2*_map540.size);
                long _key541;
                long _val542;
                for (int _i543 = 0; _i543 < _map540.size; ++_i543)
                {
                  _key541 = iprot.readI64();
                  _val542 = iprot.readI64();
                  struct.tablet_stats.put(_key541, _val542);
                }
                iprot.readMapEnd();
              }
              struct.setTabletStatsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

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

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.status != null) {
        if (struct.isSetStatus()) {
          oprot.writeFieldBegin(STATUS_FIELD_DESC);
          struct.status.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.simple_result != null) {
        if (struct.isSetSimpleResult()) {
          oprot.writeFieldBegin(SIMPLE_RESULT_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.simple_result.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.Long> _iter544 : struct.simple_result.entrySet())
            {
              oprot.writeString(_iter544.getKey());
              oprot.writeI64(_iter544.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.table_stats != null) {
        if (struct.isSetTableStats()) {
          oprot.writeFieldBegin(TABLE_STATS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.table_stats.size()));
            for (TTableQueryStats _iter545 : struct.table_stats)
            {
              _iter545.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.table_verbos_stats != null) {
        if (struct.isSetTableVerbosStats()) {
          oprot.writeFieldBegin(TABLE_VERBOS_STATS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.table_verbos_stats.size()));
            for (TTableIndexQueryStats _iter546 : struct.table_verbos_stats)
            {
              _iter546.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.tablet_stats != null) {
        if (struct.isSetTabletStats()) {
          oprot.writeFieldBegin(TABLET_STATS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, struct.tablet_stats.size()));
            for (java.util.Map.Entry<java.lang.Long, java.lang.Long> _iter547 : struct.tablet_stats.entrySet())
            {
              oprot.writeI64(_iter547.getKey());
              oprot.writeI64(_iter547.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TQueryStatsResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TQueryStatsResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TQueryStatsResult struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetStatus()) {
        optionals.set(0);
      }
      if (struct.isSetSimpleResult()) {
        optionals.set(1);
      }
      if (struct.isSetTableStats()) {
        optionals.set(2);
      }
      if (struct.isSetTableVerbosStats()) {
        optionals.set(3);
      }
      if (struct.isSetTabletStats()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetStatus()) {
        struct.status.write(oprot);
      }
      if (struct.isSetSimpleResult()) {
        {
          oprot.writeI32(struct.simple_result.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.Long> _iter548 : struct.simple_result.entrySet())
          {
            oprot.writeString(_iter548.getKey());
            oprot.writeI64(_iter548.getValue());
          }
        }
      }
      if (struct.isSetTableStats()) {
        {
          oprot.writeI32(struct.table_stats.size());
          for (TTableQueryStats _iter549 : struct.table_stats)
          {
            _iter549.write(oprot);
          }
        }
      }
      if (struct.isSetTableVerbosStats()) {
        {
          oprot.writeI32(struct.table_verbos_stats.size());
          for (TTableIndexQueryStats _iter550 : struct.table_verbos_stats)
          {
            _iter550.write(oprot);
          }
        }
      }
      if (struct.isSetTabletStats()) {
        {
          oprot.writeI32(struct.tablet_stats.size());
          for (java.util.Map.Entry<java.lang.Long, java.lang.Long> _iter551 : struct.tablet_stats.entrySet())
          {
            oprot.writeI64(_iter551.getKey());
            oprot.writeI64(_iter551.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TQueryStatsResult struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.status = new org.apache.doris.thrift.TStatus();
        struct.status.read(iprot);
        struct.setStatusIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TMap _map552 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64); 
          struct.simple_result = new java.util.HashMap<java.lang.String,java.lang.Long>(2*_map552.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key553;
          long _val554;
          for (int _i555 = 0; _i555 < _map552.size; ++_i555)
          {
            _key553 = iprot.readString();
            _val554 = iprot.readI64();
            struct.simple_result.put(_key553, _val554);
          }
        }
        struct.setSimpleResultIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list556 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.table_stats = new java.util.ArrayList<TTableQueryStats>(_list556.size);
          @org.apache.thrift.annotation.Nullable TTableQueryStats _elem557;
          for (int _i558 = 0; _i558 < _list556.size; ++_i558)
          {
            _elem557 = new TTableQueryStats();
            _elem557.read(iprot);
            struct.table_stats.add(_elem557);
          }
        }
        struct.setTableStatsIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list559 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>(_list559.size);
          @org.apache.thrift.annotation.Nullable TTableIndexQueryStats _elem560;
          for (int _i561 = 0; _i561 < _list559.size; ++_i561)
          {
            _elem560 = new TTableIndexQueryStats();
            _elem560.read(iprot);
            struct.table_verbos_stats.add(_elem560);
          }
        }
        struct.setTableVerbosStatsIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TMap _map562 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64); 
          struct.tablet_stats = new java.util.HashMap<java.lang.Long,java.lang.Long>(2*_map562.size);
          long _key563;
          long _val564;
          for (int _i565 = 0; _i565 < _map562.size; ++_i565)
          {
            _key563 = iprot.readI64();
            _val564 = iprot.readI64();
            struct.tablet_stats.put(_key563, _val564);
          }
        }
        struct.setTabletStatsIsSet(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();
  }
}