Skip to content

Comments

INTERNAL: Override equals and hashCode in core classes#886

Merged
jhpark816 merged 1 commit intonaver:developfrom
Jinyshin:refactor/override-equals-hashcode-#630
Apr 4, 2025
Merged

INTERNAL: Override equals and hashCode in core classes#886
jhpark816 merged 1 commit intonaver:developfrom
Jinyshin:refactor/override-equals-hashcode-#630

Conversation

@Jinyshin
Copy link
Contributor

@Jinyshin Jinyshin commented Mar 10, 2025

🔗 Related Issue

  • jam2in/arcus-works#630

⌨️ What I did

  • equals()hashCode() 메서드를 오버라이드하여 ArcusClient API에서 제공하는 객체들의 비교 연산을 개선했습니다.
  • 연산 상태를 나타내는 OperationStatusCollectionOperationStatusequals()hashCode()를 추가하여 객체 비교를 지원하도록 변경했습니다.
  • B+Tree 컬렉션 요소인 Element, BKeyObject, ByteArrayBKey 클래스에 equals()hashCode()를 오버라이드하여 동등성 비교가 가능하도록 수정했습니다.
  • B+Tree 연산 결과를 담는 SMGetElement, SMGetTrimKey, BTreeGetResult 클래스에 equals()hashCode()를 추가하여 컬렉션(Set, Map)에서 key로 활용할 수 있도록 개선했습니다.
  • 기존에 객체 비교 시 ==(참조 비교)가 사용되어 같은 데이터를 갖고 있어도 다른 객체로 인식되던 문제를 해결했습니다.
  • 새로 구현한 로직을 검증하기 위해 단위 테스트를 추가했습니다.

@Jinyshin Jinyshin requested a review from oliviarla March 10, 2025 07:59
@Jinyshin Jinyshin self-assigned this Mar 10, 2025
@namsic namsic changed the title INTERNAL: Refactor Operation interface with default methods INTERNAL: Override equals and hashCode in core classes Mar 10, 2025
Copy link
Collaborator

@oliviarla oliviarla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 완료입니다.

@Jinyshin Jinyshin requested a review from oliviarla March 14, 2025 09:11
Copy link
Collaborator

@oliviarla oliviarla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰완료입니다.

oliviarla
oliviarla previously approved these changes Mar 31, 2025
@jhpark816 jhpark816 requested a review from uhm0311 March 31, 2025 01:20
@jhpark816
Copy link
Collaborator

@uhm0311 최종 리뷰 바랍니다.

uhm0311
uhm0311 previously approved these changes Mar 31, 2025
@Jinyshin Jinyshin dismissed stale reviews from uhm0311 and oliviarla via 62842ac April 3, 2025 05:19
@Jinyshin Jinyshin force-pushed the refactor/override-equals-hashcode-#630 branch from f4d12ed to 62842ac Compare April 3, 2025 05:19
@Jinyshin Jinyshin requested a review from oliviarla April 3, 2025 05:23
return false;
}

Element<?> element = (Element<?>) o;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 변수명을 that으로 두면 좋겠습니다.

@Jinyshin Jinyshin force-pushed the refactor/override-equals-hashcode-#630 branch from 62842ac to aa7047c Compare April 4, 2025 06:51
oliviarla
oliviarla previously approved these changes Apr 4, 2025
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 완료

사소한 것 하나가 있습니다.

public CollectionOperationStatus getCollectionResponse() {
return opStatus;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여긴 그대로 둡시다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 알겠습니다.

@Jinyshin Jinyshin force-pushed the refactor/override-equals-hashcode-#630 branch from aa7047c to 59975db Compare April 4, 2025 07:35
@Jinyshin Jinyshin requested a review from jhpark816 April 4, 2025 08:41
@jhpark816 jhpark816 merged commit b00a67b into naver:develop Apr 4, 2025
2 checks passed
@Jinyshin Jinyshin deleted the refactor/override-equals-hashcode-#630 branch April 7, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants