Interface ReplicatedMap<K, V>

A specialized map whose values locally stored on every node of the cluster.

Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.

Type Parameters

  • K

  • V

Hierarchy

Methods

  • Adds an entry listener for this map. The listener will be notified for all map add/remove/update/evict events.

    Returns

    registration id of the listener

    Parameters

    Returns Promise<string>

  • Adds the specified entry listener for the specified key. The listener will be notified for all add/remove/update/evict events of the specified key only.

    Returns

    Registration id of the listener.

    Parameters

    • listener: EntryListener<K, V>

      listener object

    • key: K

      key to restrict events to associated entry

    Returns Promise<string>

  • Adds a continuous entry listener for this map. The listener will be notified for map add/remove/update/evict events filtered by the given predicate.

    Returns

    registration id of the listener

    Parameters

    • listener: EntryListener<K, V>

      listener object

    • key: K

      key to restrict events to associated entry

    • predicate: Predicate

      predicate

    Returns Promise<string>

  • Adds a continuous entry listener for this map. The listener will be notified for map add/remove/update/evict events filtered by the given predicate.

    Returns

    registration id of the listener

    Parameters

    Returns Promise<string>

  • Wipes data out of the replicated maps. If some node fails on executing the operation, it is retried for at most 5 times (on the failing nodes only).

    Returns Promise<void>

  • Returns true if this map contains a mapping for the specified key. This message is idempotent.

    Throws

    AssertionError if key is null

    Returns

    true if this map contains the specified key, false otherwise

    Parameters

    • key: K

      the key to search for

    Returns Promise<boolean>

  • Returns true if this map maps one or more keys to the specified value.

    Throws

    AssertionError if key is null

    Returns

    true if the specified value is associated with at least one key

    Parameters

    • value: V

      the value to search for

    Returns Promise<boolean>

  • Returns map entries as an array of key-value pairs.

    Returns

    map entries as an array of key-value pairs

    Returns Promise<[K, V][]>

  • Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

    If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases. This message is idempotent.

    Throws

    AssertionError if key is null

    Returns

    value associated with the specified key

    Parameters

    • key: K

      the key of the map entry

    Returns Promise<V>

  • Returns

    true if this map has no entries, false otherwise

    Returns Promise<boolean>

  • Returns a view of the key contained in this map.

    Returns

    keys of this map as an array

    Returns Promise<K[]>

  • Associates a given value to the specified key and replicates it to the cluster. If there is an old value, it will be replaced by the specified one and returned from the call.

    Throws

    AssertionError if key or value is null

    Returns

    old value if there was any, null otherwise

    Parameters

    • key: K

      the key of the map entry

    • value: V

      new value

    • Optional ttl: number | Long

      optional time to live in milliseconds. 0 means infinite.

    Returns Promise<V>

  • Copies all the mappings from the specified key-value pairs array to this map.

    The behavior of this operation is undefined if the specified map is modified while the operation is in progress.

    Parameters

    • pairs: [K, V][]

      entries to be put

    Returns Promise<void>

  • Removes the mapping for a key from this map if it is present.

    Throws

    AssertionError if key is null

    Returns

    value associated with key, null if the key did not exist before

    Parameters

    • key: K

      the key of the map entry

    Returns Promise<V>

  • Removes the specified entry listener. Returns silently if there was no such listener added before. This message is idempotent.

    Returns

    true if remove operation is successful, false if unsuccessful or this listener did not exist

    Parameters

    • listenerId: string

      registration id of the listener

    Returns Promise<boolean>

  • Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE (Java; 2^31-1) elements, returns Integer.MAX_VALUE.

    Returns

    the number of key-value mappings in this map.

    Returns Promise<number>

Generated using TypeDoc