diff options
author | Prashant Sharma <prashant.s@imaginea.com> | 2014-01-02 17:55:21 +0530 |
---|---|---|
committer | Prashant Sharma <prashant.s@imaginea.com> | 2014-01-02 17:55:21 +0530 |
commit | 980afd280a331103ce7391adaf484dd497218741 (patch) | |
tree | a3bef12d6c1296aa42930b8b91a07d8775831e6c /sbin/stop-slaves.sh | |
parent | 3713f8129a618a633a7aca8c944960c3e7ac9d3b (diff) | |
parent | 52ccf4f859d92ed9e86d3720a983ac2c4a1c23bf (diff) | |
download | spark-980afd280a331103ce7391adaf484dd497218741.tar.gz spark-980afd280a331103ce7391adaf484dd497218741.tar.bz2 spark-980afd280a331103ce7391adaf484dd497218741.zip |
Merge branch 'scripts-reorg' of github.com:shane-huang/incubator-spark into spark-915-segregate-scripts
Conflicts:
bin/spark-shell
core/pom.xml
core/src/main/scala/org/apache/spark/SparkContext.scala
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
core/src/main/scala/org/apache/spark/ui/UIWorkloadGenerator.scala
core/src/test/scala/org/apache/spark/DriverSuite.scala
python/run-tests
sbin/compute-classpath.sh
sbin/spark-class
sbin/stop-slaves.sh
Diffstat (limited to 'sbin/stop-slaves.sh')
-rwxr-xr-x | sbin/stop-slaves.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sbin/stop-slaves.sh b/sbin/stop-slaves.sh new file mode 100755 index 0000000000..c6b0b6ab66 --- /dev/null +++ b/sbin/stop-slaves.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# +# 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. +# + +bin=`dirname "$0"` +bin=`cd "$sbin"; pwd` + +. "$sbin/spark-config.sh" + +if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then + . "${SPARK_CONF_DIR}/spark-env.sh" +fi + +if [ "$SPARK_WORKER_INSTANCES" = "" ]; then + "$sbin"/spark-daemons.sh stop org.apache.spark.deploy.worker.Worker 1 +else + for ((i=0; i<$SPARK_WORKER_INSTANCES; i++)); do + "$sbin"/spark-daemons.sh stop org.apache.spark.deploy.worker.Worker $(( $i + 1 )) + done +fi |