otterc commented on a change in pull request #32140: URL: https://github.com/apache/spark/pull/32140#discussion_r645900543
########## File path: common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockHandler.java ########## @@ -413,6 +466,47 @@ public ManagedBuffer next() { } } + private class ShuffleChunkManagedBufferIterator implements Iterator<ManagedBuffer> { + + private int reduceIdx = 0; + private int chunkIdx = 0; + + private final String appId; + private final int shuffleId; + private final int[] reduceIds; + private final int[][] chunkIds; + + ShuffleChunkManagedBufferIterator(FetchShuffleBlockChunks msg) { + appId = msg.appId; + shuffleId = msg.shuffleId; + reduceIds = msg.reduceIds; + chunkIds = msg.chunkIds; + } + + @Override + public boolean hasNext() { + // reduceIds.length must equal to chunkIds.length, and the passed in FetchShuffleBlockChunks + // must have non-empty reduceIds and chunkIds, see the checking logic in + // OneForOneBlockFetcher. + assert(reduceIds.length != 0 && reduceIds.length == chunkIds.length); Review comment: Done -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org