public class MapConfig extends Object implements SplitBrainMergeTypeProvider, IdentifiedDataSerializable, NamedConfig
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 EvictionPolicy |
DEFAULT_EVICTION_POLICY
Default policy for eviction.
|
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 MetadataPolicy |
DEFAULT_METADATA_POLICY
Default metadata policy
|
static int |
DEFAULT_TTL_SECONDS
The number of default Time to Live in seconds.
|
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.
|
List<EntryListenerConfig> |
getEntryListenerConfigs() |
EventJournalConfig |
getEventJournalConfig()
Gets the
EventJournalConfig for this MapConfig |
EvictionPolicy |
getEvictionPolicy()
Returns the
EvictionPolicy. |
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.
|
MapEvictionPolicy |
getMapEvictionPolicy()
Returns custom eviction policy if it is set otherwise returns
null. |
MapStoreConfig |
getMapStoreConfig()
Returns the map store configuration
|
int |
getMaxIdleSeconds()
Returns the maximum number of seconds for each entry to stay idle in the map.
|
MaxSizeConfig |
getMaxSizeConfig() |
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
|
PartitioningStrategyConfig |
getPartitioningStrategyConfig() |
List<MapPartitionLostListenerConfig> |
getPartitionLostListenerConfigs() |
Class |
getProvidedMergeTypes() |
List<QueryCacheConfig> |
getQueryCacheConfigs()
Returns all
QueryCacheConfig instances defined on this MapConfig. |
String |
getSplitBrainProtectionName() |
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 |
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 |
setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) |
MapConfig |
setEventJournalConfig(EventJournalConfig eventJournalConfig)
Sets the
EventJournalConfig for this MapConfig |
MapConfig |
setEvictionPolicy(EvictionPolicy evictionPolicy)
Sets the
EvictionPolicy. |
MapConfig |
setHotRestartConfig(HotRestartConfig hotRestartConfig)
Sets the
HotRestartConfig for this MapConfig |
MapConfig |
setIndexConfigs(List<IndexConfig> indexConfigs) |
MapConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Binary type that will be used for storing records.
|
MapConfig |
setMapEvictionPolicy(MapEvictionPolicy mapEvictionPolicy)
Sets custom eviction policy implementation for this map.
|
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 |
setMaxSizeConfig(MaxSizeConfig maxSizeConfig) |
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 |
setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig) |
MapConfig |
setPartitionLostListenerConfigs(List<MapPartitionLostListenerConfig> listenerConfigs) |
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)
Sets statistics to enabled or disabled for this map.
|
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 DEFAULT_TTL_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDS
public static final EvictionPolicy DEFAULT_EVICTION_POLICY
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
public static final CacheDeserializedValues DEFAULT_CACHED_DESERIALIZED_VALUES
public static final MetadataPolicy DEFAULT_METADATA_POLICY
public MapConfig()
public MapConfig(String name)
public MapConfig(MapConfig config)
public String getName()
IMapgetName in interface NamedConfigIMappublic MapConfig setName(String name)
IMapsetName in interface NamedConfigname - the name to set for this IMappublic InMemoryFormat getInMemoryFormat()
public MapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
inMemoryFormat - the record type to set for this IMapIllegalArgumentException - if inMemoryFormat is nullpublic int getBackupCount()
IMapIMapgetAsyncBackupCount()public MapConfig setBackupCount(int backupCount)
backupCount - the number of synchronous backups to set for this IMapsetAsyncBackupCount(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 MaxSizeConfig getMaxSizeConfig()
public MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig)
public EvictionPolicy getEvictionPolicy()
EvictionPolicy.public MapConfig setEvictionPolicy(EvictionPolicy evictionPolicy)
EvictionPolicy. Default value is EvictionPolicy.NONE.evictionPolicy - the evictionPolicy to setpublic MapEvictionPolicy getMapEvictionPolicy()
null.nullpublic MapConfig setMapEvictionPolicy(MapEvictionPolicy mapEvictionPolicy)
Internal eviction algorithm finds most appropriate entry to evict from this map by using supplied policy.
mapEvictionPolicy - custom eviction policy implementationpublic 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.public Class getProvidedMergeTypes()
getProvidedMergeTypes in interface SplitBrainMergeTypeProviderpublic boolean isStatisticsEnabled()
true if statistics are enabled, false otherwisepublic MapConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled - true to enable map 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 - public 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#namepublic List<QueryCacheConfig> getQueryCacheConfigs()
QueryCacheConfig instances defined on this MapConfig.QueryCacheConfig instances defined on this MapConfigpublic 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_ONLYMapConfig instanceCacheDeserializedValues@Nonnull public HotRestartConfig getHotRestartConfig()
HotRestartConfig for this MapConfigpublic MapConfig setHotRestartConfig(@Nonnull HotRestartConfig hotRestartConfig)
HotRestartConfig for this MapConfighotRestartConfig - hot restart configMapConfig instance@Nonnull public MerkleTreeConfig getMerkleTreeConfig()
MerkleTreeConfig for this MapConfigpublic MapConfig setMerkleTreeConfig(@Nonnull MerkleTreeConfig merkleTreeConfig)
MerkleTreeConfig for this MapConfigmerkleTreeConfig - merkle tree configMapConfig instance@Nonnull public EventJournalConfig getEventJournalConfig()
EventJournalConfig for this MapConfigpublic MapConfig setEventJournalConfig(@Nonnull EventJournalConfig eventJournalConfig)
EventJournalConfig for this MapConfigeventJournalConfig - event journal configMapConfig instancepublic CacheDeserializedValues getCacheDeserializedValues()
public String getSplitBrainProtectionName()
public MapConfig setSplitBrainProtectionName(String splitBrainProtectionName)
public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getClassId()
IdentifiedDataSerializablegetClassId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - 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
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.Copyright © 2019 Hazelcast, Inc.. All rights reserved.