/** * Add default resource requirements for a executor. */ private void addDefaultResforExec(ExecutorDetails exec) { String componentId = getExecutorToComponent().get(exec); addResourcesForExec(exec, new NormalizedResourceRequest(topologyConf, componentId)); }
/** * Add default resource requirements for a executor */ private void addDefaultResforExec(ExecutorDetails exec) { Double topologyComponentCpuPcorePercent = Utils.getDouble(this.topologyConf.get(Config.TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT), null); Double topologyComponentResourcesOffheapMemoryMb = Utils.getDouble(this.topologyConf.get(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB), null); Double topologyComponentResourcesOnheapMemoryMb = Utils.getDouble(this.topologyConf.get(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB), null); assert topologyComponentCpuPcorePercent != null; assert topologyComponentResourcesOffheapMemoryMb != null; assert topologyComponentResourcesOnheapMemoryMb != null; Map<String, Double> defaultResourceList = new HashMap<>(); defaultResourceList.put(Config.TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT, topologyComponentCpuPcorePercent); defaultResourceList.put(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB, topologyComponentResourcesOffheapMemoryMb); defaultResourceList.put(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB, topologyComponentResourcesOnheapMemoryMb); LOG.debug("Scheduling Executor: {} with memory requirement as onHeap: {} - offHeap: {} " + "and CPU requirement: {}", exec, this.topologyConf.get(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB), this.topologyConf.get(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB), this.topologyConf.get(Config.TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT)); addResourcesForExec(exec, defaultResourceList); }