Skip to content
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

코드에서 subkey 용어 제거 #773

Open
oliviarla opened this issue Jul 4, 2024 · 0 comments
Open

코드에서 subkey 용어 제거 #773

oliviarla opened this issue Jul 4, 2024 · 0 comments
Assignees

Comments

@oliviarla
Copy link
Collaborator

🔍 Description

  • 공식적으로 subkey란, Arcus 캐시 아이템의 키에서 prefix를 제외한 부분을 의미한다. 즉, prefix:subkey 와 같은 형태이다.
  • 하지만 현재 코드에서는 subkey라는 용어를 다른 의미로 사용하고 있다. CollectionGet, CollectionInsert 등을 여러 자료구조가 함께 사용하면서 bkey, list index, mkey 등을 하나로 묶어 표현하는 용어가 필요해졌는데 이를 subkey라고 지칭하고 있는 것이다.
  • 예를들어 아래와 같이 CollectionUpdateOperation은 map, btree 자료구조에서 사용되는데, 이 때 mkey, bkey를 subkey라는 용어로 통합해 사용하고 있다.
@Override
public CollectionUpdateOperation collectionUpdate(String key,
                                                  String subkey,
                                                  CollectionUpdate<?> collectionUpdate,
                                                  byte[] data,
                                                  OperationCallback cb) {
  return new CollectionUpdateOperationImpl(key, subkey, collectionUpdate,
          data, cb);
}

⏰ Implementation Idea

  • CollectionGet, CollectionInsert, CollectionUpdate, CollectionExist 등을 하나만 사용하는 대신 이를 상속받는 자식 클래스로 분리하여 Operation 사용을 각자 용도에 맞게 변경해야 한다.
  • 예를 들어 CollectionUpdateOperation의 구현체로 BtreeUpdateOperationImpl, MapUpdateOperationImpl을 생성해 반환해주는 메서드를 추가하면 될 것이다.
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

No branches or pull requests

3 participants