mxm commented on code in PR #757:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/757#discussion_r1458798621


##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/event/AutoscalerEventUtils.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.autoscaler.event;
+
+import org.apache.flink.annotation.Experimental;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+/** The utils of {@link AutoScalerEventHandler}. */
+@Experimental
+public class AutoscalerEventUtils {
+
+    private static final Pattern SCALING_REPORT_SEPARATOR = 
Pattern.compile("\\{(.+?)\\}");
+    private static final Pattern VERTEX_SCALING_REPORT_PATTERN =
+            Pattern.compile(
+                    "Vertex ID (.*?) \\| Parallelism (.*?) -> (.*?) \\| 
Processing capacity (.*?) -> (.*?) \\| Target data rate (.*)");
+
+    /** Parse the scaling report from original scaling report event. */
+    public static List<VertexScalingReport> parseVertexScalingReports(String 
scalingReport) {

Review Comment:
   I'm not 100% sure whether we should provide utils for parsing the events. 
Users have the spec, metrics, and the reconciliation status to programmatically 
extract the deployment state. Deployment events are not meant to be 
machine-readable. Maybe we are missing important infos in the status field? I 
would rather add scaling information there instead of parsing the events.



-- 
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