code: private boolean matchContainerWithPendingRequest(final Container container) {
  
      if (this.requestsAfterSentToRM.isEmpty()) {
        return false;
      }
  
      final AMRMClient.ContainerRequest request = this.requestsAfterSentToRM.peek();
  
      final boolean resourceCondition = container.getResource().getMemory() >= request.getCapability().getMemory();
  
      // TODO[JIRA REEF-35]: check vcores once YARN-2380 is resolved
      final boolean nodeCondition = request.getNodes() == null
          || request.getNodes().contains(container.getNodeId().getHost());
  
      final boolean rackCondition = request.getRacks() == null
          || request.getRacks().contains(this.nodeIdToRackName.get(container.getNodeId().toString()));
  
      return resourceCondition && (request.getRelaxLocality() || rackCondition && nodeCondition);
    }
docs: Match to see whether the container satisfies the request.
  We take into consideration that RM has some freedom in rounding
  up the allocation and in placing containers on other machines.