Package com.hazelcast.config.vector
Class VectorIndexConfig
java.lang.Object
com.hazelcast.config.vector.VectorIndexConfig
- All Implemented Interfaces:
NamedConfig,DataSerializable,IdentifiedDataSerializable
@Beta
public class VectorIndexConfig
extends Object
implements NamedConfig, IdentifiedDataSerializable
Configuration for a vector index.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault efConstruction valuestatic final intDefault max degree valuestatic final booleanDefault value of whether deduplication is enabled -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty VectorIndexConfig.VectorIndexConfig(VectorIndexConfig config) Constructs a newVectorIndexConfiginstance by copying the values from the provided configuration.VectorIndexConfig(String indexName, Metric metric, int dimension) Constructs a VectorIndexConfig with the given parameters.VectorIndexConfig(String indexName, Metric metric, int dimension, int maxDegree, int efConstruction, boolean useDeduplication) Constructs a VectorIndexConfig object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns type identifier for this class.intRetrieves the dimension of this vector index configuration.intRetrieves the size of the dynamic list search to use during index time.intReturns DataSerializableFactory factory ID for this class.intRetrieves the maximum number of connections a node can have.Retrieves the metric of this vector index configuration.getName()Returns the name of this vector indexinthashCode()booleanChecks if deduplication is enabled.voidReads fields from the input streamsetDimension(int dimension) Sets the dimension of this vector index configuration.setEfConstruction(int efConstruction) Sets the size of the dynamic list search to use during index time.setMaxDegree(int maxDegree) Sets the maximum number of connections allowed per node.Sets the metric of this vector index configuration.Sets the name of the vector index.setUseDeduplication(boolean useDeduplication) Enables or disables deduplication.toString()voidWrites object fields to output stream
-
Field Details
-
DEFAULT_MAX_DEGREE
public static final int DEFAULT_MAX_DEGREEDefault max degree value- See Also:
-
DEFAULT_EF_CONSTRUCTION
public static final int DEFAULT_EF_CONSTRUCTIONDefault efConstruction value- See Also:
-
DEFAULT_USE_DEDUPLICATION
public static final boolean DEFAULT_USE_DEDUPLICATIONDefault value of whether deduplication is enabled- See Also:
-
-
Constructor Details
-
VectorIndexConfig
Constructs a VectorIndexConfig with the given parameters.- Parameters:
indexName- the name of the indexmetric- the distance metric of the indexdimension- the dimension of the index- Throws:
IllegalArgumentException- if the indexName is invalid.NullPointerException- if the metric is null.
-
VectorIndexConfig
public VectorIndexConfig(String indexName, Metric metric, int dimension, int maxDegree, int efConstruction, boolean useDeduplication) Constructs a VectorIndexConfig object with the specified parameters.- Parameters:
indexName- The name of the index.metric- The metric used for indexing.dimension- The dimension of the vectors to be indexed.maxDegree- The maximum number of connections allowed per node.efConstruction- The size of the dynamic list for search.useDeduplication- Whether to enable deduplication in the index.- Throws:
IllegalArgumentException- if the indexName is invalid.NullPointerException- if the metric is null.
-
VectorIndexConfig
public VectorIndexConfig()Constructs an empty VectorIndexConfig. -
VectorIndexConfig
Constructs a newVectorIndexConfiginstance by copying the values from the provided configuration.- Parameters:
config- TheVectorIndexConfiginstance to copy. It serves as the source of values for the new configuration.
-
-
Method Details
-
getMetric
Retrieves the metric of this vector index configuration.- Returns:
- the metric of the index
-
setMetric
Sets the metric of this vector index configuration.- Parameters:
metric- the metric to set- Returns:
- this VectorIndexConfig instance
-
getDimension
public int getDimension()Retrieves the dimension of this vector index configuration.- Returns:
- the dimension of the index
-
setDimension
Sets the dimension of this vector index configuration.- Parameters:
dimension- the dimension to set- Returns:
- this VectorIndexConfig instance
-
getMaxDegree
public int getMaxDegree()Retrieves the maximum number of connections a node can have.- Returns:
- The maximum number of connections allowed per node.
-
setMaxDegree
Sets the maximum number of connections allowed per node.- Parameters:
maxDegree- The maximum degree to set.- Returns:
- this VectorIndexConfig instance
-
getEfConstruction
public int getEfConstruction()Retrieves the size of the dynamic list search to use during index time.- Returns:
- the size of the dynamic list search.
-
setEfConstruction
Sets the size of the dynamic list search to use during index time.- Parameters:
efConstruction- the size of the dynamic list search.- Returns:
- this VectorIndexConfig instance
-
isUseDeduplication
public boolean isUseDeduplication()Checks if deduplication is enabled.- Returns:
- True if deduplication is enabled, false otherwise.
-
setUseDeduplication
Enables or disables deduplication.- Parameters:
useDeduplication- True to enable deduplication, false to disable.- Returns:
- this VectorIndexConfig instance
-
setName
Sets the name of the vector index.- Specified by:
setNamein interfaceNamedConfig- Parameters:
name- the name to set for this vector index.
-
getName
Returns the name of this vector index- Specified by:
getNamein interfaceNamedConfig- Returns:
- the name of the vector index
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
equals
-
hashCode
public int hashCode() -
toString
-