From 01968d57f29fc954b25cd70267311cbaf90f092c Mon Sep 17 00:00:00 2001 From: Alexandre Vazquez Date: Sat, 8 Jun 2019 23:40:12 +0200 Subject: [PATCH] Introducing new property BW_COMPONENT_JOB_FLOWLIMIT that include process level flowlimit with the following syntax "version.componentName:value1;version.componentName2:value2;" to be able to specify flowlimit at the component level. --- reducedStartupTime/setup.sh | 13 +++++++++++++ scripts/setup.sh | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/reducedStartupTime/setup.sh b/reducedStartupTime/setup.sh index e88df7b..af11a42 100644 --- a/reducedStartupTime/setup.sh +++ b/reducedStartupTime/setup.sh @@ -182,6 +182,19 @@ checkEnvSubstituteConfig() print_Debug "set BW_APPLICATION_JOB_FLOWLIMIT to $BW_APPLICATION_JOB_FLOWLIMIT" fi fi + if [[ ${BW_COMPONENT_JOB_FLOWLIMIT} ]]; then + if [ -e ${appnodeConfigFile} ]; then + IFS=';' # space is set as delimiter + read -ra processConfigurationList <<< "${BW_COMPONENT_JOB_FLOWLIMIT}" # str is read into an array as tokens separated by IFS + for process in "${processConfigurationList[@]}"; do # access each element of array + echo "Setting flow limit for $process" + IFS=':' # space is set as delimiter + read -ra processConfiguration <<< "$process" # str is read into an array as tokens separated by IFS + printf '%s\n' "bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]}=${processConfiguration[1]}" >> $appnodeConfigFile + print_Debug "set bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]} to ${processConfiguration[1]}" + done + fi + fi if [[ ${BW_APP_MONITORING_CONFIG} ]]; then if [ -e ${appnodeConfigFile} ]; then sed -i 's/bw.frwk.event.subscriber.metrics.enabled=false/bw.frwk.event.subscriber.metrics.enabled=true/g' $appnodeConfigFile diff --git a/scripts/setup.sh b/scripts/setup.sh index af0da6a..f9fac48 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -182,6 +182,19 @@ checkEnvSubstituteConfig() print_Debug "set BW_APPLICATION_JOB_FLOWLIMIT to $BW_APPLICATION_JOB_FLOWLIMIT" fi fi + if [[ ${BW_COMPONENT_JOB_FLOWLIMIT} ]]; then + if [ -e ${appnodeConfigFile} ]; then + IFS=';' # space is set as delimiter + read -ra processConfigurationList <<< "${BW_COMPONENT_JOB_FLOWLIMIT}" # str is read into an array as tokens separated by IFS + for process in "${processConfigurationList[@]}"; do # access each element of array + echo "Setting flow limit for $process" + IFS=':' # space is set as delimiter + read -ra processConfiguration <<< "$process" # str is read into an array as tokens separated by IFS + printf '%s\n' "bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]}=${processConfiguration[1]}" >> $appnodeConfigFile + print_Debug "set bw.application.job.flowlimit.$bwBundleAppName.${processConfiguration[0]} to ${processConfiguration[1]}" + done + fi + fi if [[ ${BW_APP_MONITORING_CONFIG} ]]; then if [ -e ${appnodeConfigFile} ]; then sed -i 's/bw.frwk.event.subscriber.metrics.enabled=false/bw.frwk.event.subscriber.metrics.enabled=true/g' $appnodeConfigFile