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_r284720861
 
 

 ##########
 File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java
 ##########
 @@ -91,21 +91,36 @@ protected void handleMessage(
       BlockTransferMessage msgObj,
       TransportClient client,
       RpcResponseCallback callback) {
-    if (msgObj instanceof OpenBlocks) {
+    if (msgObj instanceof FetchShuffleBlocks || msgObj instanceof OpenBlocks) {
       final Timer.Context responseDelayContext = 
metrics.openBlockRequestLatencyMillis.time();
       try {
-        OpenBlocks msg = (OpenBlocks) msgObj;
-        checkAuth(client, msg.appId);
-        long streamId = streamManager.registerStream(client.getClientId(),
-          new ManagedBufferIterator(msg.appId, msg.execId, msg.blockIds), 
client.getChannel());
+        int numBlockIds;
+        long streamId;
+        if (msgObj instanceof FetchShuffleBlocks) {
+          FetchShuffleBlocks msg = (FetchShuffleBlocks) msgObj;
+          numBlockIds = 0;
+          for (int[] ids: msg.reduceIds) {
+            numBlockIds += ids.length;
+          }
+          checkAuth(client, msg.appId);
 
 Review comment:
   Copy, 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