Can we change Hazelcast MapConfig after Map initialization

213 views
Skip to first unread message

Nitin Singh

unread,
Dec 10, 2021, 1:16:11 AM12/10/21
to Hazelcast
We can specify MapConfig from either static cluster-config.xml files or programmatically from code. While creating IMap instance from code,
1) Is it possible to change mapConfig after map initialization has been done.
2) Will such changes for example - backup count or max size reflect live on already partitioned map across nodes (leading to eviction of entries or creation of more backups). If this does not happen by default, will it be picked up on some next event threshold or can we trigger the new config changes to apply programmatically ?

Sample code
HazelcastInstance hazelcastInstance = Hazelcast.getHazelcastInstanceByName(instanceName);
Config config = hazelcastInstance.getConfig();
config.getMapConfig(name)
.setBackupCount(computedBackupCount)
.setMaxSizePolicy(MaxSizePolicy.PER_NODE).setSize(computedSize);

Jiri Holusa

unread,
Jan 14, 2022, 5:45:12 AM1/14/22
to Hazelcast
Hi Nitin,

sorry for a very late response, the email kind of slipped through my radar.


Hope this helps,
Jiri

Nitin Singh

unread,
Jan 19, 2022, 7:17:37 AM1/19/22
to Hazelcast
Thank you for the confirmation

Bence Eros

unread,
Jan 19, 2022, 9:09:59 AM1/19/22
to haze...@googlegroups.com
Hello Nitin,

there is support in Hazelcast Management Center for updating a couple of fields of the map configuration: https://docs.hazelcast.com/management-center/5.0/data-structures/map#map-config
In case it fits your needs, please keep in mind that these changes are not persisted anywhere, so if you restart a cluster member then your changes will be gone.

Kind regards,

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/aaef0e6b-75a4-42d7-80bb-a5d8ea41caefn%40googlegroups.com.


--
Bence Erős

dev@management-center

er...@hazelcast.com

Hazelcast

2 W 5th Ave, Ste 300 | San Mateo, CA 94402 | USA

+1 (650) 521-5453 | hazelcast.com


This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast
Reply all
Reply to author
Forward
0 new messages