0
votes

I am new to hazecast, currently I am maintaining a system where I have scenario where I 2 cache [basically 2 maps in the single instance] Cache 1 and Cache2.

When my Hazelcast server comes up I and once Cache2 is loaded a listener is triggered. But Cache 1 is not yet loaded and the listener tries to read from Cache1 also which is a business requirment.

Is there anyway for me to find if the Cache1 is loaded at the trigger of listener or to block the triggering till cache1 is also loaded.

1
Can you plz post code/config snippet? I need to know how you are handling the listener. - A.K.Desai
also, please, attach loader code. - Vik Gamov

1 Answers

0
votes

No, there's no way to check if the Map is loaded nor to block the trigger of a listener on MapB depending on the loading of MapA. These are two independent data structures.

You can try setting the InitialLoadingMode of MapA to lazy, so that only the touched partition is loaded when the record is touched. It will be faster than loading the map completely.

You can also invoke loadAll on MapA - it's a blocking call, so it will return only if the map has loaded. Then you start playing with MapB - it's 100% certain at this stage that the listener will not block.