FEATURE: Add CompletableFuture BTree insert/get API#1026
FEATURE: Add CompletableFuture BTree insert/get API#1026jhpark816 merged 1 commit intonaver:developfrom
Conversation
a07510d to
91630d5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
91630d5 to
310caa8
Compare
310caa8 to
67103e8
Compare
|
@brido4125 |
67103e8 to
a4de747
Compare
a4de747 to
fd67320
Compare
fd67320 to
01134d3
Compare
|
@brido4125 @uhm0311 |
01134d3 to
eed5b94
Compare
b5b113f to
a6c92cb
Compare
| public static final class Builder { | ||
| private ElementFlagFilter eFlagFilter; | ||
| private int offset = 0; | ||
| private int count = 50; |
There was a problem hiding this comment.
default 값 50은 어떤 기준으로 설정한 것인가요?
bop get/mget/smget 연산마다 달라질 것 같은데요.
bop get에서는 default가 0이어야 하고,
그 외는 count 값이 설정되어야 할 것 같습니다.
따라서, default 값 0이 맞을 것 같습니다.
There was a problem hiding this comment.
bop get/mget/smget 에서 모두 오류 없이 사용 가능한 최대 값을 설정해둔 것 뿐입니다.
default 값을 0으로 두면 mget 시에 항상 50으로 재정의해두어야 하기 때문에 사용할 때 불편하지 않을까 싶었는데,
0으로 두는게 더 낫다면 변경하겠습니다.
a6c92cb to
2fa92e5
Compare
|
@jhpark816 리뷰 반영했습니다. resolve하지 않은 코멘트에 대해서는 의견 주시거나 일단 resolve 상태로 변경해주시면 됩니다. |
2fa92e5 to
41521bd
Compare
|
@uhm0311 |
41521bd to
62f6ec4
Compare
|
@uhm0311 |
d59ead4 to
a9dc006
Compare
|
jhpark816
left a comment
There was a problem hiding this comment.
리뷰 완료.
그 외 의견입니다.
- PR 코드가 전반적으로 복잡해 보임.
- 용어 정리가 필요해 보임.
| for (Map.Entry<MemcachedNode, List<String>> entry : arrangedKeys) { | ||
| BTreeGetBulk<T> getBulk = createBTreeGetBulk(from, to, args, entry); | ||
| CompletableFuture<Map<String, BTreeElements<T>>> future = | ||
| bopMultiGetPerNode(client, getBulk).toCompletableFuture(); |
There was a problem hiding this comment.
질문입니다.
toCompletableFuture() 구현은 어디에 있나요?
There was a problem hiding this comment.
ArcusFuture가 상속받는 CompletableFuture 클래스 내부에 있습니다.
| : futureToKeys.entrySet()) { | ||
| if (entry.getKey().isCompletedExceptionally()) { | ||
| for (String key : entry.getValue()) { | ||
| results.put(key, null); |
There was a problem hiding this comment.
여기도 질문입니다.
이 작업을 bopMultiGetPerNode() 에서 담당할 수 있나요?
There was a problem hiding this comment.
최종 결과 Map 객체를 bopMultiGetPerNode에 인자로 전달하고 해당 메서드 내부에서 응답이 오면 Map에 바로 저장하라는 말씀이신가요?
저는 현재 방식이 이해하기 쉬울 것 같습니다.
| client.groupingKeys(keys, ArcusClient.SMGET_CHUNK_SIZE, APIType.BOP_SMGET); | ||
|
|
||
| Collection<CompletableFuture<?>> futures = new ArrayList<>(); | ||
| List<CompletableFuture<SMGetElements<T>>> smGetFutures = new ArrayList<>(); |
There was a problem hiding this comment.
futures와 smGetFutures 모두가 있어야 하나요? 하나만 두어도 되는지?
(같은 내용을 가지고 있어서 질문합니다.)
| } | ||
|
|
||
| return new SMGetElements<>(elements, missedKeys, trimmedKeys); | ||
| } |
There was a problem hiding this comment.
이러한 로직을 smget 처리하는 코드에 두지 않고, SMGetElements 클래스에 두고 있네요.
smget 처리 코드에 두어야 하지 않는 지 ?
There was a problem hiding this comment.
이전에 @uhm0311 님께서 이쪽에 두는 것에 좋겠다는 코멘트를 받기도 했고 저도 이쪽에 두는 게 나을 것 같습니다.
AsyncArcusCommands에 이 로직을 추가하면 클래스가 너무 복잡해질 것 같습니다.
a9dc006 to
c679274
Compare
🔗 Related Issue
⌨️ What I did
구현 관점 특이 사항
Transcoder<Object>타입을 가져와Transcoder<T>타입으로 형변환합니다.SMGet 관련 사항
SMGetResult#mergeSMGetResults정적 메서드에 값들을 합치는 로직을 위임합니다.bkey -> btree item key순으로 정렬됩니다. 다만 하나의 BKey를 입력받는 API의 경우btree item key가 항상 ascending 순으로 정렬됩니다.새로 추가된 VO 클래스들과 각 메서드의 서버 응답 별 반환 값은 New Interface 설계(Notion 문서)에 정리되어 있습니다.
가장 기본적인 메서드들만 추가하였고,
bop update,bop incr등의 API는 다음 PR로 추가할 예정입니다.