如何在 Hazelcast 中对 ReplicatedMap 进行同步初始填充?

How to do synchronous initial fill up for ReplicatedMap in Hazelcast?

Hazelcast documentation所述:

If a new member joins, there are two ways of handling the initial provisioning that is executed to replicate all existing values to the new member.

First, you can have an async fill up which does not block reads while the fill up operation is underway…

Or second, you can preform a synchronous initial fill up which blocks every read or write access to the map until the fill up operation is finished. …

如何配置同步初始填充?

不确定为什么文档中没有关于它的配置示例,但在 XSD:

中有解释

https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/resources/hazelcast-config-3.4.xsd#L528

只需在您的 replicatedmap 配置中(在 XML 中或通过代码中的 ReplicatedMapConfig)将带有键 "async-fillup" 的布尔值配置为 false。