首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

2019-11-26 Hazelcast Map配置文档

map: default: in-memory-format: BINARY metadata-policy: CREATE_ON_UPDATE statistics-enabled: true optimize-queries: true cache-deserialized-values: ALWAYS backup-count: 1 async-backup-count: 0 time-to-live-seconds: 0 max-idle-seconds: 0 eviction-policy: NONE max-size: policy: PER_NODE max-size: 0 eviction-percentage: 25 min-eviction-check-millis: 100 merge-policy: batch-size: 100 class-name: PutIfAbsentMergePolicy read-backup-data: false hot-restart: enabled: false fsync: false map-store: enabled: true initial-mode: LAZY class-name: com.hazelcast.examples.DummyStore write-delay-seconds: 60 write-batch-size: 1000 write-coalescing: true properties: jdbc_url: my.jdbc.com near-cache: max-size: 5000 time-to-live-seconds: 0 max-idle-seconds: 60 eviction-policy: LRU invalidate-on-change: true in-memory-format: BINARY cache-local-entries: false eviction: size: 1000 max-size-policy: ENTRY_COUNT eviction-policy: LFU wan-replication-ref: my-wan-cluster-batch: merge-policy: com.hazelcast.map.merge.PassThroughMergePolicy filters: - com.example.SampleFilter - com.example.SampleFilter2 republishing-enabled: false indexes: name: ordered: false age: ordered: true attributes: currency: extractor: com.bank.CurrencyExtractor entry-listeners: - class-name: com.your-package.MyEntryListener include-value: false local: false partition-lost-listeners: - com.your-package.YourPartitionLostListener quorum-ref: quorumRuleWithThreeNodes

03

Spring boot的缓存使用

Spring框架为不同的缓存产品提供缓存抽象api,API的使用非常简单,但功能非常强大。今天我们将在缓存上看到基于注释的Java配置,请注意,我们也可以通过XML配置实现类似的功能。 @EnableCaching 它支持Spring的注释驱动的缓存管理功能,在spring boot项目中,我们需要将它添加到带注释的引导应用程序类中@SpringBootApplication。Spring默认提供了一个并发hashmap作为缺省缓存,但我们也可以覆盖CacheManager以轻松注册外部缓存提供程序。 @Cacheable 它在方法级别上使用,让spring知道该方法的响应是可缓存的。Spring将此方法的请求/响应管理到注释属性中指定的缓存。例如,@Cacheable ("cache-name1", “cache-name2”)。 @Cacheable注释有更多选项。就像我们可以从方法的请求中指定缓存的键,如果没有指定,spring使用所有类字段并将其用作缓存键(主要是HashCode)来维护缓存,但我们可以通过提供关键信息来覆盖此行为:

01
领券