Package com.hazelcast.config.vector
Class VectorCollectionConfig
java.lang.Object
com.hazelcast.config.vector.VectorCollectionConfig
- All Implemented Interfaces:
NamedConfig,SplitBrainPolicyAwareConfig,UserCodeNamespaceAwareConfig<VectorCollectionConfig>,DataSerializable,IdentifiedDataSerializable,com.hazelcast.nio.serialization.impl.Versioned
@Beta
public class VectorCollectionConfig
extends Object
implements NamedConfig, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned, SplitBrainPolicyAwareConfig, UserCodeNamespaceAwareConfig<VectorCollectionConfig>
Configuration object for a vector collection.
- Since:
- 5.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default number of backupsstatic final intThe maximum number of backupsstatic final intThe minimum number of backupsFields inherited from interface com.hazelcast.config.UserCodeNamespaceAwareConfig
DEFAULT_NAMESPACE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, emptyVectorCollectionConfig.Constructs a newVectorCollectionConfiginstance by copying the values from the provided configuration.VectorCollectionConfig(String name) Constructs a VectorCollectionConfig with the given name. -
Method Summary
Modifier and TypeMethodDescriptionaddVectorIndexConfig(VectorIndexConfig vectorIndexConfig) Adds a vector index configuration to this vector collection configuration.booleanintReturns the asynchronous backup count for thisVectorCollection.intReturns the backupCount for thisVectorCollectionintReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.Gets theMergePolicyConfigfor the data structure.getName()Returns the name of this VectorCollectionReturns the split brain protection name for operations of the data structure.intReturns the total number of backups: backupCount plus asyncBackupCount.Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.Retrieves the list of vector index configurations associated with this vector collection configuration.inthashCode()voidReads fields from the input streamsetAsyncBackupCount(int asyncBackupCount) Sets the number of asynchronous backups. 0 means no backups.setBackupCount(int backupCount) Number of synchronous backups.setMergePolicyConfig(MergePolicyConfig mergePolicyConfig) Sets theMergePolicyConfigfor the data structure.Sets the name of the VectorCollection.setSplitBrainProtectionName(String splitBrainProtectionName) Sets the split brain protection name for operations of the data structure.setUserCodeNamespace(String userCodeNamespace) Associates the provided User Code Namespace Name with this structure forClassLoaderawareness.voidsetVectorIndexConfigs(List<VectorIndexConfig> vectorIndexConfigs) Sets the list ofVectorIndexConfiginstances for this vector collection configuration.toString()voidWrites object fields to output stream
-
Field Details
-
MIN_BACKUP_COUNT
public static final int MIN_BACKUP_COUNTThe minimum number of backups- See Also:
-
DEFAULT_BACKUP_COUNT
public static final int DEFAULT_BACKUP_COUNTThe default number of backups- See Also:
-
MAX_BACKUP_COUNT
public static final int MAX_BACKUP_COUNTThe maximum number of backups- See Also:
-
-
Constructor Details
-
VectorCollectionConfig
public VectorCollectionConfig()Creates a new, emptyVectorCollectionConfig. -
VectorCollectionConfig
Constructs a VectorCollectionConfig with the given name.- Parameters:
name- the name of the vector collection
-
VectorCollectionConfig
Constructs a newVectorCollectionConfiginstance by copying the values from the provided configuration.- Parameters:
config- TheVectorCollectionConfiginstance to copy. It serves as the source of values for the new configuration.
-
-
Method Details
-
setName
Sets the name of the VectorCollection.- Specified by:
setNamein interfaceNamedConfig- Parameters:
name- the name to set for this VectorCollection.
-
getName
Returns the name of this VectorCollection- Specified by:
getNamein interfaceNamedConfig- Returns:
- the name of the VectorCollection
-
addVectorIndexConfig
Adds a vector index configuration to this vector collection configuration.- Parameters:
vectorIndexConfig- the vector index configuration to add- Returns:
- this VectorCollectionConfig instance
-
getVectorIndexConfigs
Retrieves the list of vector index configurations associated with this vector collection configuration.- Returns:
- the list of vector index configurations
-
setVectorIndexConfigs
Sets the list ofVectorIndexConfiginstances for this vector collection configuration. Clears the existing vector index configurations and replaces them with the provided list.- Parameters:
vectorIndexConfigs- The list ofVectorIndexConfiginstances to set.
-
getBackupCount
public int getBackupCount()Returns the backupCount for thisVectorCollection- Returns:
- the backupCount for this
VectorCollection - Since:
- 5.6
- See Also:
-
setBackupCount
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 thisVectorCollection- Returns:
- the updated
VectorCollectionConfig - Since:
- 5.6
- See Also:
-
getAsyncBackupCount
public int getAsyncBackupCount()Returns the asynchronous backup count for thisVectorCollection.- Returns:
- the asynchronous backup count
- Since:
- 5.6
- See Also:
-
setAsyncBackupCount
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:
- 5.6
- See Also:
-
getTotalBackupCount
public int getTotalBackupCount()Returns the total number of backups: backupCount plus asyncBackupCount.- Returns:
- the total number of backups: synchronous + asynchronous
- Since:
- 5.6
-
getSplitBrainProtectionName
Returns the split brain protection name for operations of the data structure.- Specified by:
getSplitBrainProtectionNamein interfaceSplitBrainPolicyAwareConfig- Returns:
- the split brain protection name
- Since:
- 5.6
-
setSplitBrainProtectionName
public VectorCollectionConfig setSplitBrainProtectionName(@Nullable String splitBrainProtectionName) Sets the split brain protection name for operations of the data structure.- Specified by:
setSplitBrainProtectionNamein interfaceSplitBrainPolicyAwareConfig- Parameters:
splitBrainProtectionName- the split brain protection name- Returns:
- this configuration
- Since:
- 5.6
-
getMergePolicyConfig
Gets theMergePolicyConfigfor the data structure.- Specified by:
getMergePolicyConfigin interfaceSplitBrainPolicyAwareConfig- Returns:
- the
MergePolicyConfigfor the data structure - Since:
- 5.6
-
setMergePolicyConfig
Sets theMergePolicyConfigfor the data structure.- Specified by:
setMergePolicyConfigin interfaceSplitBrainPolicyAwareConfig- Returns:
- this configuration
- Since:
- 5.6
-
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
-
toString
-
equals
-
hashCode
public int hashCode() -
getUserCodeNamespace
Description copied from interface:UserCodeNamespaceAwareConfigRetrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.- Specified by:
getUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<VectorCollectionConfig>- Returns:
- Namespace Name for use with the
UserCodeNamespaceService, ornullif there is no User Code Namespace to associate with. - Since:
- 5.6
-
setUserCodeNamespace
Description copied from interface:UserCodeNamespaceAwareConfigAssociates the provided User Code Namespace Name with this structure forClassLoaderawareness.The behaviour of setting this to
nullis outlined in the documentation forUserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.- Specified by:
setUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<VectorCollectionConfig>- Parameters:
userCodeNamespace- The ID of the User Code Namespace to associate with this structure.- Returns:
- the updated
UserCodeNamespaceAwareConfigconfig instance - Since:
- 5.6
-