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

  private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField QUERY_VECTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("query_vector", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField TOP_K_FIELD_DESC = new org.apache.thrift.protocol.TField("top_k", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField METRIC_FIELD_DESC = new org.apache.thrift.protocol.TField("metric", org.apache.thrift.protocol.TType.I32, (short)5);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String column; // optional
  public @org.apache.thrift.annotation.Nullable TSearchVector query_vector; // optional
  public long top_k; // optional
  public long offset; // optional
  /**
   * 
   * @see TVectorMetric
   */
  public @org.apache.thrift.annotation.Nullable TVectorMetric metric; // 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 {
    COLUMN((short)1, "column"),
    QUERY_VECTOR((short)2, "query_vector"),
    TOP_K((short)3, "top_k"),
    OFFSET((short)4, "offset"),
    /**
     * 
     * @see TVectorMetric
     */
    METRIC((short)5, "metric");

    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: // COLUMN
          return COLUMN;
        case 2: // QUERY_VECTOR
          return QUERY_VECTOR;
        case 3: // TOP_K
          return TOP_K;
        case 4: // OFFSET
          return OFFSET;
        case 5: // METRIC
          return METRIC;
        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 __TOP_K_ISSET_ID = 0;
  private static final int __OFFSET_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.COLUMN,_Fields.QUERY_VECTOR,_Fields.TOP_K,_Fields.OFFSET,_Fields.METRIC};
  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.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.QUERY_VECTOR, new org.apache.thrift.meta_data.FieldMetaData("query_vector", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSearchVector.class)));
    tmpMap.put(_Fields.TOP_K, new org.apache.thrift.meta_data.FieldMetaData("top_k", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.METRIC, new org.apache.thrift.meta_data.FieldMetaData("metric", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TVectorMetric.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TVectorSearchParams.class, metaDataMap);
  }

  public TVectorSearchParams() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TVectorSearchParams(TVectorSearchParams other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetColumn()) {
      this.column = other.column;
    }
    if (other.isSetQueryVector()) {
      this.query_vector = new TSearchVector(other.query_vector);
    }
    this.top_k = other.top_k;
    this.offset = other.offset;
    if (other.isSetMetric()) {
      this.metric = other.metric;
    }
  }

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

  @Override
  public void clear() {
    this.column = null;
    this.query_vector = null;
    setTopKIsSet(false);
    this.top_k = 0;
    setOffsetIsSet(false);
    this.offset = 0;
    this.metric = null;
  }

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

  public TVectorSearchParams setColumn(@org.apache.thrift.annotation.Nullable java.lang.String column) {
    this.column = column;
    return this;
  }

  public void unsetColumn() {
    this.column = null;
  }

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

  public void setColumnIsSet(boolean value) {
    if (!value) {
      this.column = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TSearchVector getQueryVector() {
    return this.query_vector;
  }

  public TVectorSearchParams setQueryVector(@org.apache.thrift.annotation.Nullable TSearchVector query_vector) {
    this.query_vector = query_vector;
    return this;
  }

  public void unsetQueryVector() {
    this.query_vector = null;
  }

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

  public void setQueryVectorIsSet(boolean value) {
    if (!value) {
      this.query_vector = null;
    }
  }

  public long getTopK() {
    return this.top_k;
  }

  public TVectorSearchParams setTopK(long top_k) {
    this.top_k = top_k;
    setTopKIsSet(true);
    return this;
  }

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

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

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

  public long getOffset() {
    return this.offset;
  }

  public TVectorSearchParams setOffset(long offset) {
    this.offset = offset;
    setOffsetIsSet(true);
    return this;
  }

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

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

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

  /**
   * 
   * @see TVectorMetric
   */
  @org.apache.thrift.annotation.Nullable
  public TVectorMetric getMetric() {
    return this.metric;
  }

  /**
   * 
   * @see TVectorMetric
   */
  public TVectorSearchParams setMetric(@org.apache.thrift.annotation.Nullable TVectorMetric metric) {
    this.metric = metric;
    return this;
  }

  public void unsetMetric() {
    this.metric = null;
  }

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

  public void setMetricIsSet(boolean value) {
    if (!value) {
      this.metric = null;
    }
  }

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

    case QUERY_VECTOR:
      if (value == null) {
        unsetQueryVector();
      } else {
        setQueryVector((TSearchVector)value);
      }
      break;

    case TOP_K:
      if (value == null) {
        unsetTopK();
      } else {
        setTopK((java.lang.Long)value);
      }
      break;

    case OFFSET:
      if (value == null) {
        unsetOffset();
      } else {
        setOffset((java.lang.Long)value);
      }
      break;

    case METRIC:
      if (value == null) {
        unsetMetric();
      } else {
        setMetric((TVectorMetric)value);
      }
      break;

    }
  }

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

    case QUERY_VECTOR:
      return getQueryVector();

    case TOP_K:
      return getTopK();

    case OFFSET:
      return getOffset();

    case METRIC:
      return getMetric();

    }
    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 COLUMN:
      return isSetColumn();
    case QUERY_VECTOR:
      return isSetQueryVector();
    case TOP_K:
      return isSetTopK();
    case OFFSET:
      return isSetOffset();
    case METRIC:
      return isSetMetric();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_column = true && this.isSetColumn();
    boolean that_present_column = true && that.isSetColumn();
    if (this_present_column || that_present_column) {
      if (!(this_present_column && that_present_column))
        return false;
      if (!this.column.equals(that.column))
        return false;
    }

    boolean this_present_query_vector = true && this.isSetQueryVector();
    boolean that_present_query_vector = true && that.isSetQueryVector();
    if (this_present_query_vector || that_present_query_vector) {
      if (!(this_present_query_vector && that_present_query_vector))
        return false;
      if (!this.query_vector.equals(that.query_vector))
        return false;
    }

    boolean this_present_top_k = true && this.isSetTopK();
    boolean that_present_top_k = true && that.isSetTopK();
    if (this_present_top_k || that_present_top_k) {
      if (!(this_present_top_k && that_present_top_k))
        return false;
      if (this.top_k != that.top_k)
        return false;
    }

    boolean this_present_offset = true && this.isSetOffset();
    boolean that_present_offset = true && that.isSetOffset();
    if (this_present_offset || that_present_offset) {
      if (!(this_present_offset && that_present_offset))
        return false;
      if (this.offset != that.offset)
        return false;
    }

    boolean this_present_metric = true && this.isSetMetric();
    boolean that_present_metric = true && that.isSetMetric();
    if (this_present_metric || that_present_metric) {
      if (!(this_present_metric && that_present_metric))
        return false;
      if (!this.metric.equals(that.metric))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetColumn()) ? 131071 : 524287);
    if (isSetColumn())
      hashCode = hashCode * 8191 + column.hashCode();

    hashCode = hashCode * 8191 + ((isSetQueryVector()) ? 131071 : 524287);
    if (isSetQueryVector())
      hashCode = hashCode * 8191 + query_vector.hashCode();

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

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

    hashCode = hashCode * 8191 + ((isSetMetric()) ? 131071 : 524287);
    if (isSetMetric())
      hashCode = hashCode * 8191 + metric.getValue();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetColumn(), other.isSetColumn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, other.column);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryVector(), other.isSetQueryVector());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryVector()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_vector, other.query_vector);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTopK(), other.isSetTopK());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopK()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.top_k, other.top_k);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOffset(), other.isSetOffset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOffset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMetric(), other.isSetMetric());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetric()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metric, other.metric);
      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("TVectorSearchParams(");
    boolean first = true;

    if (isSetColumn()) {
      sb.append("column:");
      if (this.column == null) {
        sb.append("null");
      } else {
        sb.append(this.column);
      }
      first = false;
    }
    if (isSetQueryVector()) {
      if (!first) sb.append(", ");
      sb.append("query_vector:");
      if (this.query_vector == null) {
        sb.append("null");
      } else {
        sb.append(this.query_vector);
      }
      first = false;
    }
    if (isSetTopK()) {
      if (!first) sb.append(", ");
      sb.append("top_k:");
      sb.append(this.top_k);
      first = false;
    }
    if (isSetOffset()) {
      if (!first) sb.append(", ");
      sb.append("offset:");
      sb.append(this.offset);
      first = false;
    }
    if (isSetMetric()) {
      if (!first) sb.append(", ");
      sb.append("metric:");
      if (this.metric == null) {
        sb.append("null");
      } else {
        sb.append(this.metric);
      }
      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 (query_vector != null) {
      query_vector.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 {
      // 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 TVectorSearchParamsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TVectorSearchParamsStandardScheme getScheme() {
      return new TVectorSearchParamsStandardScheme();
    }
  }

  private static class TVectorSearchParamsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TVectorSearchParams> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TVectorSearchParams 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: // COLUMN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.column = iprot.readString();
              struct.setColumnIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // QUERY_VECTOR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.query_vector = new TSearchVector();
              struct.query_vector.read(iprot);
              struct.setQueryVectorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TOP_K
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.top_k = iprot.readI64();
              struct.setTopKIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.offset = iprot.readI64();
              struct.setOffsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // METRIC
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.metric = org.apache.doris.thrift.TVectorMetric.findByValue(iprot.readI32());
              struct.setMetricIsSet(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, TVectorSearchParams struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.column != null) {
        if (struct.isSetColumn()) {
          oprot.writeFieldBegin(COLUMN_FIELD_DESC);
          oprot.writeString(struct.column);
          oprot.writeFieldEnd();
        }
      }
      if (struct.query_vector != null) {
        if (struct.isSetQueryVector()) {
          oprot.writeFieldBegin(QUERY_VECTOR_FIELD_DESC);
          struct.query_vector.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetTopK()) {
        oprot.writeFieldBegin(TOP_K_FIELD_DESC);
        oprot.writeI64(struct.top_k);
        oprot.writeFieldEnd();
      }
      if (struct.isSetOffset()) {
        oprot.writeFieldBegin(OFFSET_FIELD_DESC);
        oprot.writeI64(struct.offset);
        oprot.writeFieldEnd();
      }
      if (struct.metric != null) {
        if (struct.isSetMetric()) {
          oprot.writeFieldBegin(METRIC_FIELD_DESC);
          oprot.writeI32(struct.metric.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TVectorSearchParamsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TVectorSearchParams> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TVectorSearchParams 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.isSetColumn()) {
        optionals.set(0);
      }
      if (struct.isSetQueryVector()) {
        optionals.set(1);
      }
      if (struct.isSetTopK()) {
        optionals.set(2);
      }
      if (struct.isSetOffset()) {
        optionals.set(3);
      }
      if (struct.isSetMetric()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetColumn()) {
        oprot.writeString(struct.column);
      }
      if (struct.isSetQueryVector()) {
        struct.query_vector.write(oprot);
      }
      if (struct.isSetTopK()) {
        oprot.writeI64(struct.top_k);
      }
      if (struct.isSetOffset()) {
        oprot.writeI64(struct.offset);
      }
      if (struct.isSetMetric()) {
        oprot.writeI32(struct.metric.getValue());
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TVectorSearchParams 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.column = iprot.readString();
        struct.setColumnIsSet(true);
      }
      if (incoming.get(1)) {
        struct.query_vector = new TSearchVector();
        struct.query_vector.read(iprot);
        struct.setQueryVectorIsSet(true);
      }
      if (incoming.get(2)) {
        struct.top_k = iprot.readI64();
        struct.setTopKIsSet(true);
      }
      if (incoming.get(3)) {
        struct.offset = iprot.readI64();
        struct.setOffsetIsSet(true);
      }
      if (incoming.get(4)) {
        struct.metric = org.apache.doris.thrift.TVectorMetric.findByValue(iprot.readI32());
        struct.setMetricIsSet(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();
  }
}