TQueryStatsResult.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 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;
    }

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

    @Override
    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;
    }
  }

  @Override
  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;
    }
  }

  @Override
  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
  @Override
  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 */
  @Override
  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
  @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("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 {
    @Override
    public TQueryStatsResultStandardScheme getScheme() {
      return new TQueryStatsResultStandardScheme();
    }
  }

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

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryStatsResult 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: // 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 _map594 = iprot.readMapBegin();
                  struct.simple_result = new java.util.HashMap<java.lang.String,java.lang.Long>(2*_map594.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _key595;
                  long _val596;
                  for (int _i597 = 0; _i597 < _map594.size; ++_i597)
                  {
                    _key595 = iprot.readString();
                    _val596 = iprot.readI64();
                    struct.simple_result.put(_key595, _val596);
                  }
                  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 _list598 = iprot.readListBegin();
                  struct.table_stats = new java.util.ArrayList<TTableQueryStats>(_list598.size);
                  @org.apache.thrift.annotation.Nullable TTableQueryStats _elem599;
                  for (int _i600 = 0; _i600 < _list598.size; ++_i600)
                  {
                    _elem599 = new TTableQueryStats();
                    _elem599.read(iprot);
                    struct.table_stats.add(_elem599);
                  }
                  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 _list601 = iprot.readListBegin();
                  struct.table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>(_list601.size);
                  @org.apache.thrift.annotation.Nullable TTableIndexQueryStats _elem602;
                  for (int _i603 = 0; _i603 < _list601.size; ++_i603)
                  {
                    _elem602 = new TTableIndexQueryStats();
                    _elem602.read(iprot);
                    struct.table_verbos_stats.add(_elem602);
                  }
                  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 _map604 = iprot.readMapBegin();
                  struct.tablet_stats = new java.util.HashMap<java.lang.Long,java.lang.Long>(2*_map604.size);
                  long _key605;
                  long _val606;
                  for (int _i607 = 0; _i607 < _map604.size; ++_i607)
                  {
                    _key605 = iprot.readI64();
                    _val606 = iprot.readI64();
                    struct.tablet_stats.put(_key605, _val606);
                  }
                  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();
      } finally {
        iprot.decrementRecursionDepth();
      }
    }

    @Override
    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> _iter608 : struct.simple_result.entrySet())
            {
              oprot.writeString(_iter608.getKey());
              oprot.writeI64(_iter608.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 _iter609 : struct.table_stats)
            {
              _iter609.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 _iter610 : struct.table_verbos_stats)
            {
              _iter610.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> _iter611 : struct.tablet_stats.entrySet())
            {
              oprot.writeI64(_iter611.getKey());
              oprot.writeI64(_iter611.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TQueryStatsResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    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> _iter612 : struct.simple_result.entrySet())
          {
            oprot.writeString(_iter612.getKey());
            oprot.writeI64(_iter612.getValue());
          }
        }
      }
      if (struct.isSetTableStats()) {
        {
          oprot.writeI32(struct.table_stats.size());
          for (TTableQueryStats _iter613 : struct.table_stats)
          {
            _iter613.write(oprot);
          }
        }
      }
      if (struct.isSetTableVerbosStats()) {
        {
          oprot.writeI32(struct.table_verbos_stats.size());
          for (TTableIndexQueryStats _iter614 : struct.table_verbos_stats)
          {
            _iter614.write(oprot);
          }
        }
      }
      if (struct.isSetTabletStats()) {
        {
          oprot.writeI32(struct.tablet_stats.size());
          for (java.util.Map.Entry<java.lang.Long, java.lang.Long> _iter615 : struct.tablet_stats.entrySet())
          {
            oprot.writeI64(_iter615.getKey());
            oprot.writeI64(_iter615.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TQueryStatsResult struct) throws org.apache.thrift.TException {
      prot.incrementRecursionDepth();
      try {
        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 _map616 = 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*_map616.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _key617;
            long _val618;
            for (int _i619 = 0; _i619 < _map616.size; ++_i619)
            {
              _key617 = iprot.readString();
              _val618 = iprot.readI64();
              struct.simple_result.put(_key617, _val618);
            }
          }
          struct.setSimpleResultIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TList _list620 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
            struct.table_stats = new java.util.ArrayList<TTableQueryStats>(_list620.size);
            @org.apache.thrift.annotation.Nullable TTableQueryStats _elem621;
            for (int _i622 = 0; _i622 < _list620.size; ++_i622)
            {
              _elem621 = new TTableQueryStats();
              _elem621.read(iprot);
              struct.table_stats.add(_elem621);
            }
          }
          struct.setTableStatsIsSet(true);
        }
        if (incoming.get(3)) {
          {
            org.apache.thrift.protocol.TList _list623 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
            struct.table_verbos_stats = new java.util.ArrayList<TTableIndexQueryStats>(_list623.size);
            @org.apache.thrift.annotation.Nullable TTableIndexQueryStats _elem624;
            for (int _i625 = 0; _i625 < _list623.size; ++_i625)
            {
              _elem624 = new TTableIndexQueryStats();
              _elem624.read(iprot);
              struct.table_verbos_stats.add(_elem624);
            }
          }
          struct.setTableVerbosStatsIsSet(true);
        }
        if (incoming.get(4)) {
          {
            org.apache.thrift.protocol.TMap _map626 = 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*_map626.size);
            long _key627;
            long _val628;
            for (int _i629 = 0; _i629 < _map626.size; ++_i629)
            {
              _key627 = iprot.readI64();
              _val628 = iprot.readI64();
              struct.tablet_stats.put(_key627, _val628);
            }
          }
          struct.setTabletStatsIsSet(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();
  }
}