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.

Field Description

name

Name of the MultiMap configuration that you’re creating. If empty, the custom resource (CR) name is used.

hazelcastResourceName

Defines the name of the Hazelcast resource.

backupCount

Count of synchronous backups.

binary

When true, stores all MultiMap values in BINARY format, otherwise stores these values in OBJECT format.

collectionType

The 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
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:

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