tillrohrmann commented on a change in pull request #11353: [FLINK-16438][yarn] 
Make YarnResourceManager starts workers using WorkerResourceSpec requested by 
SlotManager
URL: https://github.com/apache/flink/pull/11353#discussion_r409611795
 
 

 ##########
 File path: 
flink-yarn/src/test/java/org/apache/flink/yarn/YarnResourceManagerTest.java
 ##########
 @@ -243,24 +248,33 @@ protected NMClientAsync 
createAndStartNodeManagerClient(YarnConfiguration yarnCo
 
                // domain objects for test purposes
                final ResourceProfile resourceProfile1 = 
ResourceProfile.UNKNOWN;
+               final WorkerResourceSpec workerResourceSpec;
+
+               final Resource containerResource;
 
                public String taskHost = "host1";
 
                final TestingYarnNMClientAsync testingYarnNMClientAsync;
 
                final TestingYarnAMRMClientAsync testingYarnAMRMClientAsync;
 
+               int containerIdx = 0;
+
                /**
                 * Create mock RM dependencies.
                 */
                Context() throws Exception {
-                       this(flinkConfig);
+                       this(flinkConfig, null);
                }
 
-               Context(Configuration configuration) throws  Exception {
-                       final SlotManager slotManager = 
SlotManagerBuilder.newBuilder()
-                               
.setDefaultWorkerResourceSpec(YarnWorkerResourceSpecFactory.INSTANCE.createDefaultWorkerResourceSpec(configuration))
-                               .build();
+               Context(Configuration configuration, @Nullable SlotManager 
slotManager) throws  Exception {
+
+                       workerResourceSpec = 
YarnWorkerResourceSpecFactory.INSTANCE.createDefaultWorkerResourceSpec(configuration);
+                       if (slotManager == null) {
+                               slotManager = SlotManagerBuilder.newBuilder()
+                                       
.setDefaultWorkerResourceSpec(workerResourceSpec)
+                                       .build();
+                       }
 
 Review comment:
   Why not moving this block into the default constructor and removing the 
`@Nullable` annotation from `slotManager`?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to