This is an automated email from the ASF dual-hosted git repository.

kkarantasis pushed a commit to branch 2.4
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit efc131ab14609b280771545de0d6fcd182aed1d4
Author: Brian Bushree <[email protected]>
AuthorDate: Mon Nov 18 10:50:36 2019 -0800

    [MINOR] allow additional JVM args in KafkaService (#7297)
    
    Reviewers: Colin P. McCabe <[email protected]>, Vikas Singh 
<[email protected]>
---
 tests/kafkatest/services/kafka/kafka.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/kafkatest/services/kafka/kafka.py 
b/tests/kafkatest/services/kafka/kafka.py
index e71ed7c..9afb622 100644
--- a/tests/kafkatest/services/kafka/kafka.py
+++ b/tests/kafkatest/services/kafka/kafka.py
@@ -96,7 +96,7 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service):
                  client_sasl_mechanism=SecurityConfig.SASL_MECHANISM_GSSAPI, 
interbroker_sasl_mechanism=SecurityConfig.SASL_MECHANISM_GSSAPI,
                  authorizer_class_name=None, topics=None, version=DEV_BRANCH, 
jmx_object_names=None,
                  jmx_attributes=None, zk_connect_timeout=5000, 
zk_session_timeout=6000, server_prop_overides=None, zk_chroot=None,
-                 listener_security_config=ListenerSecurityConfig(), 
per_node_server_prop_overrides={}):
+                 listener_security_config=ListenerSecurityConfig(), 
per_node_server_prop_overrides={}, extra_kafka_opts=""):
         """
         :param context: test context
         :param ZookeeperService zk:
@@ -114,6 +114,8 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, 
Service):
         :param dict server_prop_overides: overrides for kafka.properties file
         :param zk_chroot:
         :param ListenerSecurityConfig listener_security_config: listener 
config to use
+        :param dict per_node_server_prop_overrides:
+        :param str extra_kafka_opts: jvm args to add to KAFKA_OPTS variable
         """
         Service.__init__(self, context, num_nodes)
         JmxMixin.__init__(self, num_nodes=num_nodes, 
jmx_object_names=jmx_object_names, jmx_attributes=(jmx_attributes or []),
@@ -138,6 +140,7 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, 
Service):
         self.log_level = "DEBUG"
         self.zk_chroot = zk_chroot
         self.listener_security_config = listener_security_config
+        self.extra_kafka_opts = extra_kafka_opts
 
         #
         # In a heavily loaded and not very fast machine, it is
@@ -325,8 +328,8 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, 
Service):
         cmd += "export KAFKA_LOG4J_OPTS=\"-Dlog4j.configuration=file:%s\"; " % 
self.LOG4J_CONFIG
         heap_kafka_opts = "-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=%s" % \
                           self.logs["kafka_heap_dump_file"]["path"]
-        other_kafka_opts = self.security_config.kafka_opts.strip('\"')
-        cmd += "export KAFKA_OPTS=\"%s %s\"; " % (heap_kafka_opts, 
other_kafka_opts)
+        security_kafka_opts = self.security_config.kafka_opts.strip('\"')
+        cmd += "export KAFKA_OPTS=\"%s %s %s\"; " % (heap_kafka_opts, 
security_kafka_opts, extra_kafka_opts)
         cmd += "%s %s 1>> %s 2>> %s &" % \
                (self.path.script("kafka-server-start.sh", node),
                 KafkaService.CONFIG_FILE,

Reply via email to