com.hazelcast.config
Class MapConfig
java.lang.Object
com.hazelcast.config.MapConfig
- Direct Known Subclasses:
- MapConfigReadOnly
public class MapConfig
- extends Object
MIN_BACKUP_COUNT
public static final int MIN_BACKUP_COUNT
- See Also:
- Constant Field Values
DEFAULT_BACKUP_COUNT
public static final int DEFAULT_BACKUP_COUNT
- See Also:
- Constant Field Values
MAX_BACKUP_COUNT
public static final int MAX_BACKUP_COUNT
- See Also:
- Constant Field Values
MIN_EVICTION_PERCENTAGE
public static final int MIN_EVICTION_PERCENTAGE
- See Also:
- Constant Field Values
DEFAULT_EVICTION_PERCENTAGE
public static final int DEFAULT_EVICTION_PERCENTAGE
- See Also:
- Constant Field Values
MAX_EVICTION_PERCENTAGE
public static final int MAX_EVICTION_PERCENTAGE
- See Also:
- Constant Field Values
DEFAULT_TTL_SECONDS
public static final int DEFAULT_TTL_SECONDS
- See Also:
- Constant Field Values
DEFAULT_MAX_IDLE_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDS
- See Also:
- Constant Field Values
DEFAULT_MAX_SIZE
public static final int DEFAULT_MAX_SIZE
- See Also:
- Constant Field Values
DEFAULT_EVICTION_POLICY
public static final MapConfig.EvictionPolicy DEFAULT_EVICTION_POLICY
DEFAULT_MAP_MERGE_POLICY
public static final String DEFAULT_MAP_MERGE_POLICY
DEFAULT_IN_MEMORY_FORMAT
public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
MapConfig
public MapConfig(String name)
MapConfig
public MapConfig()
MapConfig
public MapConfig(MapConfig config)
getAsReadOnly
public MapConfigReadOnly getAsReadOnly()
getName
public String getName()
- Returns:
- the name
setName
public MapConfig setName(String name)
- Parameters:
name
- the name to set
getInMemoryFormat
public InMemoryFormat getInMemoryFormat()
- Returns:
- data type that will be used for storing records.
setInMemoryFormat
public MapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
- Data type that will be used for storing records.
Possible values:
BINARY (default): keys and values will be stored as binary data
OBJECT : values will be stored in their object forms
OFFHEAP : values will be stored in non-heap region of JVM
- Parameters:
inMemoryFormat
- the record type to set
- Throws:
IllegalArgumentException
- if inMemoryFormat is null.
getBackupCount
public int getBackupCount()
- Returns:
- the backupCount
- See Also:
getAsyncBackupCount()
setBackupCount
public MapConfig setBackupCount(int backupCount)
- Number of synchronous backups. If 1 is set as the backup-count for example,
then all entries of the map will be copied to another JVM for
fail-safety. 0 means no sync backup.
- Parameters:
backupCount
- the backupCount to set- See Also:
setAsyncBackupCount(int)
getAsyncBackupCount
public int getAsyncBackupCount()
- Returns:
- the asyncBackupCount
- See Also:
setBackupCount(int)
setAsyncBackupCount
public MapConfig setAsyncBackupCount(int asyncBackupCount)
- Number of asynchronous backups.
0 means no backup.
- Parameters:
asyncBackupCount
- the asyncBackupCount to set- See Also:
setBackupCount(int)
getTotalBackupCount
public int getTotalBackupCount()
getEvictionPercentage
public int getEvictionPercentage()
- Returns:
- the evictionPercentage
setEvictionPercentage
public MapConfig setEvictionPercentage(int evictionPercentage)
- When max. size is reached, specified percentage of the map will be evicted.
Any integer between 0 and 100 is allowed.
If 25 is set for example, 25% of the entries will get evicted.
- Parameters:
evictionPercentage
- the evictionPercentage to set
- Throws:
IllegalArgumentException
- if evictionPercentage is not in the 0-100 range.
getTimeToLiveSeconds
public int getTimeToLiveSeconds()
- Returns:
- the timeToLiveSeconds
setTimeToLiveSeconds
public MapConfig setTimeToLiveSeconds(int timeToLiveSeconds)
- Maximum number of seconds for each entry to stay in the map. Entries that are
older than timeToLiveSeconds will get automatically evicted from the map.
Updates on the entry don't change the eviction time.
Any integer between 0 and Integer.MAX_VALUE.
0 means infinite. Default is 0.
- Parameters:
timeToLiveSeconds
- the timeToLiveSeconds to set
getMaxIdleSeconds
public int getMaxIdleSeconds()
- Returns:
- the maxIdleSeconds
setMaxIdleSeconds
public MapConfig setMaxIdleSeconds(int maxIdleSeconds)
- Maximum number of seconds for each entry to stay idle in the map. Entries that are
idle(not touched) for more than maxIdleSeconds will get
automatically evicted from the map. Entry is touched if get, put or
containsKey is called.
Any integer between 0 and Integer.MAX_VALUE.
0 means infinite. Default is 0.
- Parameters:
maxIdleSeconds
- the maxIdleSeconds to set
getMaxSizeConfig
public MaxSizeConfig getMaxSizeConfig()
setMaxSizeConfig
public MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig)
getEvictionPolicy
public MapConfig.EvictionPolicy getEvictionPolicy()
- Returns:
- the evictionPolicy
setEvictionPolicy
public MapConfig setEvictionPolicy(MapConfig.EvictionPolicy evictionPolicy)
- Parameters:
evictionPolicy
- the evictionPolicy to set
getMapStoreConfig
public MapStoreConfig getMapStoreConfig()
- Returns the map store configuration
- Returns:
- the mapStoreConfig
setMapStoreConfig
public MapConfig setMapStoreConfig(MapStoreConfig mapStoreConfig)
- Sets the mapStore configuration
- Parameters:
mapStoreConfig
- the mapStoreConfig to set
getNearCacheConfig
public NearCacheConfig getNearCacheConfig()
setNearCacheConfig
public MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig)
getMergePolicy
public String getMergePolicy()
setMergePolicy
public MapConfig setMergePolicy(String mergePolicy)
isStatisticsEnabled
public boolean isStatisticsEnabled()
setStatisticsEnabled
public MapConfig setStatisticsEnabled(boolean statisticsEnabled)
isReadBackupData
public boolean isReadBackupData()
setReadBackupData
public MapConfig setReadBackupData(boolean readBackupData)
getWanReplicationRef
public WanReplicationRef getWanReplicationRef()
setWanReplicationRef
public MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)
addEntryListenerConfig
public MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
getEntryListenerConfigs
public List<EntryListenerConfig> getEntryListenerConfigs()
setEntryListenerConfigs
public MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)
addMapIndexConfig
public MapConfig addMapIndexConfig(MapIndexConfig mapIndexConfig)
getMapIndexConfigs
public List<MapIndexConfig> getMapIndexConfigs()
setMapIndexConfigs
public MapConfig setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs)
getPartitioningStrategyConfig
public PartitioningStrategyConfig getPartitioningStrategyConfig()
setPartitioningStrategyConfig
public MapConfig setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig)
isNearCacheEnabled
public boolean isNearCacheEnabled()
isOptimizeQueries
public boolean isOptimizeQueries()
setOptimizeQueries
public MapConfig setOptimizeQueries(boolean optimizeQueries)
isCompatible
public boolean isCompatible(MapConfig other)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.