/** * Check if preemption is enabled and the utilization threshold for * preemption is met. * * @return true if preemption should be attempted, false otherwise. */ private boolean shouldAttemptPreemption() { if (preemptionEnabled) { return (preemptionUtilizationThreshold < Math.max( (float) rootMetrics.getAllocatedMB() / clusterResource.getMemory(), (float) rootMetrics.getAllocatedVirtualCores() / clusterResource.getVirtualCores())); } return false; }
/** * Check if preemption is enabled and the utilization threshold for * preemption is met. * * @return true if preemption should be attempted, false otherwise. */ private boolean shouldAttemptPreemption() { if (preemptionEnabled) { return (preemptionUtilizationThreshold < Math.max( (float) rootMetrics.getAllocatedMB() / clusterResource.getMemory(), (float) rootMetrics.getAllocatedVirtualCores() / clusterResource.getVirtualCores())); } return false; }
/** * Check if preemption is enabled and the utilization threshold for * preemption is met. * * @return true if preemption should be attempted, false otherwise. */ private boolean shouldAttemptPreemption() { if (context.isPreemptionEnabled()) { return (context.getPreemptionUtilizationThreshold() < Math.max( (float) rootMetrics.getAllocatedMB() / getClusterResource().getMemorySize(), (float) rootMetrics.getAllocatedVirtualCores() / getClusterResource().getVirtualCores())); } return false; }
public QueueStatistics getQueueStatistics() { QueueStatistics stats = recordFactory.newRecordInstance(QueueStatistics.class); stats.setNumAppsSubmitted(getMetrics().getAppsSubmitted()); stats.setNumAppsRunning(getMetrics().getAppsRunning()); stats.setNumAppsPending(getMetrics().getAppsPending()); stats.setNumAppsCompleted(getMetrics().getAppsCompleted()); stats.setNumAppsKilled(getMetrics().getAppsKilled()); stats.setNumAppsFailed(getMetrics().getAppsFailed()); stats.setNumActiveUsers(getMetrics().getActiveUsers()); stats.setAvailableMemoryMB(getMetrics().getAvailableMB()); stats.setAllocatedMemoryMB(getMetrics().getAllocatedMB()); stats.setPendingMemoryMB(getMetrics().getPendingMB()); stats.setReservedMemoryMB(getMetrics().getReservedMB()); stats.setAvailableVCores(getMetrics().getAvailableVirtualCores()); stats.setAllocatedVCores(getMetrics().getAllocatedVirtualCores()); stats.setPendingVCores(getMetrics().getPendingVirtualCores()); stats.setReservedVCores(getMetrics().getReservedVirtualCores()); stats.setAllocatedContainers(getMetrics().getAllocatedContainers()); stats.setPendingContainers(getMetrics().getPendingContainers()); stats.setReservedContainers(getMetrics().getReservedContainers()); return stats; }