Source:
<code>private static List<PartialSegmentMergeIOConfig> createMergeIOConfigs( int totalNumMergeTasks, Map<Pair<Interval, Integer>, List<PartitionLocation>> partitionToLocations ) { final int numMergeTasks = Math.min(totalNumMergeTasks, partitionToLocations.size()); LOG.info( "Number of merge tasks is set to [%d] based on totalNumMergeTasks[%d] and number of partitions[%d]", numMergeTasks, totalNumMergeTasks, partitionToLocations.size() ); final List<Pair<Interval, Integer>> partitions = new ArrayList<>(partitionToLocations.keySet()); Collections.shuffle(partitions, ThreadLocalRandom.current()); final int numPartitionsPerTask = (int) Math.round(partitions.size() / (double) numMergeTasks); final List<PartialSegmentMergeIOConfig> assignedPartitionLocations = new ArrayList<>(numMergeTasks); for (int i = 0; i < numMergeTasks - 1; i++) { <START> final List<PartitionLocation> assingedToSameTask = partitions <END> .subList(i * numPartitionsPerTask, (i + 1) * numPartitionsPerTask) .stream() .flatMap(intervalAndPartitionId -> partitionToLocations.get(intervalAndPartitionId).stream()) .collect(Collectors.toList()); assignedPartitionLocations.add(new PartialSegmentMergeIOConfig(assingedToSameTask)); } final List<PartitionLocation> assingedToSameTask = partitions .subList((numMergeTasks - 1) * numPartitionsPerTask, partitions.size()) .stream() .flatMap(intervalAndPartitionId -> partitionToLocations.get(intervalAndPartitionId).stream()) .collect(Collectors.toList()); assignedPartitionLocations.add(new PartialSegmentMergeIOConfig(assingedToSameTask)); return assignedPartitionLocations; }</code><technical_language>assingedToSameTask -> assignedToSameTask,</technical_language>

Target:
private static List<PartialSegmentMergeIOConfig> createMergeIOConfigs( int totalNumMergeTasks, Map<Pair<Interval, Integer>, List<PartitionLocation>> partitionToLocations ) { final int numMergeTasks = Math.min(totalNumMergeTasks, partitionToLocations.size()); LOG.info( "Number of merge tasks is set to [%d] based on totalNumMergeTasks[%d] and number of partitions[%d]", numMergeTasks, totalNumMergeTasks, partitionToLocations.size() ); final List<Pair<Interval, Integer>> partitions = new ArrayList<>(partitionToLocations.keySet()); Collections.shuffle(partitions, ThreadLocalRandom.current()); final int numPartitionsPerTask = (int) Math.round(partitions.size() / (double) numMergeTasks); final List<PartialSegmentMergeIOConfig> assignedPartitionLocations = new ArrayList<>(numMergeTasks); for (int i = 0; i < numMergeTasks - 1; i++) { final List<PartitionLocation> assignedToSameTask = partitions .subList(i * numPartitionsPerTask, (i + 1) * numPartitionsPerTask) .stream() .flatMap(intervalAndPartitionId -> partitionToLocations.get(intervalAndPartitionId).stream()) .collect(Collectors.toList()); assignedPartitionLocations.add(new PartialSegmentMergeIOConfig(assignedToSameTask)); } final List<PartitionLocation> assignedToSameTask = partitions .subList((numMergeTasks - 1) * numPartitionsPerTask, partitions.size()) .stream() .flatMap(intervalAndPartitionId -> partitionToLocations.get(intervalAndPartitionId).stream()) .collect(Collectors.toList()); assignedPartitionLocations.add(new PartialSegmentMergeIOConfig(assignedToSameTask)); return assignedPartitionLocations; }