xintongsong commented on a change in pull request #9801: [FLINK-13983][runtime] 
Launch task executor with new memory calculation logics
URL: https://github.com/apache/flink/pull/9801#discussion_r334728390
 
 

 ##########
 File path: flink-dist/src/main/flink-bin/bin/config.sh
 ##########
 @@ -783,3 +790,55 @@ calculateTaskManagerHeapSizeMB() {
 
     echo ${tm_heap_size_mb}
 }
+
+getTmResourceDynamicConfigsAndExportJvmParams() {
+    if [[ "`echo ${FLINK_TM_ENABLE_FLIP49} | tr '[:upper:]' '[:lower:]'`" == 
"true" ]]; then
+        echo "$(getTmResourceDynamicConfigsAndExportJvmParamsFlip49)"
+    else
+        echo "$(getTmResourceDynamicConfigsAndExportJvmParamsLegacy)"
+    fi
+}
+
+getTmResourceDynamicConfigsAndExportJvmParamsFlip49() {
+    local class_to_run=org.apache.flink.runtime.util.BashJavaUtils
+    local command=GET_TM_RESOURCE_CONFIGS_AND_JVM_PARAMS
+    local class_path=`constructFlinkClassPath`
+    class_path=`manglePathList ${class_path}`
+
+    local output="`${JAVA_RUN} -classpath ${class_path} ${class_to_run} 
${command} --configDir ${FLINK_CONF_DIR} 2> /dev/null`"
+    if [[ $? -ne 0 ]]; then
+        echo "[ERROR] Cannot get TaskManager resource dynamic configs and JVM 
parameters from BashJavaUtils."
+        exit 1
+    fi
+
+    IFS=$'\n' lines=($output)
+    local dynamic_configs=${lines[0]} # dynamic configs
+    local jvm_params=${lines[1]} # jvm parameters
+
+    echo ${jvm_params} $'\n' ${dynamic_configs}
 
 Review comment:
   Yes, it is.
   Somehow if I don't explicitly put `'\n'` in the `echo` line, the line break 
will be lost. Don't know why, I'm not very familiar with bash scripts.
   I guest it will no longer be a problem if we are separating responsibility 
of generating dynamic configs and JVM parameters.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to