XComp commented on code in PR #23101:
URL: https://github.com/apache/flink/pull/23101#discussion_r1283041203


##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/DelegateJobGraphStore.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.runtime.jobmanager;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+import org.apache.flink.runtime.jobgraph.JobResourceRequirements;
+
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+
+import static 
org.apache.flink.runtime.executiongraph.failover.flip1.FailoverStrategyFactoryLoader.isJobRestartDisable;
+
+/** Delegate for job graph store with filter for job without restart strategy. 
*/
+public class DelegateJobGraphStore implements JobGraphStore {

Review Comment:
   I feel the name could be more meaningful: `FilteringJobGraphStore` might be 
an option?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/FailoverStrategyFactoryLoader.java:
##########
@@ -59,4 +60,20 @@ public static FailoverStrategy.Factory 
loadFailoverStrategyFactory(final Configu
                         "Unknown failover strategy: " + strategyParam);
         }
     }
+
+    public static boolean isJobRestartDisable(final Configuration 
configuration) {

Review Comment:
   `RestartStrategyOptions.RESTART_STRATEGY` is covered by 
[RestartBackoffTimeStrategyFactoryLoader](https://github.com/apache/flink/blob/13b7b3e6050ee716d01c9d3d74d08702f93953a8/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/RestartBackoffTimeStrategyFactoryLoader.java).
 `FailoverStrategy` is probably the wrong location for this method.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherResourceCleanupTest.java:
##########
@@ -83,30 +86,27 @@
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import static org.apache.flink.core.testutils.FlinkMatchers.containsCause;
-import static org.apache.flink.core.testutils.FlinkMatchers.containsMessage;
 import static 
org.apache.flink.runtime.dispatcher.AbstractDispatcherTest.awaitStatus;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;

Review Comment:
   Thanks for migrating this class to JUnit5. Could you move that into a 
separate commit?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/DelegateJobGraphStore.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.runtime.jobmanager;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+import org.apache.flink.runtime.jobgraph.JobResourceRequirements;
+
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+
+import static 
org.apache.flink.runtime.executiongraph.failover.flip1.FailoverStrategyFactoryLoader.isJobRestartDisable;
+
+/** Delegate for job graph store with filter for job without restart strategy. 
*/
+public class DelegateJobGraphStore implements JobGraphStore {

Review Comment:
   I'm wondering whether we should just move this functionality into 
`DefaultJobGraphStore`. We only need it in the HA scenario, i.e. only when 
using the `DefaultJobGraphStore`. The filtering does not require that much 
extra functionality that it would deserve a separate class. WDYT? :thinking: 



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