cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject cassandra git commit: fix sstabledump script to follow the template
Date Fri, 26 Feb 2016 23:03:54 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 11d7eb3ba -> ace7fe03d


fix sstabledump script to follow the template


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ace7fe03
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ace7fe03
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ace7fe03

Branch: refs/heads/trunk
Commit: ace7fe03d0e69a6d572a6c0acd6b598bcac6327e
Parents: 11d7eb3
Author: Jeremiah D Jordan <jeremiah@datastax.com>
Authored: Fri Feb 26 17:02:34 2016 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Feb 26 17:02:34 2016 -0600

----------------------------------------------------------------------
 tools/bin/sstabledump | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ace7fe03/tools/bin/sstabledump
----------------------------------------------------------------------
diff --git a/tools/bin/sstabledump b/tools/bin/sstabledump
index 7eeb708..6bbbfc6 100755
--- a/tools/bin/sstabledump
+++ b/tools/bin/sstabledump
@@ -17,11 +17,11 @@
 # limitations under the License.
 
 if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
-    for include in "`dirname "$0"`/cassandra.in.sh" \
-                   "$HOME/.cassandra.in.sh" \
-                   /usr/share/cassandra/cassandra.in.sh \
+    for include in /usr/share/cassandra/cassandra.in.sh \
                    /usr/local/share/cassandra/cassandra.in.sh \
-                   /opt/cassandra/cassandra.in.sh; do
+                   /opt/cassandra/cassandra.in.sh \
+                   "$HOME/.cassandra.in.sh" \
+                   "`dirname "$0"`/cassandra.in.sh"; do
         if [ -r "$include" ]; then
             . "$include"
             break
@@ -31,7 +31,6 @@ 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"
@@ -39,12 +38,21 @@ else
     JAVA="`which java`"
 fi
 
+if [ "x$JAVA" = "x" ]; then
+    echo "Java executable not found (hint: set JAVA_HOME)" >&2
+    exit 1
+fi
+
 if [ -z "$CLASSPATH" ]; then
     echo "You must set the CLASSPATH var" >&2
     exit 1
 fi
 
-"$JAVA" $JAVA_AGENT -cp "$CLASSPATH" $JVM_OPTS -Dstorage-config="$CASSANDRA_CONF" \
+if [ "x$MAX_HEAP_SIZE" = "x" ]; then
+    MAX_HEAP_SIZE="256M"
+fi
+
+"$JAVA" $JAVA_AGENT -ea -cp "$CLASSPATH" $JVM_OPTS -Xmx$MAX_HEAP_SIZE \
         -Dcassandra.storagedir="$cassandra_storagedir" \
         -Dlogback.configurationFile=logback-tools.xml \
         org.apache.cassandra.tools.SSTableExport "$@"


Mime
View raw message