com.hazelcast.config
Class MapConfig

java.lang.Object
  extended by com.hazelcast.config.MapConfig
Direct Known Subclasses:
MapConfigReadOnly

public class MapConfig
extends Object

Contains the configuration for an IMap.


Field Summary
static int DEFAULT_BACKUP_COUNT
          The number of default backup counter
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
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 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 Summary
MapConfig()
           
MapConfig(MapConfig config)
           
MapConfig(String name)
           
 
Method Summary
 MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
           
 MapConfig addMapIndexConfig(MapIndexConfig mapIndexConfig)
           
 boolean equals(Object obj)
           
 MapConfigReadOnly getAsReadOnly()
           
 int getAsyncBackupCount()
           
 int getBackupCount()
           
 List<EntryListenerConfig> getEntryListenerConfigs()
           
 int getEvictionPercentage()
           
 EvictionPolicy getEvictionPolicy()
           
 InMemoryFormat getInMemoryFormat()
           
 List<MapIndexConfig> getMapIndexConfigs()
           
 MapStoreConfig getMapStoreConfig()
          Returns the map store configuration
 int getMaxIdleSeconds()
           
 MaxSizeConfig getMaxSizeConfig()
           
 String getMergePolicy()
           
 long getMinEvictionCheckMillis()
          Returns minimum milliseconds which should pass before asking if a partition of this map is evictable or not.
 String getName()
           
 NearCacheConfig getNearCacheConfig()
           
 PartitioningStrategyConfig getPartitioningStrategyConfig()
           
 int getTimeToLiveSeconds()
           
 int getTotalBackupCount()
           
 WanReplicationRef getWanReplicationRef()
           
 int hashCode()
           
 boolean isCompatible(MapConfig other)
           
 boolean isNearCacheEnabled()
           
 boolean isOptimizeQueries()
           
 boolean isReadBackupData()
           
 boolean isStatisticsEnabled()
           
 MapConfig setAsyncBackupCount(int asyncBackupCount)
          Number of asynchronous backups.
 MapConfig setBackupCount(int backupCount)
          Number of synchronous backups.
 MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)
           
 MapConfig setEvictionPercentage(int evictionPercentage)
          When max.
 MapConfig setEvictionPolicy(EvictionPolicy evictionPolicy)
           
 MapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
          Binary type that will be used for storing records.
 MapConfig setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs)
           
 MapConfig setMapStoreConfig(MapStoreConfig mapStoreConfig)
          Sets the mapStore 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)
           
 MapConfig setMinEvictionCheckMillis(long minEvictionCheckMillis)
          Sets the minimum time in millis which should pass before asking if a partition of this map is evictable or not.
 MapConfig setName(String name)
           
 MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig)
           
 MapConfig setOptimizeQueries(boolean optimizeQueries)
           
 MapConfig setPartitioningStrategyConfig(PartitioningStrategyConfig partitioningStrategyConfig)
           
 MapConfig setReadBackupData(boolean readBackupData)
           
 MapConfig setStatisticsEnabled(boolean statisticsEnabled)
           
 MapConfig setTimeToLiveSeconds(int timeToLiveSeconds)
          Maximum number of seconds for each entry to stay in the map.
 MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_BACKUP_COUNT

public static final int MIN_BACKUP_COUNT
The number of minimum backup counter

See Also:
Constant Field Values

DEFAULT_BACKUP_COUNT

public static final int DEFAULT_BACKUP_COUNT
The number of default backup counter

See Also:
Constant Field Values

MAX_BACKUP_COUNT

public static final int MAX_BACKUP_COUNT
The number of maximum backup counter

See Also:
Constant Field Values

MIN_EVICTION_PERCENTAGE

public static final int MIN_EVICTION_PERCENTAGE
The number of minimum eviction percentage

See Also:
Constant Field Values

DEFAULT_EVICTION_PERCENTAGE

public static final int DEFAULT_EVICTION_PERCENTAGE
The number of default eviction percentage

See Also:
Constant Field Values

MAX_EVICTION_PERCENTAGE

public static final int MAX_EVICTION_PERCENTAGE
The number of maximum eviction percentage

See Also:
Constant Field Values

DEFAULT_MIN_EVICTION_CHECK_MILLIS

public static final 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.

See Also:
Constant Field Values

DEFAULT_TTL_SECONDS

public static final int DEFAULT_TTL_SECONDS
The number of default Time to Live seconds

See Also:
Constant Field Values

DEFAULT_MAX_IDLE_SECONDS

public static final int DEFAULT_MAX_IDLE_SECONDS
The number of default time to wait eviction

See Also:
Constant Field Values

DEFAULT_EVICTION_POLICY

public static final EvictionPolicy DEFAULT_EVICTION_POLICY
Default policy for eviction


DEFAULT_MAP_MERGE_POLICY

public static final String DEFAULT_MAP_MERGE_POLICY
Default policy for merging


DEFAULT_IN_MEMORY_FORMAT

public static final InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
Default In-Memory format is binary

Constructor Detail

MapConfig

public MapConfig(String name)

MapConfig

public MapConfig()

MapConfig

public MapConfig(MapConfig config)
Method Detail

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)
Binary 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 NATIVE : 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.

getMinEvictionCheckMillis

public long getMinEvictionCheckMillis()
Returns minimum milliseconds which should pass before asking if a partition of this map is evictable or not.

Default value is 100L milliseconds.

Returns:
number of milliseconds should pass before asking next eviction.
Since:
3.3

setMinEvictionCheckMillis

public MapConfig setMinEvictionCheckMillis(long minEvictionCheckMillis)
Sets the minimum time in millis which should pass before asking if a partition of this map is evictable or not.

Default value is 100L milliseconds.

Parameters:
minEvictionCheckMillis - time in millis.
Since:
3.3

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, getAll, 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 EvictionPolicy getEvictionPolicy()
Returns:
the evictionPolicy

setEvictionPolicy

public MapConfig setEvictionPolicy(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 © 2015 Hazelcast, Inc.. All Rights Reserved.