From 204aa5ee72db8904b96276bace3ce1d295d3e681 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Tue, 9 Nov 2010 15:58:26 +0000 Subject: [PATCH] merge from 0.6 git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1033046 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 7 ++- bin/cassandra-cli.bat | 2 +- bin/cassandra.bat | 1 - bin/json2sstable | 100 +++++++++++++++---------------- bin/json2sstable.bat | 134 +++++++++++++++++++++--------------------- bin/nodetool.bat | 2 +- bin/sstable2json.bat | 3 +- 7 files changed, 126 insertions(+), 123 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7b432b0ac5..cb6bc73a51 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,9 @@ -dev +0.6.7 + * Update windows .bat files to work outside of main Cassandra + directory (CASSANDRA-1713) + + +0.6.7 * log threshold causing memtable flush (CASSANDRA-1675) * log type of dropped messages (CASSANDRA-1677) * upgrade to SLF4J 1.6.1 diff --git a/bin/cassandra-cli.bat b/bin/cassandra-cli.bat index 3ca2dda79f..c6953c9a9e 100644 --- a/bin/cassandra-cli.bat +++ b/bin/cassandra-cli.bat @@ -18,7 +18,7 @@ @echo off if "%OS%" == "Windows_NT" setlocal -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. if NOT DEFINED JAVA_HOME goto err REM Ensure that any user defined CLASSPATH variables are not used on startup diff --git a/bin/cassandra.bat b/bin/cassandra.bat index e2bf1cd85d..985781750d 100644 --- a/bin/cassandra.bat +++ b/bin/cassandra.bat @@ -18,7 +18,6 @@ if "%OS%" == "Windows_NT" setlocal if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. -if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF=%CASSANDRA_HOME%\conf if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.thrift.CassandraDaemon if NOT DEFINED JAVA_HOME goto err diff --git a/bin/json2sstable b/bin/json2sstable index 02ebaaff6b..6a7cd06e7f 100755 --- a/bin/json2sstable +++ b/bin/json2sstable @@ -1,50 +1,50 @@ -#!/bin/sh - -# 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. - -if [ "x$CASSANDRA_INCLUDE" = "x" ]; then - for include in /usr/share/cassandra/cassandra.in.sh \ - /usr/local/share/cassandra/cassandra.in.sh \ - /opt/cassandra/cassandra.in.sh \ - ~/.cassandra.in.sh \ - `dirname $0`/cassandra.in.sh; do - if [ -r $include ]; then - . $include - break - fi - done -elif [ -r $CASSANDRA_INCLUDE ]; then - . $CASSANDRA_INCLUDE -fi - -# Use JAVA_HOME if set, otherwise look for java in PATH -if [ -x $JAVA_HOME/bin/java ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA=`which java` -fi - -if [ -z $CLASSPATH ]; then - echo "You must set the CLASSPATH var" >&2 - exit 1 -fi - -$JAVA -cp $CLASSPATH -Dstorage-config=$CASSANDRA_CONF \ - -Dlog4j.configuration=log4j-tools.properties \ - org.apache.cassandra.tools.SSTableImport "$@" - -# vi:ai sw=4 ts=4 tw=0 et +#!/bin/sh + +# 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. + +if [ "x$CASSANDRA_INCLUDE" = "x" ]; then + for include in /usr/share/cassandra/cassandra.in.sh \ + /usr/local/share/cassandra/cassandra.in.sh \ + /opt/cassandra/cassandra.in.sh \ + ~/.cassandra.in.sh \ + `dirname $0`/cassandra.in.sh; do + if [ -r $include ]; then + . $include + break + fi + done +elif [ -r $CASSANDRA_INCLUDE ]; then + . $CASSANDRA_INCLUDE +fi + +# Use JAVA_HOME if set, otherwise look for java in PATH +if [ -x $JAVA_HOME/bin/java ]; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + +if [ -z $CLASSPATH ]; then + echo "You must set the CLASSPATH var" >&2 + exit 1 +fi + +$JAVA -cp $CLASSPATH -Dstorage-config=$CASSANDRA_CONF \ + -Dlog4j.configuration=log4j-tools.properties \ + org.apache.cassandra.tools.SSTableImport "$@" + +# vi:ai sw=4 ts=4 tw=0 et diff --git a/bin/json2sstable.bat b/bin/json2sstable.bat index 17bc232c01..96aad68b38 100644 --- a/bin/json2sstable.bat +++ b/bin/json2sstable.bat @@ -1,67 +1,67 @@ -@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 - -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% -if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF=%CASSANDRA_HOME%\conf -if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.SSTableImport -if NOT DEFINED JAVA_HOME goto err - -REM ***** JAVA options ***** -set JAVA_OPTS=^ - -Dlog4j.configuration=log4j-tools.properties - -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 %%~fi -goto okClasspath - -:append -set CLASSPATH=%CLASSPATH%;%1%2 -goto :eof - -:okClasspath -REM Include the build\classes directory so it works in development -set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_HOME%\build\classes;%CASSANDRA_CONF% - -set CASSANDRA_PARAMS= -set TOOLS_PARAMS= - -FOR %%A IN (%*) DO call :appendToolsParams %%A - -goto runTool - -:appendToolsParams -set TOOLS_PARAMS=%TOOLS_PARAMS% %1 -goto :eof - -:runTool -"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp "%CASSANDRA_CLASSPATH%" "%CASSANDRA_MAIN%" %TOOLS_PARAMS% -goto finally - -:err -echo JAVA_HOME environment variable must be set! -pause - -:finally - -ENDLOCAL +@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 + +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. +if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF=%CASSANDRA_HOME%\conf +if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.SSTableImport +if NOT DEFINED JAVA_HOME goto err + +REM ***** JAVA options ***** +set JAVA_OPTS=^ + -Dlog4j.configuration=log4j-tools.properties + +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 %%~fi +goto okClasspath + +:append +set CLASSPATH=%CLASSPATH%;%1%2 +goto :eof + +:okClasspath +REM Include the build\classes directory so it works in development +set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_HOME%\build\classes;%CASSANDRA_CONF% + +set CASSANDRA_PARAMS= +set TOOLS_PARAMS= + +FOR %%A IN (%*) DO call :appendToolsParams %%A + +goto runTool + +:appendToolsParams +set TOOLS_PARAMS=%TOOLS_PARAMS% %1 +goto :eof + +:runTool +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp "%CASSANDRA_CLASSPATH%" "%CASSANDRA_MAIN%" %TOOLS_PARAMS% +goto finally + +:err +echo JAVA_HOME environment variable must be set! +pause + +:finally + +ENDLOCAL diff --git a/bin/nodetool.bat b/bin/nodetool.bat index 334ecd8fef..c7282193e4 100644 --- a/bin/nodetool.bat +++ b/bin/nodetool.bat @@ -17,7 +17,7 @@ @echo off if "%OS%" == "Windows_NT" setlocal -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. if NOT DEFINED JAVA_HOME goto err REM Ensure that any user defined CLASSPATH variables are not used on startup diff --git a/bin/sstable2json.bat b/bin/sstable2json.bat index 55700ea8e5..9f5464f60b 100644 --- a/bin/sstable2json.bat +++ b/bin/sstable2json.bat @@ -17,7 +17,7 @@ @echo off if "%OS%" == "Windows_NT" setlocal -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD% +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0.. if NOT DEFINED CASSANDRA_CONF set CASSANDRA_CONF=%CASSANDRA_HOME%\conf if NOT DEFINED CASSANDRA_MAIN set CASSANDRA_MAIN=org.apache.cassandra.tools.SSTableExport if NOT DEFINED JAVA_HOME goto err @@ -55,7 +55,6 @@ set TOOLS_PARAMS=%TOOLS_PARAMS% %1 goto :eof :runTool -echo "%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp "%CASSANDRA_CLASSPATH%" "%CASSANDRA_MAIN%" %TOOLS_PARAMS% "%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp "%CASSANDRA_CLASSPATH%" "%CASSANDRA_MAIN%" %TOOLS_PARAMS% goto finally