public class MapConfig extends Object
IMap
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKUP_COUNT
The number of default backup counter
|
static CacheDeserializedValues |
DEFAULT_CACHED_DESERIALIZED_VALUES
We want to cache values only when an index is defined.
|
static int |
DEFAULT_EVICTION_PERCENTAGE
The number of default eviction percentage
|
static EvictionPolicy |
DEFAULT_EVICTION_POLICY
Default policy for eviction
|
static InMemoryFormat |
DEFAULT_IN_MEMORY_FORMAT
Default In-Memory format is binary
|
static String |
DEFAULT_MAP_MERGE_POLICY
Default policy for merging
|
static int |
DEFAULT_MAX_IDLE_SECONDS
The number of default time to wait eviction in seconds
|
static long |
DEFAULT_MIN_EVICTION_CHECK_MILLIS
Minimum time in milliseconds which should pass before asking
if a partition of this map is evictable or not.
|
static int |
DEFAULT_TTL_SECONDS
The number of default Time to Live in seconds
|
static int |
MAX_BACKUP_COUNT
The number of maximum backup counter
|
static int |
MAX_EVICTION_PERCENTAGE
The number of maximum eviction percentage
|
static int |
MIN_BACKUP_COUNT
The number of minimum backup counter
|
static int |
MIN_EVICTION_PERCENTAGE
The number of minimum eviction percentage
|
Constructor and Description |
---|
MapConfig() |
MapConfig(MapConfig config) |
MapConfig(String name) |
Modifier and Type | Method and Description |
---|---|
MapConfig |
addEntryListenerConfig(EntryListenerConfig listenerConfig) |
MapConfig |
addMapAttributeConfig(MapAttributeConfig mapAttributeConfig) |
MapConfig |
addMapIndexConfig(MapIndexConfig mapIndexConfig) |
MapConfig |
addMapPartitionLostListenerConfig(MapPartitionLostListenerConfig listenerConfig) |
MapConfig |
addQueryCacheConfig(QueryCacheConfig queryCacheConfig)
Adds a new
queryCacheConfig to this MapConfig . |
boolean |
equals(Object obj) |
MapConfigReadOnly |
getAsReadOnly() |
int |
getAsyncBackupCount()
Returns the asynchronous backup count for this
IMap . |
int |
getBackupCount()
Returns the backupCount for this
IMap |
CacheDeserializedValues |
getCacheDeserializedValues()
Get current value cache settings
|
List<EntryListenerConfig> |
getEntryListenerConfigs() |
int |
getEvictionPercentage()
Deprecated.
As of version 3.7, eviction mechanism changed.
It uses a probabilistic algorithm based on sampling. Please see documentation for further details.
|
EvictionPolicy |
getEvictionPolicy()
Returns the evictionPolicy
|
HotRestartConfig |
getHotRestartConfig()
Gets the
HotRestartConfig for this MapConfig |
InMemoryFormat |
getInMemoryFormat()
Returns the data type that will be used for storing records.
|
List<MapAttributeConfig> |
getMapAttributeConfigs() |
MapEvictionPolicy |
getMapEvictionPolicy()
Returns custom eviction policy if it is set otherwise returns null.
|
List<MapIndexConfig> |
getMapIndexConfigs() |
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() |
String |
getMergePolicy()
Gets the map merge policy
MapMergePolicy |
long |
getMinEvictionCheckMillis()
Deprecated.
As of version 3.7, eviction mechanism changed.
It uses a probabilistic algorithm based on sampling. Please see documentation for further details.
|
String |
getName()
Returns the name of this
IMap |
NearCacheConfig |
getNearCacheConfig()
Returns the near cache configuration
|
PartitioningStrategyConfig |
getPartitioningStrategyConfig() |
List<MapPartitionLostListenerConfig> |
getPartitionLostListenerConfigs() |
List<QueryCacheConfig> |
getQueryCacheConfigs()
Returns all
QueryCacheConfig instances defined on this MapConfig |
String |
getQuorumName() |
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 |
isCompatible(MapConfig other) |
boolean |
isNearCacheEnabled()
Checks if near cache is enabled
|
boolean |
isOptimizeQueries()
Deprecated.
user
getQueryCacheConfigs() instead. |
boolean |
isReadBackupData()
Checks if read-backup-data (reading local backup entires) is enabled for this map.
|
boolean |
isStatisticsEnabled()
Checks if statistics are enabled for this map.
|
MapConfig |
setAsyncBackupCount(int asyncBackupCount)
Sets the number of asynchronous backups.
|
MapConfig |
setBackupCount(int backupCount)
Number of synchronous backups.
|
MapConfig |
setCacheDeserializedValues(CacheDeserializedValues cacheDeserializedValues)
Configure de-serialized value caching.
|
MapConfig |
setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs) |
MapConfig |
setEvictionPercentage(int evictionPercentage)
Deprecated.
As of version 3.7, eviction mechanism changed.
It uses a probabilistic algorithm based on sampling. Please see documentation for further details.
|
MapConfig |
setEvictionPolicy(EvictionPolicy evictionPolicy)
Sets the evictionPolicy
|
MapConfig |
setHotRestartConfig(HotRestartConfig hotRestartConfig)
Sets the
HotRestartConfig for this MapConfig |
MapConfig |
setInMemoryFormat(InMemoryFormat inMemoryFormat)
Binary type that will be used for storing records.
|
MapConfig |
setMapAttributeConfigs(List<MapAttributeConfig> mapAttributeConfigs) |
MapConfig |
setMapEvictionPolicy(MapEvictionPolicy mapEvictionPolicy)
Sets custom eviction policy implementation for this map.
|
MapConfig |
setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs) |
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 |
setMergePolicy(String mergePolicy)
Sets the map merge policy
MapMergePolicy |
MapConfig |
setMinEvictionCheckMillis(long minEvictionCheckMillis)
Deprecated.
As of version 3.7, eviction mechanism changed.
It uses a probabilistic algorithm based on sampling. Please see documentation for further details.
|
MapConfig |
setName(String name)
Sets the name of the
IMap |
MapConfig |
setNearCacheConfig(NearCacheConfig nearCacheConfig)
Sets the near cache configuration
|
MapConfig |
setOptimizeQueries(boolean optimizeQueries)
Deprecated.
|
MapConfig |
setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig) |
MapConfig |
setPartitionLostListenerConfigs(List<MapPartitionLostListenerConfig> listenerConfigs) |
void |
setQueryCacheConfigs(List<QueryCacheConfig> queryCacheConfigs)
Sets
QueryCacheConfig instances to this MapConfig |
void |
setQuorumName(String quorumName) |
MapConfig |
setReadBackupData(boolean readBackupData)
Sets read-backup-data (reading local backup entires) for this map.
|
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() |
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 MIN_EVICTION_PERCENTAGE
public static final int DEFAULT_EVICTION_PERCENTAGE
public static final int MAX_EVICTION_PERCENTAGE
public static final long DEFAULT_MIN_EVICTION_CHECK_MILLIS
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 String DEFAULT_MAP_MERGE_POLICY
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
public static final CacheDeserializedValues DEFAULT_CACHED_DESERIALIZED_VALUES
public MapConfig(String name)
public MapConfig()
public MapConfig(MapConfig config)
public MapConfigReadOnly getAsReadOnly()
public MapConfig setName(String name)
IMap
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 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 setnew
- 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 backupssetBackupCount(int)
,
getAsyncBackupCount()
public int getTotalBackupCount()
@Deprecated public int getEvictionPercentage()
public MapConfig setEvictionPercentage(int evictionPercentage)
evictionPercentage
- the evictionPercentage to set: the specified percentage of the map to be evictedIllegalArgumentException
- if evictionPercentage is not in the 0-100 range.public long getMinEvictionCheckMillis()
public MapConfig setMinEvictionCheckMillis(long minEvictionCheckMillis)
minEvictionCheckMillis
- time in milliseconds that should pass before asking for the next evictionpublic int getTimeToLiveSeconds()
public MapConfig setTimeToLiveSeconds(int timeToLiveSeconds)
timeToLiveSeconds
- the timeToLiveSeconds to setpublic int getMaxIdleSeconds()
public MapConfig setMaxIdleSeconds(int maxIdleSeconds)
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()
public MapConfig setEvictionPolicy(EvictionPolicy evictionPolicy)
evictionPolicy
- the evictionPolicy to setpublic MapEvictionPolicy getMapEvictionPolicy()
public MapConfig setMapEvictionPolicy(MapEvictionPolicy mapEvictionPolicy)
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 String getMergePolicy()
MapMergePolicy
public MapConfig setMergePolicy(String mergePolicy)
MapMergePolicy
mergePolicy
- the map merge policy to setpublic boolean isStatisticsEnabled()
public MapConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- True to enable map statistics, false to disable.public boolean isReadBackupData()
public MapConfig setReadBackupData(boolean readBackupData)
readBackupData
- True to enable read-backup-data, false to disable.public WanReplicationRef getWanReplicationRef()
public MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)
wanReplicationRef
- the Wan target replication reference.public 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 addMapIndexConfig(MapIndexConfig mapIndexConfig)
public List<MapIndexConfig> getMapIndexConfigs()
public MapConfig setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs)
public MapConfig addMapAttributeConfig(MapAttributeConfig mapAttributeConfig)
public List<MapAttributeConfig> getMapAttributeConfigs()
public MapConfig setMapAttributeConfigs(List<MapAttributeConfig> mapAttributeConfigs)
public MapConfig addQueryCacheConfig(QueryCacheConfig queryCacheConfig)
queryCacheConfig
to this MapConfig
.queryCacheConfig
- the config to be added.MapConfig
instance.IllegalArgumentException
- 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 void setQueryCacheConfigs(List<QueryCacheConfig> queryCacheConfigs)
QueryCacheConfig
instances to this MapConfig
public PartitioningStrategyConfig getPartitioningStrategyConfig()
public MapConfig setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig)
public boolean isNearCacheEnabled()
public boolean isOptimizeQueries()
getQueryCacheConfigs()
instead.public MapConfig setOptimizeQueries(boolean optimizeQueries)
setCacheDeserializedValues(CacheDeserializedValues)
insteadInMemoryFormat
is InMemoryFormat.OBJECT
or when Portable
serialization is used.optimizeQueries
- MapConfig
instance.CacheDeserializedValues}
public MapConfig setCacheDeserializedValues(CacheDeserializedValues cacheDeserializedValues)
CacheDeserializedValues.INDEX_ONLY
cacheDeserializedValues
- MapConfig
instance.CacheDeserializedValues}
public HotRestartConfig getHotRestartConfig()
HotRestartConfig
for this MapConfig
public MapConfig setHotRestartConfig(HotRestartConfig hotRestartConfig)
HotRestartConfig
for this MapConfig
hotRestartConfig
- hot restart configMapConfig
instancepublic CacheDeserializedValues getCacheDeserializedValues()
public boolean isCompatible(MapConfig other)
public String getQuorumName()
public void setQuorumName(String quorumName)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.