cloud-fan commented on a change in pull request #31643:
URL: https://github.com/apache/spark/pull/31643#discussion_r585359529
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
##########
@@ -106,17 +107,17 @@ private boolean isShuffleBlocks(String[] blockIds) {
}
/**
- * Analyze the pass in blockIds and create FetchShuffleBlocks message.
- * The blockIds has been sorted by mapId and reduceId. It's produced in
- * org.apache.spark.MapOutputTracker.convertMapStatuses.
+ * Create FetchShuffleBlocks message and rebuild internal blockIds by
+ * analyzing the pass in blockIds.
*/
- private FetchShuffleBlocks createFetchShuffleBlocksMsg(
+ private FetchShuffleBlocks createFetchShuffleBlocksMsgAndBuildBlockIds(
String appId, String execId, String[] blockIds) {
String[] firstBlock = splitBlockId(blockIds[0]);
int shuffleId = Integer.parseInt(firstBlock[1]);
boolean batchFetchEnabled = firstBlock.length == 5;
- HashMap<Long, ArrayList<Integer>> mapIdToReduceIds = new HashMap<>();
+ LinkedHashMap<Long, ArrayList<Integer>> mapIdToReduceIds = new
LinkedHashMap<>();
+ LinkedHashMap<Long, ArrayList<String>> mapIdToBlockIds = new
LinkedHashMap<>();
Review comment:
Can we use a single map? we can create a `BlocksInfo` class here
```
class BlocksInfo {
ArrayList<Integer> reduceIds;
ArrayList<String> blockIds;
}
LinkedHashMap<Long, BlocksInfo> mapIdToBlocksInfo = new LinkedHashMap<>();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]