xuanyuanking commented on a change in pull request #24565: [SPARK-27665][Core] 
Split fetch shuffle blocks protocol from OpenBlocks
URL: https://github.com/apache/spark/pull/24565#discussion_r284721421
 
 

 ##########
 File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
 ##########
 @@ -76,12 +79,83 @@ public OneForOneBlockFetcher(
       TransportConf transportConf,
       DownloadFileManager downloadFileManager) {
     this.client = client;
-    this.openMessage = new OpenBlocks(appId, execId, blockIds);
     this.blockIds = blockIds;
     this.listener = listener;
     this.chunkCallback = new ChunkCallback();
     this.transportConf = transportConf;
     this.downloadFileManager = downloadFileManager;
+    if (isShuffleBlocks(blockIds)) {
+      this.message = createFetchShuffleBlocksMsg(appId, execId, blockIds);
+    } else {
+      this.message = new OpenBlocks(appId, execId, blockIds);
+    }
+  }
+
+  private boolean isShuffleBlocks(String[] blockIds) {
+    if (blockIds.length == 0) {
+      throw new IllegalArgumentException("Zero-sized blockIds array");
 
 Review comment:
   Thanks, done in b08906f.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to