public double getRequestedNonSharedOffHeap() { double totalMemOffHeap = 0.0; for (ExecutorDetails exec : this.getExecutors()) { Double execMem = getOffHeapMemoryRequirement(exec); if (execMem != null) { totalMemOffHeap += execMem; } } return totalMemOffHeap; }
/** * 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 off-heap memory requested for this topology */ public Double getTotalRequestedMemOffHeap() { Double total_memoffheap = 0.0; for (ExecutorDetails exec : this.getExecutors()) { Double exec_mem = getOffHeapMemoryRequirement(exec); if (exec_mem != null) { total_memoffheap += exec_mem; } } return total_memoffheap; }
/** * 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); }