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

  private static final org.apache.thrift.protocol.TField FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("field", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField QUERY_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("query_stats", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField FILTER_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("filter_stats", org.apache.thrift.protocol.TType.I64, (short)3);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String field; // optional
  public long query_stats; // optional
  public long filter_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 {
    FIELD((short)1, "field"),
    QUERY_STATS((short)2, "query_stats"),
    FILTER_STATS((short)3, "filter_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: // FIELD
          return FIELD;
        case 2: // QUERY_STATS
          return QUERY_STATS;
        case 3: // FILTER_STATS
          return FILTER_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 int __QUERY_STATS_ISSET_ID = 0;
  private static final int __FILTER_STATS_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.FIELD,_Fields.QUERY_STATS,_Fields.FILTER_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.FIELD, new org.apache.thrift.meta_data.FieldMetaData("field", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.QUERY_STATS, new org.apache.thrift.meta_data.FieldMetaData("query_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.FILTER_STATS, new org.apache.thrift.meta_data.FieldMetaData("filter_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableQueryStats.class, metaDataMap);
  }

  public TTableQueryStats() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TTableQueryStats(TTableQueryStats other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetField()) {
      this.field = other.field;
    }
    this.query_stats = other.query_stats;
    this.filter_stats = other.filter_stats;
  }

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

  @Override
  public void clear() {
    this.field = null;
    setQueryStatsIsSet(false);
    this.query_stats = 0;
    setFilterStatsIsSet(false);
    this.filter_stats = 0;
  }

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

  public TTableQueryStats setField(@org.apache.thrift.annotation.Nullable java.lang.String field) {
    this.field = field;
    return this;
  }

  public void unsetField() {
    this.field = null;
  }

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

  public void setFieldIsSet(boolean value) {
    if (!value) {
      this.field = null;
    }
  }

  public long getQueryStats() {
    return this.query_stats;
  }

  public TTableQueryStats setQueryStats(long query_stats) {
    this.query_stats = query_stats;
    setQueryStatsIsSet(true);
    return this;
  }

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

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

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

  public long getFilterStats() {
    return this.filter_stats;
  }

  public TTableQueryStats setFilterStats(long filter_stats) {
    this.filter_stats = filter_stats;
    setFilterStatsIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case FIELD:
      if (value == null) {
        unsetField();
      } else {
        setField((java.lang.String)value);
      }
      break;

    case QUERY_STATS:
      if (value == null) {
        unsetQueryStats();
      } else {
        setQueryStats((java.lang.Long)value);
      }
      break;

    case FILTER_STATS:
      if (value == null) {
        unsetFilterStats();
      } else {
        setFilterStats((java.lang.Long)value);
      }
      break;

    }
  }

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

    case QUERY_STATS:
      return getQueryStats();

    case FILTER_STATS:
      return getFilterStats();

    }
    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 FIELD:
      return isSetField();
    case QUERY_STATS:
      return isSetQueryStats();
    case FILTER_STATS:
      return isSetFilterStats();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_field = true && this.isSetField();
    boolean that_present_field = true && that.isSetField();
    if (this_present_field || that_present_field) {
      if (!(this_present_field && that_present_field))
        return false;
      if (!this.field.equals(that.field))
        return false;
    }

    boolean this_present_query_stats = true && this.isSetQueryStats();
    boolean that_present_query_stats = true && that.isSetQueryStats();
    if (this_present_query_stats || that_present_query_stats) {
      if (!(this_present_query_stats && that_present_query_stats))
        return false;
      if (this.query_stats != that.query_stats)
        return false;
    }

    boolean this_present_filter_stats = true && this.isSetFilterStats();
    boolean that_present_filter_stats = true && that.isSetFilterStats();
    if (this_present_filter_stats || that_present_filter_stats) {
      if (!(this_present_filter_stats && that_present_filter_stats))
        return false;
      if (this.filter_stats != that.filter_stats)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetField()) ? 131071 : 524287);
    if (isSetField())
      hashCode = hashCode * 8191 + field.hashCode();

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

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetField(), other.isSetField());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetField()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.field, other.field);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryStats(), other.isSetQueryStats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryStats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_stats, other.query_stats);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFilterStats(), other.isSetFilterStats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFilterStats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filter_stats, other.filter_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("TTableQueryStats(");
    boolean first = true;

    if (isSetField()) {
      sb.append("field:");
      if (this.field == null) {
        sb.append("null");
      } else {
        sb.append(this.field);
      }
      first = false;
    }
    if (isSetQueryStats()) {
      if (!first) sb.append(", ");
      sb.append("query_stats:");
      sb.append(this.query_stats);
      first = false;
    }
    if (isSetFilterStats()) {
      if (!first) sb.append(", ");
      sb.append("filter_stats:");
      sb.append(this.filter_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
  }

  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 TTableQueryStatsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TTableQueryStatsStandardScheme getScheme() {
      return new TTableQueryStatsStandardScheme();
    }
  }

  private static class TTableQueryStatsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTableQueryStats> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TTableQueryStats 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: // FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.field = iprot.readString();
              struct.setFieldIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // QUERY_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.query_stats = iprot.readI64();
              struct.setQueryStatsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // FILTER_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.filter_stats = iprot.readI64();
              struct.setFilterStatsIsSet(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, TTableQueryStats struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.field != null) {
        if (struct.isSetField()) {
          oprot.writeFieldBegin(FIELD_FIELD_DESC);
          oprot.writeString(struct.field);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetQueryStats()) {
        oprot.writeFieldBegin(QUERY_STATS_FIELD_DESC);
        oprot.writeI64(struct.query_stats);
        oprot.writeFieldEnd();
      }
      if (struct.isSetFilterStats()) {
        oprot.writeFieldBegin(FILTER_STATS_FIELD_DESC);
        oprot.writeI64(struct.filter_stats);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TTableQueryStatsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTableQueryStats> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TTableQueryStats 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.isSetField()) {
        optionals.set(0);
      }
      if (struct.isSetQueryStats()) {
        optionals.set(1);
      }
      if (struct.isSetFilterStats()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetField()) {
        oprot.writeString(struct.field);
      }
      if (struct.isSetQueryStats()) {
        oprot.writeI64(struct.query_stats);
      }
      if (struct.isSetFilterStats()) {
        oprot.writeI64(struct.filter_stats);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TTableQueryStats struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.field = iprot.readString();
        struct.setFieldIsSet(true);
      }
      if (incoming.get(1)) {
        struct.query_stats = iprot.readI64();
        struct.setQueryStatsIsSet(true);
      }
      if (incoming.get(2)) {
        struct.filter_stats = iprot.readI64();
        struct.setFilterStatsIsSet(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();
  }
}