-
Notifications
You must be signed in to change notification settings - Fork 47
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: Change asyncGets return future type. #711
Conversation
src/main/java/net/spy/memcached/internal/result/CASGetResult.java
Outdated
Show resolved
Hide resolved
9984d3f
to
5d2bda8
Compare
e3ce0a4
to
dafa6b3
Compare
PR 본문의
1번의 경우 버전 업그레이드 후 컴파일 시 컴파일 에러가 발생하고, 추가적인 다른 의견도 주시면 감사하겠습니다. |
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.
리뷰 완료
src/main/java/net/spy/memcached/internal/result/CASGetResultImpl.java
Outdated
Show resolved
Hide resolved
dafa6b3
to
9158edb
Compare
저는 2번이 낫다고 봅니다. |
개선을 하려면 하위호환성에 영향을 미치지 않게 개선을해야하는데, 그럴 경우 CASValue를 활용한다거나 등의 새로운 변경이 발생합니다. 그렇기 때문에 Deprecated 처리될 API는 여전히 IO 쓰레드가 작업을 하도록 놔두는게 맞는것 같습니다. |
GetFuture가 OperationFuture를 inherit 하면 backward compatibility는 만족이 되나요? |
만족이 되기 때문에 새 API를 만들고 기존 API를 Deprecated 처리할 필요가 없어집니다. |
그러면, 상속 관계를 이용하여 backward compatibility 이슈를 해결하는 것이 좋겠습니다. |
9158edb
to
b21f8d3
Compare
b21f8d3
to
f0c91c6
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.
리뷰 완료
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.
리뷰 완료
5b039d7
to
24a175f
Compare
@brido4125 |
src/main/java/net/spy/memcached/plugin/FrontCacheGetFuture.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/plugin/FrontCacheGetFuture.java
Outdated
Show resolved
Hide resolved
24a175f
to
fa9db24
Compare
fa9db24
to
58c7e95
Compare
src/main/java/net/spy/memcached/plugin/FrontCacheGetFuture.java
Outdated
Show resolved
Hide resolved
58c7e95
to
1f5abee
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.
리뷰 완료입니다.
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.
@jhpark816 @uhm0311 @brido4125
FrontCacheGetFuture가 GetFuture를 상속받으면서 동시에 GetFuture 필드를 갖고 있는 것이 좋은 형태는 아닌 것 같습니다. 일단은 지금 형태로 머지하되, 나중에는 FrontCacheGetFuture가 GetFuture를 상속하지 않도록 전체적인 구조를 변경하거나 GetFuture필드를 제거할 방안을 고민해보는 게 어떨까 싶습니다.
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.
리뷰 완료
|
||
@Override | ||
public boolean isCancelled() { | ||
return parent.isCancelled(); |
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.
set()
과 setOperation()
을 override 하지 않아도 되는 이유는 무엇인가요?
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.
아래 시퀀스로 parent에 op와 opertaionStatus가 설정됩니다.
1.setOperation() -> asyncGet() 에서 호출 (콜백 X)
2.set -> receivedStatus() 에서 호출 (콜백)
FrontCacheFuture는 parent의 op와 operationStatus를 리턴하면 됩니다.
결론적으로 parent에 설정된 operation과 operationStatus를
사용하도록 메서드를 오버라이딩해서입니다.
src/main/java/net/spy/memcached/plugin/FrontCacheGetFuture.java
Outdated
Show resolved
Hide resolved
1f5abee
to
8d52455
Compare
8d52455
to
40da6dd
Compare
변경 사항
오전에 오프라인으로 논의된 asyncGets API의 Future 리턴 타입을
OperationFuture
->GetFuture
로 변경하였습니다.아래의 코멘트의 Transcoder 문제 때문에
CASGetResult<T>
를 사용해서 구현하였습니다.GetResult 인터페이스를 통해 아래 문제를 해결하였습니다.
이를 해결하기 위해 해당 PR은 생성자 내에서super(null)
을 사용하였습니다. 아래 코멘트는 다른 방안들입니다.@Deprecated
를 사용하려면asyncGetsNew()
와 같은 새로운 함수를 정의하고 기존asyncGets()
에@Deprecated
을 붙여줘야합니다. 메서드의 리턴값만 다를 경우 오버로딩이 적용되지 않기 때문입니다. 우선은 로직에 대한 리뷰를 먼저 받기 위해 기존 메서드의 리턴값을 바로 변경하였습니다.GetResult 생성자에서 CachedData를 외부로부터 주입 받는 로직은 별도의 PR로 반영하겠습니다.