tillrohrmann commented on a change in pull request #11323: [FLINK-16439][k8s] 
Make KubernetesResourceManager starts workers using WorkerResourceSpec 
requested by SlotManager
URL: https://github.com/apache/flink/pull/11323#discussion_r410118794
 
 

 ##########
 File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManager.java
 ##########
 @@ -237,57 +230,73 @@ private void recoverWorkerNodesFromPreviousAttempts() 
throws ResourceManagerExce
                        ++currentMaxAttemptId);
        }
 
-       private void requestKubernetesPod() {
-               numPendingPodRequests++;
+       private void requestKubernetesPod(WorkerResourceSpec 
workerResourceSpec) {
+               final KubernetesTaskManagerParameters parameters =
+                       
createKubernetesTaskManagerParameters(workerResourceSpec);
+
+               final KubernetesPod taskManagerPod =
+                       
KubernetesTaskManagerFactory.createTaskManagerComponent(parameters);
+               kubeClient.createTaskManagerPod(taskManagerPod);
 
 Review comment:
   I think my main problem is that we have two `createXYZ` methods where the 
one method is creating an object and the other method doing some side effects. 
Since they are doing different things, they should not have the same prefix. 
Which one starts with `createXYZ` does not matter but I would like to break up 
the seemingly symmetry of these methods which does not exist.
   
   Moreover, I think it is a good practice to include the name of the type a 
method instantiates in the method name: `KubernetesPod 
create/instantiate/buildKubernetesPod()` or `JobManagerPodSpecification 
create/instantiate/buildJobManagerPodSpecification`. Or at least don't include 
a name which might be misleading: `X createY()`.

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