-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL: Log info level when null value is present to ArcusCache.putIfAbsent() method. #88
Conversation
07cf311
to
241a379
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 완료
@@ -217,7 +217,8 @@ public ValueWrapper putIfAbsent(Object key, Object value) { | |||
logger.debug("trying to add key: {}", arcusKey); | |||
|
|||
if (value == null) { | |||
throw new IllegalArgumentException("arcus cannot add NULL value. key: " + arcusKey); | |||
logger.info("arcus cannot putIfAbsent NULL value. key: {}", arcusKey); | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null 리턴하면, putIfAbsent() 수행이 성공했다는 의미가 될 것 같습니다.
문제가 없나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반환 값 변경했습니다.
…IfAbsent() method.
241a379
to
dde0095
Compare
@@ -215,7 +216,8 @@ public ValueWrapper putIfAbsent(Object key, Object value) { | |||
logger.debug("trying to add key: {}", arcusKey); | |||
|
|||
if (value == null) { | |||
throw new IllegalArgumentException("arcus cannot add NULL value. key: " + arcusKey); | |||
logger.info("arcus cannot putIfAbsent NULL value. key: {}", arcusKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis, couchbase에서는 value 인자에 null이 입력되었고 null 저장을 허용하지 않으면, 아래와 같이 get 메서드를 호출합니다.
저희는 아직 allowNullValue 속성이 없으므로 일단은 get 메서드를 호출하도록 변경하는게 어떤가요?
@Override
public ValueWrapper putIfAbsent(final Object key, final Object value) {
if (!isAllowNullValues() && value == null) {
return get(key);
}
// ...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
putIfAbsent()는 어떤 경우에 호출되는 지 확인 되었나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cache 객체를 CacheManager의 getCache(String name) 메서드를 통해 얻어 아래와 같이 사용할 수 있습니다. 내부적으로 AOP 처리를 위해 호출되는 경우는 없습니다.
Cache cache = cacheManager.getCache("myCache");
cache.putIfAbsent(key, value);
@uhm0311 |
통합한 PR이 반영되면 닫겠습니다. |
위 PR이 반영되어 닫습니다. |
🔗 Related Issue
⌨️ What I did