Victsm commented on a change in pull request #29855:
URL: https://github.com/apache/spark/pull/29855#discussion_r502930082
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockStoreClient.java
##########
@@ -116,6 +121,42 @@ public void fetchBlocks(
}
}
+ @Override
+ public void pushBlocks(
+ String host,
+ int port,
+ String[] blockIds,
+ ManagedBuffer[] buffers,
+ BlockFetchingListener listener) {
+ checkInit();
+ assert blockIds.length == buffers.length : "Number of block ids and
buffers do not match.";
+
+ Map<String, ManagedBuffer> buffersWithId = new HashMap<>();
+ for (int i = 0; i < blockIds.length; i++) {
+ buffersWithId.put(blockIds[i], buffers[i]);
Review comment:
This is necessary, due to `RetryingBlockFetcher` could supply a subrange
of blockIds during retry.
`OneForOneBlockPusher` is created by
`RetryingBlockFetcher.BlockFetchStarter` during the invocation its
`createAndStart`.
`RetryingBlockFetcher` could supply an array of blockIds which is a subset
of the original blockIds, based on how many blocks have already been
successfully pushed.
Since that API does not have an array of buffers, and we want to reuse
`RetryingBlockFetcher` between both block fetch and push, creating this hashmap
is thus necessary to keep track of the mapping between blockId and the buffer
throughout multiple retries of this batch.
----------------------------------------------------------------
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]