Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
zuston committed Feb 3, 2023
1 parent 58ff4d1 commit 702e354
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,7 @@ public void reportShuffleResult(
for (Map.Entry<Integer, List<ShuffleServerInfo>> entry : partitionToServers.entrySet()) {
int partitionIdx = entry.getKey();
for (ShuffleServerInfo ssi : entry.getValue()) {
if (!groupedPartitions.containsKey(ssi)) {
groupedPartitions.put(ssi, Lists.newArrayList());
}
groupedPartitions.putIfAbsent(ssi, Lists.newArrayList());
groupedPartitions.get(ssi).add(partitionIdx);
}
if (CollectionUtils.isNotEmpty(partitionToBlockIds.get(partitionIdx))) {
Expand All @@ -535,9 +533,9 @@ public void reportShuffleResult(
for (Map.Entry<ShuffleServerInfo, List<Integer>> entry : groupedPartitions.entrySet()) {
Map<Integer, List<Long>> requestBlockIds = Maps.newHashMap();
for (Integer partitionId : entry.getValue()) {
List<Long> partitions = partitionToBlockIds.get(partitionId);
if (CollectionUtils.isNotEmpty(partitions)) {
requestBlockIds.put(partitionId, partitions);
List<Long> blockIds = partitionToBlockIds.get(partitionId);
if (CollectionUtils.isNotEmpty(blockIds)) {
requestBlockIds.put(partitionId, blockIds);
}
}
if (requestBlockIds.isEmpty()) {
Expand Down

0 comments on commit 702e354

Please sign in to comment.