Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HazelCast get all distributed map names

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

like image 946
PAVAN RANGAIN Avatar asked Mar 13 '23 14:03

PAVAN RANGAIN


1 Answers

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.

like image 188
noctarius Avatar answered Apr 01 '23 13:04

noctarius