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");
}
Aggregations