-
Type: New Feature
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 9.10
-
Component/s: Key/Value Store
-
Backlog priority:1,000
-
Sprint:nxcore 9.10.1
-
Story Points:1
In order to optimize interactions with the KeyValueStoreProvider, I would like to retrieve the values for a set of keys from the KeyValueStoreProvider in one round-trip. Consider adding a method to the KeyValueStoreProvider interface similar to the one below to address this optimization requirement.
/** * Retrieves a Map of key/value pairs for the given set of keys. * * @param keys the keys * @return the Map of key/value pairs * @throws IllegalArgumentException if the value cannot be returned as a {@link String} * @since 9.3 */ Map<String, byte[]> get(Set<String> keys)
and maybe convenience method
Map<String, String> get(Set<String> keys)
Sample Use Case #1: Export contents of KeyValueStoreProvider - Page through the KeyValueStoreProvider.keyStream() of keys and use this API to efficiently retrieve the values associated with the keys for subsequent export.
Sample Use Case #2: Store tiny content (Note, Tweet, etc) as a KeyValueStoreProvider value keyed by its digest and efficiently bulk retrieve that tiny content by a set of digests. A KeyValueStoreBinaryManager could be built on top of the KeyValueStoreProvider that specializes in managing tiny content. The underlying KeyValueStoreProvider could be used directly when needed to efficiently retrieve tiny content blobs in bulk. Current BinaryManager implementations do not support bulk retrieval of tiny content blobs.