Constructor and Description |
---|
MapStoreAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
delete(K key)
Deletes the entry with a given key from the store.
|
void |
deleteAll(Collection<K> keys)
Deletes multiple entries from the store.
|
V |
load(K key)
Loads the value of a given key.
|
Map<K,V> |
loadAll(Collection<K> keys)
Loads given keys.
|
Iterable<K> |
loadAllKeys()
Loads all of the keys from the store.
|
void |
store(K key,
V value)
Stores the key-value pair.
|
void |
storeAll(Map<K,V> map)
Stores multiple entries.
|
public void delete(K key)
If an exception is thrown the remove operation will fail.
public void store(K key, V value)
If an exception is thrown then the put operation will fail.
public void storeAll(Map<K,V> map)
Implementation of this method can optimize the store operation by storing all entries in one database connection. storeAll() is used when writeDelaySeconds is positive (write-behind).If an exception is thrown, the entries will try to be stored one by one using the store() method.
Note: on the retry phase only entries left in the map will be stored one-by-one. In this way a MapStore implementation can handle partial storeAll() cases when some entries were stored successfully before a failure happens. Entries removed from the map will be not passed to subsequent call to store() method any more.
public void deleteAll(Collection<K> keys)
If an exception is thrown the entries will try to be deleted one by one using the delete() method.
Note: on the retry phase only entries left in the keys will be deleted one-by-one. In this way a MapStore implementation can handle partial deleteAll() cases when some entries were deleted successfully before a failure happens. Entries removed from the keys will be not passed to subsequent call to delete() method any more. The intended usage is to delete items from the provided collection as they are deleted from the store.
public V load(K key)
public Map<K,V> loadAll(Collection<K> keys)
For any key in the input keys, there should be a single mapping in the resulting map. Also the resulting map should not have any keys that are not part of the input keys.
The given collection should not contain any null
keys.
The returned Map should not contain any null
keys or values.
Loading other items than what provided in keys
prevents the map from being filled from the map store.
public Iterable<K> loadAllKeys()
Iterable
may return the keys lazily
by loading them in batches. The Iterator
of this Iterable
may implement the
Closeable
interface in which case it will be closed once iteration is over.
This is intended for releasing resources such as closing a JDBC result set.
The returned Iterable should not contain any null
keys.
loadAllKeys
in interface MapLoader<K,V>
null
.Copyright © 2022 Hazelcast, Inc.. All rights reserved.