Repository navigation
Add support for batch lookup by ID. - #696
Open
dlwldnjs1009 wants to merge 4 commits into
Open
dlwldnjs1009 wants to merge 4 commits into
dlwldnjs1009 wants to merge 4 commits into
Conversation
Closes spring-projects#655 Signed-off-by: Lee Jiwon <dlwldnjs1009@gmail.com>
dlwldnjs1009
marked this pull request as ready for review
September 18, 2026 07:45
See spring-projects#655 Signed-off-by: Lee Jiwon <dlwldnjs1009@gmail.com>
…aces. See spring-projects#655 Signed-off-by: Lee Jiwon <dlwldnjs1009@gmail.com>
See spring-projects#655 Signed-off-by: Lee Jiwon <dlwldnjs1009@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SimpleKeyValueRepository.findAllByIdperforms one adapter lookup per id, so store modules cannot provide a batch implementation such as the one requested in spring-projects/spring-data-redis#3150.This change adds
KeyValueOperations.findAllById(…)and aKeyValueAdapter.getAll(…)default method that falls back to per-idget(…).getAllreturns one element per requested id, in order, withnullfor missing entries, so the template can pair each id with its result when publishingAfterGetEvent.findAllByIdskips missing entries.Event order changes on this path: all
BeforeGetEvents are published before the batch lookup, followed by oneAfterGetEventper id, instead of a before/after pair per id.Tests:
KeyValueTemplateUnitTests,KeyValueTemplateTests,SimpleKeyValueRepositoryUnitTests.Open questions:
getAllsits next togetAllOf(keyspace), which returns the entire keyspace. WouldgetAllByIdbe clearer?KeyValueOperations.findAllById(…)is abstract, followingexists(…). Existing implementation binaries that neither implement nor inherit the new method will fail withAbstractMethodErrorwhenSimpleKeyValueRepository.findAllById(...)calls it. Dapr'sDaprKeyValueTemplateis an example of a directKeyValueOperationsimplementation. Should we make this a default method that falls back tofindById(…)?Closes #655