-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-3658][SQL]Take thrift server as a daemon #2509
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ then | |
| shift | ||
| fi | ||
|
|
||
| startStop=$1 | ||
| option=$1 | ||
| shift | ||
| command=$1 | ||
| shift | ||
|
|
@@ -122,9 +122,9 @@ if [ "$SPARK_NICENESS" = "" ]; then | |
| fi | ||
|
|
||
|
|
||
| case $startStop in | ||
| case $option in | ||
|
|
||
| (start) | ||
| (start|spark-submit) | ||
|
|
||
| mkdir -p "$SPARK_PID_DIR" | ||
|
|
||
|
|
@@ -142,8 +142,14 @@ case $startStop in | |
|
|
||
| spark_rotate_log "$log" | ||
| echo starting $command, logging to $log | ||
| cd "$SPARK_PREFIX" | ||
| nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null & | ||
| if [ $option == spark-submit ]; then | ||
| source "$SPARK_HOME"/bin/utils.sh | ||
| gatherSparkSubmitOpts "$@" | ||
| nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to call
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah you are right, but if we put
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, that's fair. I'd use export SUBMIT_USAGE_FUNCTION=usage
exec "$FWDIR"/sbin/spark-daemon.sh spark-submit $CLASS 1 |
||
| "${SUBMISSION_OPTS[@]}" spark-internal "${APPLICATION_OPTS[@]}" >> "$log" 2>&1 < /dev/null & | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think |
||
| else | ||
| nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null & | ||
| fi | ||
| newpid=$! | ||
| echo $newpid > $pid | ||
| sleep 2 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be executable, please |
||
|
|
||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # Stops the thrift server on the machine this script is executed on. | ||
|
|
||
| sbin="`dirname "$0"`" | ||
| sbin="`cd "$sbin"; pwd`" | ||
|
|
||
| "$sbin"/spark-daemon.sh stop org.apache.spark.sql.hive.thriftserver.HiveThriftServer2 1 | ||
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 feel complicated to add this logic here...
SparkSubmitshould not be coupled with Thrift server, but it seems that this is the only legitimate place.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.
After some thoughts, I think it's OK to add this checking here. Mainly because it avoids using the exit code checking trick, which may cause potential exit code conflict.