rmcyang commented on code in PR #37638:
URL: https://github.com/apache/spark/pull/37638#discussion_r997733472
##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RemoteBlockPushResolver.java:
##########
@@ -1124,9 +1143,23 @@ private boolean isDuplicateBlock() {
* block parts buffered in memory.
*/
private void writeDeferredBufs() throws IOException {
+ long totalSize = 0;
for (ByteBuffer deferredBuf : deferredBufs) {
+ totalSize += deferredBuf.limit();
writeBuf(deferredBuf);
}
+ mergeManager.pushMergeMetrics.cachedBlockBytes.dec(totalSize);
+ deferredBufs = null;
+ }
+
+ private void freeDeferredBufs() {
+ if (deferredBufs != null && !deferredBufs.isEmpty()) {
+ long totalSize = 0;
+ for (ByteBuffer deferredBuf : deferredBufs) {
+ totalSize += deferredBuf.limit();
+ }
+ mergeManager.pushMergeMetrics.cachedBlockBytes.dec(totalSize);
+ }
deferredBufs = null;
Review Comment:
Makes sense. Have checked all the places and made the replacement, it seems
just applies to `abortIfNecessary` and `onData`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]