Skip to main content
Version: 5.16

Configuring MultiMaps

Hazelcast MultiMap, also known as IMultiMap, is a specialized map where you can store multiple values under a single key. Just like any other distributed data structure implementation in Hazelcast, MultiMap is distributed and thread-safe. You can create and configure MultiMaps using the MultiMap custom resource.

Configuring a MultiMap Resource​

You can use any of the following configuration options in the MultiMap resource. For more information, see the API Reference.

FieldDescription
nameName of the MultiMap configuration that you're creating. If empty, the custom resource (CR) name is used.
hazelcastResourceNameDefines the name of the Hazelcast resource.
backupCountCount of synchronous backups.
binaryWhen true, stores all MultiMap values in BINARY format, otherwise stores these values in OBJECT format.
collectionTypeThe type of the value collection. Use either SET or LIST.

Example Configuration​

The following MultiMap custom resource creates a MultiMap configuration for the Hazelcast resource that is defined in the hazelcastResourceName field.

Example configuration
yaml
apiVersion: hazelcast.com/v1alpha1
kind: MultiMap
metadata:
name: multimap-sample
spec:
hazelcastResourceName: hazelcast
binary: false
backupCount: 1
collectionType: SET

After creating the MultiMap resource, use the following command to check its status:

shell
kubectl get multimap multimap-sample -o wide
NAME STATUS HAZELCAST-RESOURCE MESSAGE
multimap-sample Success hazelcast