Skip to content

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

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

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

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