Package com.hazelcast.config.vector
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 Summary
Modifier and TypeFieldDescriptionstatic final int
The default number of backupsstatic final int
The maximum number of backupsstatic final int
The minimum number of backups -
Constructor Summary
ConstructorDescriptionCreates a new, emptyVectorCollectionConfig
.Constructs a newVectorCollectionConfig
instance 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.boolean
int
Returns the asynchronous backup count for thisVectorCollection
.int
Returns the backupCount for thisVectorCollection
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.Gets theMergePolicyConfig
for the data structure.getName()
Returns the name of this VectorCollectionReturns the split brain protection name for operations of the data structure.int
Returns the total number of backups: backupCount plus asyncBackupCount.Retrieves the list of vector index configurations associated with this vector collection configuration.int
hashCode()
void
Reads 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 theMergePolicyConfig
for the data structure.Sets the name of the VectorCollection.setSplitBrainProtectionName
(String splitBrainProtectionName) Sets the split brain protection name for operations of the data structure.void
setVectorIndexConfigs
(List<VectorIndexConfig> vectorIndexConfigs) Sets the list ofVectorIndexConfig
instances for this vector collection configuration.toString()
void
Writes 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 newVectorCollectionConfig
instance by copying the values from the provided configuration.- Parameters:
config
- TheVectorCollectionConfig
instance to copy. It serves as the source of values for the new configuration.
-
-
Method Details
-
setName
Sets the name of the VectorCollection.- Specified by:
setName
in interfaceNamedConfig
- Parameters:
name
- the name to set for this VectorCollection.
-
getName
Returns the name of this VectorCollection- Specified by:
getName
in 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 ofVectorIndexConfig
instances for this vector collection configuration. Clears the existing vector index configurations and replaces them with the provided list.- Parameters:
vectorIndexConfigs
- The list ofVectorIndexConfig
instances to set.
-
getBackupCount
public int getBackupCount()Returns the backupCount for thisVectorCollection
- Returns:
- the backupCount for this
VectorCollection
- Since:
- 6.0
- 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:
- 6.0
- See Also:
-
getAsyncBackupCount
public int getAsyncBackupCount()Returns the asynchronous backup count for thisVectorCollection
.- Returns:
- the asynchronous backup count
- Since:
- 6.0
- 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:
- 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
Returns the split brain protection name for operations of the data structure.- Specified by:
getSplitBrainProtectionName
in interfaceSplitBrainPolicyAwareConfig
- 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 interfaceSplitBrainPolicyAwareConfig
- Parameters:
splitBrainProtectionName
- the split brain protection name- Returns:
- this configuration
- Since:
- 6.0
-
getMergePolicyConfig
Gets theMergePolicyConfig
for the data structure.- Specified by:
getMergePolicyConfig
in interfaceSplitBrainPolicyAwareConfig
- Returns:
- the
MergePolicyConfig
for the data structure - Since:
- 6.0
-
setMergePolicyConfig
Sets theMergePolicyConfig
for the data structure.- Specified by:
setMergePolicyConfig
in interfaceSplitBrainPolicyAwareConfig
- Returns:
- this configuration
- Since:
- 6.0
-
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
-
toString
-
equals
-
hashCode
public int hashCode()
-