Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating and Removing an Map from HazelCast

Tags:

hazelcast

I am using the following code to create an map in HazelCast

HazelcastInstance instance = null;
Config cfg = new Config();
instance =Hazelcast.newHazelcastInstance(cfg);
instance.getMap(mapName);

Once I am done with the my processing I want to remove this map from HazelCast. Can you Please suggest how to go about it.

like image 413
user3525836 Avatar asked Jun 04 '14 01:06

user3525836


People also ask

How do I delete a map from Hazelcast?

getMap(mapName). destroy();

How do I use a Hazelcast map?

Getting a Map and Putting an Entry Let's create a Hazelcast instance and fill a map named Capitals with key-value pairs using the following code. Use the HazelcastInstance getMap method to get the map, then use the map put method to put an entry into the map.

How does a Hazelcast distributed map work?

Hazelcast distributes the map entries onto multiple cluster members. Each member holds some portion of the data. Distributed maps have one backup by default. If a member goes down, your data is recovered using the backups in the cluster.


1 Answers

I did not receive any replies but got the answer. You can use

instance.getMap(mapName).destroy();

I am posting this so that it might help someone else in need.

like image 104
user3525836 Avatar answered Oct 22 '22 04:10

user3525836