cloud-fan commented on a change in pull request #19788: [SPARK-9853][Core] 
Optimize shuffle fetch of contiguous partition IDs
URL: https://github.com/apache/spark/pull/19788#discussion_r249477485
 
 

 ##########
 File path: 
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java
 ##########
 @@ -89,17 +92,30 @@ public OneForOneBlockFetcher(
     @Override
     public void onSuccess(int chunkIndex, ManagedBuffer buffer) {
       // On receipt of a chunk, pass it upwards as a block.
-      listener.onBlockFetchSuccess(blockIds[chunkIndex], buffer);
+      listener.onBlockFetchSuccess(Arrays.copyOfRange(blockIds, 
blockIdIndices[chunkIndex],
 
 Review comment:
   is there a way to avoid copy? e.g. if we change the callback interface to 
not take `Array` but `Seq`, then maybe we can create a special `Seq` which 
re-maps the index of `blockIds`, to avoid array copy.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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