mateczagany commented on code in PR #868:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/868#discussion_r1727345249


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/SnapshotTriggerTimestampStore.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.kubernetes.operator.reconciler;
+
+import org.apache.flink.autoscaler.utils.DateTimeUtils;
+import org.apache.flink.kubernetes.operator.api.AbstractFlinkResource;
+import org.apache.flink.kubernetes.operator.api.CrdConstants;
+import org.apache.flink.kubernetes.operator.api.FlinkStateSnapshot;
+import org.apache.flink.kubernetes.operator.api.status.SnapshotInfo;
+
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import lombok.RequiredArgsConstructor;
+
+import java.time.Instant;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Supplier;
+
+import static 
org.apache.flink.kubernetes.operator.api.status.FlinkStateSnapshotStatus.State.COMPLETED;
+import static 
org.apache.flink.kubernetes.operator.api.status.SnapshotTriggerType.PERIODIC;
+import static 
org.apache.flink.kubernetes.operator.reconciler.SnapshotType.SAVEPOINT;
+
+/** Class used to store latest timestamps of periodic checkpoint/savepoint. */
+@RequiredArgsConstructor
+public class SnapshotTriggerTimestampStore {
+    private final ConcurrentHashMap<String, Instant> 
checkpointsLastTriggeredCache =
+            new ConcurrentHashMap<>();
+    private final ConcurrentHashMap<String, Instant> 
savepointsLastTriggeredCache =
+            new ConcurrentHashMap<>();

Review Comment:
   In my opinion this has such minimal memory footprint that we can safely 
ignore and not complicate the code more. Please let me know if you think 
otherwise.



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