Skip to content

INTERNAL: Fix expire time parameter type from int to long#1100

Closed
f1v3-dev wants to merge 1 commit into
naver:developfrom
f1v3-dev:internal/v2-exp-type
Closed

INTERNAL: Fix expire time parameter type from int to long#1100
f1v3-dev wants to merge 1 commit into
naver:developfrom
f1v3-dev:internal/v2-exp-type

Conversation

@f1v3-dev

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

Copy link
Copy Markdown
Collaborator

🔗 Related Issue

⌨️ What I did

  • expiration time 파라미터 타입을 intlong 으로 변경합니다.
  • 사용자가 직접 사용하는 public API는 primitive type (long)을 사용하여 기존 int 리터럴이 자동으로 변환됩니다.

수정 파일

v2 API

  • v2/AsyncArcusCommandsIF.java
    • exp 파라미터 intlong
  • v2/AsyncArcusCommands.java
    • 인터페이스 변경에 맞춰 구현 갱신

public API

  • collection/Attributes.java
    • 내부 필드 IntegerLong
    • setExpireTime(Integer)setExpireTime(long)
    • getExpireTime() 반환 타입 IntegerLong
  • collection/CollectionAttributes.java
    • 생성자 파라미터 Integer expireTimelong expireTime

내부

  • collection/CollectionCreate.java
    • 생성자 파라미터 Integer expTimeLong expTime
  • collection/{List,Set,Map,BTree}Create.java
    • 생성자 파라미터 Integer expTimeLong expTime
  • OperationFactory.java, ops/{Store,CAS,Mutator,Touch}Operation.java
    • exp 파라미터 intlong
  • protocol/ascii/AsciiOperationFactory.java 및 관련 impl
    • exp 파라미터 intlong
  • protocol/binary/BinaryOperationFactory.java 및 관련 impl
    • exp 파라미터 intlong
    • binary write 시 (int) 캐스트로 4바이트 유지

@f1v3-dev f1v3-dev requested a review from oliviarla July 3, 2026 07:51
@f1v3-dev f1v3-dev self-assigned this Jul 3, 2026
@f1v3-dev

f1v3-dev commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

하위 호환성 정리

✅ 기존 코드 그대로 동작

// int 리터럴 → long 으로 자동 형변환
CollectionAttributes attr = new CollectionAttributes(60, null, null); 
attr.setExpireTime(60);
attr.setExpireTime(3600L);

⚠️ 컴파일 에러가 발생하는 케이스

// 1. getExpireTime() 반환값을 int/Integer에 담는 경우
//    반환 타입이 Integer → Long으로 변경됨
int exp = attr.getExpireTime();    // X
Integer exp = attr.getExpireTime();    // X

// 2. 생성자/setter에 null을 넘기는 경우
//    파라미터 타입이 Integer → long(primitive)으로 변경됨
CollectionAttributes attr = new CollectionAttributes(null, null, null);  // X
attr.setExpireTime(null);  // X

@oliviarla

Copy link
Copy Markdown
Collaborator

@jhpark816
다시 생각해보니, 기존과 새로운 API가 CollectionAttributes, Operation 클래스들을 공유하고 있어, 이 작업으로 인해 기존 하위 호환성을 해치는 일이 발생할 것 같습니다.
따라서 여러 사항 고려하지 않고 빠르게 v2 릴리즈하기 위해 close하겠습니다.

@oliviarla oliviarla closed this Jul 6, 2026
@jhpark816

Copy link
Copy Markdown
Collaborator

기존과 새로운 API가 CollectionAttributes, Operation 클래스들을 공유하고 있어, 이 작업으로 인해 기존 하위 호환성을 해치는 일이 발생할 것 같습니다.

하위 호환성을 해치지 않게 수정할 방안은 없나요?

@oliviarla

Copy link
Copy Markdown
Collaborator

네 현재 너무 밀결합되어 있기 때문에 불가능합니다.

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.

3 participants