Updated Branches:
refs/heads/trunk b0fecacbe -> 3e7c9c6ab
KAFKA-1081 Clean up shell scripts. Removed re-run of failed command. Use exec instead of subprocess
execution.
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/3e7c9c6a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/3e7c9c6a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/3e7c9c6a
Branch: refs/heads/trunk
Commit: 3e7c9c6abfed90b4e6e0e1bb3c806adf1c6bbbe9
Parents: b0fecac
Author: Jay Kreps <jay.kreps@gmail.com>
Authored: Mon Oct 14 09:39:10 2013 -0700
Committer: Jay Kreps <jay.kreps@gmail.com>
Committed: Mon Oct 14 09:39:10 2013 -0700
----------------------------------------------------------------------
bin/kafka-console-consumer.sh | 2 +-
bin/kafka-console-producer.sh | 2 +-
bin/kafka-consumer-perf-test.sh | 2 +-
bin/kafka-preferred-replica-election.sh | 2 +-
bin/kafka-producer-perf-test.sh | 2 +-
bin/kafka-reassign-partitions.sh | 2 +-
bin/kafka-replay-log-producer.sh | 2 +-
bin/kafka-run-class.sh | 18 ++----------------
bin/kafka-server-start.sh | 2 +-
bin/kafka-simple-consumer-perf-test.sh | 2 +-
bin/kafka-simple-consumer-shell.sh | 2 +-
bin/kafka-topics.sh | 2 +-
bin/zookeeper-server-start.sh | 2 +-
bin/zookeeper-shell.sh | 2 +-
14 files changed, 15 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-console-consumer.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-console-consumer.sh b/bin/kafka-console-consumer.sh
index 95edc9e..b86ea56 100755
--- a/bin/kafka-console-consumer.sh
+++ b/bin/kafka-console-consumer.sh
@@ -15,4 +15,4 @@
# limitations under the License.
export KAFKA_HEAP_OPTS="-Xmx512M"
-$(dirname $0)/kafka-run-class.sh kafka.consumer.ConsoleConsumer $@
+exec $(dirname $0)/kafka-run-class.sh kafka.consumer.ConsoleConsumer $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-console-producer.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-console-producer.sh b/bin/kafka-console-producer.sh
index f102c22..ec0f21f 100755
--- a/bin/kafka-console-producer.sh
+++ b/bin/kafka-console-producer.sh
@@ -15,4 +15,4 @@
# limitations under the License.
export KAFKA_HEAP_OPTS="-Xmx512M"
-$(dirname $0)/kafka-run-class.sh kafka.producer.ConsoleProducer $@
+exec $(dirname $0)/kafka-run-class.sh kafka.producer.ConsoleProducer $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-consumer-perf-test.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-consumer-perf-test.sh b/bin/kafka-consumer-perf-test.sh
index 39434d1..38c56c7 100755
--- a/bin/kafka-consumer-perf-test.sh
+++ b/bin/kafka-consumer-perf-test.sh
@@ -15,4 +15,4 @@
# limitations under the License.
export KAFKA_HEAP_OPTS="-Xmx512M"
-$(dirname $0)/kafka-run-class.sh kafka.perf.ConsumerPerformance $@
+exec $(dirname $0)/kafka-run-class.sh kafka.perf.ConsumerPerformance $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-preferred-replica-election.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-preferred-replica-election.sh b/bin/kafka-preferred-replica-election.sh
index 6416dc1..ed167c2 100755
--- a/bin/kafka-preferred-replica-election.sh
+++ b/bin/kafka-preferred-replica-election.sh
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand $@
+exec $(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-producer-perf-test.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-producer-perf-test.sh b/bin/kafka-producer-perf-test.sh
index 1935522..d75ab7d 100755
--- a/bin/kafka-producer-perf-test.sh
+++ b/bin/kafka-producer-perf-test.sh
@@ -15,4 +15,4 @@
# limitations under the License.
export KAFKA_HEAP_OPTS="-Xmx512M"
-$(dirname $0)/kafka-run-class.sh kafka.perf.ProducerPerformance $@
+exec $(dirname $0)/kafka-run-class.sh kafka.perf.ProducerPerformance $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-reassign-partitions.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-reassign-partitions.sh b/bin/kafka-reassign-partitions.sh
index a6bd148..95b4ae0 100755
--- a/bin/kafka-reassign-partitions.sh
+++ b/bin/kafka-reassign-partitions.sh
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand $@
+exec $(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-replay-log-producer.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-replay-log-producer.sh b/bin/kafka-replay-log-producer.sh
index 86943ee..8e2e713 100755
--- a/bin/kafka-replay-log-producer.sh
+++ b/bin/kafka-replay-log-producer.sh
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$(dirname $0)/kafka-run-class.sh kafka.tools.ReplayLogProducer $@
+exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplayLogProducer $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-run-class.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index eb6ff1b..2ef75e4 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -88,7 +88,7 @@ fi
# JVM performance options
if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then
- KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC"
+ KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC -Djava.awt.headless=true"
fi
# GC options
@@ -101,20 +101,6 @@ if [ "$1" = "daemon" ] && [ -z "$KAFKA_GC_LOG_OPTS"] ; then
KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps "
fi
-$JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS
-cp $CLASSPATH $KAFKA_OPTS "$@"
-
-exitval=$?
-
-if [ $exitval -eq "1" ] ; then
- $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS
-cp $CLASSPATH $KAFKA_OPTS "$@" >& exception.txt
- exception=`cat exception.txt`
- noBuildMessage='Please build the project using sbt. Documentation is available at http://kafka.apache.org/'
- pattern="(Could not find or load main class)|(java\.lang\.NoClassDefFoundError)"
- match=`echo $exception | grep -E "$pattern"`
- if [[ -n "$match" ]]; then
- echo $noBuildMessage
- fi
- rm exception.txt
-fi
+exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS
$KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-server-start.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-server-start.sh b/bin/kafka-server-start.sh
index 4005289..4a36b2d 100755
--- a/bin/kafka-server-start.sh
+++ b/bin/kafka-server-start.sh
@@ -22,4 +22,4 @@ fi
base_dir=$(dirname $0)
export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
-$base_dir/kafka-run-class.sh daemon kafkaServer kafka.Kafka $@
+exec $base_dir/kafka-run-class.sh daemon kafkaServer kafka.Kafka $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-simple-consumer-perf-test.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-simple-consumer-perf-test.sh b/bin/kafka-simple-consumer-perf-test.sh
index 94c9ed0..c466cc8 100755
--- a/bin/kafka-simple-consumer-perf-test.sh
+++ b/bin/kafka-simple-consumer-perf-test.sh
@@ -15,4 +15,4 @@
# limitations under the License.
export KAFKA_HEAP_OPTS="-Xmx512M"
-$(dirname $0)/kafka-run-class.sh kafka.perf.SimpleConsumerPerformance $@
+exec $(dirname $0)/kafka-run-class.sh kafka.perf.SimpleConsumerPerformance $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-simple-consumer-shell.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-simple-consumer-shell.sh b/bin/kafka-simple-consumer-shell.sh
index 8d69357..9316f79 100755
--- a/bin/kafka-simple-consumer-shell.sh
+++ b/bin/kafka-simple-consumer-shell.sh
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$(dirname $0)/kafka-run-class.sh kafka.tools.SimpleConsumerShell $@
+exec $(dirname $0)/kafka-run-class.sh kafka.tools.SimpleConsumerShell $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/kafka-topics.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-topics.sh b/bin/kafka-topics.sh
index cb76590..b39b272 100755
--- a/bin/kafka-topics.sh
+++ b/bin/kafka-topics.sh
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-$(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand $@
+exec $(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand $@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/zookeeper-server-start.sh
----------------------------------------------------------------------
diff --git a/bin/zookeeper-server-start.sh b/bin/zookeeper-server-start.sh
index e4746a8..cdbbf33 100755
--- a/bin/zookeeper-server-start.sh
+++ b/bin/zookeeper-server-start.sh
@@ -22,5 +22,5 @@ fi
base_dir=$(dirname $0)
export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"
export KAFKA_HEAP_OPTS="-Xmx512M -Xms512M"
-$base_dir/kafka-run-class.sh daemon zookeeper org.apache.zookeeper.server.quorum.QuorumPeerMain
$@
+exec $base_dir/kafka-run-class.sh daemon zookeeper org.apache.zookeeper.server.quorum.QuorumPeerMain
$@
http://git-wip-us.apache.org/repos/asf/kafka/blob/3e7c9c6a/bin/zookeeper-shell.sh
----------------------------------------------------------------------
diff --git a/bin/zookeeper-shell.sh b/bin/zookeeper-shell.sh
index e0de33f..92cce76 100755
--- a/bin/zookeeper-shell.sh
+++ b/bin/zookeeper-shell.sh
@@ -20,4 +20,4 @@ then
exit 1
fi
-$(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1
\ No newline at end of file
+exec $(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1
\ No newline at end of file
|