Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java (revision 1538191) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/ProportionalCapacityPreemptionPolicy.java (working copy) @@ -120,6 +120,7 @@ private long monitoringInterval; private final Map preempted = new HashMap(); + private boolean isQueuesChange = true; private ResourceCalculator rc; private float percentageClusterPreemptionAllowed; private double naturalTerminationFactor; @@ -202,7 +203,10 @@ Map> toPreempt = getContainersToPreempt(queues, clusterResources); - logToCSV(queues); + if (isQueuesChange) { + logToCSV(queues); + isQueuesChange = false; + } // if we are in observeOnly mode return before any action is taken if (observeOnly) { @@ -220,6 +224,7 @@ dispatcher.handle(new ContainerPreemptEvent(e.getKey(), container, ContainerPreemptEventType.KILL_CONTAINER)); preempted.remove(container); + isQueuesChange = true; } else { //otherwise just send preemption events dispatcher.handle(new ContainerPreemptEvent(e.getKey(), container,