This is a prerelease version.

View latest

Map Operations that Trigger Methods on a MapStore

These are the map operations that trigger methods on a configured MapStore.

If the initial-mode configuration is set to LAZY, the first time any map method is called, it triggers the MapLoader.loadAllKeys() method.
Map method Description

flush()

Flush all the local dirty entries by calling the MapStore.storeAll(Map) or MapStore.deleteAll(Collection) methods with the elements marked as dirty.

put()

putAll()

putAsync()

tryPut()

putIfAbsent()

Add entries to the map. Because map.put() returns the old value, these methods call the MapLoader.load(Object) method if the entry is not found in memory to load the old value from the external data store. If the MapStore uses the write-through pattern, these methods also call the MapStore.store(Object, Object) method for each entry to write the new value to the external data store.

set()

setAsync()

Add an entry to the map without returning the old value. These methods call the `MapStore.store(Object,Object) method to write the value to the external data store.

remove()

Remove the mapping for a key from the map if it is present. Because map.remove() returns the old value, this method calls the MapLoader.load(Object) if the entry is not found in memory to load the value from the external data store. This method also calls the MapStore.delete(Object) method to remove the value from the external data store.

removeAll()

delete()

removeAsync()

tryRemove()

Remove entries from the map in various conditions. These methods call the MapStore.delete(Object) method to remove the value from the external data store.

setTtl

Update the time-to-live of an existing entry. This method calls the MapLoader.load(Object) method if no value is found in memory. It also calls EntryStore.store(Object, MetadataAwareValue) with the entry whose time-to-live has been updated.

clear()

Delete all entries from the map and the corresponding items from the external data store. This method calls the MapStore.deleteAll(Collection) method on each partition with the keys that the given partition stores.

If the initial-mode configuration is set to LAZY, Hazelcast deletes only the loaded entries from the map and the data store. Since all the data may not be loaded in this case, some entries may still exist in the data store.

replace()

Replace the entry for a key only if the key is currently mapped to a given value. This method calls the MapStore.store(Object, Object) method to write the value into the external data store.

executeOnKey()

executeOnKeys()

submitToKey()

executeOnAllEntries()

Apply the user-defined entry processors to one or more entries. These methods call the MapLoader.load(Object) method if the value with key is not found in the memory, to load the value from the external data store. If the entry processor updates the entry, these methods call the MapStore.store(Object, Object) method to write the value into the external data store. If the entry processor updates the entry’s value to null value, they call the MapStore.delete(Object) method to delete the value from the external data store.