Browse Source

KAFKA-1081 Remove re-run functionality from start script and use exec to launch commands to avoid spurious .sh process.

pull/10/head
Jay Kreps 11 years ago
parent
commit
ba1ceea6d3
  1. 2
      bin/kafka-add-partitions.sh
  2. 2
      bin/kafka-console-consumer.sh
  3. 2
      bin/kafka-console-producer.sh
  4. 2
      bin/kafka-consumer-perf-test.sh
  5. 2
      bin/kafka-create-topic.sh
  6. 2
      bin/kafka-list-topic.sh
  7. 2
      bin/kafka-preferred-replica-election.sh
  8. 2
      bin/kafka-producer-perf-test.sh
  9. 2
      bin/kafka-reassign-partitions.sh
  10. 2
      bin/kafka-replay-log-producer.sh
  11. 18
      bin/kafka-run-class.sh
  12. 2
      bin/kafka-server-start.sh
  13. 2
      bin/kafka-simple-consumer-perf-test.sh
  14. 2
      bin/kafka-simple-consumer-shell.sh
  15. 2
      bin/zookeeper-server-start.sh
  16. 2
      bin/zookeeper-shell.sh

2
bin/kafka-add-partitions.sh

@ -15,4 +15,4 @@ @@ -15,4 +15,4 @@
# limitations under the License.
base_dir=$(dirname $0)
$base_dir/kafka-run-class.sh kafka.admin.AddPartitionsCommand $@
exec $base_dir/kafka-run-class.sh kafka.admin.AddPartitionsCommand $@

2
bin/kafka-console-consumer.sh

@ -15,4 +15,4 @@ @@ -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 $@

2
bin/kafka-console-producer.sh

@ -15,4 +15,4 @@ @@ -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 $@

2
bin/kafka-consumer-perf-test.sh

@ -15,4 +15,4 @@ @@ -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 $@

2
bin/kafka-create-topic.sh

@ -14,4 +14,4 @@ @@ -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.CreateTopicCommand $@
exec $(dirname $0)/kafka-run-class.sh kafka.admin.CreateTopicCommand $@

2
bin/kafka-list-topic.sh

@ -14,4 +14,4 @@ @@ -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.ListTopicCommand $@
exec $(dirname $0)/kafka-run-class.sh kafka.admin.ListTopicCommand $@

2
bin/kafka-preferred-replica-election.sh

@ -14,4 +14,4 @@ @@ -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 $@

2
bin/kafka-producer-perf-test.sh

@ -15,4 +15,4 @@ @@ -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 $@

2
bin/kafka-reassign-partitions.sh

@ -14,4 +14,4 @@ @@ -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 $@

2
bin/kafka-replay-log-producer.sh

@ -14,4 +14,4 @@ @@ -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 $@

18
bin/kafka-run-class.sh

@ -88,7 +88,7 @@ fi @@ -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 @@ -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 "$@"

2
bin/kafka-server-start.sh

@ -22,4 +22,4 @@ fi @@ -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 $@

2
bin/kafka-simple-consumer-perf-test.sh

@ -15,4 +15,4 @@ @@ -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 $@

2
bin/kafka-simple-consumer-shell.sh

@ -14,4 +14,4 @@ @@ -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 $@

2
bin/zookeeper-server-start.sh

@ -22,5 +22,5 @@ fi @@ -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 $@

2
bin/zookeeper-shell.sh

@ -20,4 +20,4 @@ then @@ -20,4 +20,4 @@ then
exit 1
fi
$(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1
exec $(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server $1
Loading…
Cancel
Save