arcus-java-client icon indicating copy to clipboard operation
arcus-java-client copied to clipboard

FEATURE: Create new api asyncBopPipedUpsert.

Open brido4125 opened this issue 1 year ago • 4 comments

Motivation

아래 캐시 동기화에 필요한 기능 이슈를 해결하기 위해 구현한다. https://github.com/jam2in/arcus-works/issues/426

구현 로직

캐시 서버는 bop insert와 bop upsert 요청에 대해 아래와 같이 동일한 인자와 형식을 가지고 있습니다.

bop insert <key> <bkey> [<eflag>] <bytes> [create <attributes>] [noreply|pipe|getrim]\r\n<data>\r\n
bop upsert <key> <bkey> [<eflag>] <bytes> [create <attributes>] [noreply|pipe|getrim]\r\n<data>\r\n

그래서 기존의 asyncCollectionPipedInsert()를 활용하여 piped upsert를 가능하도록 구현하였습니다.

단건 upsert의 경우도 아래와 같이 asyncCollectionInsert를 사용하여 구현되어 있습니다.

@Override
  public CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey,
                                                  byte[] elementFlag, Object value,
                                                  CollectionAttributes attributesForCreate) {

    BTreeUtil.validateBkey(bkey);
    BTreeUpsert<Object> bTreeUpsert = new BTreeUpsert<Object>(value, elementFlag, null, attributesForCreate);

    return asyncCollectionInsert(key, String.valueOf(bkey), bTreeUpsert,
            collectionTranscoder);
  }

즉, 이러한 구현이 단건과 다건 api에 대한 일관적으로 구현된 형태입니다.

brido4125 avatar Aug 22 '23 07:08 brido4125

@uhm0311 @brido4125 리뷰는 진행해 주시고, merge는 향후 버전에 반영하기 위해 나중에 처리할 예정임을 참고 바랍니다.

jhpark816 avatar Aug 23 '23 04:08 jhpark816

@brido4125 커밋메시지 부분 오타있습니다. INTERNAL이 아니라 INTREANL이라고 적혀있네요.

junghoon-vans avatar Sep 12 '23 02:09 junghoon-vans

@brido4125 리뷰가 모두 반영되지 않은 것 같습니다. 다른 의견이 있다면 말씀해주세요.

uhm0311 avatar Sep 20 '23 01:09 uhm0311

@brido4125 1.13.4 버전이 릴리즈 되었으니 리뷰 반영을 재개해주시기 바랍니다. 혹은 리뷰 의견에 이견이 있다면 코멘트 바랍니다.

uhm0311 avatar Oct 10 '23 07:10 uhm0311