Ejemplo n.º 1
0
 public virtual void Move(Queue newQueue)
 {
     lock (this)
     {
         QueueMetrics oldMetrics = queue.GetMetrics();
         QueueMetrics newMetrics = newQueue.GetMetrics();
         foreach (IDictionary <string, ResourceRequest> asks in requests.Values)
         {
             ResourceRequest request = asks[ResourceRequest.Any];
             if (request != null)
             {
                 oldMetrics.DecrPendingResources(user, request.GetNumContainers(), request.GetCapability
                                                     ());
                 newMetrics.IncrPendingResources(user, request.GetNumContainers(), request.GetCapability
                                                     ());
             }
         }
         oldMetrics.MoveAppFrom(this);
         newMetrics.MoveAppTo(this);
         activeUsersManager.DeactivateApplication(user, applicationId);
         activeUsersManager = newQueue.GetActiveUsersManager();
         activeUsersManager.ActivateApplication(user, applicationId);
         this.queue     = newQueue;
         this.queueName = newQueue.GetQueueName();
     }
 }