com.hazelcast.config
Class MapConfig

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

public class MapConfig
extends Object


Nested Class Summary
static class MapConfig.EvictionPolicy
           
 
Field Summary
static int DEFAULT_BACKUP_COUNT
           
static int DEFAULT_EVICTION_PERCENTAGE
           
static MapConfig.EvictionPolicy DEFAULT_EVICTION_POLICY
           
static InMemoryFormat DEFAULT_IN_MEMORY_FORMAT
           
static String DEFAULT_MAP_MERGE_POLICY
           
static int DEFAULT_MAX_IDLE_SECONDS
           
static int DEFAULT_MAX_SIZE
           
static int DEFAULT_TTL_SECONDS
           
static int MAX_BACKUP_COUNT
           
static int MAX_EVICTION_PERCENTAGE
           
static int MIN_BACKUP_COUNT
           
static int MIN_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()
           
 MapConfig.EvictionPolicy getEvictionPolicy()
           
 InMemoryFormat getInMemoryFormat()
           
 List<MapIndexConfig> getMapIndexConfigs()
           
 MapStoreConfig getMapStoreConfig()
          Returns the map store configuration
 int getMaxIdleSeconds()
           
 MaxSizeConfig getMaxSizeConfig()
           
 String getMergePolicy()
           
 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(MapConfig.EvictionPolicy evictionPolicy)
           
 MapConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
          Data 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 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
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
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)
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.