[ 
https://issues.apache.org/jira/browse/FLINK-5856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894410#comment-15894410
 ] 

ASF GitHub Bot commented on FLINK-5856:
---------------------------------------

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3398#discussion_r104153657
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -207,11 +210,14 @@ protected void shutDownApplication(ApplicationStatus 
finalStatus, String optiona
        @Override
        public void startNewWorker(ResourceProfile resourceProfile) {
                // Priority for worker containers - priorities are 
intra-application
    -           //TODO: set priority according to the resource allocated
                Priority priority = 
Priority.newInstance(generatePriority(resourceProfile));
                int mem = resourceProfile.getMemoryInMB() < 0 ? 
DEFAULT_TSK_EXECUTOR_MEMORY_SIZE : (int)resourceProfile.getMemoryInMB();
                int vcore = resourceProfile.getCpuCores() < 1 ? 1 : 
(int)resourceProfile.getCpuCores();
                Resource capability = Resource.newInstance(mem, vcore);
    +
    +           if (!orgPriorityResources.containsKey(priority.getPriority())) {
    +                   orgPriorityResources.put(priority.getPriority(), 
capability);
    --- End diff --
    
    Isn't `capability` basically the same as `resourceProfile`? Why storing the 
different type? `orgPriorityResources` is effectively the inverse map of 
`resourcePriorities`, right? Why not treating them as a proper `BiMap`? 


> Need return redundant containers to yarn for yarn mode
> ------------------------------------------------------
>
>                 Key: FLINK-5856
>                 URL: https://issues.apache.org/jira/browse/FLINK-5856
>             Project: Flink
>          Issue Type: Bug
>          Components: YARN
>            Reporter: shuai.xu
>            Assignee: shuai.xu
>              Labels: flip-6
>
> In flip6, for flink on yarn mode, RM requests container from yarn according 
> to the requirement of the JM. But the AMRMClientAsync used in yarn doesn't 
> guarantee that the number of containers returned exactly equal to the number 
> requested. So it need to record the number request by flink rm and return the 
> redundant ones to yarn.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to