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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to