Class VectorCollectionConfig

java.lang.Object
com.hazelcast.config.vector.VectorCollectionConfig
All Implemented Interfaces:
NamedConfig, SplitBrainPolicyAwareConfig, DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned

@Beta public class VectorCollectionConfig extends Object implements NamedConfig, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, SplitBrainPolicyAwareConfig
Configuration object for a vector collection.
Since:
5.5
  • Field Details

    • MIN_BACKUP_COUNT

      public static final int MIN_BACKUP_COUNT
      The minimum number of backups
      See Also:
    • DEFAULT_BACKUP_COUNT

      public static final int DEFAULT_BACKUP_COUNT
      The default number of backups
      See Also:
    • MAX_BACKUP_COUNT

      public static final int MAX_BACKUP_COUNT
      The maximum number of backups
      See Also:
  • Constructor Details

    • VectorCollectionConfig

      public VectorCollectionConfig()
      Creates a new, empty VectorCollectionConfig.
    • VectorCollectionConfig

      public VectorCollectionConfig(String name)
      Constructs a VectorCollectionConfig with the given name.
      Parameters:
      name - the name of the vector collection
    • VectorCollectionConfig

      public VectorCollectionConfig(VectorCollectionConfig config)
      Constructs a new VectorCollectionConfig instance by copying the values from the provided configuration.
      Parameters:
      config - The VectorCollectionConfig instance to copy. It serves as the source of values for the new configuration.
  • Method Details

    • setName

      public VectorCollectionConfig setName(String name)
      Sets the name of the VectorCollection.
      Specified by:
      setName in interface NamedConfig
      Parameters:
      name - the name to set for this VectorCollection.
    • getName

      public String getName()
      Returns the name of this VectorCollection
      Specified by:
      getName in interface NamedConfig
      Returns:
      the name of the VectorCollection
    • addVectorIndexConfig

      public VectorCollectionConfig addVectorIndexConfig(VectorIndexConfig vectorIndexConfig)
      Adds a vector index configuration to this vector collection configuration.
      Parameters:
      vectorIndexConfig - the vector index configuration to add
      Returns:
      this VectorCollectionConfig instance
    • getVectorIndexConfigs

      public List<VectorIndexConfig> getVectorIndexConfigs()
      Retrieves the list of vector index configurations associated with this vector collection configuration.
      Returns:
      the list of vector index configurations
    • setVectorIndexConfigs

      public void setVectorIndexConfigs(List<VectorIndexConfig> vectorIndexConfigs)
      Sets the list of VectorIndexConfig instances for this vector collection configuration. Clears the existing vector index configurations and replaces them with the provided list.
      Parameters:
      vectorIndexConfigs - The list of VectorIndexConfig instances to set.
    • getBackupCount

      public int getBackupCount()
      Returns the backupCount for this VectorCollection
      Returns:
      the backupCount for this VectorCollection
      Since:
      6.0
      See Also:
    • setBackupCount

      public VectorCollectionConfig setBackupCount(int backupCount)
      Number of synchronous backups. For example, if 1 is set as the backup count, then all entries of the vector collection will be copied to another JVM for fail-safety. 0 means no sync backup.
      Parameters:
      backupCount - the number of synchronous backups to set for this VectorCollection
      Returns:
      the updated VectorCollectionConfig
      Since:
      6.0
      See Also:
    • getAsyncBackupCount

      public int getAsyncBackupCount()
      Returns the asynchronous backup count for this VectorCollection.
      Returns:
      the asynchronous backup count
      Since:
      6.0
      See Also:
    • setAsyncBackupCount

      public VectorCollectionConfig setAsyncBackupCount(int asyncBackupCount)
      Sets the number of asynchronous backups. 0 means no backups.
      Parameters:
      asyncBackupCount - the number of asynchronous synchronous backups to set
      Returns:
      the updated VectorCollectionConfig
      Throws:
      IllegalArgumentException - if asyncBackupCount smaller than 0, or larger than the maximum number of backup or the sum of the backups and async backups is larger than the maximum number of backups
      Since:
      6.0
      See Also:
    • getTotalBackupCount

      public int getTotalBackupCount()
      Returns the total number of backups: backupCount plus asyncBackupCount.
      Returns:
      the total number of backups: synchronous + asynchronous
      Since:
      6.0
    • getSplitBrainProtectionName

      public String getSplitBrainProtectionName()
      Returns the split brain protection name for operations of the data structure.
      Specified by:
      getSplitBrainProtectionName in interface SplitBrainPolicyAwareConfig
      Returns:
      the split brain protection name
      Since:
      6.0
    • setSplitBrainProtectionName

      public VectorCollectionConfig setSplitBrainProtectionName(@Nullable String splitBrainProtectionName)
      Sets the split brain protection name for operations of the data structure.
      Specified by:
      setSplitBrainProtectionName in interface SplitBrainPolicyAwareConfig
      Parameters:
      splitBrainProtectionName - the split brain protection name
      Returns:
      this configuration
      Since:
      6.0
    • getMergePolicyConfig

      public MergePolicyConfig getMergePolicyConfig()
      Gets the MergePolicyConfig for the data structure.
      Specified by:
      getMergePolicyConfig in interface SplitBrainPolicyAwareConfig
      Returns:
      the MergePolicyConfig for the data structure
      Since:
      6.0
    • setMergePolicyConfig

      public VectorCollectionConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
      Sets the MergePolicyConfig for the data structure.
      Specified by:
      setMergePolicyConfig in interface SplitBrainPolicyAwareConfig
      Returns:
      this configuration
      Since:
      6.0
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException 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 interface IdentifiedDataSerializable
      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 interface IdentifiedDataSerializable
      Returns:
      type ID
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object