Correct usage of the destroy() method

154 views
Skip to first unread message

Luis Fernando Planella Gonzalez

unread,
Feb 22, 2012, 12:48:53 PM2/22/12
to Hazelcast
Hi.
I've been using the .destroy() method on created IMaps and ITopics.
However, I'm now in doubt if I really have to do it or not, as the
examples on the docs don't state that clearly.
Should I invoke the destroy() method on maps, topics, locks, etc? Or
is the Hazelcast.getLifecycleService().shutdown() enough to release
all resources?
Thanks.

Mehmet Dogan

unread,
Feb 22, 2012, 4:05:43 PM2/22/12
to haze...@googlegroups.com

Destruction of map or topic releases resources related to that map or topic across the cluster, in all nodes. If you won't use a map or a topic anymore, then you can call destroy safely. But HazelcastInstance shutdown releases all resources allocated in current node, not in the whole cluster. To release resources of single node, it's enough to call HazelcastInstance shutdown.

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.

Luis Fernando Planella Gonzalez

unread,
Feb 23, 2012, 5:40:23 AM2/23/12
to Hazelcast
Ouch. I was assuming I had to call destroy on each node shutdown.
Thanks!

On Feb 22, 7:05 pm, Mehmet Dogan <meh...@hazelcast.com> wrote:
> Destruction of map or topic releases resources related to that map or topic
> across the cluster, in all *nodes*. If you won't use a map or a topic
Reply all
Reply to author
Forward
0 new messages