示例#1
0
 /// <summary>
 /// This methods to change capacity for a queue and adjusts its
 /// absoluteCapacity
 /// </summary>
 /// <param name="entitlement">
 /// the new entitlement for the queue (capacity,
 /// maxCapacity, etc..)
 /// </param>
 /// <exception cref="Org.Apache.Hadoop.Yarn.Server.Resourcemanager.Scheduler.SchedulerDynamicEditException
 ///     "/>
 public virtual void SetEntitlement(QueueEntitlement entitlement)
 {
     lock (this)
     {
         float capacity = entitlement.GetCapacity();
         if (capacity < 0 || capacity > 1.0f)
         {
             throw new SchedulerDynamicEditException("Capacity demand is not in the [0,1] range: "
                                                     + capacity);
         }
         SetCapacity(capacity);
         SetAbsoluteCapacity(GetParent().GetAbsoluteCapacity() * GetCapacity());
         // note: we currently set maxCapacity to capacity
         // this might be revised later
         SetMaxCapacity(entitlement.GetMaxCapacity());
         if (Log.IsDebugEnabled())
         {
             Log.Debug("successfully changed to " + capacity + " for queue " + this.GetQueueName
                           ());
         }
     }
 }
 /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
 public virtual void SetEntitlement(string queue, QueueEntitlement entitlement)
 {
     throw new YarnException(GetType().Name + " does not support this operation");
 }