-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
HIVE-28104. (2.3) Move HTTP related methods from Utils to HttpUtils in shims #5114
Conversation
shims/common/src/main/java/org/apache/hadoop/hive/shims/HttpUtils.java
Outdated
Show resolved
Hide resolved
* Return Hadoop-native RestCsrfPreventionFilter if it is available. | ||
* Otherwise, construct our own copy of its logic. | ||
*/ | ||
public static Filter getXSRFFilter() { |
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.
I'm not sure if the Hive community treats it as a public API, if there are concerns about compatibility, another approach is:
- leaving
Utils
as-is - creating a
HadoopUtils
, copying all other methods toHadoopUtils
- changing callers to use
HadoopUtils
instead ofUtils
to avoid initializingUtils
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.
Sounds like a more compatible solution.
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.
Either works for me. Looks like this method is only in one place.
Merged, thanks |
What changes were proposed in this pull request?
HIVE-13853 added some HTTP-related methods to the shims
Utils
, this PR aims to move it to a dedicated classHttpUtils
Why are the changes needed?
The invocation of any method in
Utils
will trigger all imported classes to be loaded, which blocks the downstream projects from migrating fromjavax.servlet-api
tojakarta.servlet-api
, see more context at apache/spark#45154 (comment)Does this PR introduce any user-facing change?
No.
Is the change a dependency upgrade?
No.
How was this patch tested?
Pass CI(no new failed tests) to ensure everything goes well on the Hive side.
Spark integration tests