public class MapConfig extends Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned
IMap
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKUP_COUNT
The default number of backups
|
static CacheDeserializedValues |
DEFAULT_CACHED_DESERIALIZED_VALUES
We want to cache values only when an index is defined.
|
static boolean |
DEFAULT_ENTRY_STATS_ENABLED
Default value of whether per entry statistics are enabled or not
|
static EvictionPolicy |
DEFAULT_EVICTION_POLICY
Default eviction policy
|
static InMemoryFormat |
DEFAULT_IN_MEMORY_FORMAT
Default In-Memory format is binary.
|
static int |
DEFAULT_MAX_IDLE_SECONDS
The number of default time to wait eviction in seconds.
|
static int |
DEFAULT_MAX_SIZE
Default max size.
|
static MaxSizePolicy |
DEFAULT_MAX_SIZE_POLICY
Default max size policy
|
static MetadataPolicy |
DEFAULT_METADATA_POLICY
Default metadata policy
|
static boolean |
DEFAULT_STATISTICS_ENABLED
Default value of whether statistics are enabled or not
|
static int |
DEFAULT_TTL_SECONDS
The number of default Time to Live in seconds.
|
static int |
DISABLED_TTL_SECONDS
The number of Time to Live that represents disabling TTL.
|
static int |
MAX_BACKUP_COUNT
The maximum number of backups
|
static int |
MIN_BACKUP_COUNT
The minimum number of backups
|
Constructor and Description |
---|
MapConfig() |
MapConfig(MapConfig config) |
MapConfig(String name) |
Modifier and Type | Method and Description |
---|---|
MapConfig |
addAttributeConfig(AttributeConfig attributeConfig) |
MapConfig |
addEntryListenerConfig(EntryListenerConfig listenerConfig) |
MapConfig |
addIndexConfig(IndexConfig indexConfig) |
MapConfig |
addMapPartitionLostListenerConfig(MapPartitionLostListenerConfig listenerConfig) |
MapConfig |
addQueryCacheConfig(QueryCacheConfig queryCacheConfig)
Adds a new
QueryCacheConfig to this MapConfig . |
boolean |
equals(Object o) |
int |
getAsyncBackupCount()
Returns the asynchronous backup count for this
IMap . |
List<AttributeConfig> |
getAttributeConfigs() |
int |
getBackupCount()
Returns the backupCount for this
IMap |
CacheDeserializedValues |
getCacheDeserializedValues()
Get current value cache settings
|
int |
getClassId()
Returns type identifier for this class.
|
DataPersistenceConfig |
getDataPersistenceConfig()
Gets the
DataPersistenceConfig for this MapConfig |
List<EntryListenerConfig> |
getEntryListenerConfigs() |
EventJournalConfig |
getEventJournalConfig()
Gets the
EventJournalConfig for this MapConfig |
EvictionConfig |
getEvictionConfig()
Gets the
EvictionConfig instance of the eviction
configuration for this IMap . |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
HotRestartConfig |
getHotRestartConfig()
Gets the
HotRestartConfig for this MapConfig |
List<IndexConfig> |
getIndexConfigs() |
InMemoryFormat |
getInMemoryFormat()
Returns the data type that will be used for storing records.
|
MapStoreConfig |
getMapStoreConfig()
Returns the map store configuration
|
int |
getMaxIdleSeconds()
Returns the maximum number of seconds for each entry to stay idle in the map.
|
MergePolicyConfig |
getMergePolicyConfig()
Gets the
MergePolicyConfig for this map. |
MerkleTreeConfig |
getMerkleTreeConfig()
Gets the
MerkleTreeConfig for this MapConfig |
MetadataPolicy |
getMetadataPolicy()
Returns
MetadataPolicy for this map. |
String |
getName()
Returns the name of this
IMap |
NearCacheConfig |
getNearCacheConfig()
Returns the Near Cache configuration
|
List<PartitioningAttributeConfig> |
getPartitioningAttributeConfigs()
Get Partition Attribute configs used for creation of
AttributePartitioningStrategy |
PartitioningStrategyConfig |
getPartitioningStrategyConfig() |
List<MapPartitionLostListenerConfig> |
getPartitionLostListenerConfigs() |
List<QueryCacheConfig> |
getQueryCacheConfigs()
Returns all
QueryCacheConfig instances defined on this MapConfig . |
String |
getSplitBrainProtectionName() |
TieredStoreConfig |
getTieredStoreConfig()
Gets the
TieredStoreConfig for this MapConfig |
int |
getTimeToLiveSeconds()
Returns the maximum number of seconds for each entry to stay in the map.
|
int |
getTotalBackupCount()
Returns the total number of backups: backupCount plus asyncBackupCount.
|
WanReplicationRef |
getWanReplicationRef()
Gets the WAN target replication reference.
|
int |
hashCode() |
boolean |
isNearCacheEnabled()
Checks if Near Cache is enabled.
|
boolean |
isPerEntryStatsEnabled()
Checks if entry level statistics are enabled for this map.
|
boolean |
isReadBackupData()
Checks if read-backup-data (reading local backup entries) is enabled for this map.
|
boolean |
isStatisticsEnabled()
Checks if statistics are enabled for this map.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
MapConfig |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
MapConfig |
setAttributeConfigs(List<AttributeConfig> attributeConfigs) |
MapConfig |
setBackupCount(int backupCount)
Number of synchronous backups.
|
MapConfig |
setCacheDeserializedValues(CacheDeserializedValues cacheDeserializedValues)
Configure de-serialized value caching.
|
MapConfig |
setDataPersistenceConfig(DataPersistenceConfig dataPersistenceConfig)
Sets the
DataPersistenceConfig for this MapConfig |
MapConfig |
setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) |
MapConfig |
setEventJournalConfig(EventJournalConfig eventJournalConfig)
Sets the
EventJournalConfig for this MapConfig |
MapConfig |
setEvictionConfig(EvictionConfig evictionConfig)
Sets the
EvictionConfig instance for eviction
configuration for this IMap . |
MapConfig |
setHotRestartConfig(HotRestartConfig hotRestartConfig)
Deprecated.
since 5.0 use
setDataPersistenceConfig(DataPersistenceConfig) |
MapConfig |
setIndexConfigs(List<IndexConfig> indexConfigs) |
MapConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Binary type that will be used for storing records.
|
MapConfig |
setMapStoreConfig(MapStoreConfig mapStoreConfig)
Sets the map store configuration
|
MapConfig |
setMaxIdleSeconds(int maxIdleSeconds)
Maximum number of seconds for each entry to stay idle in the
map.
|
MapConfig |
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets the
MergePolicyConfig for this map. |
MapConfig |
setMerkleTreeConfig(MerkleTreeConfig merkleTreeConfig)
Sets the
MerkleTreeConfig for this MapConfig |
MapConfig |
setMetadataPolicy(MetadataPolicy metadataPolicy)
Sets the metadata policy.
|
MapConfig |
setName(String name)
Sets the name of the
IMap |
MapConfig |
setNearCacheConfig(NearCacheConfig nearCacheConfig)
Sets the Near Cache configuration
|
MapConfig |
setPartitioningAttributeConfigs(List<PartitioningAttributeConfig> partitioningAttributeConfigs) |
MapConfig |
setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig) |
MapConfig |
setPartitionLostListenerConfigs(List<MapPartitionLostListenerConfig> listenerConfigs) |
MapConfig |
setPerEntryStatsEnabled(boolean perEntryStatsEnabled)
Set to enable/disable per entry statistics.
|
MapConfig |
setQueryCacheConfigs(List<QueryCacheConfig> queryCacheConfigs)
Sets
QueryCacheConfig instances to this MapConfig . |
MapConfig |
setReadBackupData(boolean readBackupData)
Sets read-backup-data (reading local backup entries) for this map.
|
MapConfig |
setSplitBrainProtectionName(String splitBrainProtectionName) |
MapConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Set to enable/disable map level statistics for this map.
|
MapConfig |
setTieredStoreConfig(TieredStoreConfig tieredStoreConfig)
Sets the
TieredStoreConfig for this MapConfig |
MapConfig |
setTimeToLiveSeconds(int timeToLiveSeconds)
The maximum number of seconds for each entry to stay in the map.
|
MapConfig |
setWanReplicationRef(WanReplicationRef wanReplicationRef)
Sets the WAN target replication reference.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int MIN_BACKUP_COUNT
public static final int DEFAULT_BACKUP_COUNT
public static final int MAX_BACKUP_COUNT
public static final int DISABLED_TTL_SECONDS
public static final int DEFAULT_TTL_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDS
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
public static final CacheDeserializedValues DEFAULT_CACHED_DESERIALIZED_VALUES
public static final MetadataPolicy DEFAULT_METADATA_POLICY
public static final boolean DEFAULT_STATISTICS_ENABLED
public static final boolean DEFAULT_ENTRY_STATS_ENABLED
public static final int DEFAULT_MAX_SIZE
public static final MaxSizePolicy DEFAULT_MAX_SIZE_POLICY
public static final EvictionPolicy DEFAULT_EVICTION_POLICY
public MapConfig()
public MapConfig(String name)
public MapConfig(MapConfig config)
public String getName()
IMap
getName
in interface NamedConfig
IMap
public MapConfig setName(String name)
IMap
setName
in interface NamedConfig
name
- the name to set for this IMap
public InMemoryFormat getInMemoryFormat()
public MapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
inMemoryFormat
- the record type to set for this IMap
IllegalArgumentException
- if inMemoryFormat is null
public EvictionConfig getEvictionConfig()
EvictionConfig
instance of the eviction
configuration for this IMap
.EvictionConfig
instance of the eviction configurationpublic MapConfig setEvictionConfig(EvictionConfig evictionConfig)
EvictionConfig
instance for eviction
configuration for this IMap
.evictionConfig
- the EvictionConfig
instance to set for the eviction configurationpublic int getBackupCount()
IMap
IMap
getAsyncBackupCount()
public MapConfig setBackupCount(int backupCount)
backupCount
- the number of synchronous backups to set for this IMap
setAsyncBackupCount(int)
public int getAsyncBackupCount()
IMap
.setBackupCount(int)
public MapConfig setAsyncBackupCount(int asyncBackupCount)
asyncBackupCount
- the number of asynchronous synchronous backups to setIllegalArgumentException
- 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 backupssetBackupCount(int)
,
getAsyncBackupCount()
public int getTotalBackupCount()
public int getTimeToLiveSeconds()
public MapConfig setTimeToLiveSeconds(int timeToLiveSeconds)
timeToLiveSeconds
- the timeToLiveSeconds to setpublic int getMaxIdleSeconds()
public MapConfig setMaxIdleSeconds(int maxIdleSeconds)
maxIdleSeconds
will get automatically evicted from the map. Entry
is touched if get()
, getAll()
, put()
or
containsKey()
is called. Any integer between 0
and Integer.MAX_VALUE
. 0
means infinite. Default
is 0
. The time precision is limited by 1 second. The
MaxIdle that less than 1 second can lead to unexpected behaviour.maxIdleSeconds
- the maxIdleSeconds (the maximum number
of seconds for each entry to stay idle in the map) to setpublic MapStoreConfig getMapStoreConfig()
public MapConfig setMapStoreConfig(MapStoreConfig mapStoreConfig)
mapStoreConfig
- the mapStoreConfig (map store configuration) to setpublic NearCacheConfig getNearCacheConfig()
public MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig)
nearCacheConfig
- the Near Cache configurationpublic MergePolicyConfig getMergePolicyConfig()
MergePolicyConfig
for this map.MergePolicyConfig
for this mappublic MapConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
MergePolicyConfig
for this map.
Note that you may need to enable per entry stats
via setPerEntryStatsEnabled(boolean)
to see all fields of entry view in your SplitBrainMergePolicy
implementation.public boolean isStatisticsEnabled()
true
if statistics are enabled, false
otherwisepublic MapConfig setStatisticsEnabled(boolean statisticsEnabled)
perEntryStatsEnabled
statisticsEnabled
- true
to
enable map statistics, false
to disablesetPerEntryStatsEnabled(boolean)
public boolean isPerEntryStatsEnabled()
true
if entry level statistics
are enabled, false
otherwisepublic MapConfig setPerEntryStatsEnabled(boolean perEntryStatsEnabled)
false
.
When you enable per entry stats, you can retrieve entry
level statistics such as hits, creation time, last access
time, last update time, last stored time for an entry.perEntryStatsEnabled
- true
to enable
entry level statistics, false
to disablepublic boolean isReadBackupData()
true
if read-backup-data is enabled, false
otherwisepublic MapConfig setReadBackupData(boolean readBackupData)
readBackupData
- true
to enable read-backup-data, false
to disablepublic WanReplicationRef getWanReplicationRef()
public MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)
wanReplicationRef
- the WAN target replication referencepublic MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
public List<EntryListenerConfig> getEntryListenerConfigs()
public MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)
public MapConfig addMapPartitionLostListenerConfig(MapPartitionLostListenerConfig listenerConfig)
public List<MapPartitionLostListenerConfig> getPartitionLostListenerConfigs()
public MapConfig setPartitionLostListenerConfigs(List<MapPartitionLostListenerConfig> listenerConfigs)
public MapConfig addIndexConfig(IndexConfig indexConfig)
public List<IndexConfig> getIndexConfigs()
public MapConfig setIndexConfigs(List<IndexConfig> indexConfigs)
public MapConfig addAttributeConfig(AttributeConfig attributeConfig)
public List<AttributeConfig> getAttributeConfigs()
public MapConfig setAttributeConfigs(List<AttributeConfig> attributeConfigs)
public MetadataPolicy getMetadataPolicy()
MetadataPolicy
for this map.MetadataPolicy
for this mappublic MapConfig setMetadataPolicy(MetadataPolicy metadataPolicy)
MetadataPolicy
for more
information.metadataPolicy
- the metadata policypublic MapConfig addQueryCacheConfig(QueryCacheConfig queryCacheConfig)
QueryCacheConfig
to this MapConfig
.queryCacheConfig
- the config to be addedMapConfig
instanceIllegalArgumentException
- if there is already a QueryCache
with the same QueryCacheConfig#name
public List<QueryCacheConfig> getQueryCacheConfigs()
QueryCacheConfig
instances defined on this MapConfig
.QueryCacheConfig
instances defined on this MapConfig
public MapConfig setQueryCacheConfigs(List<QueryCacheConfig> queryCacheConfigs)
QueryCacheConfig
instances to this MapConfig
.public PartitioningStrategyConfig getPartitioningStrategyConfig()
public MapConfig setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig)
public boolean isNearCacheEnabled()
true
if Near Cache is enabled, false
otherwisepublic MapConfig setCacheDeserializedValues(CacheDeserializedValues cacheDeserializedValues)
CacheDeserializedValues.INDEX_ONLY
MapConfig
instanceCacheDeserializedValues
@Nonnull public HotRestartConfig getHotRestartConfig()
HotRestartConfig
for this MapConfig
@Nonnull public DataPersistenceConfig getDataPersistenceConfig()
DataPersistenceConfig
for this MapConfig
@Deprecated public MapConfig setHotRestartConfig(@Nonnull HotRestartConfig hotRestartConfig)
setDataPersistenceConfig(DataPersistenceConfig)
HotRestartConfig
for this MapConfig
hotRestartConfig
- hot restart configMapConfig
instancepublic MapConfig setDataPersistenceConfig(@Nonnull DataPersistenceConfig dataPersistenceConfig)
DataPersistenceConfig
for this MapConfig
dataPersistenceConfig
- dataPersistenceConfig configMapConfig
instance@Nonnull public MerkleTreeConfig getMerkleTreeConfig()
MerkleTreeConfig
for this MapConfig
public MapConfig setMerkleTreeConfig(@Nonnull MerkleTreeConfig merkleTreeConfig)
MerkleTreeConfig
for this MapConfig
merkleTreeConfig
- merkle tree configMapConfig
instance@Nonnull public EventJournalConfig getEventJournalConfig()
EventJournalConfig
for this MapConfig
public MapConfig setEventJournalConfig(@Nonnull EventJournalConfig eventJournalConfig)
EventJournalConfig
for this MapConfig
eventJournalConfig
- event journal configMapConfig
instancepublic TieredStoreConfig getTieredStoreConfig()
TieredStoreConfig
for this MapConfig
public MapConfig setTieredStoreConfig(TieredStoreConfig tieredStoreConfig)
TieredStoreConfig
for this MapConfig
tieredStoreConfig
- tiered-store configMapConfig
instancepublic CacheDeserializedValues getCacheDeserializedValues()
public String getSplitBrainProtectionName()
public MapConfig setSplitBrainProtectionName(String splitBrainProtectionName)
public List<PartitioningAttributeConfig> getPartitioningAttributeConfigs()
AttributePartitioningStrategy
public MapConfig setPartitioningAttributeConfigs(List<PartitioningAttributeConfig> partitioningAttributeConfigs)
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2024 Hazelcast, Inc.. All rights reserved.