hdata.bat 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @echo off
  2. cd /d %~dp0..
  3. setlocal ENABLEDELAYEDEXPANSION
  4. set HDATA_HOME=%cd%
  5. set HDATA_LIB_DIR=%HDATA_HOME%\lib
  6. set HDATA_CONF_DIR=%HDATA_HOME%\conf
  7. set HDATA_PLUGINS_DIR=%HDATA_HOME%\plugins
  8. if not defined java_home (
  9. echo "Not defined JAVA_HOME,Please install java in your PATH and set JAVA_HOME"
  10. call :timeoutAndExit
  11. )
  12. set JAVA="%JAVA_HOME%\bin\java.exe"
  13. if not exist %JAVA% (
  14. echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME"
  15. call :timeoutAndExit
  16. )
  17. set HDATA_CLASSPATH=.;%HDATA_LIB_DIR%\*
  18. ::add plugins to class_path
  19. ::for /f %%i in ('dir /b /ad %HDATA_PLUGINS_DIR%') do (
  20. ::set HDATA_CLASSPATH=!HDATA_CLASSPATH!;!HDATA_PLUGINS_DIR!\%%i\*
  21. ::)
  22. echo %HDATA_CLASSPATH%
  23. set JAVA_OPTS=%JAVA_OPTS% -Xss256k
  24. set JAVA_OPTS=%JAVA_OPTS% -Xms1G -Xmx1G -Xmn512M
  25. set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC
  26. set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC
  27. set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSClassUnloadingEnabled
  28. set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSParallelRemarkEnabled
  29. set JAVA_OPTS=%JAVA_OPTS% -XX:+DisableExplicitGC
  30. set JAVA_OPTS=%JAVA_OPTS% -XX:CMSInitiatingOccupancyFraction=75
  31. set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCMSInitiatingOccupancyOnly
  32. set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
  33. set JAVA_OPTS=%JAVA_OPTS% -XX:SoftRefLRUPolicyMSPerMB=0
  34. set JAVA_OPTS=%JAVA_OPTS% -Dhdata.conf.dir="%HDATA_CONF_DIR%"
  35. set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.configurationFile=file:///%HDATA_CONF_DIR%\log4j2.xml
  36. set MAIN_CLASS="com.github.stuxuhai.hdata.CliDriver"
  37. echo %JAVA% %JAVA_OPTS% -classpath "%HDATA_CLASSPATH%" %MAIN_CLASS% %1 %2 %3 %4 %5 %6 %7 %8 %9
  38. %JAVA% %JAVA_OPTS% -classpath "%HDATA_CLASSPATH%" %MAIN_CLASS% %1 %2 %3 %4 %5 %6 %7 %8 %9
  39. goto :EOF
  40. :timeoutAndExit
  41. timeout /t 10&&exit