-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HADOOP-17947. Provide alternative to Guava VisibleForTesting #3505
Conversation
FYI @amahussein @aajisaka @tasanuma @steveloughran. Once this PR gets in, will update PR #3503 to just use this |
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/VisibleForTesting.java
Outdated
Show resolved
Hide resolved
If we are going to change the javadocs, maybe make clear this is a guava replacement and what guarantees we offer (none). Here's my draft /**
* Annotates a program element that exists, or is more widely visible than
* otherwise necessary, for the benefits of testability.
* More specifically <i>testability within the hadoop-* modules</i>.
* This gives the implicit scope and stability of:
* <pre>
* @InterfaceAudience.Private
* @InterfaceStability.Unstable
* </pre>
* If external modules need to access/override these methods, then
* they MUST be rescoped as public/limited private.
*/ Now, should we actually move this to the package |
@steveloughran Javadoc changes, specifically the relation with IA.Private and IS.Unstable makes the doc look better.
This is interesting thought. I think it makes sense. In fact, we also have another advantage here - all modules have dependency on |
Adjust to the VFT in Guava, we may want to annotate it with the following annotations.
|
Thanks @tasanuma. I tried to adjust it to the one defined here https://github.com/google/guava/blob/master/guava/src/com/google/common/annotations/VisibleForTesting.java |
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.
@virajjasani Thanks for updating it. LGTM.
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.
+1 from me
Merged it. Thanks for your contribution, @virajjasani. Thanks for your review, @steveloughran. |
Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 5b1d594)
Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 5b1d594)
…3505) Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
…ing (apache#3505) This includes both the asf commits for this 5b1d594 - HADOOP-17947. Provide alternative to Guava VisibleForTesting (apache#3505) 783e480 - HADOOP-17947. Additional element types for VisibleForTesting (ADDENDUM) (apache#3521) Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 5b1d594) (cherry picked from commit 4554833) (cherry picked from commit 1af94fee55275f0c3c44639b0fa891e5c3e20675) Signed-off-by: Arpit Agarwal <aagarwal@cloudera.com> Change-Id: Ice45ed9b1a2988152e041c9063c4a68da9f18f88
Description of PR
Provide alternative to Guava VisibleForTesting so that we can get rid of Guava dependency to represent testing scope for a class/method/field.