mirror of https://github.com/apache/cassandra
Get Windows command-line flags in-line with linux
patch by Josh McKenzie; reviewed by Philip Thompson for CASSANDRA-7748
This commit is contained in:
parent
9b9bf45b67
commit
dbcc4eae6c
|
|
@ -17,7 +17,8 @@ param (
|
||||||
[switch]$install,
|
[switch]$install,
|
||||||
[switch]$uninstall,
|
[switch]$uninstall,
|
||||||
[switch]$help,
|
[switch]$help,
|
||||||
[switch]$verbose,
|
[switch]$v,
|
||||||
|
[switch]$s,
|
||||||
[switch]$f,
|
[switch]$f,
|
||||||
[string]$p,
|
[string]$p,
|
||||||
[string]$H,
|
[string]$H,
|
||||||
|
|
@ -51,8 +52,9 @@ usage: cassandra.ps1 [-f] [-h] [-p pidfile] [-H dumpfile] [-D arg] [-E errorfile
|
||||||
-H change JVM HeapDumpPath
|
-H change JVM HeapDumpPath
|
||||||
-D items to append to JVM_OPTS
|
-D items to append to JVM_OPTS
|
||||||
-E change JVM ErrorFile
|
-E change JVM ErrorFile
|
||||||
|
-v Print cassandra version and exit
|
||||||
|
-s Show detailed jvm environment information during launch
|
||||||
-help print this message
|
-help print this message
|
||||||
-verbose Show detailed command-line parameters for cassandra run
|
|
||||||
|
|
||||||
NOTE: installing cassandra as a service requires Commons Daemon Service Runner
|
NOTE: installing cassandra as a service requires Commons Daemon Service Runner
|
||||||
available at http://commons.apache.org/proper/commons-daemon/"
|
available at http://commons.apache.org/proper/commons-daemon/"
|
||||||
|
|
@ -76,13 +78,18 @@ Function Main
|
||||||
. "$env:CASSANDRA_HOME\bin\source-conf.ps1"
|
. "$env:CASSANDRA_HOME\bin\source-conf.ps1"
|
||||||
|
|
||||||
$conf = Find-Conf
|
$conf = Find-Conf
|
||||||
if ($verbose)
|
if ($s)
|
||||||
{
|
{
|
||||||
echo "Sourcing cassandra config file: $conf"
|
echo "Sourcing cassandra config file: $conf"
|
||||||
}
|
}
|
||||||
. $conf
|
. $conf
|
||||||
|
|
||||||
SetCassandraEnvironment
|
SetCassandraEnvironment
|
||||||
|
if ($v)
|
||||||
|
{
|
||||||
|
PrintVersion
|
||||||
|
exit
|
||||||
|
}
|
||||||
$pidfile = "$env:CASSANDRA_HOME\$pidfile"
|
$pidfile = "$env:CASSANDRA_HOME\$pidfile"
|
||||||
|
|
||||||
$logdir = "$env:CASSANDRA_HOME/logs"
|
$logdir = "$env:CASSANDRA_HOME/logs"
|
||||||
|
|
@ -195,6 +202,20 @@ Function HandleInstallation
|
||||||
echo "Installation of [$SERVICE_JVM] is complete"
|
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 = "-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)
|
Function RunCassandra([string]$foreground)
|
||||||
{
|
{
|
||||||
|
|
@ -211,7 +232,7 @@ $env:JAVA_BIN
|
||||||
|
|
||||||
$proc = $null
|
$proc = $null
|
||||||
|
|
||||||
if ($verbose)
|
if ($s)
|
||||||
{
|
{
|
||||||
echo "Running cassandra with: [$cmd $arg1 $arg2 $arg3 $arg4]"
|
echo "Running cassandra with: [$cmd $arg1 $arg2 $arg3 $arg4]"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue