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 Map or Map methods with the elements marked as dirty. |
| Add entries to the map. Because map. returns the old value, these methods call the Map method if the entry is not found in memory to load the old value from the external system. If the MapStore uses the write-through pattern, these methods also call the Map method for each entry to write the new value to the external system. |
| 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 system. |
remove() | Remove the mapping for a key from the map if it is present. Because map. returns the old value, this method calls the Map if the entry is not found in memory to load the value from the external system. This method also calls the Map method to remove the value from the external system. |
| Remove entries from the map in various conditions. These methods call the Map method to remove the value from the external system. |
set | Update the time-to-live of an existing entry. This method calls the Map method if no value is found in memory. It also calls Entry with the entry whose time-to-live has been updated. |
clear() | Delete all entries from the map and the corresponding items from the external system. This method calls the note If the |
replace() | Replace the entry for a key only if the key is currently mapped to a given value. This method calls the Map method to write the value into the external system. |
| Apply the user-defined entry processors to one or more entries. These methods call the Map method if the value with key is not found in the memory, to load the value from the external system. If the entry processor updates the entry, these methods call the Map method to write the value into the external system. If the entry processor updates the entry's value to null value, they call the Map method to delete the value from the external system. |