FEATURE: Add CompletableFuture Map-based multiStore APIs#1056
Open
f1v3-dev wants to merge 1 commit intonaver:developfrom
Open
FEATURE: Add CompletableFuture Map-based multiStore APIs#1056f1v3-dev wants to merge 1 commit intonaver:developfrom
f1v3-dev wants to merge 1 commit intonaver:developfrom
Conversation
e7dacd6 to
4e1634a
Compare
oliviarla
reviewed
Mar 11, 2026
| * @param exp expiration time in seconds | ||
| * @return Map of key to Boolean result | ||
| */ | ||
| ArcusFuture<Map<String, Boolean>> multiSet(Map<String, T> keyValueMap, int exp); |
Collaborator
There was a problem hiding this comment.
전체적으로 keyValueMap -> elements로 표현해도 충분할 것 같습니다.
| } | ||
|
|
||
| @Test | ||
| void multiSetSuccess() throws ExecutionException, InterruptedException, TimeoutException { |
Collaborator
There was a problem hiding this comment.
multiSetSuccess -> multiSetMapSuccess
Comment on lines
+262
to
+272
| return new ArcusMultiFuture<>(keyToFuture.values(), () -> { | ||
| Map<String, Boolean> results = new HashMap<>(); | ||
| for (Map.Entry<String, CompletableFuture<?>> entry : keyToFuture.entrySet()) { | ||
| if (entry.getValue().isCompletedExceptionally()) { | ||
| results.put(entry.getKey(), null); | ||
| } else { | ||
| results.put(entry.getKey(), (Boolean) entry.getValue().join()); | ||
| } | ||
| } | ||
| return results; | ||
| }); |
Collaborator
There was a problem hiding this comment.
기존 multiStore과 중복되는 부분인데 별도 메서드화하여 중복을 줄일 수 있을까요?
Collaborator
Author
There was a problem hiding this comment.
아래 코드와 같은 buildMultiFuture() 메서드로 공통 로직을 추출하여 중복을 줄일 수 있을 것 같습니다.
private ArcusMultiFuture<Map<String, Boolean>> buildMultiFuture(Map<String, CompletableFuture<?>> keyToFuture) {
return new ArcusMultiFuture<>(keyToFuture.values(), () -> {
//...
}
return results;
});
}| for (int i = 0; i < 2; i++) { | ||
| assertEquals(VALUE + "-new-" + i, result.get(keys.get(i))); | ||
| } | ||
| // 캐시에 아예 없어야 하므로 맵에서 꺼냈을 때 null이 나와야 합니다. |
4e1634a to
c0086e7
Compare
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.
🔗 Related Issue
⌨️ What I did
multiSet,multiAdd,multiReplace) API를 구현합니다.