KAFKA-1081 Clean up shell scripts. Removed re-run of failed command. Use exec instead of subprocess execution.

This commit is contained in:
Jay Kreps 2013-10-14 09:39:10 -07:00
parent b0fecacbe8
commit 3e7c9c6abf
14 changed files with 15 additions and 29 deletions

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 "$@"

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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 $@

View File

@ -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