tillrohrmann commented on a change in pull request #7662: [FLINK-10431] 
Extraction of scheduling-related code from SlotPool into preliminary Scheduler 
(rebased)
URL: https://github.com/apache/flink/pull/7662#discussion_r255157973
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolResource.java
 ##########
 @@ -19,54 +19,55 @@
 package org.apache.flink.runtime.jobmaster.slotpool;
 
 import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor;
+import 
org.apache.flink.runtime.executiongraph.TestingComponentMainThreadExecutorServiceAdapter;
 import org.apache.flink.runtime.jobmaster.JobMasterId;
 import 
org.apache.flink.runtime.resourcemanager.utils.TestingResourceManagerGateway;
-import org.apache.flink.runtime.rpc.RpcService;
 
 import org.junit.rules.ExternalResource;
 
 import javax.annotation.Nonnull;
 
+import java.util.HashMap;
 import java.util.concurrent.CompletableFuture;
+import java.util.function.Supplier;
 
 /**
- * {@link ExternalResource} which provides a {@link SlotPool}.
+ * {@link ExternalResource} which provides a {@link SlotPoolImpl}.
  */
 public class SlotPoolResource extends ExternalResource {
 
        @Nonnull
-       private final RpcService rpcService;
-
-       @Nonnull
-       private final SchedulingStrategy schedulingStrategy;
+       private final SlotSelectionStrategy schedulingStrategy;
 
        private SlotPool slotPool;
 
-       private SlotPoolGateway slotPoolGateway;
+       private Scheduler scheduler;
 
        private TestingResourceManagerGateway testingResourceManagerGateway;
 
-       public SlotPoolResource(@Nonnull RpcService rpcService, @Nonnull 
SchedulingStrategy schedulingStrategy) {
-               this.rpcService = rpcService;
+       private final ComponentMainThreadExecutor mainThreadExecutor;
+
+       public SlotPoolResource(@Nonnull SlotSelectionStrategy 
schedulingStrategy) {
                this.schedulingStrategy = schedulingStrategy;
+               this.mainThreadExecutor = 
TestingComponentMainThreadExecutorServiceAdapter.forMainThread();
                slotPool = null;
-               slotPoolGateway = null;
                testingResourceManagerGateway = null;
        }
 
        public SlotProvider getSlotProvider() {
                checkInitialized();
-               return slotPool.getSlotProvider();
+               return scheduler;
        }
 
        public TestingResourceManagerGateway getTestingResourceManagerGateway() 
{
                checkInitialized();
                return testingResourceManagerGateway;
        }
 
-       public SlotPoolGateway getSlotPoolGateway() {
+       public SlotPool getSlotPoolGateway() {
 
 Review comment:
   method name should be renamed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to