From 626d70d86d3bee944edf548606b38042f31e09b6 Mon Sep 17 00:00:00 2001 From: Chesnay Schepler Date: Wed, 14 Jun 2023 14:25:17 +0200 Subject: [PATCH] [FLINK-31916][python] Respect 'env.java.opts.all' (#22776) --- flink-python/pyflink/pyflink_gateway_server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flink-python/pyflink/pyflink_gateway_server.py b/flink-python/pyflink/pyflink_gateway_server.py index c58124709a5a0..9782b719f5191 100644 --- a/flink-python/pyflink/pyflink_gateway_server.py +++ b/flink-python/pyflink/pyflink_gateway_server.py @@ -34,7 +34,8 @@ KEY_ENV_HADOOP_CONF_DIR = "env.hadoop.conf.dir" KEY_ENV_HBASE_CONF_DIR = "env.hbase.conf.dir" KEY_ENV_JAVA_HOME = "env.java.home" -KEY_ENV_JAVA_OPTS = "env.java.opts" +KEY_ENV_JAVA_OPTS = "env.java.opts.all" +KEY_ENV_JAVA_OPTS_DEPRECATED = "env.java.opts" def on_windows(): @@ -156,7 +157,11 @@ def construct_log_settings(env): def get_jvm_opts(env): flink_conf_file = os.path.join(env['FLINK_CONF_DIR'], "flink-conf.yaml") jvm_opts = env.get( - 'FLINK_ENV_JAVA_OPTS', read_from_config(KEY_ENV_JAVA_OPTS, "", flink_conf_file)) + 'FLINK_ENV_JAVA_OPTS', + read_from_config( + KEY_ENV_JAVA_OPTS, + read_from_config(KEY_ENV_JAVA_OPTS_DEPRECATED, "", flink_conf_file), + flink_conf_file)) # Remove leading and ending double quotes (if present) of value jvm_opts = jvm_opts.strip("\"")