zentol commented on a change in pull request #11963:
URL: https://github.com/apache/flink/pull/11963#discussion_r419317944



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/utils/TestingResourceManagerGateway.java
##########
@@ -52,6 +51,7 @@
 import org.apache.flink.runtime.taskexecutor.TaskExecutorHeartbeatPayload;
 import org.apache.flink.runtime.taskexecutor.TaskExecutorRegistrationSuccess;
 import org.apache.flink.util.Preconditions;
+import org.apache.flink.util.function.QuadFunction;

Review comment:
       The commit order is incorrect; the `QuadFunction` is only added 20 
commits later.

##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TestingJobLeaderService.java
##########
@@ -0,0 +1,141 @@
+/*
+ * 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.taskexecutor;
+
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.highavailability.HighAvailabilityServices;
+import org.apache.flink.runtime.rpc.RpcService;
+import org.apache.flink.util.function.BiConsumerWithException;
+import org.apache.flink.util.function.QuadConsumer;
+import org.apache.flink.util.function.ThrowingConsumer;
+import org.apache.flink.util.function.ThrowingRunnable;
+
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+/**
+ * Testing {@link JobLeaderService} implementation.
+ */
+public class TestingJobLeaderService implements JobLeaderService {
+
+       private final QuadConsumer<String, RpcService, 
HighAvailabilityServices, JobLeaderListener> startConsumer;
+       private final ThrowingRunnable<? extends Exception> stopRunnable;
+       private final ThrowingConsumer<JobID, ? extends Exception> 
removeJobConsumer;
+       private final BiConsumerWithException<JobID, String, ? extends 
Exception> addJobConsumer;
+       private final Consumer<JobID> reconnectConsumer;
+       private final Function<JobID, Boolean> containsJobFunction;
+
+       TestingJobLeaderService(
+               QuadConsumer<String, RpcService, HighAvailabilityServices, 
JobLeaderListener> startConsumer,
+               ThrowingRunnable<? extends Exception> stopRunnable,
+               ThrowingConsumer<JobID, ? extends Exception> removeJobConsumer,
+               BiConsumerWithException<JobID, String, ? extends Exception> 
addJobConsumer,
+               Consumer<JobID> reconnectConsumer,
+               Function<JobID, Boolean> containsJobFunction) {

Review comment:
       ```suggestion
                        QuadConsumer<String, RpcService, 
HighAvailabilityServices, JobLeaderListener> startConsumer,
                        ThrowingRunnable<? extends Exception> stopRunnable,
                        ThrowingConsumer<JobID, ? extends Exception> 
removeJobConsumer,
                        BiConsumerWithException<JobID, String, ? extends 
Exception> addJobConsumer,
                        Consumer<JobID> reconnectConsumer,
                        Function<JobID, Boolean> containsJobFunction) {
   ```
   ?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobManagerTable.java
##########
@@ -61,4 +73,20 @@
         */
        @Nullable
        JobManagerConnection get(JobID jobId);
+
+       /**
+        * Gets the {@link JobManagerConnection} stored under the given {@link 
ResourceID}.
+        *
+        * @param resourceId resourceId identifying the {@link 
JobManagerConnection} to return
+        * @return the {@link JobManagerConnection} stored under resourceId; 
{@code null} otherwise
+        */
+       @Nullable
+       JobManagerConnection get(ResourceID resourceId);

Review comment:
       maybe return `Optional` instead




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

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


Reply via email to