public double getRequestedNonSharedOnHeap() { double totalMemOnHeap = 0.0; for (ExecutorDetails exec : this.getExecutors()) { Double execMem = getOnHeapMemoryRequirement(exec); if (execMem != null) { totalMemOnHeap += execMem; } } return totalMemOnHeap; }
/** * Gets the total memory requirement for a task. * * @param exec the executor the inquiry is concerning. * @return Double the total memory requirement for this exec in topology topoId. */ public Double getTotalMemReqTask(ExecutorDetails exec) { if (hasExecInTopo(exec)) { return getOffHeapMemoryRequirement(exec) + getOnHeapMemoryRequirement(exec); } return null; }
/** * Note: The public API relevant to resource aware scheduling is unstable as of May 2015. * We reserve the right to change them. * * @return the total on-heap memory requested for this topology */ public Double getTotalRequestedMemOnHeap() { Double total_memonheap = 0.0; for (ExecutorDetails exec : this.getExecutors()) { Double exec_mem = getOnHeapMemoryRequirement(exec); if (exec_mem != null) { total_memonheap += exec_mem; } } return total_memonheap; }
/** * Gets the total memory requirement for a task * @param exec the executor the inquiry is concerning. * @return Double the total memory requirement * for this exec in topology topoId. */ public Double getTotalMemReqTask(ExecutorDetails exec) { if (hasExecInTopo(exec)) { return getOffHeapMemoryRequirement(exec) + getOnHeapMemoryRequirement(exec); } return null; }
private WorkerSlot allocateResourceToSlot (TopologyDetails td, Collection<ExecutorDetails> executors, WorkerSlot slot) { double onHeapMem = 0.0; double offHeapMem = 0.0; double cpu = 0.0; for (ExecutorDetails exec : executors) { Double onHeapMemForExec = td.getOnHeapMemoryRequirement(exec); if (onHeapMemForExec != null) { onHeapMem += onHeapMemForExec; } Double offHeapMemForExec = td.getOffHeapMemoryRequirement(exec); if (offHeapMemForExec != null) { offHeapMem += offHeapMemForExec; } Double cpuForExec = td.getTotalCpuReqTask(exec); if (cpuForExec != null) { cpu += cpuForExec; } } return new WorkerSlot(slot.getNodeId(), slot.getPort(), onHeapMem, offHeapMem, cpu); }