clarax commented on code in PR #685:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/685#discussion_r1370420200


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/EventUtils.java:
##########
@@ -197,4 +198,19 @@ private static Event buildEvent(
                 .endMetadata()
                 .build();
     }
+
+    private static boolean intervalCheck(Event existing, @Nullable Duration 
interval) {
+        return interval != null
+                && Instant.now()
+                        .isBefore(
+                                Instant.parse(existing.getLastTimestamp())
+                                        .plusMillis(interval.toMillis()));
+    }
+
+    private static boolean labelCheck(
+            Event existing, Predicate<Map<String, String>> dedupePredicate) {
+        return dedupePredicate == null
+                || (existing.getMetadata() != null
+                        && 
dedupePredicate.test(existing.getMetadata().getLabels()));
+    }

Review Comment:
   when Interval == null, we don't dedupe. This is intentional. It is commented 
in the interface method param and unit  tested.
   but when the config is null, we use the default value of 30 min. It is also 
documented and unit tested.



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

Reply via email to