diff --git a/.rat-excludes b/.rat-excludes new file mode 100644 index 000000000000..6df36a5e6a5b --- /dev/null +++ b/.rat-excludes @@ -0,0 +1,33 @@ +**/*.avpr +debian/** +.classpath +.rat-excludes +**/.project +**/.pydevproject +CHANGES.txt +README.asc +.git/** +**/*.json +**/*.patch +interface/*/gen-*/** +src/gen-java/** +build/** +lib/licenses/*.txt +.settings/** +**/cassandra.yaml +**/cassandra-topology.yaml +**/metrics-reporter-config-sample.yaml +**/*.db +.externalToolBuilders/** +test/data/serialization/*/* +**/*.wpr +doc/** +build.properties.default +test/data/** +examples/triggers/build.xml +examples/triggers/conf/* +examples/hadoop_word_count/conf/log4j.properties +pylib/cqlshlib/test/** +src/resources/org/apache/cassandra/config/version.properties +conf/hotspot_compiler +**/*-example.yaml diff --git a/bin/cassandra.bat b/bin/cassandra.bat new file mode 100644 index 000000000000..fd9cc03c03e7 --- /dev/null +++ b/bin/cassandra.bat @@ -0,0 +1,184 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +set ARG=%1 +set INSTALL="INSTALL" +set UNINSTALL="UNINSTALL" + +pushd %~dp0.. +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +popd + +if /i "%ARG%" == "LEGACY" goto runLegacy +REM ----------------------------------------------------------------------------- +REM See if we have access to run unsigned powershell scripts +for /F "delims=" %%i in ('powershell Get-ExecutionPolicy') do set PERMISSION=%%i +if "%PERMISSION%" == "Unrestricted" goto runPowerShell +goto runLegacy + +REM ----------------------------------------------------------------------------- +:runPowerShell +echo Detected powershell execution permissions. Running with enhanced startup scripts. +set errorlevel= +powershell /file "%CASSANDRA_HOME%\bin\cassandra.ps1" %* +exit /b %errorlevel% + +REM ----------------------------------------------------------------------------- +:runLegacy +echo WARNING! Powershell script execution unavailable. +echo Please use 'powershell Set-ExecutionPolicy Unrestricted' +echo on this user-account to run cassandra with fully featured +echo functionality on this platform. + +echo Starting with legacy startup options + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.service.CassandraDaemon +if NOT DEFINED JAVA_HOME goto :err + +REM ----------------------------------------------------------------------------- +REM JVM Opts we'll use in legacy run or installation +set JAVA_OPTS=-ea^ + -javaagent:"%CASSANDRA_HOME%\lib\jamm-0.3.2"^ + -Xms2G^ + -Xmx2G^ + -XX:+HeapDumpOnOutOfMemoryError^ + -XX:+UseParNewGC^ + -XX:+UseConcMarkSweepGC^ + -XX:+CMSParallelRemarkEnabled^ + -XX:SurvivorRatio=8^ + -XX:MaxTenuringThreshold=1^ + -XX:CMSInitiatingOccupancyFraction=75^ + -XX:+UseCMSInitiatingOccupancyOnly^ + -Dlogback.configurationFile=logback.xml^ + -Djava.library.path="%CASSANDRA_HOME%\lib\sigar-bin"^ + -Dcassandra.jmx.local.port=7199 +REM **** JMX REMOTE ACCESS SETTINGS SEE: https://wiki.apache.org/cassandra/JmxSecurity *** +REM -Dcom.sun.management.jmxremote.port=7199^ +REM -Dcom.sun.management.jmxremote.ssl=false^ +REM -Dcom.sun.management.jmxremote.authenticate=true^ +REM -Dcom.sun.management.jmxremote.password.file=C:\jmxremote.password + +REM ***** CLASSPATH library setting ***** +REM Ensure that any user defined CLASSPATH variables are not used on startup +set CLASSPATH="%CASSANDRA_HOME%\conf" + +REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable. +for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i" +goto okClasspath + +:append +set CLASSPATH=%CLASSPATH%;%1 +goto :eof + +REM ----------------------------------------------------------------------------- +:okClasspath + +REM JSR223 - collect all JSR223 engines' jars +for /D %%P in ("%CASSANDRA_HOME%\lib\jsr223\*.*") do ( + for %%i in ("%%P\*.jar") do call :append "%%i" +) + +REM JSR223/JRuby - set ruby lib directory +if EXIST "%CASSANDRA_HOME%\lib\jsr223\jruby\ruby" ( + set JAVA_OPTS=%JAVA_OPTS% "-Djruby.lib=%CASSANDRA_HOME%\lib\jsr223\jruby" +) +REM JSR223/JRuby - set ruby JNI libraries root directory +if EXIST "%CASSANDRA_HOME%\lib\jsr223\jruby\jni" ( + set JAVA_OPTS=%JAVA_OPTS% "-Djffi.boot.library.path=%CASSANDRA_HOME%\lib\jsr223\jruby\jni" +) +REM JSR223/Jython - set python.home system property +if EXIST "%CASSANDRA_HOME%\lib\jsr223\jython\jython.jar" ( + set JAVA_OPTS=%JAVA_OPTS% "-Dpython.home=%CASSANDRA_HOME%\lib\jsr223\jython" +) +REM JSR223/Scala - necessary system property +if EXIST "%CASSANDRA_HOME%\lib\jsr223\scala\scala-compiler.jar" ( + set JAVA_OPTS=%JAVA_OPTS% "-Dscala.usejavacp=true" +) + +REM Include the build\classes\main directory so it works in development +set CASSANDRA_CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\main" +set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes +set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.logdir="%CASSANDRA_HOME%\logs" +set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.storagedir="%CASSANDRA_HOME%\data" + +if /i "%ARG%" == "INSTALL" goto doInstallOperation +if /i "%ARG%" == "UNINSTALL" goto doInstallOperation + +echo Starting Cassandra Server +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" +goto finally + +REM ----------------------------------------------------------------------------- +:doInstallOperation +set SERVICE_JVM="cassandra" +rem location of Prunsrv +set PATH_PRUNSRV=%CASSANDRA_HOME%\bin\daemon\ +set PR_LOGPATH=%PATH_PRUNSRV% + +rem Allow prunsrv to be overridden +if "%PRUNSRV%" == "" set PRUNSRV=%PATH_PRUNSRV%prunsrv + +echo trying to delete service if it has been created already +"%PRUNSRV%" //DS//%SERVICE_JVM% +rem quit if we're just going to uninstall +if /i "%ARG%" == "UNINSTALL" goto finally + +echo Installing %SERVICE_JVM%. If you get registry warnings, re-run as an Administrator +"%PRUNSRV%" //IS//%SERVICE_JVM% + +echo Setting startup parameters for %SERVICE_JVM% +set cmd="%PRUNSRV%" //US//%SERVICE_JVM% ^ + --Jvm=auto --StdOutput auto --StdError auto ^ + --Classpath=%CASSANDRA_CLASSPATH% ^ + --StartMode=jvm --StartClass=%CASSANDRA_MAIN% --StartMethod=main ^ + --StopMode=jvm --StopClass=%CASSANDRA_MAIN% --StopMethod=stop + +REM convert ' -' into ';-' so we can tokenize on semicolon as we may have spaces in folder names +set tempOptions=%JAVA_OPTS: -=;-% +REM Append the JAVA_OPTS, each with independent ++JvmOptions as delimited list fails for some options +:optStrip +for /F "tokens=1* delims=;" %%a in ("%tempOptions%") do ( + set JVMOPTIONS=%JVMOPTIONS% ++JvmOptions=%%a + set tempOptions=%%b +) +if defined tempOptions goto :optStrip + +REM do the same for CASSANDRA_PARAMS +set tempOptions=%CASSANDRA_PARAMS: -=;-% + +:paramStrip +for /F "tokens=1* delims=;" %%a in ("%tempOptions%") do ( + set JVMOPTIONS=%JVMOPTIONS% ++JvmOptions=%%a + set tempOptions=%%b +) +if defined tempOptions goto :paramStrip + +%cmd% %JVMOPTIONS% + +echo Installation of %SERVICE_JVM% is complete +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +REM ----------------------------------------------------------------------------- +:finally + +ENDLOCAL diff --git a/bin/cassandra.in.bat b/bin/cassandra.in.bat new file mode 100644 index 000000000000..97ae83699b49 --- /dev/null +++ b/bin/cassandra.in.bat @@ -0,0 +1,74 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +pushd %~dp0.. +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +popd + +if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF="%CASSANDRA_HOME%\conf" + +REM the default location for commitlogs, sstables, and saved caches +REM if not set in cassandra.yaml +set cassandra_storagedir="%CASSANDRA_HOME%\data" + +REM JAVA_HOME can optionally be set here +REM set JAVA_HOME="" + +REM ***** CLASSPATH library setting ***** + +REM Ensure that any user defined CLASSPATH variables are not used on startup +set CLASSPATH=%CASSANDRA_CONF% + +REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable. +for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i" +goto :okClasspath + +:append +set CLASSPATH=%CLASSPATH%;%1 +goto :eof + +:okClasspath + +REM Include the build\classes\main directory so it works in development +set CASSANDRA_CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\main";%CASSANDRA_CONF% + +REM Add the default storage location. Can be overridden in conf\cassandra.yaml +set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% "-Dcassandra.storagedir=%CASSANDRA_HOME%\data" + +REM JSR223 - collect all JSR223 engines' jars +for /r %%P in ("%CASSANDRA_HOME%\lib\jsr223\*.jar") do ( + set CLASSPATH=%CLASSPATH%;%%~fP +) +REM JSR223/JRuby - set ruby lib directory +if EXIST "%CASSANDRA_HOME%\lib\jsr223\jruby\ruby" ( + set JAVA_OPTS=%JAVA_OPTS% "-Djruby.lib=%CASSANDRA_HOME%\lib\jsr223\jruby" +) +REM JSR223/JRuby - set ruby JNI libraries root directory +if EXIST "%CASSANDRA_HOME%\lib\jsr223\jruby\jni" ( + set JAVA_OPTS=%JAVA_OPTS% "-Djffi.boot.library.path=%CASSANDRA_HOME%\lib\jsr223\jruby\jni" +) +REM JSR223/Jython - set python.home system property +if EXIST "%$CASSANDRA_HOME%\lib\jsr223\jython\jython.jar" ( + set JAVA_OPTS=%JAVA_OPTS% "-Dpython.home=%CASSANDRA_HOME%\lib\jsr223\jython" +) +REM JSR223/Scala - necessary system property +if EXIST "$CASSANDRA_HOME\lib\jsr223\scala\scala-compiler.jar" ( + set JAVA_OPTS=%JAVA_OPTS% "-Dscala.usejavacp=true" +) + +REM Add the sigar-bin path to the java.library.path CASSANDRA-7838 +set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path=%CASSANDRA_HOME%\lib\sigar-bin" diff --git a/bin/cassandra.ps1 b/bin/cassandra.ps1 new file mode 100644 index 000000000000..c96ec2faceb9 --- /dev/null +++ b/bin/cassandra.ps1 @@ -0,0 +1,390 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#----------------------------------------------------------------------------- +Function PrintUsage +{ + echo @" +usage: cassandra.ps1 [-f] [-h] [-q] [-a] [-p pidfile] [-H dumpfile] [-D arg] [-E errorfile] [-install | -uninstall] [-help] + -f Run cassandra in foreground + -install install cassandra as a service + -uninstall remove cassandra service + -p pidfile tracked by server and removed on close (defaults to pid.txt) + -H change JVM HeapDumpPath + -D items to append to JVM_OPTS + -E change JVM ErrorFile + -v Print cassandra version and exit + -s Show detailed jvm environment information during launch + -a Aggressive startup. Skip VerifyPorts check. For use in dev environments. + -q Quiet output. Does not print stdout/stderr to console (when run without -f) + -help print this message + + NOTE: installing cassandra as a service requires Commons Daemon Service Runner + available at http://commons.apache.org/proper/commons-daemon/" +"@ + exit +} + +#----------------------------------------------------------------------------- +Function Main +{ + ValidateArguments + + # support direct run of .ps1 file w/out batch file + if ($env:CASSANDRA_HOME -eq $null) + { + $scriptDir = Split-Path $script:MyInvocation.MyCommand.Path + $env:CASSANDRA_HOME = (Get-Item $scriptDir).parent.FullName + } + . "$env:CASSANDRA_HOME\bin\source-conf.ps1" + + $conf = Find-Conf + if ($s) + { + echo "Sourcing cassandra config file: $conf" + } + . $conf + + SetCassandraEnvironment + if ($v) + { + PrintVersion + exit + } + $pidfile = "$env:CASSANDRA_HOME\$pidfile" + + # Other command line params + if ($H) + { + $env:JVM_OPTS = $env:JVM_OPTS + " -XX:HeapDumpPath=$H" + } + if ($E) + { + $env:JVM_OPTS = $env:JVM_OPTS + " -XX:ErrorFile=$E" + } + if ($p) + { + $pidfile = "$p" + $env:CASSANDRA_PARAMS = $env:CASSANDRA_PARAMS + ' -Dcassandra-pidfile="' + "$pidfile" + '"' + } + + # Parse -D and -X JVM_OPTS + for ($i = 0; $i -lt $script:args.Length; ++$i) + { + if ($script:args[$i].StartsWith("-D") -Or $script:args[$i].StartsWith("-X")) + { + $env:JVM_OPTS = "$env:JVM_OPTS " + $script:args[$i] + } + } + + if ($install -or $uninstall) + { + HandleInstallation + } + else + { + VerifyPortsAreAvailable + RunCassandra($f) + } +} + +#----------------------------------------------------------------------------- +Function HandleInstallation +{ + $SERVICE_JVM = """cassandra""" + $PATH_PRUNSRV = "$env:CASSANDRA_HOME\bin\daemon" + $PR_LOGPATH = $serverPath + + if (-Not (Test-Path $PATH_PRUNSRV\prunsrv.exe)) + { + Write-Warning "Cannot find $PATH_PRUNSRV\prunsrv.exe. Please download package from https://downloads.apache.org/commons/daemon/binaries/windows/ to install as a service." + Break + } + + If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) + { + Write-Warning "Cannot perform installation without admin credentials. Please re-run as administrator." + Break + } + if (!$env:PRUNSRV) + { + $env:PRUNSRV="$PATH_PRUNSRV\prunsrv" + } + + $regPath = "HKLM:\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\" + + echo "Attempting to delete existing $SERVICE_JVM service..." + Start-Sleep -s 2 + $proc = Start-Process -FilePath "$env:PRUNSRV" -ArgumentList "//DS//$SERVICE_JVM" -PassThru -WindowStyle Hidden + + echo "Reverting to default TCP keepalive settings (2 hour timeout)" + Remove-ItemProperty -Path $regPath -Name KeepAliveTime -EA SilentlyContinue + + # Quit out if this is uninstall only + if ($uninstall) + { + return + } + + echo "Installing [$SERVICE_JVM]." + Start-Sleep -s 2 + $proc = Start-Process -FilePath "$env:PRUNSRV" -ArgumentList "//IS//$SERVICE_JVM" -PassThru -WindowStyle Hidden + + echo "Setting launch parameters for [$SERVICE_JVM]" + Start-Sleep -s 2 + + $args = @" +//US//$SERVICE_JVM + --Jvm=auto --StdOutput auto --StdError auto + --Classpath=$env:CLASSPATH + --StartMode=jvm --StartClass=$env:CASSANDRA_MAIN --StartMethod=main + --StopMode=jvm --StopClass=$env:CASSANDRA_MAIN --StopMethod=stop + --PidFile "$pidfile" +"@ + + # Include cassandra params + $prunArgs = "$env:CASSANDRA_PARAMS $env:JVM_OPTS" + + # Change to semicolon delim as we can't split on space due to potential spaces in directory names + $prunArgs = $prunArgs -replace " -", ";-" + + # JvmOptions w/multiple semicolon delimited items isn't working correctly. storagedir and logdir were + # both being ignored / failing to parse on startup. See CASSANDRA-8115 + $split_opts = $prunArgs.Split(";") + foreach ($arg in $split_opts) + { + $args += " ++JvmOptions=$arg" + } + + $args = $args -replace [Environment]::NewLine, "" + $proc = Start-Process -FilePath "$env:PRUNSRV" -ArgumentList $args -PassThru -WindowStyle Hidden + + echo "Setting KeepAliveTimer to 5 minutes for TCP keepalive" + Set-ItemProperty -Path $regPath -Name KeepAliveTime -Value 300000 + + echo "Installation of [$SERVICE_JVM] is complete" +} + +#----------------------------------------------------------------------------- +Function PrintVersion() +{ + Write-Host "Cassandra Version: " -NoNewLine + $pinfo = New-Object System.Diagnostics.ProcessStartInfo + $pinfo.FileName = "$env:JAVA_BIN" + $pinfo.UseShellExecute = $false + $pinfo.Arguments = "-Dlogback.configurationFile=logback-tools.xml -cp $env:CLASSPATH org.apache.cassandra.tools.GetVersion" + $p = New-Object System.Diagnostics.Process + $p.StartInfo = $pinfo + $p.Start() | Out-Null + $p.WaitForExit() +} + +#----------------------------------------------------------------------------- +Function RunCassandra([string]$foreground) +{ + $cmd = @" +$env:JAVA_BIN +"@ + $arg1 = $env:CASSANDRA_PARAMS + $arg2 = $env:JVM_OPTS + $arg3 = "-cp $env:CLASSPATH" + $arg4 = @" +"$env:CASSANDRA_MAIN" +"@ + + $proc = $null + + if ($s) + { + echo "Running cassandra with: [$cmd $arg1 $arg2 $arg3 $arg4]" + } + + if ($foreground) + { + $cygwin = $false + try + { + $uname = uname -o + if ($uname.CompareTo("Cygwin") -eq 0) + { + $cygwin = $true + } + } + catch + { + # Failed at uname call, not in cygwin + } + + if ($cygwin) + { + # if running on cygwin, we cannot capture ctrl+c signals as mintty traps them and then + # SIGKILLs processes, so we'll need to record our $pidfile file for future + # stop-server usage + if (!$p) + { + echo "Detected cygwin runtime environment. Adding -Dcassandra-pidfile=$pidfile to JVM params as control+c trapping on mintty is inconsistent" + $arg2 = $arg2 + " -Dcassandra-pidfile=$pidfile" + } + } + + $arg2 = $arg2 + " -Dcassandra-foreground=yes" + + $pinfo = New-Object System.Diagnostics.ProcessStartInfo + $pinfo.FileName = "$env:JAVA_BIN" + $pinfo.RedirectStandardInput = $true + $pinfo.UseShellExecute = $false + $pinfo.Arguments = $arg1,$arg2,$arg3,$arg4 + $p = New-Object System.Diagnostics.Process + $p.StartInfo = $pinfo + $p.Start() | Out-Null + echo $p.Id > $pidfile + $p.WaitForExit() + } + else + { + if ($q) + { + $proc = Start-Process -FilePath "$cmd" -ArgumentList $arg1,$arg2,$arg3,$arg4 -PassThru -WindowStyle Hidden + } + else + { + $proc = Start-Process -FilePath "$cmd" -ArgumentList $arg1,$arg2,$arg3,$arg4 -PassThru -NoNewWindow + } + + $exitCode = $? + + try + { + echo $proc.Id > $pidfile + } + catch + { + echo @" +WARNING! Failed to write pidfile to $pidfile. stop-server.bat and + startup protection will not be available. +"@ + echo $_.Exception.Message + exit 1 + } + + if (-Not $exitCode) + { + exit 1 + } + } +} + +#----------------------------------------------------------------------------- +Function VerifyPortsAreAvailable +{ + if ($a) + { + return + } + # Need to confirm 5 different ports are available or die if any are currently bound + # From cassandra.yaml: + # storage_port + # ssl_storage_port + # native_transport_port + # and from env: JMX_PORT which we cache in our environment during SetCassandraEnvironment for this check + $yamlRegex = "storage_port:|ssl_storage_port:|native_transport_port:" + $yaml = Get-Content "$env:CASSANDRA_CONF\cassandra.yaml" + $portRegex = ":$env:JMX_PORT |" + + foreach ($line in $yaml) + { + if ($line -match $yamlRegex) + { + $sa = $line.Split(":") + $portRegex = $portRegex + ":" + ($sa[1] -replace " ","") + " |" + } + } + $portRegex = $portRegex.Substring(0, $portRegex.Length - 2) + + $netstat = netstat -an + + foreach ($line in $netstat) + { + if ($line -match "TCP" -and $line -match $portRegex) + { + Write-Error "Found a port already in use. Aborting startup" + Write-Error $line + Exit + } + } +} + +#----------------------------------------------------------------------------- +Function ValidateArguments +{ + if ($install -and $uninstall) + { + echo "Cannot install and uninstall" + exit + } + if ($help) + { + PrintUsage + } +} + +#----------------------------------------------------------------------------- +Function CheckEmptyParam($param) +{ + if ([String]::IsNullOrEmpty($param)) + { + echo "Invalid parameter: empty value" + PrintUsage + } +} + +#----------------------------------------------------------------------------- +# Populate arguments +for ($i = 0; $i -lt $args.count; $i++) +{ + # Skip JVM args + if ($args[$i].StartsWith("-D") -Or $args[$i].StartsWith("-X")) + { + continue; + } + Switch($args[$i]) + { + "-install" { $install = $True } + "-uninstall" { $uninstall = $True } + "-help" { PrintUsage } + "-?" { PrintUsage } + "--help" { PrintUsage } + "-v" { $v = $True } + "-f" { $f = $True } + "-s" { $s = $True } + "-p" { $p = $args[++$i]; CheckEmptyParam($p) } + "-H" { $H = $args[++$i]; CheckEmptyParam($H) } + "-E" { $E = $args[++$i]; CheckEmptyParam($E) } + "-a" { $a = $True } + "-q" { $q = $True } + default + { + "Invalid argument: " + $args[$i]; + if (-Not $args[$i].startsWith("-")) + { + echo "Note: All options require -" + } + exit + } + } +} +$pidfile = "pid.txt" + +Main diff --git a/bin/cqlsh.bat b/bin/cqlsh.bat new file mode 100644 index 000000000000..a9bc4d17a066 --- /dev/null +++ b/bin/cqlsh.bat @@ -0,0 +1,34 @@ +@ECHO OFF +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off + +if "%OS%" == "Windows_NT" setlocal + +python -V >nul 2>&1 +if ERRORLEVEL 1 goto err + +python "%~dp0\cqlsh.py" %* +goto finally + +:err +echo Can't detect Python version! + +:finally + +ENDLOCAL + diff --git a/bin/debug-cql.bat b/bin/debug-cql.bat new file mode 100644 index 000000000000..b937a039ada5 --- /dev/null +++ b/bin/debug-cql.bat @@ -0,0 +1,39 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.transport.Client +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/nodetool.bat b/bin/nodetool.bat new file mode 100644 index 000000000000..410a4af99fae --- /dev/null +++ b/bin/nodetool.bat @@ -0,0 +1,38 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. +if NOT DEFINED JAVA_HOME goto :err + +set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.logdir="%CASSANDRA_HOME%\logs" +set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.storagedir="%CASSANDRA_HOME%\data" + +"%JAVA_HOME%\bin\java" -cp %CASSANDRA_CLASSPATH% %CASSANDRA_PARAMS% -Dlogback.configurationFile=logback-tools.xml org.apache.cassandra.tools.NodeTool %* +goto finally + +:err +echo The JAVA_HOME environment variable must be set to run this program! +pause + +:finally +ENDLOCAL & set RC=%ERRORLEVEL% +exit /B %RC% diff --git a/bin/source-conf.ps1 b/bin/source-conf.ps1 new file mode 100644 index 000000000000..21d1383fbe35 --- /dev/null +++ b/bin/source-conf.ps1 @@ -0,0 +1,57 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Function Find-Conf +{ + $file = ""; + # Order of preference on grabbing environment settings: + # 1: %CASSANDRA_INCLUDE% + # 2a: %USERPROFILE%/cassandra-env.ps1 (cmd-prompt) + # 2b: $HOME/cassandra-env.ps1 (cygwin) + # 3: %CASSANDRA_HOME%/conf/cassandra-env.ps1 + # 4: Relative to current working directory (../conf) + if (Test-Path Env:\CASSANDRA_INCLUDE) + { + $file = "$env:CASSANDRA_INCLUDE" + } + elseif (Test-Path "$env:USERPROFILE/cassandra-env.ps1") + { + $file = "$env:USERPROFILE/cassandra-env.ps1" + } + elseif (Test-Path "$env:HOME/cassandra-env.ps1") + { + $file = "$env:HOME/cassandra-env.ps1" + } + elseif (Test-Path Env:\CASSANDRA_HOME) + { + $file = "$env:CASSANDRA_HOME/conf/cassandra-env.ps1" + } + else + { + $file = [System.IO.Directory]::GetCurrentDirectory() + "/../conf/cassandra-env.ps1" + } + $file = $file -replace "\\", "/" + + if (Test-Path $file) + { + return $file + } + else + { + echo "Error with environment file resolution. Path: [$file] not found." + exit + } +} diff --git a/bin/sstableloader.bat b/bin/sstableloader.bat new file mode 100644 index 000000000000..6a9e03b3995d --- /dev/null +++ b/bin/sstableloader.bat @@ -0,0 +1,41 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.BulkLoader +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/sstablescrub.bat b/bin/sstablescrub.bat new file mode 100644 index 000000000000..88e1920b5585 --- /dev/null +++ b/bin/sstablescrub.bat @@ -0,0 +1,41 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.StandaloneScrubber +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/sstableupgrade.bat b/bin/sstableupgrade.bat new file mode 100644 index 000000000000..4943b1530fa1 --- /dev/null +++ b/bin/sstableupgrade.bat @@ -0,0 +1,41 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.StandaloneUpgrader +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/sstableutil.bat b/bin/sstableutil.bat new file mode 100644 index 000000000000..73fc38b65788 --- /dev/null +++ b/bin/sstableutil.bat @@ -0,0 +1,41 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.StandaloneSSTableUtil +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/sstableverify.bat b/bin/sstableverify.bat new file mode 100644 index 000000000000..658715434b76 --- /dev/null +++ b/bin/sstableverify.bat @@ -0,0 +1,48 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd "%~dp0" +call cassandra.in.bat + +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.StandaloneVerifier +if NOT DEFINED JAVA_HOME goto :err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlogback.configurationFile=logback-tools.xml + +set TOOLS_PARAMS= + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%" %* +goto finally + +:err +echo JAVA_HOME environment variable must be set! +set ERRORLEVEL=1 +pause + +:finally +ENDLOCAL & set RC=%ERRORLEVEL% +goto :exit_with_code + +:returncode +exit /B %RC% + +:exit_with_code +call :returncode %RC% diff --git a/bin/stop-server.bat b/bin/stop-server.bat new file mode 100644 index 000000000000..62aa79cf5674 --- /dev/null +++ b/bin/stop-server.bat @@ -0,0 +1,55 @@ +@REM +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. 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 off +if "%OS%" == "Windows_NT" setlocal + +pushd %~dp0.. +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +popd + +REM ----------------------------------------------------------------------------- +REM See if we have the capabilities of running the powershell scripts +for /F "delims=" %%i in ('powershell Get-ExecutionPolicy') do set PERMISSION=%%i +if "%PERMISSION%" == "Unrestricted" goto runPowerShell +goto runLegacy + +REM ----------------------------------------------------------------------------- +:runPowerShell +REM Need to generate a random title for this command-prompt to determine its pid. +REM We detach and re-attach the console in stop-server.ps1 to send ctrl+c to the +REM running cassandra process and need to re-attach here to print results. +set /A rand=%random% %% (100000 - 1 + 1) + 1 +TITLE %rand% +FOR /F "tokens=2 delims= " %%A IN ('TASKLIST /FI ^"WINDOWTITLE eq %rand%^" /NH') DO set PID=%%A + +REM Start with /B -> the control+c event we generate in stop-server.ps1 percolates +REM up and hits this external batch file if we call powershell directly. +start /WAIT /B powershell /file "%CASSANDRA_HOME%/bin/stop-server.ps1" -batchpid %PID% %* +goto finally + +REM ----------------------------------------------------------------------------- +:runLegacy +echo WARNING! Powershell script execution unavailable. +echo Please use 'powershell Set-ExecutionPolicy Unrestricted' +echo on this user-account to run cassandra with fully featured +echo functionality on this platform. + +echo Cannot stop server without powershell access. +goto finally + +:finally +ENDLOCAL diff --git a/bin/stop-server.ps1 b/bin/stop-server.ps1 new file mode 100644 index 000000000000..2b7f7909244f --- /dev/null +++ b/bin/stop-server.ps1 @@ -0,0 +1,193 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +param ( + [string]$p, + [string]$batchpid, + [switch]$f, + [switch]$silent, + [switch]$help +) + +#----------------------------------------------------------------------------- +Function ValidateArguments +{ + if (!$p) + { + PrintUsage + } + if ($help) + { + PrintUsage + } +} + +#----------------------------------------------------------------------------- +Function PrintUsage +{ + echo @" + +usage: stop-server.ps1 -p pidfile -f[-help] + -p pidfile tracked by server and removed on close. + -s Silent. Don't print success/failure data. + -f force kill. +"@ + exit +} + +#----------------------------------------------------------------------------- +Function KillProcess +{ + if (-Not (Test-Path $p)) + { + if (-Not ($silent)) + { + echo "Error - pidfile not found. Aborting." + } + exit + } + + $t = @" + using System; + using System.Diagnostics; + using System.IO; + using System.Runtime.InteropServices; + using System.Threading; + + namespace PowerStopper + { + public static class Stopper + { + delegate bool ConsoleCtrlDelegate(CtrlTypes CtrlType); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool AttachConsole(uint dwProcessId); + + [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] + static extern bool FreeConsole(); + + enum CtrlTypes : uint + { + CTRL_C_EVENT = 0, + CTRL_BREAK_EVENT, + CTRL_CLOSE_EVENT, + CTRL_LOGOFF_EVENT = 5, + CTRL_SHUTDOWN_EVENT + } + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool GenerateConsoleCtrlEvent(CtrlTypes dwCtrlEvent, uint dwProcessGroupId); + + [DllImport("kernel32.dll")] + static extern bool SetConsoleCtrlHandler(ConsoleCtrlDelegate HandlerRoutine, bool Add); + + // Our output gets swallowed on ms-dos as we can't re-attach our console to the output of the cmd + // running the batch file. + public static void StopProgram(int pidToKill, int consolePid, bool silent) + { + Process proc = null; + try + { + proc = Process.GetProcessById(pidToKill); + } + catch (ArgumentException) + { + if (!silent) + System.Console.WriteLine("Process " + pidToKill + " not found. Aborting."); + return; + } + + if (!FreeConsole()) + { + if (!silent) + System.Console.WriteLine("Failed to FreeConsole to attach to running cassandra process. Aborting."); + return; + } + + if (AttachConsole((uint)pidToKill)) + { + //Disable Ctrl-C handling for our program + SetConsoleCtrlHandler(null, true); + GenerateConsoleCtrlEvent(CtrlTypes.CTRL_C_EVENT, 0); + + // Must wait here. If we don't and re-enable Ctrl-C + // handling below too fast, we might terminate ourselves. + bool exited = proc.WaitForExit(30000); + if(!exited) + proc.Kill(); + + FreeConsole(); + + // Re-attach to current console to write output + if (consolePid >= 0) + AttachConsole((uint)consolePid); + + // Re-enable Ctrl-C handling or any subsequently started + // programs will inherit the disabled state. + SetConsoleCtrlHandler(null, false); + + if (!silent) + { + if(exited) + System.Console.WriteLine("Successfully sent ctrl+c to process with id: " + pidToKill + "."); + else + System.Console.WriteLine("Process with id: " + pidToKill + " did not exit after 30 seconds, killed."); + } + } + else + { + if (!silent) + { + string errorMsg = new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()).Message; + System.Console.WriteLine("Error attaching to pid: " + pidToKill + ": " + Marshal.GetLastWin32Error() + " - " + errorMsg); + } + } + } + } + } +"@ + # cygwin assumes environment variables are case sensitive which causes problems when + # the type dictionary references 'tmp' or 'temp' and throws a System.ArgumentException + $oldTmp = $env:TMP + $oldTemp = $env:Temp + $env:TMP='' + $env:TEMP='' + Add-Type -TypeDefinition $t + $env:TMP = $oldTmp + $env:TEMP = $oldTemp + + $pidToKill = Get-Content $p + # If run in cygwin, we don't get the TITLE / pid combo in stop-server.bat but also don't need + # to worry about reattaching console output as it gets stderr/stdout even after the C#/C++ + # FreeConsole calls. + if ($batchpid -eq "No") + { + $batchpid = -1 + } + + if ($f) + { + taskkill /f /pid $pidToKill + } + else + { + [PowerStopper.Stopper]::StopProgram($pidToKill, $batchpid, $silent) + } +} + +#----------------------------------------------------------------------------- +ValidateArguments +KillProcess diff --git a/build.xml b/build.xml index 99fc92c59d07..a64ad0493a3e 100644 --- a/build.xml +++ b/build.xml @@ -336,14 +336,14 @@ - + - # SASIIndex [`SASIIndex`](https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/index/sasi/SASIIndex.java), diff --git a/doc/antora.yml b/doc/antora.yml new file mode 100644 index 000000000000..771311bfd964 --- /dev/null +++ b/doc/antora.yml @@ -0,0 +1,9 @@ +name: Cassandra +version: '4.0' +display_version: '4.0' +asciidoc: + attributes: + cass_url: 'http://cassandra.apache.org/' +nav: +- modules/ROOT/nav.adoc +- modules/cassandra/nav.adoc diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile index 46bf8a24d9d9..fafca1436e68 100644 --- a/doc/cql3/CQL.textile +++ b/doc/cql3/CQL.textile @@ -1,22 +1,3 @@ - h1. Cassandra Query Language (CQL) v3.4.3 @@ -415,7 +396,6 @@ bc(syntax).. | ADD ( ( , )* ) | DROP | DROP ( ( , )* ) - | DROP COMPACT STORAGE | WITH