gyfora commented on PR #685:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/685#issuecomment-1771652868

   Sorry @clarax I think I gave confusing feedback and didn't express myself 
clearly. I was thinking something like this:
   
   ```
   interface AutoScalerEventHandler {
   
   void handleGenericEvent(Ctx, Type, Reson, Message, Key, Interval);
   
   default void handleScalingEvent(Ctx, Map<JobVertexId, ScalingSummary> 
summaries, boolean scalingEnabled, Interval) {
       // Provide default implementation without proper deduplication
      handleGenericEvent(...., toMessage(summaries), interval);
   } 
   
   }
   ```
   
   Then for Kubernetes we have the custom label logic encapsulated:
   
   ```
   class KubernetesAutoScalerEventHandler {
   
   ...
   
   @Override 
   void handleScalingEvent(Ctx, Map<JobVertexId, ScalingSummary> summaries, 
boolean scalingEnabled, Interval) {
      var labels = createLabels(summaries)
      getOldEvent, compare labels, whatever we need to do we do not leak to 
ScalingExecutor
   }
   
   }
   ```
   
   This way the ScalingExecutor simply calls:
   
   ```
   eventHandler.handleScalingEvent(...)
   ```
   
   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 
`KubernetesAutoScalerEventHandler` implementation. 
   
   What do you think?


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to