HADOOP-19838. Support parsing environment variables and system properties in the Configuration class.#8346
Open
huangzhaobo99 wants to merge 3 commits intoapache:trunkfrom
Open
HADOOP-19838. Support parsing environment variables and system properties in the Configuration class.#8346huangzhaobo99 wants to merge 3 commits intoapache:trunkfrom
huangzhaobo99 wants to merge 3 commits intoapache:trunkfrom
Conversation
…ties in the Configuration class.
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
8a477a0 to
54e9dc4
Compare
|
🎊 +1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
JIRA: https://issues.apache.org/jira/browse/HADOOP-19838
Problem
Currently, Hadoop shell startup scripts only append "HADOOP_CLIENT_OPTS" as JVM arguments before the main class. This prevents users from transparently configuring client-side generic config (such as fs.defaultFS, dfs.client.socket-timeout, dfs.replication) via environment variables.
The examples provided in the doc at this link (https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/UnixShellGuide.html#HADOOP_CLIENT_OPTS) fail to take effect in actual practice.
These generic options must be parsed by GenericOptionsParser class, which only processes arguments passed after the main class. As a result, users have to manually add -D/-conf parameters to every single command execution, which is inconvenient and breaks the expected transparent configuration experience, for example:
Solution
Support parsing configuration items from "HADOOP_CLIENT_OPTS" in the Configuration class. The keys used here are exactly the same as those in Hadoop configuration.
This patch also adds support for parsing Java system properties with a specific prefix: "hadoop.property.".
Only system properties prefixed with "hadoop.property." are scanned. The substring after the prefix is used as the actual configuration key.
Benefits
For AI algorithm training scenarios, tuning parameters is required to address training efficiency. With this feature enabled, users no longer need to modify any related code.
How was this patch tested?
Add UT & HDFS Shell
environment variables
system properties
This is a Java project that can read and write to the HDFS filesystem