Skip to content

Commit

Permalink
Change documentation for "default" tag in map configuration (#1282)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
orcunc authored Oct 2, 2024
1 parent 202d387 commit ddf3e1c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions docs/modules/data-structures/pages/map-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 <<map-configuration-defaults,Map Configuration Defaults>> 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 <<map-configuration-defaults,Map Configuration Defaults>>.


== 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].

Expand Down

0 comments on commit ddf3e1c

Please sign in to comment.