Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 40 additions & 44 deletions package/src/main/scripts/console.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,35 @@
@REM

@echo off
rem
rem Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com)
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.


echo
echo █████╗ ██████╗ ██████╗ █████╗ ██████╗ ███████╗██████╗ ██████╗
echo ██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔══██╗
echo ███████║██████╔╝██║ ███████║██║ ██║█████╗ ██║ ██║██████╔╝
echo ██╔══██║██╔══██╗██║ ██╔══██║██║ ██║██╔══╝ ██║ ██║██╔══██╗
echo ██║ ██║██║ ██║╚██████╗██║ ██║██████╔╝███████╗██████╔╝██████╔╝
echo ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝
echo PLAY WITH DATA arcadedb.com
echo ARCADEDB - PLAY WITH DATA - https://arcadedb.com

rem Guess ARCADEDB_HOME if not defined
set CURRENT_DIR=%cd%
@setlocal

set ERROR_CODE=0

rem Validations
if not "%JAVA_HOME%"=="" goto OkJHome

rem Look for java executable
for %%i in (java.exe) do set "JAVACMD=%%~$PATH:i"
goto checkJCmd

if exist "%JAVA_HOME%\bin\java.exe" goto setJavaHome
set JAVA="java"
goto okJava
:OkJHome
set "JAVACMD=%JAVA_HOME%\bin\java.exe"

:setJavaHome
set JAVA="%JAVA_HOME%\bin\java"
:checkJCmd
if exist "%JAVACMD%" goto chkArcHome

:okJava
echo The JAVA_HOME environment variable is not defined correctly, >&2
echo this environment variable is needed to run this program. >&2
goto error

:chkArcHome
if not "%ARCADEDB_HOME%" == "" goto gotHome
set ARCADEDB_HOME=%CURRENT_DIR%
if exist "%ARCADEDB_HOME%\bin\console.bat" goto okHome
cd ..
set ARCADEDB_HOME=%cd%
cd %CURRENT_DIR%

rem Guess ARCADEDB_HOME if not defined
set "ARCADEDB_HOME=%~dp0"
set "ARCADEDB_HOME=%ARCADEDB_HOME:~0,-5%"

:gotHome
if exist "%ARCADEDB_HOME%\bin\console.bat" goto okHome
Expand All @@ -65,6 +52,12 @@ echo This environment variable is needed to run this program
goto end

:okHome
echo ARCADEDB console script path = %~dpnx0
echo ARCADEDB home directory = %ARCADEDB_HOME%

rem Always change directory to HOME directory
cd /d %ARCADEDB_HOME%

rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=

Expand All @@ -75,14 +68,17 @@ shift
goto setArgs

:doneSetArgs

set JAVA_OPTS_SCRIPT=-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF8

rem ARCADEDB memory options, default uses the available RAM. To set it to a specific value, like 2GB of heap, use "-Xms2G -Xmx2G"
set ARCADEDB_OPTS_MEMORY=

set ARCADEDB_SETTINGS=-Xmx1024m -Djna.nosys=true -Djava.util.logging.config.file="%ARCADEDB_HOME%\config\orientdb-client-log.properties" -Djava.awt.headless=true

call %JAVA% -client %JAVA_OPTS% %ARCADEDB_OPTS_MEMORY% %JAVA_OPTS_SCRIPT% %ARCADEDB_JMX% %ARCADEDB_SETTINGS% -cp "%ARCADEDB_HOME%\lib\*" com.arcadedb.console.Console %CMD_LINE_ARGS%
%JAVACMD% ^
-client ^
%JAVA_OPTS% ^
%JAVA_OPTS_SCRIPT% ^
%ARCADEDB_OPTS_MEMORY% ^
%ARCADEDB_JMX% ^
%ARCADEDB_SETTINGS% ^
-cp "%ARCADEDB_HOME%\lib\*" ^
%CMD_LINE_ARGS% ^
com.arcadedb.console.Console

:end
63 changes: 47 additions & 16 deletions package/src/main/scripts/server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,36 @@
@REM limitations under the License.
@REM

echo "ARCADEDB - PLAY WITH DATA - arcadedb.com"
@echo off
echo ARCADEDB - PLAY WITH DATA - https://arcadedb.com

rem Guess ARCADEDB_HOME if not defined
set CURRENT_DIR=%cd%
@setlocal

set ERROR_CODE=0

rem Validations
if not "%JAVA_HOME%"=="" goto OkJHome

rem Look for java executable on PATH
for %%i in (java.exe) do set "JAVACMD=%%~$PATH:i"
goto checkJCmd

if exist "%JAVA_HOME:"=%\bin\java.exe" goto setJavaHome
set JAVA=java
goto okJava
:OkJHome
set "JAVACMD=%JAVA_HOME%\bin\java.exe"

:setJavaHome
set JAVA="%JAVA_HOME:"=%\bin\java"
:checkJCmd
if exist "%JAVACMD%" goto chkArcHome

:okJava
echo The JAVA_HOME environment variable is not defined correctly, >&2
echo this environment variable is needed to run this program. >&2
goto error

:chkArcHome
if not "%ARCADEDB_HOME%" == "" goto gotHome
set ARCADEDB_HOME=%CURRENT_DIR%
if exist "%ARCADEDB_HOME%\bin\server.bat" goto okHome
cd ..
set ARCADEDB_HOME=%cd%
cd %CURRENT_DIR%

rem Guess ARCADEDB_HOME if not defined
set "ARCADEDB_HOME=%~dp0"
set "ARCADEDB_HOME=%ARCADEDB_HOME:~0,-5%"

:gotHome
if exist "%ARCADEDB_HOME%\bin\server.bat" goto okHome
Expand All @@ -41,6 +52,12 @@ echo This environment variable is needed to run this program
goto end

:okHome
echo ARCADEDB server script path = %~dpnx0
echo ARCADEDB home directory = %ARCADEDB_HOME%

rem Always change directory to HOME directory
cd /d %ARCADEDB_HOME%

rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=

Expand All @@ -59,11 +76,25 @@ set ARCADEDB_OPTS_MEMORY=

set ARCADEDB_JMX=-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.rmi.port=9998


rem TO DEBUG ARCADEDB SERVER RUN IT WITH THESE OPTIONS:
rem -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
rem AND ATTACH TO THE CURRENT HOST, PORT 1044

call %JAVA% -server %JAVA_OPTS% %ARCADEDB_OPTS_MEMORY% %JAVA_OPTS_SCRIPT% %ARCADEDB_JMX% %ARCADEDB_SETTINGS% %CMD_LINE_ARGS% -cp "%ARCADEDB_HOME%\lib\*" com.arcadedb.server.ArcadeDBServer
"%JAVACMD%" ^
-server %JAVA_OPTS% ^
%ARCADEDB_OPTS_MEMORY% ^
%JAVA_OPTS_SCRIPT% ^
%ARCADEDB_JMX% ^
%ARCADEDB_SETTINGS% ^
-cp "%ARCADEDB_HOME%\lib\*" ^
%CMD_LINE_ARGS% com.arcadedb.server.ArcadeDBServer

if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
cmd /c exit /b %ERROR_CODE%
53 changes: 36 additions & 17 deletions package/src/main/scripts/stresstester.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,35 @@
@REM

@echo off
rem
rem Copyright (c) Arcade Analytics LTD (https://www.arcadeanalytics.com)
rem
rem Guess ARCADEDB_HOME if not defined
set CURRENT_DIR=%cd%
echo ARCADEDB - PLAY WITH DATA - https://arcadedb.com

@setlocal

set ERROR_CODE=0

rem Validations
if not "%JAVA_HOME%"=="" goto OkJHome

rem Look for java executable
for %%i in (java.exe) do set "JAVACMD=%%~$PATH:i"
goto checkJCmd

:OkJHome
set "JAVACMD=%JAVA_HOME%\bin\java.exe"

if exist "%JAVA_HOME%\bin\java.exe" goto setJavaHome
set JAVA="java"
goto okJava
:checkJCmd
if exist "%JAVACMD%" goto chkArcHome

:setJavaHome
set JAVA="%JAVA_HOME%\bin\java"
echo The JAVA_HOME environment variable is not defined correctly, >&2
echo this environment variable is needed to run this program. >&2
goto error

:okJava
:chkArcHome
if not "%ARCADEDB_HOME%" == "" goto gotHome
set ARCADEDB_HOME=%CURRENT_DIR%
if exist "%ARCADEDB_HOME%\bin\stresstester.bat" goto okHome
cd ..
set ARCADEDB_HOME=%cd%
cd %CURRENT_DIR%

rem Guess ARCADEDB_HOME if not defined
set "ARCADEDB_HOME=%~dp0"
set "ARCADEDB_HOME=%ARCADEDB_HOME:~0,-5%"

:gotHome
if exist "%ARCADEDB_HOME%\bin\stresstester.bat" goto okHome
Expand All @@ -43,6 +52,12 @@ echo This environment variable is needed to run this program
goto end

:okHome
echo ARCADEDB stresstester script path = %~dpnx0
echo ARCADEDB home directory = %ARCADEDB_HOME%

rem Always change directory to HOME directory
cd /d %ARCADEDB_HOME%

rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=

Expand All @@ -54,6 +69,10 @@ goto setArgs

:doneSetArgs

call %JAVA% -client -cp "%ARCADEDB_HOME%\lib\*;%ARCADEDB_HOME%\plugins\*" com.arcadedb.console.stresstest.StressTester %CMD_LINE_ARGS%
%JAVACMD% ^
-client ^
-cp "%ARCADEDB_HOME%\lib\*;%ARCADEDB_HOME%\plugins\*" ^
com.arcadedb.console.stresstest.StressTester ^
%CMD_LINE_ARGS%

:end