incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Molinaro <antho...@pinkbunny.net>
Subject cassandra-cli suggestion
Date Wed, 01 Jul 2009 18:18:31 GMT
Hi,

  I'm in the process of packaging cassandra into some rpms to deploy at
work and noticed that cassandra-cli is structured differently than
cassandra and cassandra-nodeprobe.  The current structure is

    classpath()
    {       
        cassandra_home=`dirname $0`/..
        classp=$cassandra_home/build/classes
        
        for j in $cassandra_home/lib/*.jar; do
            classp=$classp:$j
        done

        printf $classp
    }

    if [ -z $CLASSPATH ]; then
        jvmargs="-cp `classpath`"
    fi

    java $jvmargs org.apache.cassandra.cli.CliMain "$@"

Which assumes you are running cassandra out of the build directory, however
if you were to change it to

    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 \
                       `dirname $0`/cassandra.in.sh; do
            if [ -r $include ]; then
                . $include
                break
            fi
        done
    elif [ -r $CASSANDRA_INCLUDE ]; then
        . $CASSANDRA_INCLUDE
    fi

    if [ -z $CASSANDRA_CONF -o -z $CLASSPATH ]; then
        echo "You must set the CASSANDRA_CONF and CLASSPATH vars" >&2
        exit 1
    fi

    java -cp $CLASSPATH  org.apache.cassandra.cli.CliMain "$@"

It would work the same as cassandra and cassandra-nodeprobe in that you could
install it centralling and run it.

Just a suggestion,

-Anthony

-- 
------------------------------------------------------------------------
Anthony Molinaro                           <anthonym@alumni.caltech.edu>

Mime
View raw message