Package com.hazelcast.config
Class MultiMapConfig
java.lang.Object
com.hazelcast.config.MultiMapConfig
- All Implemented Interfaces:
NamedConfig,UserCodeNamespaceAwareConfig<MultiMapConfig>,DataSerializable,IdentifiedDataSerializable,com.hazelcast.nio.serialization.impl.Versioned
public class MultiMapConfig
extends Object
implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned, UserCodeNamespaceAwareConfig<MultiMapConfig>
Configuration for MultiMap.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of value collection -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default number of asynchronous backups for this MultiMap.static final intThe default number of synchronous backups for this MultiMap.static final MultiMapConfig.ValueCollectionTypeDefault value collection type of this MultiMap.Fields inherited from interface com.hazelcast.config.UserCodeNamespaceAwareConfig
DEFAULT_NAMESPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEntryListenerConfig(EntryListenerConfig listenerConfig) Adds an entry listener to this MultiMap (listens for when entries are added or removed).final booleanintGets the number of asynchronous backups for this MultiMap.intGets the number of synchronous backups for this MultiMap.intReturns type identifier for this class.Gets the list of entry listeners (listens for when entries are added or removed) for this MultiMap.intReturns DataSerializableFactory factory ID for this class.Gets theMergePolicyConfigfor this MultiMap.getName()Gets the name of this MultiMap.Returns the split brain protection name for operations.intGets the total number of backups (synchronous + asynchronous) for this MultiMap.Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.Gets the collection type for the values of this MultiMap.final inthashCode()booleanisBinary()Checks if the MultiMap is in binary (serialized) form.booleanChecks to see if statistics are enabled for this MultiMap.voidReads fields from the input streamsetAsyncBackupCount(int asyncBackupCount) Sets the number of asynchronous backups.setBackupCount(int backupCount) Sets the number of synchronous backups.setBinary(boolean binary) Enables or disables binary (serialized) form for this MultiMap.setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) Sets the list of entry listeners (listens for when entries are added or removed) for this MultiMap.setMergePolicyConfig(MergePolicyConfig mergePolicyConfig) Sets theMergePolicyConfigfor this MultiMap.Sets the name of this MultiMap.setSplitBrainProtectionName(String splitBrainProtectionName) Sets the split brain protection name for operations.setStatisticsEnabled(boolean statisticsEnabled) Enables or disables statistics for this MultiMap.setUserCodeNamespace(String userCodeNamespace) Associates the provided Namespace Name with this structure forClassLoaderawareness.setValueCollectionType(MultiMapConfig.ValueCollectionType valueCollectionType) Sets the collection type for the values of this MultiMap.setValueCollectionType(String valueCollectionType) Sets the collection type for the values of this MultiMap.toString()voidWrites object fields to output stream
-
Field Details
-
DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_SYNC_BACKUP_COUNTThe default number of synchronous backups for this MultiMap.- See Also:
-
DEFAULT_ASYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNTThe default number of asynchronous backups for this MultiMap.- See Also:
-
DEFAULT_VALUE_COLLECTION_TYPE
Default value collection type of this MultiMap.
-
-
Constructor Details
-
MultiMapConfig
public MultiMapConfig() -
MultiMapConfig
-
MultiMapConfig
-
-
Method Details
-
getName
Gets the name of this MultiMap.- Specified by:
getNamein interfaceNamedConfig- Returns:
- the name of this MultiMap
-
setName
Sets the name of this MultiMap.- Specified by:
setNamein interfaceNamedConfig- Parameters:
name- the name to set for this MultiMap- Returns:
- this updated MultiMap configuration
-
getValueCollectionType
Gets the collection type for the values of this MultiMap.- Returns:
- the collection type for the values of this MultiMap
-
setValueCollectionType
Sets the collection type for the values of this MultiMap.- Parameters:
valueCollectionType- the collection type for the values of this MultiMap (SET or LIST)- Returns:
- this updated MultiMap configuration
-
setValueCollectionType
public MultiMapConfig setValueCollectionType(MultiMapConfig.ValueCollectionType valueCollectionType) Sets the collection type for the values of this MultiMap.- Parameters:
valueCollectionType- the collection type for the values of this MultiMap (SET or LIST)- Returns:
- this updated MultiMap configuration
-
addEntryListenerConfig
Adds an entry listener to this MultiMap (listens for when entries are added or removed).- Parameters:
listenerConfig- the entry listener to add to this MultiMap
-
getEntryListenerConfigs
Gets the list of entry listeners (listens for when entries are added or removed) for this MultiMap.- Returns:
- the list of entry listeners for this MultiMap
-
setEntryListenerConfigs
Sets the list of entry listeners (listens for when entries are added or removed) for this MultiMap.- Parameters:
listenerConfigs- the list of entry listeners for this MultiMap- Returns:
- this updated MultiMap configuration
-
isBinary
public boolean isBinary()Checks if the MultiMap is in binary (serialized) form.- Returns:
trueif the MultiMap is in binary (serialized) form,falseotherwise
-
setBinary
Enables or disables binary (serialized) form for this MultiMap.- Parameters:
binary-trueto set the MultiMap to binary (serialized) form,falseotherwise- Returns:
- this updated MultiMap configuration
-
getBackupCount
public int getBackupCount()Gets the number of synchronous backups for this MultiMap.- Returns:
- the number of synchronous backups for this MultiMap
-
setBackupCount
Sets the number of synchronous backups.- Parameters:
backupCount- the number of synchronous backups to set for this MultiMap- Returns:
- the current MultiMapConfig
- Throws:
IllegalArgumentException- if backupCount 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- See Also:
-
getAsyncBackupCount
public int getAsyncBackupCount()Gets the number of asynchronous backups for this MultiMap.- Returns:
- the number of asynchronous backups for this MultiMap
-
setAsyncBackupCount
Sets the number of asynchronous backups. 0 means no backups- Parameters:
asyncBackupCount- the number of asynchronous synchronous backups to set- Returns:
- the updated MultiMapConfig
- 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- See Also:
-
getTotalBackupCount
public int getTotalBackupCount()Gets the total number of backups (synchronous + asynchronous) for this MultiMap.- Returns:
- the total number of backups (synchronous + asynchronous) for this MultiMap
-
isStatisticsEnabled
public boolean isStatisticsEnabled()Checks to see if statistics are enabled for this MultiMap.- Returns:
trueif statistics are enabled for this MultiMap,falseotherwise
-
setStatisticsEnabled
Enables or disables statistics for this MultiMap.- Parameters:
statisticsEnabled-trueto enable statistics for this MultiMap,falseto disable- Returns:
- the updated MultiMapConfig
-
getSplitBrainProtectionName
Returns the split brain protection name for operations.- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
Sets the split brain protection name for operations.- Parameters:
splitBrainProtectionName- the split brain protection name- Returns:
- the updated configuration
-
getMergePolicyConfig
Gets theMergePolicyConfigfor this MultiMap.- Returns:
- the
MergePolicyConfigfor this MultiMap
-
setMergePolicyConfig
Sets theMergePolicyConfigfor this MultiMap.- Returns:
- the updated MultiMapConfig
-
getUserCodeNamespace
Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.- Specified by:
getUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<MultiMapConfig>- Returns:
- Namespace Name for use with the
UserCodeNamespaceService, ornullif there is no User Code Namespace to associate with.
-
setUserCodeNamespace
Associates the provided Namespace Name with this structure forClassLoaderawareness.The behaviour of setting this to
nullis outlined in the documentation forUserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.- Specified by:
setUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<MultiMapConfig>- Parameters:
userCodeNamespace- The ID of the Namespace to associate with this structure.- Returns:
- the updated
MultiMapConfiginstance - Since:
- 5.4
-
toString
-
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
-
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.
-
equals
-
hashCode
public final int hashCode()
-