示例#1
0
 public override void CompletedContainer(Org.Apache.Hadoop.Yarn.Api.Records.Resource
                                         clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer
                                         rmContainer, ContainerStatus containerStatus, RMContainerEventType @event, CSQueue
                                         completedChildQueue, bool sortQueues)
 {
     if (application != null)
     {
         // Careful! Locking order is important!
         // Book keeping
         lock (this)
         {
             base.ReleaseResource(clusterResource, rmContainer.GetContainer().GetResource(), node
                                  .GetLabels());
             Log.Info("completedContainer" + " queue=" + GetQueueName() + " usedCapacity=" + GetUsedCapacity
                          () + " absoluteUsedCapacity=" + GetAbsoluteUsedCapacity() + " used=" + queueUsage
                      .GetUsed() + " cluster=" + clusterResource);
             // Note that this is using an iterator on the childQueues so this can't
             // be called if already within an iterator for the childQueues. Like
             // from assignContainersToChildQueues.
             if (sortQueues)
             {
                 // reinsert the updated queue
                 for (IEnumerator <CSQueue> iter = childQueues.GetEnumerator(); iter.HasNext();)
                 {
                     CSQueue csqueue = iter.Next();
                     if (csqueue.Equals(completedChildQueue))
                     {
                         iter.Remove();
                         Log.Info("Re-sorting completed queue: " + csqueue.GetQueuePath() + " stats: " + csqueue
                                  );
                         childQueues.AddItem(csqueue);
                         break;
                     }
                 }
             }
         }
         // Inform the parent
         if (parent != null)
         {
             // complete my parent
             parent.CompletedContainer(clusterResource, application, node, rmContainer, null,
                                       @event, this, sortQueues);
         }
     }
 }
示例#2
0
 /// <exception cref="Org.Apache.Hadoop.Yarn.Server.Resourcemanager.Scheduler.SchedulerDynamicEditException
 ///     "/>
 internal virtual void RemoveChildQueue(CSQueue remQueue)
 {
     lock (this)
     {
         if (remQueue.GetCapacity() > 0)
         {
             throw new SchedulerDynamicEditException("Queue " + remQueue + " being removed has non zero capacity."
                                                     );
         }
         IEnumerator <CSQueue> qiter = childQueues.GetEnumerator();
         while (qiter.HasNext())
         {
             CSQueue cs = qiter.Next();
             if (cs.Equals(remQueue))
             {
                 qiter.Remove();
                 if (Log.IsDebugEnabled())
                 {
                     Log.Debug("Removed child queue: {}", cs.GetQueueName());
                 }
             }
         }
     }
 }