commit 7de20c7e950ac3ea7ccf0eb41294fec83442d56f Author: Nate Brown AuthorDate: Thu Feb 20 20:38:31 2014 -0800 Commit: Nate Brown CommitDate: Thu Feb 20 20:38:31 2014 -0800 More flexible helper scripts diff --git bin/kafka-console-consumer.sh bin/kafka-console-consumer.sh index b86ea56..e410dde 100755 --- bin/kafka-console-consumer.sh +++ bin/kafka-console-consumer.sh @@ -14,5 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -export KAFKA_HEAP_OPTS="-Xmx512M" +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi + exec $(dirname $0)/kafka-run-class.sh kafka.consumer.ConsoleConsumer $@ diff --git bin/kafka-console-producer.sh bin/kafka-console-producer.sh index ec0f21f..cd8ce62 100755 --- bin/kafka-console-producer.sh +++ bin/kafka-console-producer.sh @@ -14,5 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -export KAFKA_HEAP_OPTS="-Xmx512M" +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi exec $(dirname $0)/kafka-run-class.sh kafka.producer.ConsoleProducer $@ diff --git bin/kafka-consumer-perf-test.sh bin/kafka-consumer-perf-test.sh index 38c56c7..4ed3ed9 100755 --- bin/kafka-consumer-perf-test.sh +++ bin/kafka-consumer-perf-test.sh @@ -14,5 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -export KAFKA_HEAP_OPTS="-Xmx512M" +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi exec $(dirname $0)/kafka-run-class.sh kafka.perf.ConsumerPerformance $@ diff --git bin/kafka-producer-perf-test.sh bin/kafka-producer-perf-test.sh index d75ab7d..b4efc29 100755 --- bin/kafka-producer-perf-test.sh +++ bin/kafka-producer-perf-test.sh @@ -14,5 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -export KAFKA_HEAP_OPTS="-Xmx512M" +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi exec $(dirname $0)/kafka-run-class.sh kafka.perf.ProducerPerformance $@ diff --git bin/kafka-run-class.sh bin/kafka-run-class.sh index 2ef75e4..209edc5 100755 --- bin/kafka-run-class.sh +++ bin/kafka-run-class.sh @@ -23,9 +23,12 @@ fi base_dir=$(dirname $0)/.. # create logs directory -LOG_DIR=$base_dir/logs -if [ ! -d $LOG_DIR ]; then - mkdir $LOG_DIR +if [ "x$LOG_DIR" = "x" ]; then + LOG_DIR="$base_dir/logs" +fi + +if [ ! -d "$LOG_DIR" ]; then + mkdir -p "$LOG_DIR" fi if [ -z "$SCALA_VERSION" ]; then diff --git bin/kafka-server-start.sh bin/kafka-server-start.sh index 4a36b2d..ba33617 100755 --- bin/kafka-server-start.sh +++ bin/kafka-server-start.sh @@ -20,6 +20,13 @@ then exit 1 fi base_dir=$(dirname $0) -export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" -export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" +fi + exec $base_dir/kafka-run-class.sh daemon kafkaServer kafka.Kafka $@ diff --git bin/kafka-simple-consumer-perf-test.sh bin/kafka-simple-consumer-perf-test.sh index c466cc8..2d3e3d3 100755 --- bin/kafka-simple-consumer-perf-test.sh +++ bin/kafka-simple-consumer-perf-test.sh @@ -14,5 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -export KAFKA_HEAP_OPTS="-Xmx512M" +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M -Xms512M" +fi + exec $(dirname $0)/kafka-run-class.sh kafka.perf.SimpleConsumerPerformance $@