简体   繁体   中英

Is hazelcast distributed-loading blocking?

Currently, I have an IMap backed with a MapStore. This IMap is loaded on startup and have millions of entries. When the map is fully loaded, the clients retrieves entries using Imap.values() with predicates. This loading work fine for me on startup.

Now, I have to reload peridiocally all the data (eg, every 2 hours). I'm using IMap.loadAll(true) to force the reload. The MapStore (loadAllKeys() + loadAll(keys)) takes about 4 minutes to finish the complete load. It seems that in these 4 minutes, all the clients that send queries to the imap via predicates are blocked until the reloading is finished.

In my case, I can't block the cluster 4 minutes (neither a second in fact).

  1. is really the Imap.loadAll blocking the predicates queries?
  2. is possible configure the imap as non-blocking or exists a non-blocking alternative to IMap.loadAll().

I'm trying it with HC 3.7.2, with 2 nodes and java 8.

It's a sensible use case, but it's currently unsupported for a couple of reasons. The loading takes place on the partition threads and thus blocks them - it gives consistency, the map won't serve any requests until the loading has finished.

For your use case of "reloading" it would have to happen not on partition threads so that the requests can be served.

Could you create a feature request on github? It looks like sth we could address in the next release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM