com.yelp.nrtsearch.server.grpc.VectorIndexingOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clientlib Show documentation
Show all versions of clientlib Show documentation
GRPC Clientlib for nrtSearch
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: yelp/nrtsearch/luceneserver.proto
// Protobuf Java Version: 3.25.3
package com.yelp.nrtsearch.server.grpc;
/**
*
* Options for indexing a VECTOR field for search
*
*
* Protobuf type {@code luceneserver.VectorIndexingOptions}
*/
public final class VectorIndexingOptions extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:luceneserver.VectorIndexingOptions)
VectorIndexingOptionsOrBuilder {
private static final long serialVersionUID = 0L;
// Use VectorIndexingOptions.newBuilder() to construct.
private VectorIndexingOptions(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private VectorIndexingOptions() {
type_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new VectorIndexingOptions();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.LuceneServerProto.internal_static_luceneserver_VectorIndexingOptions_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.LuceneServerProto.internal_static_luceneserver_VectorIndexingOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.class, com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.Builder.class);
}
private int bitField0_;
public static final int TYPE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object type_ = "";
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return Whether the type field is set.
*/
@java.lang.Override
public boolean hasType() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return The type.
*/
@java.lang.Override
public java.lang.String getType() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
}
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return The bytes for type.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HNSW_M_FIELD_NUMBER = 2;
private int hnswM_ = 0;
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @return Whether the hnswM field is set.
*/
@java.lang.Override
public boolean hasHnswM() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @return The hnswM.
*/
@java.lang.Override
public int getHnswM() {
return hnswM_;
}
public static final int HNSW_EF_CONSTRUCTION_FIELD_NUMBER = 3;
private int hnswEfConstruction_ = 0;
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @return Whether the hnswEfConstruction field is set.
*/
@java.lang.Override
public boolean hasHnswEfConstruction() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @return The hnswEfConstruction.
*/
@java.lang.Override
public int getHnswEfConstruction() {
return hnswEfConstruction_;
}
public static final int MERGE_WORKERS_FIELD_NUMBER = 4;
private int mergeWorkers_ = 0;
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @return Whether the mergeWorkers field is set.
*/
@java.lang.Override
public boolean hasMergeWorkers() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @return The mergeWorkers.
*/
@java.lang.Override
public int getMergeWorkers() {
return mergeWorkers_;
}
public static final int QUANTIZED_CONFIDENCE_INTERVAL_FIELD_NUMBER = 5;
private float quantizedConfidenceInterval_ = 0F;
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @return Whether the quantizedConfidenceInterval field is set.
*/
@java.lang.Override
public boolean hasQuantizedConfidenceInterval() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @return The quantizedConfidenceInterval.
*/
@java.lang.Override
public float getQuantizedConfidenceInterval() {
return quantizedConfidenceInterval_;
}
public static final int QUANTIZED_BITS_FIELD_NUMBER = 6;
private int quantizedBits_ = 0;
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @return Whether the quantizedBits field is set.
*/
@java.lang.Override
public boolean hasQuantizedBits() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @return The quantizedBits.
*/
@java.lang.Override
public int getQuantizedBits() {
return quantizedBits_;
}
public static final int QUANTIZED_COMPRESS_FIELD_NUMBER = 7;
private boolean quantizedCompress_ = false;
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @return Whether the quantizedCompress field is set.
*/
@java.lang.Override
public boolean hasQuantizedCompress() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @return The quantizedCompress.
*/
@java.lang.Override
public boolean getQuantizedCompress() {
return quantizedCompress_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeInt32(2, hnswM_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeInt32(3, hnswEfConstruction_);
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeInt32(4, mergeWorkers_);
}
if (((bitField0_ & 0x00000010) != 0)) {
output.writeFloat(5, quantizedConfidenceInterval_);
}
if (((bitField0_ & 0x00000020) != 0)) {
output.writeInt32(6, quantizedBits_);
}
if (((bitField0_ & 0x00000040) != 0)) {
output.writeBool(7, quantizedCompress_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, hnswM_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, hnswEfConstruction_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, mergeWorkers_);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(5, quantizedConfidenceInterval_);
}
if (((bitField0_ & 0x00000020) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, quantizedBits_);
}
if (((bitField0_ & 0x00000040) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, quantizedCompress_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.yelp.nrtsearch.server.grpc.VectorIndexingOptions)) {
return super.equals(obj);
}
com.yelp.nrtsearch.server.grpc.VectorIndexingOptions other = (com.yelp.nrtsearch.server.grpc.VectorIndexingOptions) obj;
if (hasType() != other.hasType()) return false;
if (hasType()) {
if (!getType()
.equals(other.getType())) return false;
}
if (hasHnswM() != other.hasHnswM()) return false;
if (hasHnswM()) {
if (getHnswM()
!= other.getHnswM()) return false;
}
if (hasHnswEfConstruction() != other.hasHnswEfConstruction()) return false;
if (hasHnswEfConstruction()) {
if (getHnswEfConstruction()
!= other.getHnswEfConstruction()) return false;
}
if (hasMergeWorkers() != other.hasMergeWorkers()) return false;
if (hasMergeWorkers()) {
if (getMergeWorkers()
!= other.getMergeWorkers()) return false;
}
if (hasQuantizedConfidenceInterval() != other.hasQuantizedConfidenceInterval()) return false;
if (hasQuantizedConfidenceInterval()) {
if (java.lang.Float.floatToIntBits(getQuantizedConfidenceInterval())
!= java.lang.Float.floatToIntBits(
other.getQuantizedConfidenceInterval())) return false;
}
if (hasQuantizedBits() != other.hasQuantizedBits()) return false;
if (hasQuantizedBits()) {
if (getQuantizedBits()
!= other.getQuantizedBits()) return false;
}
if (hasQuantizedCompress() != other.hasQuantizedCompress()) return false;
if (hasQuantizedCompress()) {
if (getQuantizedCompress()
!= other.getQuantizedCompress()) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasType()) {
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
}
if (hasHnswM()) {
hash = (37 * hash) + HNSW_M_FIELD_NUMBER;
hash = (53 * hash) + getHnswM();
}
if (hasHnswEfConstruction()) {
hash = (37 * hash) + HNSW_EF_CONSTRUCTION_FIELD_NUMBER;
hash = (53 * hash) + getHnswEfConstruction();
}
if (hasMergeWorkers()) {
hash = (37 * hash) + MERGE_WORKERS_FIELD_NUMBER;
hash = (53 * hash) + getMergeWorkers();
}
if (hasQuantizedConfidenceInterval()) {
hash = (37 * hash) + QUANTIZED_CONFIDENCE_INTERVAL_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getQuantizedConfidenceInterval());
}
if (hasQuantizedBits()) {
hash = (37 * hash) + QUANTIZED_BITS_FIELD_NUMBER;
hash = (53 * hash) + getQuantizedBits();
}
if (hasQuantizedCompress()) {
hash = (37 * hash) + QUANTIZED_COMPRESS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getQuantizedCompress());
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.yelp.nrtsearch.server.grpc.VectorIndexingOptions prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Options for indexing a VECTOR field for search
*
*
* Protobuf type {@code luceneserver.VectorIndexingOptions}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:luceneserver.VectorIndexingOptions)
com.yelp.nrtsearch.server.grpc.VectorIndexingOptionsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.yelp.nrtsearch.server.grpc.LuceneServerProto.internal_static_luceneserver_VectorIndexingOptions_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.yelp.nrtsearch.server.grpc.LuceneServerProto.internal_static_luceneserver_VectorIndexingOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.class, com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.Builder.class);
}
// Construct using com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
type_ = "";
hnswM_ = 0;
hnswEfConstruction_ = 0;
mergeWorkers_ = 0;
quantizedConfidenceInterval_ = 0F;
quantizedBits_ = 0;
quantizedCompress_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.yelp.nrtsearch.server.grpc.LuceneServerProto.internal_static_luceneserver_VectorIndexingOptions_descriptor;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.VectorIndexingOptions getDefaultInstanceForType() {
return com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.getDefaultInstance();
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.VectorIndexingOptions build() {
com.yelp.nrtsearch.server.grpc.VectorIndexingOptions result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.VectorIndexingOptions buildPartial() {
com.yelp.nrtsearch.server.grpc.VectorIndexingOptions result = new com.yelp.nrtsearch.server.grpc.VectorIndexingOptions(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.yelp.nrtsearch.server.grpc.VectorIndexingOptions result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.type_ = type_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.hnswM_ = hnswM_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.hnswEfConstruction_ = hnswEfConstruction_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.mergeWorkers_ = mergeWorkers_;
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.quantizedConfidenceInterval_ = quantizedConfidenceInterval_;
to_bitField0_ |= 0x00000010;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.quantizedBits_ = quantizedBits_;
to_bitField0_ |= 0x00000020;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.quantizedCompress_ = quantizedCompress_;
to_bitField0_ |= 0x00000040;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.yelp.nrtsearch.server.grpc.VectorIndexingOptions) {
return mergeFrom((com.yelp.nrtsearch.server.grpc.VectorIndexingOptions)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.yelp.nrtsearch.server.grpc.VectorIndexingOptions other) {
if (other == com.yelp.nrtsearch.server.grpc.VectorIndexingOptions.getDefaultInstance()) return this;
if (other.hasType()) {
type_ = other.type_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.hasHnswM()) {
setHnswM(other.getHnswM());
}
if (other.hasHnswEfConstruction()) {
setHnswEfConstruction(other.getHnswEfConstruction());
}
if (other.hasMergeWorkers()) {
setMergeWorkers(other.getMergeWorkers());
}
if (other.hasQuantizedConfidenceInterval()) {
setQuantizedConfidenceInterval(other.getQuantizedConfidenceInterval());
}
if (other.hasQuantizedBits()) {
setQuantizedBits(other.getQuantizedBits());
}
if (other.hasQuantizedCompress()) {
setQuantizedCompress(other.getQuantizedCompress());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
type_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
hnswM_ = input.readInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
hnswEfConstruction_ = input.readInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
mergeWorkers_ = input.readInt32();
bitField0_ |= 0x00000008;
break;
} // case 32
case 45: {
quantizedConfidenceInterval_ = input.readFloat();
bitField0_ |= 0x00000010;
break;
} // case 45
case 48: {
quantizedBits_ = input.readInt32();
bitField0_ |= 0x00000020;
break;
} // case 48
case 56: {
quantizedCompress_ = input.readBool();
bitField0_ |= 0x00000040;
break;
} // case 56
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object type_ = "";
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return Whether the type field is set.
*/
public boolean hasType() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return The type.
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return The bytes for type.
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
type_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @return This builder for chaining.
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* The vector indexing type, supports 'hnsw' and 'hnsw_scalar_quantized', default: hnsw
*
*
* optional string type = 1;
* @param value The bytes for type to set.
* @return This builder for chaining.
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
type_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private int hnswM_ ;
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @return Whether the hnswM field is set.
*/
@java.lang.Override
public boolean hasHnswM() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @return The hnswM.
*/
@java.lang.Override
public int getHnswM() {
return hnswM_;
}
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @param value The hnswM to set.
* @return This builder for chaining.
*/
public Builder setHnswM(int value) {
hnswM_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The number of neighbors each node will be connected to in the HNSW graph, default: 16
*
*
* optional int32 hnsw_m = 2;
* @return This builder for chaining.
*/
public Builder clearHnswM() {
bitField0_ = (bitField0_ & ~0x00000002);
hnswM_ = 0;
onChanged();
return this;
}
private int hnswEfConstruction_ ;
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @return Whether the hnswEfConstruction field is set.
*/
@java.lang.Override
public boolean hasHnswEfConstruction() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @return The hnswEfConstruction.
*/
@java.lang.Override
public int getHnswEfConstruction() {
return hnswEfConstruction_;
}
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @param value The hnswEfConstruction to set.
* @return This builder for chaining.
*/
public Builder setHnswEfConstruction(int value) {
hnswEfConstruction_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* The number of candidates to track while assembling the list of nearest neighbors for each new node, default: 100
*
*
* optional int32 hnsw_ef_construction = 3;
* @return This builder for chaining.
*/
public Builder clearHnswEfConstruction() {
bitField0_ = (bitField0_ & ~0x00000004);
hnswEfConstruction_ = 0;
onChanged();
return this;
}
private int mergeWorkers_ ;
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @return Whether the mergeWorkers field is set.
*/
@java.lang.Override
public boolean hasMergeWorkers() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @return The mergeWorkers.
*/
@java.lang.Override
public int getMergeWorkers() {
return mergeWorkers_;
}
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @param value The mergeWorkers to set.
* @return This builder for chaining.
*/
public Builder setMergeWorkers(int value) {
mergeWorkers_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* Number of threads to use for merging vector data, default: 1
*
*
* optional int32 merge_workers = 4;
* @return This builder for chaining.
*/
public Builder clearMergeWorkers() {
bitField0_ = (bitField0_ & ~0x00000008);
mergeWorkers_ = 0;
onChanged();
return this;
}
private float quantizedConfidenceInterval_ ;
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @return Whether the quantizedConfidenceInterval field is set.
*/
@java.lang.Override
public boolean hasQuantizedConfidenceInterval() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @return The quantizedConfidenceInterval.
*/
@java.lang.Override
public float getQuantizedConfidenceInterval() {
return quantizedConfidenceInterval_;
}
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @param value The quantizedConfidenceInterval to set.
* @return This builder for chaining.
*/
public Builder setQuantizedConfidenceInterval(float value) {
quantizedConfidenceInterval_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
* The confidenceInterval for scalar quantizing the vectors. When unset, it is calculated based on the vector dimension.
* When `0`, the quantiles are dynamically determined by sampling many confidence intervals and determining the most accurate pair.
* Otherwise, the value must be between 0.9 and 1.0 (both inclusive). default: unset
*
*
* optional float quantized_confidence_interval = 5;
* @return This builder for chaining.
*/
public Builder clearQuantizedConfidenceInterval() {
bitField0_ = (bitField0_ & ~0x00000010);
quantizedConfidenceInterval_ = 0F;
onChanged();
return this;
}
private int quantizedBits_ ;
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @return Whether the quantizedBits field is set.
*/
@java.lang.Override
public boolean hasQuantizedBits() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @return The quantizedBits.
*/
@java.lang.Override
public int getQuantizedBits() {
return quantizedBits_;
}
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @param value The quantizedBits to set.
* @return This builder for chaining.
*/
public Builder setQuantizedBits(int value) {
quantizedBits_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
* The number of bits to use for quantizing the vectors. It can have the following values:
* 4 - half byte
* 7 - signed byte (default)
* 8 - unsigned byte
*
*
* optional int32 quantized_bits = 6;
* @return This builder for chaining.
*/
public Builder clearQuantizedBits() {
bitField0_ = (bitField0_ & ~0x00000020);
quantizedBits_ = 0;
onChanged();
return this;
}
private boolean quantizedCompress_ ;
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @return Whether the quantizedCompress field is set.
*/
@java.lang.Override
public boolean hasQuantizedCompress() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @return The quantizedCompress.
*/
@java.lang.Override
public boolean getQuantizedCompress() {
return quantizedCompress_;
}
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @param value The quantizedCompress to set.
* @return This builder for chaining.
*/
public Builder setQuantizedCompress(boolean value) {
quantizedCompress_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
* Whether to compress the vectors, if true, the vectors that are quantized with <= 4 bits will be compressed into
* a single byte. If false, the vectors will be stored as is. This provides a trade-off of memory usage and speed. default: false
*
*
* optional bool quantized_compress = 7;
* @return This builder for chaining.
*/
public Builder clearQuantizedCompress() {
bitField0_ = (bitField0_ & ~0x00000040);
quantizedCompress_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:luceneserver.VectorIndexingOptions)
}
// @@protoc_insertion_point(class_scope:luceneserver.VectorIndexingOptions)
private static final com.yelp.nrtsearch.server.grpc.VectorIndexingOptions DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.yelp.nrtsearch.server.grpc.VectorIndexingOptions();
}
public static com.yelp.nrtsearch.server.grpc.VectorIndexingOptions getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public VectorIndexingOptions parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.yelp.nrtsearch.server.grpc.VectorIndexingOptions getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}