Skip to content

FEATURE: Support long type expiration time in v2 APIs#1101

Open
f1v3-dev wants to merge 1 commit into
naver:developfrom
f1v3-dev:feat/v2-long-type-exp
Open

FEATURE: Support long type expiration time in v2 APIs#1101
f1v3-dev wants to merge 1 commit into
naver:developfrom
f1v3-dev:feat/v2-long-type-exp

Conversation

@f1v3-dev

@f1v3-dev f1v3-dev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🔗 Related Issue

⌨️ What I did

v2 API의 만료 시간 (expiration time) 파라미터 타입을 int 에서 long 으로 변경합니다.
이를 통해 int 범위를 넘는 Unix timestamp 기반 만료 시각(e.g. 2038년 이후 절대 시각)을 사용할 수 있습니다.

  • KV Store API: long exp 를 받도록 변경
  • Collection Create / Insert API: long 만료 시간을 담는 AttributesCreate 도입
  • 내부 operation 계층: OperationFactory, ops/*Operation -> getExpiration method, `ASCII / Binary 프로토콜 구현체까지 타입 변경
    • ASCII는 만료 시간을 텍스트로 전송하므로 long 값을 그대로 사용
    • Binary 프로토콜은 int 범위를 넘는 값은 예외 처리

기존 API(MemcachedClient, ArcusClient)는 변경되지 않으며 int 만료 파라미터가 long 으로 자동 형 변환(auto-widening)이 되어 기존 사용자 코드에는 영향이 없습니다.

@f1v3-dev f1v3-dev requested a review from oliviarla July 7, 2026 10:41
@f1v3-dev f1v3-dev self-assigned this Jul 7, 2026
@f1v3-dev

f1v3-dev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

속성 타입 구조 정리 (as-is → to-be)

타입 역할 expireTime 상태
Attributes (v1) v1 setattr 입력 Integer 유지 (implements AttributeClause만 추가)
CollectionAttributes (v1) v1 create/insert/setattr 입력 + getattr 출력 Integer 유지
AttributesCreate (신규) v2 create/insert 입력 long 신규
AttributesUpdate (신규) v2 setattr 입력 (부분갱신) long 신규
AttributesResult (신규) v2 getattr 출력 long 신규

AS-IS (기존)

v1은 한 클래스 계열(Attributes / CollectionAttributes) 이 모든 역할을 가지고 있는 상태

CollectionAttributes (extends Attributes)   ← expireTime: Integer (int 범위 한계)
   ├─ create 입력      (asyncBopCreate ...)
   ├─ insert 입력      (asyncBopInsert ...)
   ├─ setattr 입력     (asyncSetAttr)
   └─ getattr 출력     (asyncGetAttr 반환)
  • 입력/출력이 한 객체에 섞여 있고, expireTimeInteger라 int 범위를 넘는 만료 시각을 표현할 수 없음.

TO-BE (변경 후)

v1은 그대로 두고, v2는 역할별로 분리 + long 기반으로 로 재설계

[v1 — 변경 X]

  • Attributes / CollectionAttributes (Integer expireTime, 기존 API 전용)
    • Attributes 에 implements AttributeClause 만 추가 (setAttr 호환을 위한 인터페이스만 추가)

[v2 — 신규, long]

  • AttributesCreate
    • 생성(create/insert) 클래스
    • long expTime, primitive + 기본값
  • AttributesResult
    • 조회(getAttr) 클래스
    • immutable, 조회 전용 필드 포함, BKey 정보 포함
  • AttributesUpdate
    • 수정(setAttr) 클래스
    • 부분 갱신을 위해 null을 허용하는 Wrapper Class + maxBkeyRange
  • AttributeClause (interface)
    • 수정(setAttr) Operation을 생성할 때 기존 Attributes와 새로 만든AttributesUpdate 를 모두 받기 위한 인터페이스

역할 분리 요약

동작 AS-IS (v1 공용) TO-BE (v2)
create / insert 입력 CollectionAttributes AttributesCreate
setattr 입력 CollectionAttributes AttributesUpdate (부분갱신)
getattr 출력 CollectionAttributes AttributesResult (조회 전용)

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.

1 participant