blob: 8e35c5fcecb0c167a252cc8ba04d94c15250c75f [file] [log] [blame]
Michael Blow8ed62562016-09-02 13:23:09 -04001@REM ------------------------------------------------------------
2@REM Licensed to the Apache Software Foundation (ASF) under one
3@REM or more contributor license agreements. See the NOTICE file
4@REM distributed with this work for additional information
5@REM regarding copyright ownership. The ASF licenses this file
6@REM to you under the Apache License, Version 2.0 (the
7@REM "License"); you may not use this file except in compliance
8@REM with the License. You may obtain a copy of the License at
9@REM
10@REM http://www.apache.org/licenses/LICENSE-2.0
11@REM
12@REM Unless required by applicable law or agreed to in writing,
13@REM software distributed under the License is distributed on an
14@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15@REM KIND, either express or implied. See the License for the
16@REM specific language governing permissions and limitations
17@REM under the License.
18@REM ------------------------------------------------------------
19@echo off
20setlocal
21if NOT DEFINED JAVA_HOME (
22 echo ERROR: JAVA_HOME not defined
23 goto :ERROR
24)
25
26REM ensure JAVA_HOME has no spaces nor quotes, since appassembler can't handle them
Michael Blowe6bb4aa2016-09-19 17:14:12 -040027set JAVA_HOME=%JAVA_HOME:"=%
28for %%I in ("%JAVA_HOME%") do (
Michael Blow8ed62562016-09-02 13:23:09 -040029 set JAVA_HOME=%%~sI
30)
31
32set DIRNAME=%~dp0
33
34pushd %DIRNAME%\..
35set CLUSTERDIR=%cd%
36cd %CLUSTERDIR%\..\..
37set INSTALLDIR=%cd%
38
39call %INSTALLDIR%\bin\${HELPER_COMMAND} get_cluster_state -quiet
Michael Blowfdcf0552016-09-25 22:18:27 -040040if %ERRORLEVEL% NEQ 1 (
Michael Blowbe706d52016-09-14 00:34:51 -040041 call %INSTALLDIR%\bin\${HELPER_COMMAND} shutdown_cluster_all
Michael Blow8ed62562016-09-02 13:23:09 -040042) else (
Michael Blowbe706d52016-09-14 00:34:51 -040043 echo WARNING: sample cluster does not appear to be running, will attempt to wait for
44 echo CCDriver to terminate if running.
Michael Blow8ed62562016-09-02 13:23:09 -040045)
46echo.
Michael Blow8ed62562016-09-02 13:23:09 -040047powershell "Write-Host "Waiting for CCDriver to terminate..." -nonewline; do { if ($running) { Start-Sleep 1 }; %JAVA_HOME%\bin\jps.exe -v | select-string -pattern ${CC_COMMAND} -quiet -outvariable running | Out-Null; Write-Host "." -nonewline } while ($running)"
48echo .done.
49goto :END
50:ERROR
51echo.
52popd
53exit /B 1
54
55:END
56echo.
57popd