-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25711][Core] Improve start-history-server.sh: show usage User-Friendly and remove deprecated options #22699
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
Conversation
| CLASS="org.apache.spark.deploy.history.HistoryServer" | ||
|
|
||
| if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then | ||
| echo "Usage: ./sbin/start-history-server.sh [options]" |
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.
nit: why not have a separated usage() function?
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.
Well this is short, and I am following what start-master.sh and start-slave.sh did.
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.
Well, I also saw similar code in start-thriftserver.sh, it uses usage(). Both are fine to me, just head up to make sure we've taken that into consideration.
| propertiesFile = value | ||
| parse(tail) | ||
|
|
||
| case dir :: Nil => |
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.
IIUC this is not related to the PR description?
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.
No, it is related. For the last single argument, it is treated as the event log directory.
See the deleted code
if (args.length == 1) {
setLogDirectory(args.head)
}
I prefer to keep the behavior.
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 good.
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 see. I have updated the description.
srowen
left a comment
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.
Looks OK but update the title. It's not clear that it's about showing a help message on the command line
|
BTW, @srowen , @jiangxb1987 , and @gengliangwang . Spark 3.0 is a good chance to remove the deprecated options. Shall we remove the following? If we don't do this now, this can happen in Spark 4.0. (This is deprecated since Spark 1.1.0) |
|
Agree that's a good idea |
|
Agree. Let me remove them in this PR. |
|
Test build #97267 has finished for PR 22699 at commit
|
|
Test build #97278 has finished for PR 22699 at commit
|
|
Test build #4373 has finished for PR 22699 at commit
|
|
Let's also update the title to include the deprecation changes. |
|
retest this please. |
|
Test build #97292 has finished for PR 22699 at commit
|
|
Retest this please. |
|
Test build #97295 has finished for PR 22699 at commit
|
|
Retest this please. |
|
Test build #97296 has finished for PR 22699 at commit
|
|
retest this please. |
|
Test build #97308 has finished for PR 22699 at commit
|
|
Test build #4375 has finished for PR 22699 at commit
|
|
Test build #97333 has finished for PR 22699 at commit
|
|
retest this please. |
|
Test build #97338 has finished for PR 22699 at commit
|
dongjoon-hyun
left a comment
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, LGTM.
|
Merged to master. Thank you, @gengliangwang , @srowen , @jiangxb1987 . |
…Friendly and remove deprecated options
## What changes were proposed in this pull request?
Currently, if we try run
```
./start-history-server.sh -h
```
We will get such error
```
java.io.FileNotFoundException: File -h does not exist
```
1. This is not User-Friendly. For option `-h` or `--help`, it should be parsed correctly and show the usage of the class/script.
2. We can remove deprecated options for setting event log directory through command line options.
After fix, we can get following output:
```
Usage: ./sbin/start-history-server.sh [options]
Options:
--properties-file FILE Path to a custom Spark properties file.
Default is conf/spark-defaults.conf.
Configuration options can be set by setting the corresponding JVM system property.
History Server options are always available; additional options depend on the provider.
History Server options:
spark.history.ui.port Port where server will listen for connections
(default 18080)
spark.history.acls.enable Whether to enable view acls for all applications
(default false)
spark.history.provider Name of history provider class (defaults to
file system-based provider)
spark.history.retainedApplications Max number of application UIs to keep loaded in memory
(default 50)
FsHistoryProvider options:
spark.history.fs.logDirectory Directory where app logs are stored
(default: file:/tmp/spark-events)
spark.history.fs.updateInterval How often to reload log data from storage
(in seconds, default: 10)
```
## How was this patch tested?
Manual test
Closes apache#22699 from gengliangwang/refactorSHSUsage.
Authored-by: Gengliang Wang <gengliang.wang@databricks.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
Currently, if we try run
We will get such error
-hor--help, it should be parsed correctly and show the usage of the class/script.After fix, we can get following output:
How was this patch tested?
Manual test