Class ReplicatedMapConfig

java.lang.Object
com.hazelcast.config.ReplicatedMapConfig
All Implemented Interfaces:
NamedConfig, UserCodeNamespaceAwareConfig<ReplicatedMapConfig>, DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned

public class ReplicatedMapConfig extends Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned, UserCodeNamespaceAwareConfig<ReplicatedMapConfig>
Contains the configuration for an ReplicatedMap
  • Field Details

    • DEFAULT_IN_MEMORY_FORMAT

      public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
      Default value of In-memory format
    • DEFAULT_ASNYC_FILLUP

      public static final boolean DEFAULT_ASNYC_FILLUP
      Default value of asynchronous fill up
      See Also:
  • Constructor Details

    • ReplicatedMapConfig

      public ReplicatedMapConfig()
    • ReplicatedMapConfig

      public ReplicatedMapConfig(String name)
      Creates a ReplicatedMapConfig with the given name.
      Parameters:
      name - the name of the ReplicatedMap
    • ReplicatedMapConfig

      public ReplicatedMapConfig(ReplicatedMapConfig replicatedMapConfig)
  • Method Details

    • getName

      public String getName()
      Returns the name of this ReplicatedMap.
      Specified by:
      getName in interface NamedConfig
      Returns:
      the name of the ReplicatedMap
    • setName

      public ReplicatedMapConfig setName(String name)
      Sets the name of this ReplicatedMap.
      Specified by:
      setName in interface NamedConfig
      Parameters:
      name - the name of the ReplicatedMap
      Returns:
      the current replicated map config instance
    • getInMemoryFormat

      public InMemoryFormat getInMemoryFormat()
      Data type used to store entries.

      Possible values:

      • BINARY: keys and values are stored as binary data
      • OBJECT (default): values are stored in their object forms
      • NATIVE: keys and values are stored in native memory
      Returns:
      Data type used to store entries
    • setInMemoryFormat

      public ReplicatedMapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
      Data type used to store entries.

      Possible values:

      • BINARY: keys and values are stored as binary data
      • OBJECT (default): values are stored in their object forms
      • NATIVE: keys and values are stored in native memory
      Parameters:
      inMemoryFormat - Data type used to store entries
      Returns:
      the current replicated map config instance
    • getListenerConfigs

      public List<ListenerConfig> getListenerConfigs()
    • setListenerConfigs

      public ReplicatedMapConfig setListenerConfigs(List<ListenerConfig> listenerConfigs)
    • addEntryListenerConfig

      public ReplicatedMapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
    • isAsyncFillup

      public boolean isAsyncFillup()
      True if the replicated map is available for reads before the initial replication is completed, false otherwise. Default is true. If false, no Exception will be thrown when the replicated map is not yet ready, but `null` values can be seen until the initial replication is completed.
      Returns:
      true if the replicated map is available for reads before the initial replication is completed, false otherwise
    • setAsyncFillup

      public ReplicatedMapConfig setAsyncFillup(boolean asyncFillup)
      True if the replicated map is available for reads before the initial replication is completed, false otherwise. Default is true. If false, no Exception will be thrown when the replicated map is not yet ready, but `null` values can be seen until the initial replication is completed.
      Parameters:
      asyncFillup - true if the replicated map is available for reads before the initial replication is completed, false otherwise
      Returns:
      this configuration
    • isStatisticsEnabled

      public boolean isStatisticsEnabled()
      Checks if statistics are enabled for this replicated map.
      Returns:
      true if statistics are enabled, false otherwise
    • setStatisticsEnabled

      public ReplicatedMapConfig setStatisticsEnabled(boolean statisticsEnabled)
      Sets statistics to enabled or disabled for this replicated map.
      Parameters:
      statisticsEnabled - true to enable replicated map statistics, false to disable
      Returns:
      the current replicated map config instance
    • getSplitBrainProtectionName

      public String getSplitBrainProtectionName()
      Returns the split brain protection name for operations.
      Returns:
      the split brain protection name
    • setSplitBrainProtectionName

      public ReplicatedMapConfig setSplitBrainProtectionName(String splitBrainProtectionName)
      Sets the split brain protection name for operations.
      Parameters:
      splitBrainProtectionName - the split brain protection name
      Returns:
      the updated configuration
    • getMergePolicyConfig

      public MergePolicyConfig getMergePolicyConfig()
      Gets the MergePolicyConfig for this replicated map.
      Returns:
      the MergePolicyConfig for this replicated map
    • setMergePolicyConfig

      public ReplicatedMapConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
      Sets the MergePolicyConfig for this replicated map.
      Returns:
      the updated replicated map configuration
    • getUserCodeNamespace

      @Nullable public String getUserCodeNamespace()
      Retrieve the User Code Deployment Namespace to be used for ClassLoader awareness during operations related to the structure associated with this configuration.
      Specified by:
      getUserCodeNamespace in interface UserCodeNamespaceAwareConfig<ReplicatedMapConfig>
      Returns:
      Namespace Name for use with the UserCodeNamespaceService, or null if there is no User Code Namespace to associate with.
    • setUserCodeNamespace

      public ReplicatedMapConfig setUserCodeNamespace(@Nullable String userCodeNamespace)
      Associates the provided Namespace Name with this structure for ClassLoader awareness.

      The behaviour of setting this to null is outlined in the documentation for UserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.

      Specified by:
      setUserCodeNamespace in interface UserCodeNamespaceAwareConfig<ReplicatedMapConfig>
      Parameters:
      userCodeNamespace - The ID of the Namespace to associate with this structure.
      Returns:
      the updated ReplicatedMapConfig instance
      Since:
      5.4
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
    • 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.
    • equals

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

      public final int hashCode()
      Overrides:
      hashCode in class Object