Skip to content

Conversation

@gengliangwang
Copy link
Member

@gengliangwang gengliangwang commented Oct 11, 2018

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

@gengliangwang gengliangwang changed the title [SPARK-25711][Core] Allow history server to show usage [SPARK-25711][Core] Allow history server to show usage User-Friendly Oct 11, 2018
CLASS="org.apache.spark.deploy.history.HistoryServer"

if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
echo "Usage: ./sbin/start-history-server.sh [options]"
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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 =>
Copy link
Contributor

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?

Copy link
Member Author

@gengliangwang gengliangwang Oct 11, 2018

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

Copy link
Member Author

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.

Copy link
Member

@srowen srowen left a 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

@gengliangwang gengliangwang changed the title [SPARK-25711][Core] Allow history server to show usage User-Friendly [SPARK-25711][Core] Allow start-history-server.sh to show usage User-Friendly Oct 11, 2018
@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Oct 11, 2018

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)

  DIR                         Deprecated; set spark.history.fs.logDirectory directly
  --dir DIR (-d DIR)          Deprecated; set spark.history.fs.logDirectory directly

@srowen
Copy link
Member

srowen commented Oct 11, 2018

Agree that's a good idea

@gengliangwang
Copy link
Member Author

Agree. Let me remove them in this PR.

@SparkQA
Copy link

SparkQA commented Oct 11, 2018

Test build #97267 has finished for PR 22699 at commit e91f611.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 11, 2018

Test build #97278 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 12, 2018

Test build #4373 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jiangxb1987
Copy link
Contributor

Let's also update the title to include the deprecation changes.

@gengliangwang gengliangwang changed the title [SPARK-25711][Core] Allow start-history-server.sh to show usage User-Friendly [SPARK-25711][Core] Improve start-history-server.sh: show usage User-Friendly and remove deprecated options Oct 12, 2018
@gengliangwang
Copy link
Member Author

retest this please.

@SparkQA
Copy link

SparkQA commented Oct 12, 2018

Test build #97292 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Oct 12, 2018

Test build #97295 has finished for PR 22699 at commit 5e05c60.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Oct 12, 2018

Test build #97296 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gengliangwang
Copy link
Member Author

retest this please.

@SparkQA
Copy link

SparkQA commented Oct 12, 2018

Test build #97308 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 13, 2018

Test build #4375 has finished for PR 22699 at commit 5e05c60.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 13, 2018

Test build #97333 has finished for PR 22699 at commit 7fada77.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gengliangwang
Copy link
Member Author

retest this please.

@SparkQA
Copy link

SparkQA commented Oct 13, 2018

Test build #97338 has finished for PR 22699 at commit 7fada77.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@dongjoon-hyun
Copy link
Member

Merged to master. Thank you, @gengliangwang , @srowen , @jiangxb1987 .

@asfgit asfgit closed this in 26c1b95 Oct 13, 2018
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants