From ddf3e1cae15bda02aeb38da9ee5a46c2d05ff587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Or=C3=A7un=20=C3=87olak?= <90305879+orcunc@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:43:40 +0300 Subject: [PATCH] Change documentation for "default" tag in map configuration (#1282) As the resolution of the SUP : https://hazelcast.atlassian.net/browse/SUP-550?focusedCommentId=102526 it was decided to update the documentation to make it clear that the "default" tag in map configuration means that it is used as "fallback" when the map's name that is being created does not match any entry --- .../data-structures/pages/map-config.adoc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/modules/data-structures/pages/map-config.adoc b/docs/modules/data-structures/pages/map-config.adoc index bee7e009c..4b24f5c87 100644 --- a/docs/modules/data-structures/pages/map-config.adoc +++ b/docs/modules/data-structures/pages/map-config.adoc @@ -4,6 +4,7 @@ {description} +[[map-configuration-defaults]] == Hazelcast Map Configuration Defaults The `hazelcast.xml`/`hazelcast.yaml` configuration included with your Hazelcast distribution includes the following default settings for maps. @@ -33,9 +34,22 @@ For details on map backups, refer to xref:backing-up-maps.adoc[]. For details on in-memory format, refer to xref:setting-data-format.adoc[]. -== Modifying the Default Configuration +== The Default (Fallback) Map Configuration +When a map is created, if the map name matches an entry in the `hazelcast.xml`/`hazelcast.yaml` file, the values in the matching entry are used to overwrite the initial values +discussed in the <> section. -You can create a default configuration for all maps for your environment by modifying the map configuration block named "default" in your `hazelcast.xml`/`hazelcast.yaml` file. In the following example, we set expiration timers for map entries. Map entries that are idle for an hour will be marked as eligible for removal if the cluster begins to run out of memory. Any map entry older than six hours will be marked as eligible for removal. +Maps that do not have any configuration defined use the default configuration. If you want to set a configuration that is valid for all maps, you can name your configuration as `default`. A user-defined default configuration applies to every map that does not have a specific custom map configuration defined with the map’s name. You can also use wildcards to associate your configuration with multiple map names. See the [configuration documentation](https://docs.hazelcast.com/hazelcast/5.5/configuration/using-wildcards) for more information about wildcards. + +When a map name does not match any entry in the `hazelcast.xml`/`hazelcast.yaml` file then: + +- If the `default` map configuration exists, the values under this entry are used to overwrite initial values. Therefore, `default` serves as a fallback. + +- If a `default` map configuration does not exist, the map is created with initial values as discussed in <>. + + +== Modifying the Default (Fallback) Configuration + +In the following example, we set expiration timers for dynamically created maps that lack a named configuration block. Map entries that are idle for an hour will be marked as eligible for removal if the cluster begins to run out of memory. Any map entry older than six hours will be marked as eligible for removal. For more on entry expiration, go to xref:managing-map-memory.adoc[Managing Map Memory].