Skip to content

Commit

Permalink
Introducing new property BW_COMPONENT_JOB_FLOWLIMIT that include proc…
Browse files Browse the repository at this point in the history
…ess level flowlimit with the following syntax "version.componentName:value1;version.componentName2:value2;" to be able to specify flowlimit at the component level.
  • Loading branch information
Alexandre Vazquez committed Jun 8, 2019
1 parent f179135 commit 01968d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions reducedStartupTime/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01968d5

Please sign in to comment.