TLanceVectorSearchOptions.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 TLanceVectorSearchOptions implements org.apache.thrift.TBase<TLanceVectorSearchOptions, TLanceVectorSearchOptions._Fields>, java.io.Serializable, Cloneable, Comparable<TLanceVectorSearchOptions> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TLanceVectorSearchOptions");
private static final org.apache.thrift.protocol.TField NPROBES_FIELD_DESC = new org.apache.thrift.protocol.TField("nprobes", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField REFINE_FACTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("refine_factor", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField EF_FIELD_DESC = new org.apache.thrift.protocol.TField("ef", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField USE_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("use_index", org.apache.thrift.protocol.TType.BOOL, (short)4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TLanceVectorSearchOptionsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TLanceVectorSearchOptionsTupleSchemeFactory();
public int nprobes; // optional
public int refine_factor; // optional
public int ef; // optional
public boolean use_index; // 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 {
NPROBES((short)1, "nprobes"),
REFINE_FACTOR((short)2, "refine_factor"),
EF((short)3, "ef"),
USE_INDEX((short)4, "use_index");
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: // NPROBES
return NPROBES;
case 2: // REFINE_FACTOR
return REFINE_FACTOR;
case 3: // EF
return EF;
case 4: // USE_INDEX
return USE_INDEX;
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 __NPROBES_ISSET_ID = 0;
private static final int __REFINE_FACTOR_ISSET_ID = 1;
private static final int __EF_ISSET_ID = 2;
private static final int __USE_INDEX_ISSET_ID = 3;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.NPROBES,_Fields.REFINE_FACTOR,_Fields.EF,_Fields.USE_INDEX};
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.NPROBES, new org.apache.thrift.meta_data.FieldMetaData("nprobes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.REFINE_FACTOR, new org.apache.thrift.meta_data.FieldMetaData("refine_factor", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.EF, new org.apache.thrift.meta_data.FieldMetaData("ef", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.USE_INDEX, new org.apache.thrift.meta_data.FieldMetaData("use_index", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TLanceVectorSearchOptions.class, metaDataMap);
}
public TLanceVectorSearchOptions() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TLanceVectorSearchOptions(TLanceVectorSearchOptions other) {
__isset_bitfield = other.__isset_bitfield;
this.nprobes = other.nprobes;
this.refine_factor = other.refine_factor;
this.ef = other.ef;
this.use_index = other.use_index;
}
public TLanceVectorSearchOptions deepCopy() {
return new TLanceVectorSearchOptions(this);
}
@Override
public void clear() {
setNprobesIsSet(false);
this.nprobes = 0;
setRefineFactorIsSet(false);
this.refine_factor = 0;
setEfIsSet(false);
this.ef = 0;
setUseIndexIsSet(false);
this.use_index = false;
}
public int getNprobes() {
return this.nprobes;
}
public TLanceVectorSearchOptions setNprobes(int nprobes) {
this.nprobes = nprobes;
setNprobesIsSet(true);
return this;
}
public void unsetNprobes() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NPROBES_ISSET_ID);
}
/** Returns true if field nprobes is set (has been assigned a value) and false otherwise */
public boolean isSetNprobes() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NPROBES_ISSET_ID);
}
public void setNprobesIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NPROBES_ISSET_ID, value);
}
public int getRefineFactor() {
return this.refine_factor;
}
public TLanceVectorSearchOptions setRefineFactor(int refine_factor) {
this.refine_factor = refine_factor;
setRefineFactorIsSet(true);
return this;
}
public void unsetRefineFactor() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REFINE_FACTOR_ISSET_ID);
}
/** Returns true if field refine_factor is set (has been assigned a value) and false otherwise */
public boolean isSetRefineFactor() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REFINE_FACTOR_ISSET_ID);
}
public void setRefineFactorIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REFINE_FACTOR_ISSET_ID, value);
}
public int getEf() {
return this.ef;
}
public TLanceVectorSearchOptions setEf(int ef) {
this.ef = ef;
setEfIsSet(true);
return this;
}
public void unsetEf() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EF_ISSET_ID);
}
/** Returns true if field ef is set (has been assigned a value) and false otherwise */
public boolean isSetEf() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EF_ISSET_ID);
}
public void setEfIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EF_ISSET_ID, value);
}
public boolean isUseIndex() {
return this.use_index;
}
public TLanceVectorSearchOptions setUseIndex(boolean use_index) {
this.use_index = use_index;
setUseIndexIsSet(true);
return this;
}
public void unsetUseIndex() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __USE_INDEX_ISSET_ID);
}
/** Returns true if field use_index is set (has been assigned a value) and false otherwise */
public boolean isSetUseIndex() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USE_INDEX_ISSET_ID);
}
public void setUseIndexIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __USE_INDEX_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case NPROBES:
if (value == null) {
unsetNprobes();
} else {
setNprobes((java.lang.Integer)value);
}
break;
case REFINE_FACTOR:
if (value == null) {
unsetRefineFactor();
} else {
setRefineFactor((java.lang.Integer)value);
}
break;
case EF:
if (value == null) {
unsetEf();
} else {
setEf((java.lang.Integer)value);
}
break;
case USE_INDEX:
if (value == null) {
unsetUseIndex();
} else {
setUseIndex((java.lang.Boolean)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case NPROBES:
return getNprobes();
case REFINE_FACTOR:
return getRefineFactor();
case EF:
return getEf();
case USE_INDEX:
return isUseIndex();
}
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 NPROBES:
return isSetNprobes();
case REFINE_FACTOR:
return isSetRefineFactor();
case EF:
return isSetEf();
case USE_INDEX:
return isSetUseIndex();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TLanceVectorSearchOptions)
return this.equals((TLanceVectorSearchOptions)that);
return false;
}
public boolean equals(TLanceVectorSearchOptions that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_nprobes = true && this.isSetNprobes();
boolean that_present_nprobes = true && that.isSetNprobes();
if (this_present_nprobes || that_present_nprobes) {
if (!(this_present_nprobes && that_present_nprobes))
return false;
if (this.nprobes != that.nprobes)
return false;
}
boolean this_present_refine_factor = true && this.isSetRefineFactor();
boolean that_present_refine_factor = true && that.isSetRefineFactor();
if (this_present_refine_factor || that_present_refine_factor) {
if (!(this_present_refine_factor && that_present_refine_factor))
return false;
if (this.refine_factor != that.refine_factor)
return false;
}
boolean this_present_ef = true && this.isSetEf();
boolean that_present_ef = true && that.isSetEf();
if (this_present_ef || that_present_ef) {
if (!(this_present_ef && that_present_ef))
return false;
if (this.ef != that.ef)
return false;
}
boolean this_present_use_index = true && this.isSetUseIndex();
boolean that_present_use_index = true && that.isSetUseIndex();
if (this_present_use_index || that_present_use_index) {
if (!(this_present_use_index && that_present_use_index))
return false;
if (this.use_index != that.use_index)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetNprobes()) ? 131071 : 524287);
if (isSetNprobes())
hashCode = hashCode * 8191 + nprobes;
hashCode = hashCode * 8191 + ((isSetRefineFactor()) ? 131071 : 524287);
if (isSetRefineFactor())
hashCode = hashCode * 8191 + refine_factor;
hashCode = hashCode * 8191 + ((isSetEf()) ? 131071 : 524287);
if (isSetEf())
hashCode = hashCode * 8191 + ef;
hashCode = hashCode * 8191 + ((isSetUseIndex()) ? 131071 : 524287);
if (isSetUseIndex())
hashCode = hashCode * 8191 + ((use_index) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(TLanceVectorSearchOptions other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetNprobes(), other.isSetNprobes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNprobes()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nprobes, other.nprobes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetRefineFactor(), other.isSetRefineFactor());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRefineFactor()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.refine_factor, other.refine_factor);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetEf(), other.isSetEf());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEf()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ef, other.ef);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetUseIndex(), other.isSetUseIndex());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUseIndex()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.use_index, other.use_index);
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("TLanceVectorSearchOptions(");
boolean first = true;
if (isSetNprobes()) {
sb.append("nprobes:");
sb.append(this.nprobes);
first = false;
}
if (isSetRefineFactor()) {
if (!first) sb.append(", ");
sb.append("refine_factor:");
sb.append(this.refine_factor);
first = false;
}
if (isSetEf()) {
if (!first) sb.append(", ");
sb.append("ef:");
sb.append(this.ef);
first = false;
}
if (isSetUseIndex()) {
if (!first) sb.append(", ");
sb.append("use_index:");
sb.append(this.use_index);
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 TLanceVectorSearchOptionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TLanceVectorSearchOptionsStandardScheme getScheme() {
return new TLanceVectorSearchOptionsStandardScheme();
}
}
private static class TLanceVectorSearchOptionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TLanceVectorSearchOptions> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TLanceVectorSearchOptions 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: // NPROBES
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.nprobes = iprot.readI32();
struct.setNprobesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // REFINE_FACTOR
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.refine_factor = iprot.readI32();
struct.setRefineFactorIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // EF
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.ef = iprot.readI32();
struct.setEfIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // USE_INDEX
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.use_index = iprot.readBool();
struct.setUseIndexIsSet(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, TLanceVectorSearchOptions struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetNprobes()) {
oprot.writeFieldBegin(NPROBES_FIELD_DESC);
oprot.writeI32(struct.nprobes);
oprot.writeFieldEnd();
}
if (struct.isSetRefineFactor()) {
oprot.writeFieldBegin(REFINE_FACTOR_FIELD_DESC);
oprot.writeI32(struct.refine_factor);
oprot.writeFieldEnd();
}
if (struct.isSetEf()) {
oprot.writeFieldBegin(EF_FIELD_DESC);
oprot.writeI32(struct.ef);
oprot.writeFieldEnd();
}
if (struct.isSetUseIndex()) {
oprot.writeFieldBegin(USE_INDEX_FIELD_DESC);
oprot.writeBool(struct.use_index);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TLanceVectorSearchOptionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TLanceVectorSearchOptionsTupleScheme getScheme() {
return new TLanceVectorSearchOptionsTupleScheme();
}
}
private static class TLanceVectorSearchOptionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TLanceVectorSearchOptions> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TLanceVectorSearchOptions 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.isSetNprobes()) {
optionals.set(0);
}
if (struct.isSetRefineFactor()) {
optionals.set(1);
}
if (struct.isSetEf()) {
optionals.set(2);
}
if (struct.isSetUseIndex()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetNprobes()) {
oprot.writeI32(struct.nprobes);
}
if (struct.isSetRefineFactor()) {
oprot.writeI32(struct.refine_factor);
}
if (struct.isSetEf()) {
oprot.writeI32(struct.ef);
}
if (struct.isSetUseIndex()) {
oprot.writeBool(struct.use_index);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TLanceVectorSearchOptions struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.nprobes = iprot.readI32();
struct.setNprobesIsSet(true);
}
if (incoming.get(1)) {
struct.refine_factor = iprot.readI32();
struct.setRefineFactorIsSet(true);
}
if (incoming.get(2)) {
struct.ef = iprot.readI32();
struct.setEfIsSet(true);
}
if (incoming.get(3)) {
struct.use_index = iprot.readBool();
struct.setUseIndexIsSet(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();
}
}