-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-17123. remove guava Preconditions from Hadoop-common module #2134
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-17123. remove guava Preconditions from Hadoop-common module #2134
Conversation
💔 -1 overall
This message was automatically generated. |
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.
This is going to be a big piece of work. not just the coding, but the merging and backporting.
- we are going to have to backport the noguava package back many versions of releases, so that then cherrypicking is easy. That doesn't need any other changes to go...it should be a separate patch
- I'm not sure about "noguava" as a name. "unguava"?
- package must be scoped private/unstable
- we need separate checks for state and arg, as different exceptions are raised.
Also, if we are going to do this, can we have one overload which takes a Supplier<String> messageSupplier
as Objects.requireNonNull() does. Gives us room to play in future
Finally, big thing to consider: we need tests for the methods actually doing what we expect. That's raising exceptions and forming the correct strings.
super(); | ||
} | ||
|
||
public static void checkIsTrue(final boolean expression, final String message, |
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.
its explicitly an argument here, hence the IllegalArgumentException.
We will also need checkState, which throw ome illegal state exception too.
We need both and so the check method names should be distinct
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.
This is going to be a big piece of work. not just the coding, but the merging and backporting.
- we are going to have to backport the noguava package back many versions of releases, so that then cherrypicking is easy. That doesn't need any other changes to go...it should be a separate patch
- I'm not sure about "noguava" as a name. "unguava"?
- package must be scoped private/unstable
- we need separate checks for state and arg, as different exceptions are raised.
Also, if we are going to do this, can we have one overload which takes a
Supplier<String> messageSupplier
as Objects.requireNonNull() does. Gives us room to play in futureFinally, big thing to consider: we need tests for the methods actually doing what we expect. That's raising exceptions and forming the correct strings.
Thanks @steveloughran for the feedback. I created a new PR #2143 that has unguava.Validate#checkNotNull
implementation.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
revisiting this...we should get this in so it can be backported and we can keep guava out of future patches. is the name 'noguava' the right one?
|
(oh, and for merging, I'd propose two commits: one to create the new Predicate class, one to use). Why so? Makes it straightforward to cherrypick the predicate class across all old versions so that other cherrypicked code can use it, without worrying about the big merge) |
Thanks @steveloughran |
NOTICE
Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HADOOP-XXXXX. Fix a typo in YYY.)
For more details, please see https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute