samza-yarn/src/main/java/org/apache/samza/job/yarn/YarnFaultDomainManager.java [117:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Multimap<String, FaultDomain> computeHostToFaultDomainMap() {
    Multimap<String, FaultDomain> hostToRackMap = HashMultimap.create();
    try {
      List<NodeReport> nodeReport = yarnClient.getNodeReports(NodeState.RUNNING);
      nodeReport.forEach(report -> {
        FaultDomain rack = new FaultDomain(FaultDomainType.RACK, report.getRackName());
        hostToRackMap.put(report.getNodeId().getHost(), rack);
      });
      log.info("Computed the host to rack map successfully from Yarn.");
    } catch (YarnException | IOException e) {
      throw new SamzaException("Yarn threw an exception while getting NodeReports.", e);
    }
    return hostToRackMap;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



samza-yarn3/src/main/java/org/apache/samza/job/yarn/YarnFaultDomainManager.java [117:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Multimap<String, FaultDomain> computeHostToFaultDomainMap() {
    Multimap<String, FaultDomain> hostToRackMap = HashMultimap.create();
    try {
      List<NodeReport> nodeReport = yarnClient.getNodeReports(NodeState.RUNNING);
      nodeReport.forEach(report -> {
        FaultDomain rack = new FaultDomain(FaultDomainType.RACK, report.getRackName());
        hostToRackMap.put(report.getNodeId().getHost(), rack);
      });
      log.info("Computed the host to rack map successfully from Yarn.");
    } catch (YarnException | IOException e) {
      throw new SamzaException("Yarn threw an exception while getting NodeReports.", e);
    }
    return hostToRackMap;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



