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
Modifier and TypeFieldDescriptionstatic final int
Default efConstruction valuestatic final int
Default max degree valuestatic final boolean
Default value of whether deduplication is enabled -
Constructor Summary
ConstructorDescriptionConstructs an empty VectorIndexConfig.VectorIndexConfig
(VectorIndexConfig config) Constructs a newVectorIndexConfig
instance 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 TypeMethodDescriptionboolean
int
Returns type identifier for this class.int
Retrieves the dimension of this vector index configuration.int
Retrieves the size of the dynamic list search to use during index time.int
Returns DataSerializableFactory factory ID for this class.int
Retrieves the maximum number of connections a node can have.Retrieves the metric of this vector index configuration.getName()
Returns the name of this vector indexint
hashCode()
boolean
Checks if deduplication is enabled.void
Reads 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()
void
Writes 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 newVectorIndexConfig
instance by copying the values from the provided configuration.- Parameters:
config
- TheVectorIndexConfig
instance 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:
setName
in interfaceNamedConfig
- Parameters:
name
- the name to set for this vector index.
-
getName
Returns the name of this vector index- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of the vector index
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
equals
-
hashCode
public int hashCode() -
toString
-