public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
public int compare(FSAppAttempt a1, FSAppAttempt a2) { int res = a1.getPriority().compareTo(a2.getPriority()); if (res == 0) { if (a1.getStartTime() < a2.getStartTime()) { res = -1; } else { res = (a1.getStartTime() == a2.getStartTime() ? 0 : 1); } } if (res == 0) { // If there is a tie, break it by app ID to get a deterministic order res = a1.getApplicationId().compareTo(a2.getApplicationId()); } return res; } }
public synchronized ResourceWeights getAppWeight(FSAppAttempt app) { double weight = 1.0; if (sizeBasedWeight) { // Set weight based on current memory demand weight = Math.log1p(app.getDemand().getMemory()) / Math.log(2); } weight *= app.getPriority().getPriority(); if (weightAdjuster != null) { // Run weight through the user-supplied weightAdjuster weight = weightAdjuster.adjustWeight(app, weight); } ResourceWeights resourceWeights = app.getResourceWeights(); resourceWeights.setWeight((float)weight); return resourceWeights; }
public synchronized ResourceWeights getAppWeight(FSAppAttempt app) { double weight = 1.0; if (sizeBasedWeight) { // Set weight based on current memory demand weight = Math.log1p(app.getDemand().getMemory()) / Math.log(2); } weight *= app.getPriority().getPriority(); if (weightAdjuster != null) { // Run weight through the user-supplied weightAdjuster weight = weightAdjuster.adjustWeight(app, weight); } ResourceWeights resourceWeights = app.getResourceWeights(); resourceWeights.setWeight((float)weight); return resourceWeights; }