cloud-fan commented on a change in pull request #31643:
URL: https://github.com/apache/spark/pull/31643#discussion_r585383459
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
##########
@@ -157,6 +170,18 @@ private FetchShuffleBlocks createFetchShuffleBlocksMsg(
return blockIdParts;
}
+ /** The reduceIds and blocks in a single mapId */
+ private class BlocksInfo {
+
+ ArrayList<Integer> reduceIds;
+ ArrayList<String> blockIds;
+
+ public BlocksInfo(ArrayList<Integer> reduceIds, ArrayList<String>
blockIds) {
Review comment:
nit
```
public BlocksInfo() {
this.reduceIds = new ArrayList<>();
this.blockIds = new ArrayList<>();
}
```
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
##########
@@ -157,6 +170,18 @@ private FetchShuffleBlocks createFetchShuffleBlocksMsg(
return blockIdParts;
}
+ /** The reduceIds and blocks in a single mapId */
+ private class BlocksInfo {
+
+ ArrayList<Integer> reduceIds;
Review comment:
nit: final
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
##########
@@ -106,41 +107,53 @@ 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<>();
+ HashMap<Long, BlocksInfo> mapIdToBlocksInfo = new HashMap<>();
Review comment:
shall we use linked hash map to eliminate the randomness of map id
array? It's not a hard requirement but it seems better if the block ids are the
same with and without the new shuffle protocol.
----------------------------------------------------------------
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]