@Override public void finishApplication(ApplicationId application, String user) { // Inform the activeUsersManager usersManager.deactivateApplication(user, application); appFinished(); // Inform the parent queue getParent().finishApplication(application, user); }
protected void setupConfigurableCapacities(QueueCapacities queueCapacities) { CSQueueUtils.updateAndCheckCapacitiesByLabel(getQueuePath(), queueCapacities, parent == null ? null : parent.getQueueCapacities()); } }
private void initializeQueueManagementPolicy() throws IOException { queueManagementPolicy = csContext.getConfiguration().getAutoCreatedQueueManagementPolicyClass( getQueuePath()); queueManagementPolicy.init(csContext, this); }
public ReservationQueue(CapacitySchedulerContext cs, String queueName, PlanQueue parent) throws IOException { super(cs, queueName, parent, null); // the following parameters are common to all reservation in the plan updateQuotas(parent.getUserLimitForReservation(), parent.getUserLimitFactor(), parent.getMaxApplicationsForReservations(), parent.getMaxApplicationsPerUserForReservation()); this.parent = parent; }
protected void setupConfigurableCapacities() { CSQueueUtils.loadUpdateAndCheckCapacities( getQueuePath(), csContext.getConfiguration(), queueCapacities, parent == null ? null : parent.getQueueCapacities()); }
public boolean isSystemAppsLimitReached() { if (getRootQueue().getNumApplications() < conf .getMaximumSystemApplications()) { return false; } return true; }
protected void validateCapacitiesByLabel(ManagedParentQueue autoCreateEnabledParentQueue, AutoCreatedLeafQueue leafQueue, String label) throws InterruptedException { assertEquals(autoCreateEnabledParentQueue.getLeafQueueTemplate() .getQueueCapacities().getCapacity(label), leafQueue.getQueueCapacities() .getCapacity(label), EPSILON); assertEquals(autoCreateEnabledParentQueue.getLeafQueueTemplate() .getQueueCapacities().getMaximumCapacity(label), leafQueue.getQueueCapacities() .getMaximumCapacity(label), EPSILON); }
protected void setupConfigurableCapacities( CapacitySchedulerConfiguration configuration) { CSQueueUtils.loadUpdateAndCheckCapacities( getQueuePath(), configuration, queueCapacities, parent == null ? null : parent.getQueueCapacities()); }
@Override public String getQueuePath() { String parentPath = ((parent == null) ? "" : (parent.getQueuePath() + ".")); return parentPath + getQueueName(); }
@Override public void reinitialize( CSQueue newlyParsedQueue, Resource clusterResource) throws IOException { reinitialize(newlyParsedQueue, clusterResource, csContext.getConfiguration()); }
@Override protected void setupConfigurableCapacities() { CSQueueUtils.updateAndCheckCapacitiesByLabel(getQueuePath(), queueCapacities, parent == null ? null : parent.getQueueCapacities()); } }
@Override public void finishApplication(ApplicationId application, String user) { removeApplication(application, user); appFinished(); // Inform the parent queue if (parent != null) { parent.finishApplication(application, user); } }
public static Configuration getConfigurationWithDefaultQueueLabels( Configuration config) { final String A = CapacitySchedulerConfiguration.ROOT + ".a"; final String B = CapacitySchedulerConfiguration.ROOT + ".b"; CapacitySchedulerConfiguration conf = (CapacitySchedulerConfiguration) getConfigurationWithQueueLabels(config); new CapacitySchedulerConfiguration(config); conf.setDefaultNodeLabelExpression(A, "x"); conf.setDefaultNodeLabelExpression(B, "y"); return conf; }
private CapacitySchedulerConfiguration getSchedulerAutoCreatedQueueConfiguration( boolean overrideWithQueueMappings) throws IOException { CapacitySchedulerConfiguration schedulerConf = new CapacitySchedulerConfiguration(conf); TestCapacitySchedulerAutoCreatedQueueBase .setupQueueConfigurationForSingleAutoCreatedLeafQueue(schedulerConf); TestCapacitySchedulerAutoCreatedQueueBase.setupQueueMappings(schedulerConf, "c", overrideWithQueueMappings, new int[] {0, 1}); return schedulerConf; }
void validateQueueEntitlements(String leafQueueName, Map<String, QueueEntitlement> expectedEntitlements, List<QueueManagementChange> queueEntitlementChanges, Set<String> expectedNodeLabels) { AutoCreatedLeafQueue leafQueue = (AutoCreatedLeafQueue) cs.getQueue( leafQueueName); validateQueueEntitlementChanges(leafQueue, expectedEntitlements, queueEntitlementChanges, expectedNodeLabels); }
@Override public ResourceScheduler createScheduler() { CapacityScheduler cs = new MyScheduler(); cs.setConf(conf); return cs; } };
public ReservationQueue(CapacitySchedulerContext cs, String queueName, PlanQueue parent) throws IOException { super(cs, queueName, parent, null); // the following parameters are common to all reservation in the plan updateQuotas(parent.getUserLimitForReservation(), parent.getUserLimitFactor(), parent.getMaxApplicationsForReservations(), parent.getMaxApplicationsPerUserForReservation()); this.parent = parent; }
protected void setupConfigurableCapacities() { CSQueueUtils.loadUpdateAndCheckCapacities( getQueuePath(), csContext.getConfiguration(), queueCapacities, parent == null ? null : parent.getQueueCapacities()); }
@Override protected void setupConfigurableCapacities() { CSQueueUtils.updateAndCheckCapacitiesByLabel(getQueuePath(), queueCapacities, parent == null ? null : parent.getQueueCapacities()); } }
public ReservationQueue(CapacitySchedulerContext cs, String queueName, PlanQueue parent) throws IOException { super(cs, queueName, parent, null); // the following parameters are common to all reservation in the plan updateQuotas(parent.getUserLimitForReservation(), parent.getUserLimitFactor(), parent.getMaxApplicationsForReservations(), parent.getMaxApplicationsPerUserForReservation()); this.parent = parent; }