|
| 1 | +@echo off |
| 2 | + |
| 3 | +rem |
| 4 | +rem Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | +rem contributor license agreements. See the NOTICE file distributed with |
| 6 | +rem this work for additional information regarding copyright ownership. |
| 7 | +rem The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 | +rem (the "License"); you may not use this file except in compliance with |
| 9 | +rem the License. You may obtain a copy of the License at |
| 10 | +rem |
| 11 | +rem http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +rem |
| 13 | +rem Unless required by applicable law or agreed to in writing, software |
| 14 | +rem distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +rem See the License for the specific language governing permissions and |
| 17 | +rem limitations under the License. |
| 18 | +rem |
| 19 | + |
| 20 | +set SPARK_HOME=%~dp0.. |
| 21 | +set ORIG_ARGS=%* |
| 22 | + |
| 23 | +rem Clear the values of all variables used |
| 24 | +set DEPLOY_MODE= |
| 25 | +set DRIVER_MEMORY= |
| 26 | +set SPARK_SUBMIT_LIBRARY_PATH= |
| 27 | +set SPARK_SUBMIT_CLASSPATH= |
| 28 | +set SPARK_SUBMIT_OPTS= |
| 29 | +set SPARK_DRIVER_MEMORY= |
| 30 | + |
| 31 | +:loop |
| 32 | +if [%1] == [] goto continue |
| 33 | + if [%1] == [--deploy-mode] ( |
| 34 | + set DEPLOY_MODE=%2 |
| 35 | + ) else if [%1] == [--driver-memory] ( |
| 36 | + set DRIVER_MEMORY=%2 |
| 37 | + ) else if [%1] == [--driver-library-path] ( |
| 38 | + set SPARK_SUBMIT_LIBRARY_PATH=%2 |
| 39 | + ) else if [%1] == [--driver-class-path] ( |
| 40 | + set SPARK_SUBMIT_CLASSPATH=%2 |
| 41 | + ) else if [%1] == [--driver-java-options] ( |
| 42 | + set SPARK_SUBMIT_OPTS=%2 |
| 43 | + ) |
| 44 | + shift |
| 45 | +goto loop |
| 46 | +:continue |
| 47 | + |
| 48 | +if [%DEPLOY_MODE%] == [] ( |
| 49 | + set DEPLOY_MODE=client |
| 50 | +) |
| 51 | + |
| 52 | +if not [%DRIVER_MEMORY%] == [] if [%DEPLOY_MODE%] == [client] ( |
| 53 | + set SPARK_DRIVER_MEMORY=%DRIVER_MEMORY% |
| 54 | +) |
| 55 | + |
| 56 | +cmd /V /E /C %SPARK_HOME%\bin\spark-class.cmd org.apache.spark.deploy.SparkSubmit %ORIG_ARGS% |
0 commit comments