naver / arcus-java-client

ARCUS Java client
Apache License 2.0
50 stars 46 forks source link

collection API - 생략 가능 인자 처리. #439

Open jhpark816 opened 2 years ago

jhpark816 commented 2 years ago

Cache server API에서는 생략 가능한 인자이지만, client API에서는 필수 인자로 받고 있다. 따라서, client API 호출 시에 불필요하게 많은 인자를 넘기고 있다.

예를 들어, asyncBopGet API에서 생략 가능한 인자는 아래와 같다.

읽기 쉬운 코드를 위해 생략되는 인자를 제외하는 API 제공하는 것은 어떤지 ?

jhpark816 commented 2 years ago

@sUpniverse @hjyun328 의견 바랍니다.

hjyun328 commented 2 years ago

@jhpark816 @sUpniverse 추가하는게 좋겠습니다. 추가 옵션을 사용하지 않는다면 응용 코드도 한결 깔끔해질 것이구요. bopGet 뿐만 아니라 다른 collection도 마찬가지로 withDelete, dropIfEmpty를 제거한 API 추가도 필요해보입니다.

sUpniverse commented 2 years ago

@jhpark816 @hjyun328 저도 동의 합니다. 사용자 관점에서 모든 인자가 반드시 입력이 필요한 필수인자로 느껴져 혼란을 줄 수 있다고 생각합니다. 생략 가능한 인자에 관해서는 생략한 API를 제공하는게 사용자에게 좋을것 같습니다.

sUpniverse commented 2 years ago

@jhpark816 @hjyun328 생략가능한 인자를 가진 API는 아래와 같습니다. 생략가능 인자를 제외하고 필수 인자만으로 이루어진 API를 추가하면 될 것 같습니다.

// b+tree
CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key,  long bkey, ElementFlagFilter eFlagFilter, boolean withDelete, boolean dropIfEmpty)

CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key, long bkey, ElementFlagFilter eFlagFilter, boolean withDelete,  boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count, boolean withDelete, boolean dropIfEmpty)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count, boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, byte[] eFlag, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, byte[] eFlag, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopUpsert(String key, byte[] bkey, byte[] elementFlag, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopUpsert(String key, byte[] bkey, byte[] elementFlag, Object value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet( List<String> keyList, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, long from, long to, ElementFlagFilter eFlagFilter, int count, SMGetMode smgetMode)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int count, SMGetMode smgetMode)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopInsertAndGetTrimmed(String key, long bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopInsertAndGetTrimmed(String key, byte[] bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed(String key, long bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed(String key, byte[] bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopUpsertAndGetTrimmed(String key, long bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

BTreeStoreAndGetFuture<Boolean, E> asyncBopUpsertAndGetTrimmed(String key, long bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopUpsertAndGetTrimmed(String key, byte[] bkey, byte[] eFlag, Object value, CollectionAttributes attributesForCreate)

BTreeStoreAndGetFuture<Boolean, E> asyncBopUpsertAndGetTrimmed(String key, byte[] bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder)

CollectionFuture<Long> asyncBopIncr(String key, long bkey, int by, long initial, byte[] eFlag)

CollectionFuture<Long> asyncBopIncr(String key, byte[] bkey, int by, long initial, byte[] eFlag)

CollectionFuture<Long> asyncBopDecr(String key, long bkey, int by, long initial, byte[] eFlag)

CollectionFuture<Long> asyncBopDecr(String key, byte[] bkey, int by, long initial, byte[] eFlag)

CollectionFuture<Boolean> asyncBopDelete(String key, long bkey, ElementFlagFilter eFlagFilter, boolean dropIfEmpty)

CollectionFuture<Boolean> asyncBopDelete(String key, long from, long to, ElementFlagFilter eFlagFilter, int count, boolean dropIfEmpty)

// map
CollectionFuture<Map<String, Object>> asyncMopGet(String key, boolean withDelete,  boolean dropIfEmpty)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, boolean withDelete,  boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey,  boolean withDelete, boolean dropIfEmpty)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey,  boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList, boolean withDelete, boolean dropIfEmpty) 

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList, boolean withDelete, boolean dropIfEmpty,  Transcoder<T> tc) 

CollectionFuture<Integer> asyncBopGetItemCount(String key, byte[] from, byte[] to,  ElementFlagFilter eFlagFilter)

CollectionFuture<Boolean> asyncMopDelete(String key, boolean dropIfEmpty)

CollectionFuture<Boolean> asyncMopDelete(String key, String mkey, boolean dropIfEmpty)

// list
CollectionFuture<List<Object>> asyncLopGet(String key, int index, boolean withDelete, boolean dropIfEmpty, )

CollectionFuture<List<Object>> asyncLopGet(String key, int index, boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to, boolean withDelete, boolean dropIfEmpty)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to, boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<Boolean> asyncLopDelete(String key, int index, boolean dropIfEmpty)

CollectionFuture<Boolean> asyncLopDelete(String key, int from, int to, boolean dropIfEmpty)

// set
CollectionFuture<Set<Object>> asyncSopGet(String key, int count, boolean withDelete, boolean dropIfEmpty)

CollectionFuture<Set<Object>> asyncSopGet(String key, int count, boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value, boolean dropIfEmpty)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value, boolean dropIfEmpty, Transcoder<T> tc)

// 생성자 추가 대상
CollectionInsert(T value, byte[] elementFlag, boolean createKeyIfNotExists, RequestMode requestMode, CollectionAttributes attr)

BTreeInsert(T value, byte[] eFlag, boolean createKeyIfNotExists, RequestMode requestMode, CollectionAttributes attr)

BTreeUpsert(T value, byte[] eFlag, boolean createKeyIfNotExists, RequestMode requestMode, CollectionAttributes attr)

BTreeInsertAndGet(Command cmd, long bkey, byte[] eFlag, T value, CollectionAttributes attributesForCreate)

BTreeInsertAndGet(Command cmd, byte[] bkey, byte[] eFlag, T value, CollectionAttributes attributesForCreate)

BTreeBulkInsert(MemcachedNode node, List<String> keyList, long bkey, byte[] eflag, T value, CollectionAttributes attr, Transcoder<T> tc)

BTreeBulkInsert(MemcachedNode node, List<String> keyList, byte[] bkey, byte[] eflag, T value, CollectionAttributes attr, Transcoder<T> tc)

BTreeMutate(Mutator m, int by, long initial, byte[] eFlag)

BTreeSMGetWithByteTypeBkeyOld(MemcachedNode node, List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeGetBulkWithLongTypeBkey(MemcachedNode node, List<String> keyList,  long from, long to, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeGetBulkWithByteTypeBkey(MemcachedNode node, List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeGetBulkImpl(MemcachedNode node, List<String> keyList, long from, long to, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeGetBulkImpl(MemcachedNode node, List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeGetBulkImpl(MemcachedNode node, List<String> keyList, long bkey, ElementFlagFilter eFlagFilter, int offset, int count)

BTreeElement(K bkey, byte[] eflag, V value)

Element(byte[] bkey, T value, byte[] eflag)

Element(long bkey, T value, byte[] eflag)
jhpark816 commented 2 years ago

@sUpniverse @hjyun328 offline 미팅으로 논의하고 나서, 최종 결정하시죠.

sUpniverse commented 2 years ago

@oliviarla

server의 ascii 문서를 참고하여

  1. 생략가능한 인자를 제외한 API (필수 인자)
  2. 그외에 생략가능한 인자를 부분적으로 포함한 API 도 고려

추가할 API 목록을 작성 후 작업을 진행하면 됩니다.

oliviarla commented 2 years ago

@sUpniverse 1. 생략가능한 인자를 제외한 API (필수 인자) 목록입니다. 이대로 진행해도 괜찮을까요?

// list
CollectionFuture<List<Object>> asyncLopGet(String key, int index)

CollectionFuture<List<Object>> asyncLopGet(String key, int index, Transcoder<T> tc)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to, Transcoder<T> tc)

CollectionFuture<Boolean> asyncLopDelete(String key, int index)

CollectionFuture<Boolean> asyncLopDelete(String key, int from, int to)

// set
CollectionFuture<Set<Object>> asyncSopGet(String key, int count)

CollectionFuture<Set<Object>> asyncSopGet(String key, int count, Transcoder<T> tc)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value, Transcoder<T> tc)

//map
CollectionFuture<Map<String, Object>> asyncMopGet(String key)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList) 

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList, Transcoder<T> tc) 

CollectionFuture<Boolean> asyncMopDelete(String key)

CollectionFuture<Boolean> asyncMopDelete(String key, String mkey)

//b+tree
// bkey, from, to가 byte[] 형식인 메소드들은 생략
CollectionFuture<Integer> asyncBopGetItemCount(String key, long from, long to)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key,  long bkey)

CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key, long bkey, Transcoder<T> tc)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, int offset, int count)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, int offset, int count, Transcoder<T> tc)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, int offset, int count)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, int offset, int count, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)ong, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, int offset, int count, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, Object value)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, T value, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, Object value)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, Object value, Transcoder<T> tc)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet( List<String> keyList, long from, long to, int offset, int count)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, long from, long to, int count, SMGetMode smgetMode)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopInsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopUpsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopUpsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

CollectionFuture<Long> asyncBopIncr(String key, long bkey, int by) //eflag와 동시에 initial도 삭제하였습니다

CollectionFuture<Long> asyncBopDecr(String key, long bkey, int by)

CollectionFuture<Boolean> asyncBopDelete(String key, long bkey)

CollectionFuture<Boolean> asyncBopDelete(String key, long from, long to, int count) //count(필수): from~to 범위 내에서 앞에서부터 count 개수만큼 삭제
sUpniverse commented 2 years ago

@oliviarla

bopGet 의 offset arugemnt는 생략 불가능 한가요? 그외 다른 API의 offset 도 마찬가지로 생략 불가능 한가요?

oliviarla commented 2 years ago

@sUpniverse 모두 offset과 count 생략이 가능하네요! 수정했습니다.

// list
CollectionFuture<List<Object>> asyncLopGet(String key, int index)

CollectionFuture<List<Object>> asyncLopGet(String key, int index, Transcoder<T> tc)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to)

CollectionFuture<List<Object>> asyncLopGet(String key,  int from, int to, Transcoder<T> tc)

CollectionFuture<Boolean> asyncLopDelete(String key, int index)

CollectionFuture<Boolean> asyncLopDelete(String key, int from, int to)

// set
CollectionFuture<Set<Object>> asyncSopGet(String key, int count)

CollectionFuture<Set<Object>> asyncSopGet(String key, int count, Transcoder<T> tc)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value)

CollectionFuture<Boolean> asyncSopDelete(String key, Object value, Transcoder<T> tc)

//map
CollectionFuture<Map<String, Object>> asyncMopGet(String key)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey, Transcoder<T> tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList) 

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List<String> mkeyList, Transcoder<T> tc) 

CollectionFuture<Boolean> asyncMopDelete(String key)

CollectionFuture<Boolean> asyncMopDelete(String key, String mkey)

//b+tree
// bkey, from, to가 byte[] 형식인 메소드들도 구현 필요
CollectionFuture<Integer> asyncBopGetItemCount(String key, long from, long to)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key,  long bkey)

CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key, long bkey, Transcoder<T> tc)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, Transcoder<T> tc)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, Object value)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, T value, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, Object value)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, Object value, Transcoder<T> tc)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet( List<String> keyList, long from, long to)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, long from, long to, SMGetMode smgetMode)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopInsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopUpsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopUpsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

CollectionFuture<Long> asyncBopIncr(String key, long bkey, int by)

CollectionFuture<Long> asyncBopDecr(String key, long bkey, int by)

CollectionFuture<Boolean> asyncBopDelete(String key, long bkey)

CollectionFuture<Boolean> asyncBopDelete(String key, long from, long to, int count) //count(필수): from~to 범위 내에서 앞에서부터 count 개수만큼 삭제
jhpark816 commented 2 years ago

코멘트입니다.

oliviarla commented 2 years ago

코멘트에 대한 답변입니다!

jhpark816 commented 2 years ago

@oliviarla @sUpniverse @uhm0311

jhpark816 commented 2 years ago

@sUpniverse @uhm0311 위에 코멘트 한 작업에 대해 수정이 필요한 사항이 있다면, 알려주세요.

sUpniverse commented 2 years ago

@jhpark816 @oliviarla 제네릭 type T를 사용한건 class의 type을 제한하기 위해서 입니다.

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

위의 API 와 같이 Transcoder에 제네릭T가 선언되어 있는데, 그 이유는 value의 type과 transcoder의 type을 맞추기 위함입니다. object type으로 변경할 경우 value와 transcoder의 type이 달라도 사용이 가능하므로 이는 컴파일 time에서는 오류가 발생하지 않지만, 런타임시에 문제가 될 수 있는 부분입니다. 그러므로 Object로 대체해서는 안될 것 같습니다.

sUpniverse commented 2 years ago

@oliviarla

CollectionFuture<Boolean> asyncBopDelete(String key, long from, long to, int count) //count(필수): from~to 범위 내에서 앞에서부터 count 개수만큼 삭제

작성해준 API중에 위의 API도 count 를 제거해도 될 것 같습니다.

jhpark816 commented 2 years ago

@oliviarla @sUpniverse 제네릭 코멘트를 반영하여 위의 작업 코멘트 수정하였으므로, 참고 바랍니다.

oliviarla commented 2 years ago

수정된 작업 예정 목록입니다.

  1. asyncMopDelete 추가
    @Override
    public CollectionFuture<Boolean> asyncMopDelete(String key, List<String> mkeyList, boolean dropIfEmpty)
  2. list/set/map에 대한 추가 API
    
    //list
    CollectionFuture<List<Object>> asyncLopGet(String key, int index)

CollectionFuture<List> asyncLopGet(String key, int index, Transcoder tc)

CollectionFuture<List> asyncLopGet(String key, int from, int to)

CollectionFuture<List> asyncLopGet(String key, int from, int to, Transcoder tc)

//set CollectionFuture<Set> asyncSopGet(String key, int count)

CollectionFuture<Set> asyncSopGet(String key, int count, Transcoder tc)

//map CollectionFuture<Map<String, Object>> asyncMopGet(String key)

CollectionFuture<Map<String, T>> asyncMopGet(String key, Transcoder tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, String mkey)

CollectionFuture<Map<String, T>> asyncMopGet(String key, String mkey, Transcoder tc)

CollectionFuture<Map<String, Object>> asyncMopGet(String key, List mkeyList)

CollectionFuture<Map<String, T>> asyncMopGet(String key, List mkeyList, Transcoder tc)

jhpark816 commented 2 years ago

@oliviarla Transcoder 사용하는 API의 리턴 타입에서 Object => T로 변경해 두었습니다. 수고 바랍니다.

jhpark816 commented 2 years ago

@sUpniverse asyncMopDelete() API 리턴 타입을 검토해 주세요.

sUpniverse commented 2 years ago

@jhpark816 @oliviarla

overloading의 목적으로 동일 API들이 CollectionFuture<Boolean> type으로 반환하고 있으며, 그외 asyncBop, asyncMop, asyncLop 도 동일하게 CollectionFuture<Boolean> type으로 반환하므로 일관성에서도 문제 없습니다.

jhpark816 commented 2 years ago

@oliviarla @sUpniverse asyncMopDelete( ... mkeyList, ...) API는 다수의 elements 제거하는 API이므로, 리턴 타입이나 future 객체의 get() 결과가 잘 정리가 되어야 할 것 같습니다. 여튼, 직접 구현해 보고 최종 결정하도록 하시죠.

oliviarla commented 2 years ago

@jhpark816 @sUpniverse

bop에 대한 추가 API 제공 목록입니다. 전에 작업했던 것과 마찬가지로 기존 메소드의 eFlagFilter 인자에 null값을 입력하여 구현 가능할 것 같은데 진행할까요?

//b+tree
// bkey, from, to가 byte[] 형식인 메소드들도 동일하게 구현
CollectionFuture<Integer> asyncBopGetItemCount(String key, long from, long to)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key,  long bkey)

CollectionFuture<Map<Long, Element<T>>> asyncBopGet(String key, long bkey, Transcoder<T> tc)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to)

CollectionFuture<Map<Long, Element<Object>>> asyncBopGet(String key, long from, long to, Transcoder<T> tc)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to)

CollectionGetBulkFuture<Map<String, BTreeGetResult<Long, Object>>> asyncBopGetBulk( List<String> keyList, long from, long to, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, Object value, CollectionAttributes attributesForCreate)

CollectionFuture<Boolean> asyncBopInsert(String key, long bkey, T value, CollectionAttributes attributesForCreate, Transcoder<T> tc)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, Object value)

Future<Map<String, CollectionOperationStatus>> asyncBopInsertBulk(List<String> keyList, long bkey, T value, Transcoder<T> tc)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, Object value)

CollectionFuture<Boolean> asyncBopUpsert(String key, long bkey, T value, Transcoder<T> tc)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet( List<String> keyList, long from, long to, int count)

SMGetFuture<List<SMGetElement<Object>>> asyncBopSortMergeGet(List<String> keyList, long from, long to, int count, SMGetMode smgetMode)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopInsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

BTreeStoreAndGetFuture<Boolean, Object> asyncBopUpsertAndGetTrimmed(String key, long bkey, Object value)

BTreeStoreAndGetFuture<Boolean, E> asyncBopUpsertAndGetTrimmed(String key, long bkey, E value, Transcoder<E> transcoder)

CollectionFuture<Long> asyncBopIncr(String key, long bkey, int by)

CollectionFuture<Long> asyncBopDecr(String key, long bkey, int by)

//delete 메소드일 경우 eFlagFilter를 제외한 BopDelete만 추가 구현할 것
CollectionFuture<Boolean> asyncBopDelete(String key, long bkey, boolean dropIfEmpty)

CollectionFuture<Boolean> asyncBopDelete(String key, long from, long to, boolean dropIfEmpty)
jhpark816 commented 2 years ago

@oliviarla 이에 대해서는 의견이 다양할 것 같습니다. 여튼, 생각해 보고 의견을 제시할게요.

jhpark816 commented 2 years ago

@oliviarla @sUpniverse bop 관련하여 아래와 같이 간단하게 정리합시다. 다른 의견이 있다면 제시해 주세요.

  • asyncBopGet()에 한해 withDelete, dropIfEmpty 인자만 생략한 API를 제공합시다.
    • 이 방식이 다른 collection 연산하고도 일관될 것 같습니다.
  • 그 외에 생략 가능하지만, eflag 관련 인자와 offset or count 관련 인자는 그대로 두시죠.
  • 기타 사항
    • 위에 포함된 asyncBopIncr()와 asyncBopDecr()는 이미 제공하고 있는 API입니다.

추가 사항으로, bop API 추가한 PR 후에, arcus-java-client 가이드 문서에 새로운 API를 일괄 반영하는 PR도 보내주면 좋겠습니다.