Right now we are creating map using the default option .getMap(). We do not use the getConfig().addMapConfig option as we want to avoid checking if map empty etc., to avoid calling this code everytime we need access to a map (client code abstracted by interface getMap()).
Now the question is at some time if we want to destroy certain maps we want to iterate through all the map names and destroy only the ones matching a certain criteria. Since we do not add to MapConfig we are not able to use getConfig().getMapConfigs().keyset() to get the map names.
Now we are trying to use .getDistributedObjects() to iterate through. Only worry is is the distributed object as a whole loaded in memory (i hope not..) or just the ID and names loaded into the DistributedObject reference (like proxy). I could not make out from the code.Is it a good idea to do this way or is there a better way to get the map object references. Please help
HazelcastInstance::getDistributedObjects just recalls all locally known proxy objects, however these are all objects known to the cluster. On clients those information are requested using a server node inside the cluster itself. Therefore it is safe to iterate those proxy objects and test their types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With