com.hazelcast.config
Class MapConfig

java.lang.Object
  extended by com.hazelcast.config.MapConfig
All Implemented Interfaces:
DataSerializable, Serializable

public class MapConfig
extends Object
implements DataSerializable

See Also:
Serialized Form

Nested Class Summary
static class MapConfig.StorageType
           
 
Field Summary
static String ATOMIC_LONG_MAP_NAME
           
static String COUNT_DOWN_LATCH_MAP_NAME
           
static int DEFAULT_BACKUP_COUNT
           
static boolean DEFAULT_CACHE_VALUE
           
static int DEFAULT_EVICTION_DELAY_SECONDS
           
static int DEFAULT_EVICTION_PERCENTAGE
           
static String DEFAULT_EVICTION_POLICY
           
static int DEFAULT_MAX_IDLE_SECONDS
           
static int DEFAULT_MAX_SIZE
           
static String DEFAULT_MERGE_POLICY
           
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
           
static String SEMAPHORE_MAP_NAME
           
 
Constructor Summary
MapConfig()
           
MapConfig(MapConfig config)
           
MapConfig(String name)
           
 
Method Summary
 MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig)
           
 MapConfig addMapIndexConfig(MapIndexConfig mapIndexConfig)
           
 boolean equals(Object obj)
           
 int getAsyncBackupCount()
           
 int getBackupCount()
           
 List<EntryListenerConfig> getEntryListenerConfigs()
           
 int getEvictionDelaySeconds()
          Deprecated.  
 int getEvictionPercentage()
           
 String getEvictionPolicy()
           
 List<MapIndexConfig> getMapIndexConfigs()
           
 MapStoreConfig getMapStoreConfig()
          Returns the map store configuration
 int getMaxIdleSeconds()
           
 int getMaxSize()
          Deprecated. use MaxSizeConfig.getSize
 MaxSizeConfig getMaxSizeConfig()
           
 String getMergePolicy()
           
 String getName()
           
 NearCacheConfig getNearCacheConfig()
           
 MapConfig.StorageType getStorageType()
           
 int getTimeToLiveSeconds()
           
 WanReplicationRef getWanReplicationRef()
           
 int hashCode()
           
 boolean isCacheValue()
          Returns if the entry values are cached
 boolean isCompatible(MapConfig other)
           
 boolean isReadBackupData()
           
 boolean isValueIndexed()
          Returns if the value of the mapEntry should be indexed for faster containsValue(obj) operations.
 void readData(DataInput in)
           
 MapConfig setAsyncBackupCount(int asyncBackupCount)
          Number of asynchronous backups.
 MapConfig setBackupCount(int backupCount)
          Number of synchronous backups.
 MapConfig setBackupCounts(int backupCount, int asyncBackupCount)
          Number of sync and async backups.
 MapConfig setCacheValue(boolean cacheValue)
          Sets if entry values should be cached
 MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs)
           
 MapConfig setEvictionDelaySeconds(int evictionDelaySeconds)
          Deprecated.  
 MapConfig setEvictionPercentage(int evictionPercentage)
          When max.
 MapConfig setEvictionPolicy(String evictionPolicy)
           
 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 setMaxSize(int maxSize)
          Deprecated. use MaxSizeConfig.setSize
 MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig)
           
 MapConfig setMergePolicy(String mergePolicyName)
           
 MapConfig setName(String name)
           
 MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig)
           
 MapConfig setReadBackupData(boolean readBackupData)
           
 MapConfig setStorageType(MapConfig.StorageType storageType)
           
 MapConfig setTimeToLiveSeconds(int timeToLiveSeconds)
          Maximum number of seconds for each entry to stay in the map.
 MapConfig setValueIndexed(boolean valueIndexed)
          Sets if the value of the map entries should be indexed for faster containsValue(obj) operations.
 MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)
           
 String toString()
           
 void writeData(DataOutput out)
           
 
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_EVICTION_DELAY_SECONDS

public static final int DEFAULT_EVICTION_DELAY_SECONDS
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

ATOMIC_LONG_MAP_NAME

public static final String ATOMIC_LONG_MAP_NAME
See Also:
Constant Field Values

COUNT_DOWN_LATCH_MAP_NAME

public static final String COUNT_DOWN_LATCH_MAP_NAME
See Also:
Constant Field Values

SEMAPHORE_MAP_NAME

public static final String SEMAPHORE_MAP_NAME
See Also:
Constant Field Values

DEFAULT_EVICTION_POLICY

public static final String DEFAULT_EVICTION_POLICY
See Also:
Constant Field Values

DEFAULT_MERGE_POLICY

public static final String DEFAULT_MERGE_POLICY
See Also:
Constant Field Values

DEFAULT_CACHE_VALUE

public static final boolean DEFAULT_CACHE_VALUE
See Also:
Constant Field Values
Constructor Detail

MapConfig

public MapConfig(String name)

MapConfig

public MapConfig()

MapConfig

public MapConfig(MapConfig config)
Method Detail

getName

public String getName()
Returns:
the name

setName

public MapConfig setName(String name)
Parameters:
name - the name to set

isValueIndexed

public boolean isValueIndexed()
Returns if the value of the mapEntry should be indexed for faster containsValue(obj) operations.

Default is false.

Returns:
true if value is indexed, false otherwise

setValueIndexed

public MapConfig setValueIndexed(boolean valueIndexed)
Sets if the value of the map entries should be indexed for faster containsValue(obj) operations.

Default is false.

Parameters:
valueIndexed -

isCacheValue

public boolean isCacheValue()
Returns if the entry values are cached

Returns:
true if cached, false otherwise

setCacheValue

public MapConfig setCacheValue(boolean cacheValue)
Sets if entry values should be cached

Parameters:
cacheValue -
Returns:
this MapConfig

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), setBackupCounts(int, 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), setBackupCounts(int, int)

setBackupCounts

public MapConfig setBackupCounts(int backupCount,
                                 int asyncBackupCount)
Number of sync and async backups. 0 means no backup.

Parameters:
backupCount - the sync backup count to set
asyncBackupCount - the async backup count to set
See Also:
setBackupCount(int), setAsyncBackupCount(int)

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.

getEvictionDelaySeconds

public int getEvictionDelaySeconds()
Deprecated. 

Returns:
the evictionDelaySeconds

setEvictionDelaySeconds

public MapConfig setEvictionDelaySeconds(int evictionDelaySeconds)
Deprecated. 

Parameters:
evictionDelaySeconds - the evictionPercentage to set

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

getMaxSize

public int getMaxSize()
Deprecated. use MaxSizeConfig.getSize

Returns:
the maxSize

setMaxSize

public MapConfig setMaxSize(int maxSize)
Deprecated. use MaxSizeConfig.setSize

Parameters:
maxSize - the maxSize to set

getMaxSizeConfig

public MaxSizeConfig getMaxSizeConfig()

setMaxSizeConfig

public MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig)

getEvictionPolicy

public String getEvictionPolicy()
Returns:
the evictionPolicy

setEvictionPolicy

public MapConfig setEvictionPolicy(String 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 mergePolicyName)

isReadBackupData

public boolean isReadBackupData()

setReadBackupData

public MapConfig setReadBackupData(boolean readBackupData)

getWanReplicationRef

public WanReplicationRef getWanReplicationRef()

setWanReplicationRef

public MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef)

getStorageType

public MapConfig.StorageType getStorageType()

setStorageType

public MapConfig setStorageType(MapConfig.StorageType storageType)

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)

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

readData

public void readData(DataInput in)
              throws IOException
Specified by:
readData in interface DataSerializable
Throws:
IOException

writeData

public void writeData(DataOutput out)
               throws IOException
Specified by:
writeData in interface DataSerializable
Throws:
IOException


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.