|
| 1 | +rem |
| 2 | +rem Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +rem contributor license agreements. See the NOTICE file distributed with |
| 4 | +rem this work for additional information regarding copyright ownership. |
| 5 | +rem The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +rem (the "License"); you may not use this file except in compliance with |
| 7 | +rem the License. You may obtain a copy of the License at |
| 8 | +rem |
| 9 | +rem http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +rem |
| 11 | +rem Unless required by applicable law or agreed to in writing, software |
| 12 | +rem distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +rem See the License for the specific language governing permissions and |
| 15 | +rem limitations under the License. |
| 16 | +rem |
| 17 | + |
| 18 | +rem Gather all spark-submit options into SUBMISSION_OPTS |
| 19 | + |
| 20 | +set SUBMISSION_OPTS= |
| 21 | +set APPLICATION_OPTS= |
| 22 | + |
| 23 | +rem NOTE: If you add or remove spark-sumbmit options, |
| 24 | +rem modify NOT ONLY this script but also SparkSubmitArgument.scala |
| 25 | + |
| 26 | +:OptsLoop |
| 27 | +if "x%1"=="x" ( |
| 28 | + goto :OptsLoopEnd |
| 29 | +) |
| 30 | + |
| 31 | +SET opts="\<--master\> \<--deploy-mode\> \<--class\> \<--name\> \<--jars\> \<--py-files\> \<--files\>" |
| 32 | +SET opts="%opts:~1,-1% \<--conf\> \<--properties-file\> \<--driver-memory\> \<--driver-java-options\>" |
| 33 | +SET opts="%opts:~1,-1% \<--driver-library-path\> \<--driver-class-path\> \<--executor-memory\>" |
| 34 | +SET opts="%opts:~1,-1% \<--driver-cores\> \<--total-executor-cores\> \<--executor-cores\> \<--queue\>" |
| 35 | +SET opts="%opts:~1,-1% \<--num-executors\> \<--archives\>" |
| 36 | + |
| 37 | +echo %1 | findstr %opts% >nul |
| 38 | +if %ERRORLEVEL% equ 0 ( |
| 39 | + if "x%2"=="x" ( |
| 40 | + echo "%1" requires an argument. >&2 |
| 41 | + exit /b 1 |
| 42 | + ) |
| 43 | + set SUBMISSION_OPTS=%SUBMISSION_OPTS% %1 %2 |
| 44 | + shift |
| 45 | + shift |
| 46 | + goto :OptsLoop |
| 47 | +) |
| 48 | +echo %1 | findstr "\<--verbose\> \<-v\> \<--supervise\>" >nul |
| 49 | +if %ERRORLEVEL% equ 0 ( |
| 50 | + set SUBMISSION_OPTS=%SUBMISSION_OPTS% %1 |
| 51 | + shift |
| 52 | + goto :OptsLoop |
| 53 | +) |
| 54 | +set APPLICATION_OPTS=%APPLICATION_OPTS% %1 |
| 55 | +shift |
| 56 | +goto :OptsLoop |
| 57 | + |
| 58 | +:OptsLoopEnd |
| 59 | +exit /b 0 |
0 commit comments