protected internal virtual void DecContainerReq(RMContainerRequestor.ContainerRequest
                                                 req)
 {
     // Update resource requests
     foreach (string hostName in req.hosts)
     {
         DecResourceRequest(req.priority, hostName, req.capability);
     }
     foreach (string rack in req.racks)
     {
         DecResourceRequest(req.priority, rack, req.capability);
     }
     DecResourceRequest(req.priority, ResourceRequest.Any, req.capability);
 }
        protected internal virtual RMContainerRequestor.ContainerRequest GetFilteredContainerRequest
            (RMContainerRequestor.ContainerRequest orig)
        {
            AList <string> newHosts = new AList <string>();

            foreach (string host in orig.hosts)
            {
                if (!IsNodeBlacklisted(host))
                {
                    newHosts.AddItem(host);
                }
            }
            string[] hosts = Sharpen.Collections.ToArray(newHosts, new string[newHosts.Count]
                                                         );
            RMContainerRequestor.ContainerRequest newReq = new RMContainerRequestor.ContainerRequest
                                                               (orig.attemptID, orig.capability, hosts, orig.racks, orig.priority);
            return(newReq);
        }
 protected internal virtual void AddContainerReq(RMContainerRequestor.ContainerRequest
                                                 req)
 {
     // Create resource requests
     foreach (string host in req.hosts)
     {
         // Data-local
         if (!IsNodeBlacklisted(host))
         {
             AddResourceRequest(req.priority, host, req.capability);
         }
     }
     // Nothing Rack-local for now
     foreach (string rack in req.racks)
     {
         AddResourceRequest(req.priority, rack, req.capability);
     }
     // Off-switch
     AddResourceRequest(req.priority, ResourceRequest.Any, req.capability);
 }