Class JdbcGenericMapStore
java.lang.Object
com.loomcache.server.datastructures.mapstore.JdbcGenericMapStore
- All Implemented Interfaces:
MapStore<String,String>, AutoCloseable
public final class JdbcGenericMapStore
extends Object
implements MapStore<String,String>, AutoCloseable
Built-in JDBC-backed MapStore for declarative
data-connection-ref usage.
The store is intentionally String/String because the current server-side
distributed map registry exposes DistributedMap<String, String>.
Operators provide the table and column names declaratively; all values are
bound as prepared-statement parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcGenericMapStore(String mapName, DataConnectionConfig dataConnection, GenericMapStoreConfig storeConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidRemove a single key from the backing store.voiddeleteAll(Collection<? extends String> keys) Remove multiple keys.@Nullable StringLoad the value associated withkeyfrom the backing store.Stream every key known to the backing store.voidPersist a single key/value pair.voidPersist multiple key/value pairs.
-
Constructor Details
-
JdbcGenericMapStore
public JdbcGenericMapStore(String mapName, DataConnectionConfig dataConnection, GenericMapStoreConfig storeConfig)
-
-
Method Details
-
load
Description copied from interface:MapStoreLoad the value associated withkeyfrom the backing store. -
loadAllKeys
Description copied from interface:MapStoreStream every key known to the backing store. Used for EAGER preload. Default returns an empty iterable, which disables EAGER preload.- Specified by:
loadAllKeysin interfaceMapStore<String,String> - Returns:
- an iterable over all persisted keys
-
store
-
storeAll
Description copied from interface:MapStorePersist multiple key/value pairs. Default implementation loopsMapStore.store(Object, Object); override for efficiency when the store supports bulk writes. -
delete
-
deleteAll
Description copied from interface:MapStoreRemove multiple keys. Default implementation loopsMapStore.delete(Object); override for efficiency when the store supports bulk deletes. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-