-
Notifications
You must be signed in to change notification settings - Fork 492
[FLINK-33187] using hashcode for parallelism map comparison #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/event/AutoScalerEventHandler.java
Outdated
Show resolved
Hide resolved
Sorry @clarax I think I gave confusing feedback and didn't express myself clearly. I was thinking something like this:
Then for Kubernetes we have the custom label logic encapsulated:
This way the ScalingExecutor simply calls:
And we could remove the predicate/label logic that really do not belong there as that is very Kubernetes specific and move it to the What do you think? |
Refactored as @gyfora suggusted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks really good now, we have a much nicer separation of responsibilities in the different components. Please verify the latest version manually (locally or something) if you can @clarax
@1996fanrui What do you think about the interface change?
...n/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesAutoScalerEventHandler.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesAutoScalerEventHandler.java
Show resolved
Hide resolved
...kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/EventUtils.java
Outdated
Show resolved
Hide resolved
...kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/EventUtils.java
Show resolved
Hide resolved
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/event/AutoScalerEventHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing we have been discussing with @1996fanrui
The interval config should probably be renamed scaling.report.interval->scaling.event.interval
this way we can use it generally in the future for autoscaler triggered events.
We should also make sure that the simple handleEvent
method also respects the interval if specified. And we should probably use the interval also for ineffective scaling events. I know that some of these changes are not directly related to this PR but it may be better to clean it up so we leave it in a good state afterwards.
Resolved all requested changes. |
Hi, the ci fails, and please run the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks great @clarax , thank you!
I found 2 very minor things (see comments), otherwise it is good to go
What is the purpose of the change
This is to implement the scaling report comparison algorithm for event suppression by using hashcodes of the parallelism maps. Originally I used the full string of report message which contains the metrics fluctuating with current load. As long as parallelism map doesn't change, we don't need to generate new events within the defined interval.
Brief change log
Verifying this change
Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors
: NoDocumentation