Search in sources :

Example 1 with LRUEvictionPolicyComparator

use of com.hazelcast.internal.eviction.impl.comparator.LRUEvictionPolicyComparator in project hazelcast by hazelcast.

the class DynamicConfigBouncingTest method createMapConfig.

private static MapConfig createMapConfig(String mapName) {
    NearCacheConfig nearCacheConfig = new NearCacheConfig().setCacheLocalEntries(true).setInMemoryFormat(InMemoryFormat.NATIVE).setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy.CACHE_ON_UPDATE).setPreloaderConfig(new NearCachePreloaderConfig().setEnabled(true));
    HotRestartConfig hotRestartConfig = new HotRestartConfig().setEnabled(true).setFsync(true);
    EvictionConfig evictionConfig = new EvictionConfig();
    evictionConfig.setSize(1000).setMaxSizePolicy(MaxSizePolicy.FREE_HEAP_SIZE).setComparator(new LRUEvictionPolicyComparator());
    MapStoreConfig mapStoreConfig = new MapStoreConfig().setEnabled(true).setClassName("foo.bar.MapStoreDoesNotExist");
    WanReplicationRef wanRef = new WanReplicationRef("name", "foo.bar.PolicyClass", Collections.<String>emptyList(), true);
    EntryListenerConfig classEntryListener = new EntryListenerConfig("foo.bar.ClassName", true, true);
    EntryListenerConfig entryListener = new EntryListenerConfig(new MyEntryListener(), true, true);
    EntryListenerConfig mapListener = new EntryListenerConfig(new MyEntryUpdatedListener(), true, true);
    QueryCacheConfig queryCacheConfig = new QueryCacheConfig("queryCacheName").setBatchSize(100).addIndexConfig(new IndexConfig(IndexType.HASH, "attribute")).addEntryListenerConfig(new EntryListenerConfig("foo.bar.Classname", false, true)).setInMemoryFormat(InMemoryFormat.OBJECT);
    return new MapConfig(mapName).setBackupCount(2).setBackupCount(3).setTimeToLiveSeconds(12).setMaxIdleSeconds(20).setNearCacheConfig(nearCacheConfig).setReadBackupData(true).setCacheDeserializedValues(CacheDeserializedValues.ALWAYS).setInMemoryFormat(InMemoryFormat.OBJECT).setHotRestartConfig(hotRestartConfig).setEvictionConfig(evictionConfig).setMapStoreConfig(mapStoreConfig).setWanReplicationRef(wanRef).addEntryListenerConfig(classEntryListener).addEntryListenerConfig(entryListener).addEntryListenerConfig(mapListener).addMapPartitionLostListenerConfig(new MapPartitionLostListenerConfig("foo.bar.Classname")).addIndexConfig(new IndexConfig(IndexType.SORTED, "orderAttribute")).addIndexConfig(new IndexConfig(IndexType.HASH, "unorderedAttribute")).addAttributeConfig(new AttributeConfig("attribute", "foo.bar.ExtractorClass")).addQueryCacheConfig(queryCacheConfig).setStatisticsEnabled(false).setPerEntryStatsEnabled(true).setPartitioningStrategyConfig(new PartitioningStrategyConfig("foo.bar.Class")).setSplitBrainProtectionName("split-brain-protection");
}
Also used : HotRestartConfig(com.hazelcast.config.HotRestartConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) WanReplicationRef(com.hazelcast.config.WanReplicationRef) EvictionConfig(com.hazelcast.config.EvictionConfig) NearCacheConfig(com.hazelcast.config.NearCacheConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) IndexConfig(com.hazelcast.config.IndexConfig) NearCachePreloaderConfig(com.hazelcast.config.NearCachePreloaderConfig) LRUEvictionPolicyComparator(com.hazelcast.internal.eviction.impl.comparator.LRUEvictionPolicyComparator) MapConfig(com.hazelcast.config.MapConfig) AttributeConfig(com.hazelcast.config.AttributeConfig)

Aggregations

AttributeConfig (com.hazelcast.config.AttributeConfig)1 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)1 EvictionConfig (com.hazelcast.config.EvictionConfig)1 HotRestartConfig (com.hazelcast.config.HotRestartConfig)1 IndexConfig (com.hazelcast.config.IndexConfig)1 MapConfig (com.hazelcast.config.MapConfig)1 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 NearCacheConfig (com.hazelcast.config.NearCacheConfig)1 NearCachePreloaderConfig (com.hazelcast.config.NearCachePreloaderConfig)1 PartitioningStrategyConfig (com.hazelcast.config.PartitioningStrategyConfig)1 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)1 WanReplicationRef (com.hazelcast.config.WanReplicationRef)1 LRUEvictionPolicyComparator (com.hazelcast.internal.eviction.impl.comparator.LRUEvictionPolicyComparator)1