@Test public void testSetEvictionPercentage() { assertEquals(50, new MapConfig().setEvictionPercentage(50).getEvictionPercentage()); }
public MapConfig setEvictionPercentage(final int evictionPercentage) { if (evictionPercentage < MIN_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be greater or equal than 0"); } if (evictionPercentage > MAX_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be smaller or equal than 100"); } this.evictionPercentage = evictionPercentage; return this; }
MapConfig implements DataSerializable { public MapConfig setEvictionPercentage(final int evictionPercentage) { if (evictionPercentage < MIN_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be greater or equal than 0"); } if (evictionPercentage > MAX_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be smaller or equal than 100"); } this.evictionPercentage = evictionPercentage; return this; } }
MapConfig implements DataSerializable { public MapConfig setEvictionPercentage(final int evictionPercentage) { if (evictionPercentage < MIN_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be greater or equal than 0"); } if (evictionPercentage > MAX_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be smaller or equal than 100"); } this.evictionPercentage = evictionPercentage; return this; } MapConfig(String name);  MapConfig();  MapConfig(MapConfig config); }
MapConfig implements DataSerializable { public MapConfig setEvictionPercentage(final int evictionPercentage) { if (evictionPercentage < MIN_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be greater or equal than 0"); } if (evictionPercentage > MAX_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be smaller or equal than 100"); } this.evictionPercentage = evictionPercentage; return this; } MapConfig(String name);  MapConfig();  MapConfig(MapConfig config); String getName(); MapConfig setName(String name); boolean isValueIndexed(); MapConfig setValueIndexed(boolean valueIndexed); boolean isCacheValue(); MapConfig setCacheValue(boolean cacheValue); boolean isClearQuick(); MapConfig setClearQuick(boolean clearQuick); int getBackupCount(); MapConfig setBackupCount(final int backupCount); int getAsyncBackupCount(); MapConfig setAsyncBackupCount(final int asyncBackupCount); MapConfig setBackupCounts(final int backupCount, final int asyncBackupCount); int getEvictionPercentage(); MapConfig setEvictionPercentage(final int evictionPercentage); int getEvictionDelaySeconds(); MapConfig setEvictionDelaySeconds(int evictionDelaySeconds); int getTimeToLiveSeconds(); MapConfig setTimeToLiveSeconds(int timeToLiveSeconds); int getMaxIdleSeconds(); MapConfig setMaxIdleSeconds(int maxIdleSeconds); int getMaxSize(); MapConfig setMaxSize(final int maxSize); MaxSizeConfig getMaxSizeConfig(); MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig); String getEvictionPolicy(); MapConfig setEvictionPolicy(String evictionPolicy); MapStoreConfig getMapStoreConfig(); MapConfig setMapStoreConfig(MapStoreConfig mapStoreConfig); NearCacheConfig getNearCacheConfig(); MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig); String getMergePolicy(); MapConfig setMergePolicy(String mergePolicyName); boolean isReadBackupData(); MapConfig setReadBackupData(boolean readBackupData); WanReplicationRef getWanReplicationRef(); MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef); StorageType getStorageType(); MapConfig setStorageType(StorageType storageType); MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig); List<EntryListenerConfig> getEntryListenerConfigs(); MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs); MapConfig addMapIndexConfig(MapIndexConfig mapIndexConfig); List<MapIndexConfig> getMapIndexConfigs(); MapConfig setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs); boolean isCompatible(MapConfig other); @Override int hashCode(); @Override boolean equals(Object obj); void readData(DataInput in); void writeData(DataOutput out); @Override String toString(); }
MapConfig implements DataSerializable { public MapConfig setEvictionPercentage(final int evictionPercentage) { if (evictionPercentage < MIN_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be greater or equal than 0"); } if (evictionPercentage > MAX_EVICTION_PERCENTAGE) { throw new IllegalArgumentException("eviction percentage must be smaller or equal than 100"); } this.evictionPercentage = evictionPercentage; return this; } MapConfig(String name);  MapConfig();  MapConfig(MapConfig config); String getName(); MapConfig setName(String name); boolean isValueIndexed(); MapConfig setValueIndexed(boolean valueIndexed); boolean isCacheValue(); MapConfig setCacheValue(boolean cacheValue); boolean isClearQuick(); MapConfig setClearQuick(boolean clearQuick); int getBackupCount(); MapConfig setBackupCount(final int backupCount); int getAsyncBackupCount(); MapConfig setAsyncBackupCount(final int asyncBackupCount); MapConfig setBackupCounts(final int backupCount, final int asyncBackupCount); int getEvictionPercentage(); MapConfig setEvictionPercentage(final int evictionPercentage); int getEvictionDelaySeconds(); MapConfig setEvictionDelaySeconds(int evictionDelaySeconds); int getTimeToLiveSeconds(); MapConfig setTimeToLiveSeconds(int timeToLiveSeconds); int getMaxIdleSeconds(); MapConfig setMaxIdleSeconds(int maxIdleSeconds); int getMaxSize(); MapConfig setMaxSize(final int maxSize); MaxSizeConfig getMaxSizeConfig(); MapConfig setMaxSizeConfig(MaxSizeConfig maxSizeConfig); String getEvictionPolicy(); MapConfig setEvictionPolicy(String evictionPolicy); MapStoreConfig getMapStoreConfig(); MapConfig setMapStoreConfig(MapStoreConfig mapStoreConfig); NearCacheConfig getNearCacheConfig(); MapConfig setNearCacheConfig(NearCacheConfig nearCacheConfig); String getMergePolicy(); MapConfig setMergePolicy(String mergePolicyName); boolean isReadBackupData(); MapConfig setReadBackupData(boolean readBackupData); WanReplicationRef getWanReplicationRef(); MapConfig setWanReplicationRef(WanReplicationRef wanReplicationRef); StorageType getStorageType(); MapConfig setStorageType(StorageType storageType); MapConfig addEntryListenerConfig(EntryListenerConfig listenerConfig); List<EntryListenerConfig> getEntryListenerConfigs(); MapConfig setEntryListenerConfigs(List<EntryListenerConfig> listenerConfigs); MapConfig addMapIndexConfig(MapIndexConfig mapIndexConfig); List<MapIndexConfig> getMapIndexConfigs(); MapConfig setMapIndexConfigs(List<MapIndexConfig> mapIndexConfigs); boolean isCompatible(MapConfig other); @Override int hashCode(); @Override boolean equals(Object obj); void readData(DataInput in); void writeData(DataOutput out); @Override String toString(); final static int MIN_BACKUP_COUNT; final static int DEFAULT_BACKUP_COUNT; final static int MAX_BACKUP_COUNT; final static int MIN_EVICTION_PERCENTAGE; final static int DEFAULT_EVICTION_PERCENTAGE; final static int MAX_EVICTION_PERCENTAGE; final static int DEFAULT_EVICTION_DELAY_SECONDS; final static int DEFAULT_TTL_SECONDS; final static int DEFAULT_MAX_IDLE_SECONDS; final static int DEFAULT_MAX_SIZE; final static String ATOMIC_LONG_MAP_NAME; final static String COUNT_DOWN_LATCH_MAP_NAME; final static String SEMAPHORE_MAP_NAME; final static String DEFAULT_EVICTION_POLICY; final static String DEFAULT_MERGE_POLICY; final static boolean DEFAULT_CACHE_VALUE; }