Github user ctubbsii commented on a diff in the pull request: https://github.com/apache/accumulo-testing/pull/1#discussion_r94993185 --- Diff: bin/accumulo-testing --- @@ -0,0 +1,89 @@ +#! /usr/bin/env bash + +# 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. + +BIN_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +export AT_HOME=$( cd "$( dirname "$BIN_DIR" )" && pwd ) +export AT_VERSION=2.0.0-SNAPSHOT + +function print_usage() { + cat <<EOF + +Usage: accumulo-testing <command> (<argument>) + +Possible commands: + rw-local <module> Runs randomwalk <module> in local java process + rw-cluster <module> Runs randomwalk <module> on YARN cluster +EOF +} + +if [ -f $AT_HOME/conf/accumulo-testing-env.sh ]; then + . $AT_HOME/conf/accumulo-testing-env.sh +else + . $AT_HOME/conf/accumulo-testing-env.sh.example +fi + +export AT_PROPS=$AT_HOME/conf/accumulo-testing.props +if [ ! -f $AT_PROPS ]; then + echo "Please create and edit accumulo-testing.props in $AT_HOME/conf" + exit 1 +fi + +log4j_config=$AT_HOME/conf/log4j.properties +if [ ! -f $log4j_config ]; then + log4j_config=$AT_HOME/conf/log4j.properties.example + if [ ! -f $log4j_config ]; then + echo "Could not find logj4.properties or log4j.properties.example in $AT_HOME/conf" + exit 1 + fi +fi + +function build_shade_jar() { + export AT_SHADED_JAR=$AT_HOME/core/target/accumulo-testing-core-$AT_VERSION-shaded.jar + if [ ! -f $AT_SHADED_JAR ]; then + echo "Building $AT_SHADED_JAR" + cd $AT_HOME + + : ${ACCUMULO_VERSION?"ACCUMULO_VERSION must be set in bash env or conf/accumulo-testing-env.sh"} + mvn clean package -Pcreate-shade-jar -DskipTests -Daccumulo.version=$ACCUMULO_VERSION -Dhadoop.version=$HADOOP_VERSION + fi +} + +randomwalk_main="org.apache.accumulo.testing.core.randomwalk.Framework" +case "$1" in +rw-local) + if [ -z $2 ]; then + echo "ERROR: <module> needs to be set" + print_usage + exit 1 + fi + build_shade_jar + java -Dlog4j.configuration=file:$log4j_config -cp $AT_SHADED_JAR $randomwalk_main $AT_PROPS $2 + ;; +rw-cluster) + if [ -z $2 ]; then + echo "ERROR: <module> needs to be set" + print_usage + exit 1 + fi + build_shade_jar + mvn compile -Ptest-runner -Dhadoop.version=$HADOOP_VERSION -Dexec.args="-n AccumuloRandomWalkTest -j $AT_SHADED_JAR -m $randomwalk_main -t $AT_PROPS -l $log4j_config -a ./accumulo-testing.props $2" --- End diff -- The `build_shade_jar` function does a `mvn package`, and the `mvn compile` here is just to trigger the `exec:java` from the compiled code. I'm sure there's a more efficient way to do this, because this seems a bit redundant, but I can't see any immediate problems with it.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---