code: private static Set<NetworkAddress> buildNodesWithPrimaryPartitions(final List<NodeInfo> nodeInfos,
          final List<Partition> partitions) {
          Set<NetworkAddress> nodes = new HashSet<NetworkAddress>(nodeInfos.size());
          for (Partition partition : partitions) {
              int index = partition.master();
              if (index >= 0) {
                  nodes.add(nodeInfos.get(index).hostname());
              }
          }
          return nodes;
      }
docs: Pre-computes a set of nodes that have primary partitions active.
  
  @param nodeInfos the list of nodes.
  @param partitions the partitions.
  @return a set containing the addresses of nodes with primary partitions.