You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/18 05:30:08 UTC
[GitHub] [spark] rmcyang commented on a diff in pull request #37638: [SPARK-33573][SHUFFLE][YARN] Shuffle server side metrics for Push-based shuffle
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org