-
Notifications
You must be signed in to change notification settings - Fork 49
FEAT: add support for shard key in ketama hashing #1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/java/net/spy/memcached/ArcusReplKetamaNodeLocator.java
Outdated
Show resolved
Hide resolved
3c2d05c to
0b1d784
Compare
0b1d784 to
609d705
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
609d705 to
05d6ef7
Compare
05d6ef7 to
0930062
Compare
0930062 to
3e147e9
Compare
3e147e9 to
e4c2caf
Compare
|
https://github.com/jam2in/arcus-works/issues/790#issuecomment-3629954750 위에서 코멘트 주신대로 |
e4c2caf to
7aa0868
Compare
7aa0868 to
67e1908
Compare
|
|
67e1908 to
24f0d77
Compare
|
리뷰 가능한 상태가 되면 요청 주세요. |
|
@oliviarla @uhm0311 |
24f0d77 to
5060c02
Compare
jhpark816
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 완료
| private ArcusReplKetamaNodeLocator(TreeMap<Long, SortedSet<MemcachedReplicaGroup>> kg, | ||
| ConcurrentHashMap<String, MemcachedReplicaGroup> ag, | ||
| Collection<MemcachedNode> an) { | ||
| Collection<MemcachedNode> an, boolean shardKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArcusReplKetamaNodeLocator 기존 생성자 구현에서는
config 인자를 가지도록 먼저 변경하는 것이 좋겠습니다.
2c6110d to
4231505
Compare
|
|
uhm0311
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문입니다.
src/test/java/net/spy/memcached/ArcusKetamaNodeLocatorTest.java
Outdated
Show resolved
Hide resolved
4231505 to
326f307
Compare
|
@oliviarla |
|
commit message의 첫 문자를 대문자로 변경해주세요. |
326f307 to
1e15d08
Compare
🔗 Related Issue
⌨️ What I did
원하는 key string을 하나의 노드에 저장할 수 있도록 그룹화하는 Shard Key 기능을 구현합니다.
shard 결정을 위해서는 key의 일부만을 사용하며, 해당 조건은 아래와 같습니다.
키에
{...}패턴이 포함될 경우, 전체 키 대신{와}사이의 문자열만을 해싱하여 저장할 노드를 결정합니다.{와 처음 등장하는}사이의 하나 이상의 문자열을 해싱이를 통해 동일한 Shard Key를 가진 키들은 항상 같은 노드에 배치됨을 보장하도록 합니다.
테스트코드는 새로운
ArcusShardKeyTest클래스를 추가했습니다.