public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) { this.name = name; this.scheduler = scheduler; this.authorizer = YarnAuthorizationProvider.getInstance(scheduler.getConf()); this.queueEntity = new PrivilegedEntity(EntityType.QUEUE, name); this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf()); this.parent = parent; setPolicy(scheduler.getAllocationConfiguration().getSchedulingPolicy(name)); reinit(false); }
/** * Recursively check policies for queues in pre-order. Get queue policies * from the allocation file instead of properties of {@link FSQueue} objects. * Set the policy for current queue if there is no policy violation for its * children. This method is invoked while reloading the allocation file. * * @param queueConf allocation configuration * @return true if no policy violation and successfully set polices * for queues; false otherwise */ public boolean verifyAndSetPolicyFromConf(AllocationConfiguration queueConf) { SchedulingPolicy queuePolicy = queueConf.getSchedulingPolicy(getName()); for (FSQueue child : getChildQueues()) { if (!queuePolicy.isChildPolicyAllowed( queueConf.getSchedulingPolicy(child.getName()))) { return false; } boolean success = child.verifyAndSetPolicyFromConf(queueConf); if (!success) { return false; } } // Set the policy if no policy violation for all children setPolicy(queuePolicy); return true; }
SchedulingPolicy policy = queueConf.getSchedulingPolicy(queue.getName()); policy.initialize(scheduler.getClusterResource()); queue.setPolicy(policy); } catch (AllocationConfigurationException ex) { LOG.warn("Cannot apply configured scheduling policy to queue "
SchedulingPolicy policy = queueConf.getSchedulingPolicy(queue.getName()); policy.initialize(scheduler.getClusterResource()); queue.setPolicy(policy); } catch (AllocationConfigurationException ex) { LOG.warn("Cannot apply configured scheduling policy to queue "
scheduler.getQueueManager().getQueue("queue1").setPolicy(drfPolicy); scheduler.update();
scheduler.getQueueManager().getQueue("queue1").setPolicy(drfPolicy); scheduler.update();