|
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 | | -rem This script computes Spark's classpath and prints it to stdout; it's used by both the "run" |
21 | | -rem script and the ExecutorRunner in standalone cluster mode. |
22 | | - |
23 | | -set SCALA_VERSION=2.10 |
24 | | - |
25 | | -rem Figure out where the Spark framework is installed |
26 | | -set FWDIR=%~dp0..\ |
27 | | - |
28 | | -rem Load environment variables from conf\spark-env.cmd, if it exists |
29 | | -if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd" |
30 | | - |
31 | | -rem Build up classpath |
32 | | -set CLASSPATH=%FWDIR%conf |
33 | | -if exist "%FWDIR%RELEASE" ( |
34 | | - for %%d in ("%FWDIR%jars\spark-assembly*.jar") do ( |
35 | | - set ASSEMBLY_JAR=%%d |
36 | | - ) |
37 | | -) else ( |
38 | | - for %%d in ("%FWDIR%assembly\target\scala-%SCALA_VERSION%\spark-assembly*hadoop*.jar") do ( |
39 | | - set ASSEMBLY_JAR=%%d |
40 | | - ) |
41 | | -) |
42 | | -set CLASSPATH=%CLASSPATH%;%ASSEMBLY_JAR% |
43 | | - |
44 | | -if "x%SPARK_TESTING%"=="x1" ( |
45 | | - rem Add test clases to path |
46 | | - set CLASSPATH=%CLASSPATH%;%FWDIR%core\target\scala-%SCALA_VERSION%\test-classes |
47 | | - set CLASSPATH=%CLASSPATH%;%FWDIR%repl\target\scala-%SCALA_VERSION%\test-classes |
48 | | - set CLASSPATH=%CLASSPATH%;%FWDIR%mllib\target\scala-%SCALA_VERSION%\test-classes |
49 | | - set CLASSPATH=%CLASSPATH%;%FWDIR%bagel\target\scala-%SCALA_VERSION%\test-classes |
50 | | - set CLASSPATH=%CLASSPATH%;%FWDIR%streaming\target\scala-%SCALA_VERSION%\test-classes |
51 | | -) |
52 | | - |
53 | | -rem Add hadoop conf dir - else FileSystem.*, etc fail |
54 | | -rem Note, this assumes that there is either a HADOOP_CONF_DIR or YARN_CONF_DIR which hosts |
55 | | -rem the configurtion files. |
56 | | -if "x%HADOOP_CONF_DIR%"=="x" goto no_hadoop_conf_dir |
57 | | - set CLASSPATH=%CLASSPATH%;%HADOOP_CONF_DIR% |
58 | | -:no_hadoop_conf_dir |
59 | | - |
60 | | -if "x%YARN_CONF_DIR%"=="x" goto no_yarn_conf_dir |
61 | | - set CLASSPATH=%CLASSPATH%;%YARN_CONF_DIR% |
62 | | -:no_yarn_conf_dir |
63 | | - |
64 | | -rem A bit of a hack to allow calling this script within run2.cmd without seeing output |
65 | | -if "%DONT_PRINT_CLASSPATH%"=="1" goto exit |
66 | | - |
67 | | -echo %CLASSPATH% |
68 | | - |
69 | | -:exit |
| 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 | +rem This script computes Spark's classpath and prints it to stdout; it's used by both the "run" |
| 21 | +rem script and the ExecutorRunner in standalone cluster mode. |
| 22 | + |
| 23 | +set SCALA_VERSION=2.10 |
| 24 | + |
| 25 | +rem Figure out where the Spark framework is installed |
| 26 | +set FWDIR=%~dp0..\ |
| 27 | + |
| 28 | +rem Load environment variables from conf\spark-env.cmd, if it exists |
| 29 | +if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd" |
| 30 | + |
| 31 | +rem Build up classpath |
| 32 | +set CLASSPATH=%FWDIR%conf |
| 33 | +if exist "%FWDIR%RELEASE" ( |
| 34 | + for %%d in ("%FWDIR%jars\spark-assembly*.jar") do ( |
| 35 | + set ASSEMBLY_JAR=%%d |
| 36 | + ) |
| 37 | +) else ( |
| 38 | + for %%d in ("%FWDIR%assembly\target\scala-%SCALA_VERSION%\spark-assembly*hadoop*.jar") do ( |
| 39 | + set ASSEMBLY_JAR=%%d |
| 40 | + ) |
| 41 | +) |
| 42 | + |
| 43 | +set CLASSPATH=%CLASSPATH%;%ASSEMBLY_JAR% |
| 44 | + |
| 45 | +set SPARK_CLASSES=%FWDIR%core\target\scala-%SCALA_VERSION%\classes |
| 46 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%repl\target\scala-%SCALA_VERSION%\classes |
| 47 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%mllib\target\scala-%SCALA_VERSION%\classes |
| 48 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%bagel\target\scala-%SCALA_VERSION%\classes |
| 49 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%graphx\target\scala-%SCALA_VERSION%\classes |
| 50 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%streaming\target\scala-%SCALA_VERSION%\classes |
| 51 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%tools\target\scala-%SCALA_VERSION%\classes |
| 52 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%sql\catalyst\target\scala-%SCALA_VERSION%\classes |
| 53 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%sql\core\target\scala-%SCALA_VERSION%\classes |
| 54 | +set SPARK_CLASSES=%SPARK_CLASSES%;%FWDIR%sql\hive\target\scala-%SCALA_VERSION%\classes |
| 55 | + |
| 56 | +set SPARK_TEST_CLASSES=%FWDIR%core\target\scala-%SCALA_VERSION%\test-classes |
| 57 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%repl\target\scala-%SCALA_VERSION%\test-classes |
| 58 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%mllib\target\scala-%SCALA_VERSION%\test-classes |
| 59 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%bagel\target\scala-%SCALA_VERSION%\test-classes |
| 60 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%graphx\target\scala-%SCALA_VERSION%\test-classes |
| 61 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%streaming\target\scala-%SCALA_VERSION%\test-classes |
| 62 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%sql\catalyst\target\scala-%SCALA_VERSION%\test-classes |
| 63 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%sql\core\target\scala-%SCALA_VERSION%\test-classes |
| 64 | +set SPARK_TEST_CLASSES=%SPARK_TEST_CLASSES%;%FWDIR%sql\hive\target\scala-%SCALA_VERSION%\test-classes |
| 65 | + |
| 66 | +if "x%SPARK_TESTING%"=="x1" ( |
| 67 | + rem Add test clases to path - note, add SPARK_CLASSES and SPARK_TEST_CLASSES before CLASSPATH |
| 68 | + rem so that local compilation takes precedence over assembled jar |
| 69 | + set CLASSPATH=%SPARK_CLASSES%;%SPARK_TEST_CLASSES%;%CLASSPATH% |
| 70 | +) |
| 71 | + |
| 72 | +rem Add hadoop conf dir - else FileSystem.*, etc fail |
| 73 | +rem Note, this assumes that there is either a HADOOP_CONF_DIR or YARN_CONF_DIR which hosts |
| 74 | +rem the configurtion files. |
| 75 | +if "x%HADOOP_CONF_DIR%"=="x" goto no_hadoop_conf_dir |
| 76 | + set CLASSPATH=%CLASSPATH%;%HADOOP_CONF_DIR% |
| 77 | +:no_hadoop_conf_dir |
| 78 | + |
| 79 | +if "x%YARN_CONF_DIR%"=="x" goto no_yarn_conf_dir |
| 80 | + set CLASSPATH=%CLASSPATH%;%YARN_CONF_DIR% |
| 81 | +:no_yarn_conf_dir |
| 82 | + |
| 83 | +rem A bit of a hack to allow calling this script within run2.cmd without seeing output |
| 84 | +if "%DONT_PRINT_CLASSPATH%"=="1" goto exit |
| 85 | + |
| 86 | +echo %CLASSPATH% |
| 87 | + |
| 88 | +:exit |
0 commit comments