mxm commented on code in PR #728:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/728#discussion_r1433991220
##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/event/AutoScalerEventHandler.java:
##########
@@ -83,12 +92,27 @@ default void handleScalingEvent(
}
static String scalingReport(
- Map<JobVertexID, ScalingSummary> scalingSummaries, boolean
scalingEnabled) {
- StringBuilder sb =
- new StringBuilder(
- scalingEnabled
- ? SCALING_SUMMARY_HEADER_SCALING_ENABLED
- : SCALING_SUMMARY_HEADER_SCALING_DISABLED);
+ Map<JobVertexID, ScalingSummary> scalingSummaries,
+ boolean scalingEnabled,
+ boolean isExcluded,
+ Configuration config) {
+ StringBuilder sb = new StringBuilder();
+ if (!scalingEnabled) {
+ sb.append(
+ String.format(
+ SCALING_SUMMARY_HEADER_SCALING_EXECUTION_DISABLED,
+ SCALING_ENABLED.key(),
+ false));
+ } else if (isExcluded) {
+ sb.append(
+ String.format(
+ SCALING_SUMMARY_HEADER_SCALING_EXECUTION_DISABLED,
+ EXCLUDED_PERIODS.key(),
+ config.get(EXCLUDED_PERIODS)));
+ } else {
+ sb.append(SCALING_SUMMARY_HEADER_SCALING_EXECUTION_ENABLED);
+ }
Review Comment:
I also didn't like this change at first, but I think the additional code
here is justified to provide better error reporting to the user.
As an alternative, we could replace the `scalingEnabled` and
`scalingBlocked` flags via a generic String which allows to pass in any
additional explanation by the caller.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]