You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "zuston (via GitHub)" <gi...@apache.org> on 2025/11/06 06:58:57 UTC
[PR] feat(spark): Add compression for task write stats [uniffle]
zuston opened a new pull request, #2666:
URL: https://github.com/apache/uniffle/pull/2666
### What changes were proposed in this pull request?
1. Add compression for task write stats
2. Optional blocks number check mechanism (disabled by default)
### Why are the changes needed?
To reduce the task write stats size
### Does this PR introduce _any_ user-facing change?
`spark.rss.client.integrityValidation.blockNumberCheckEnabled=false`
### How was this patch tested?
Unit tests.
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#2652] feat(spark): Add compression for task write stats [uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston merged PR #2666:
URL: https://github.com/apache/uniffle/pull/2666
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#2652] feat(spark): Add compression for task write stats [uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #2666:
URL: https://github.com/apache/uniffle/pull/2666#discussion_r2498035959
##########
client-spark/common/src/main/java/org/apache/uniffle/shuffle/ShuffleWriteTaskStats.java:
##########
@@ -60,45 +77,72 @@ public void incPartitionRecord(int partitionId) {
}
public void incPartitionBlock(int partitionId) {
- partitionBlocksWritten[partitionId]++;
+ if (blockNumberCheckEnabled) {
+ partitionBlocksWritten[partitionId]++;
+ }
}
public long getBlocksWritten(int partitionId) {
- return partitionBlocksWritten[partitionId];
+ if (blockNumberCheckEnabled) {
+ return partitionBlocksWritten[partitionId];
+ }
+ return -1L;
}
public long getTaskAttemptId() {
return taskAttemptId;
}
public String encode() {
+ final long start = System.currentTimeMillis();
int partitions = partitionRecordsWritten.length;
- ByteBuffer buffer =
- ByteBuffer.allocate(2 * Long.BYTES + Integer.BYTES + partitions * Long.BYTES * 2);
+ int capacity = 2 * Long.BYTES + Integer.BYTES + partitions * Long.BYTES;
+ if (blockNumberCheckEnabled) {
+ capacity += partitions * Long.BYTES;
+ }
+ ByteBuffer buffer = ByteBuffer.allocate(capacity);
buffer.putLong(taskId);
buffer.putLong(taskAttemptId);
buffer.putInt(partitions);
for (long records : partitionRecordsWritten) {
buffer.putLong(records);
}
- for (long blocks : partitionBlocksWritten) {
- buffer.putLong(blocks);
+ if (blockNumberCheckEnabled) {
+ for (long blocks : partitionBlocksWritten) {
+ buffer.putLong(blocks);
+ }
}
- return new String(buffer.array(), ISO_8859_1);
+ byte[] compressed = ZstdCodec.getInstance(rssConf).compress(buffer.array());
Review Comment:
yes. But this should be introduced another option to enable this.
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#2652] feat(spark): Add compression for task write stats [uniffle]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #2666:
URL: https://github.com/apache/uniffle/pull/2666#discussion_r2497767730
##########
client-spark/common/src/main/java/org/apache/uniffle/shuffle/ShuffleWriteTaskStats.java:
##########
@@ -60,45 +77,72 @@ public void incPartitionRecord(int partitionId) {
}
public void incPartitionBlock(int partitionId) {
- partitionBlocksWritten[partitionId]++;
+ if (blockNumberCheckEnabled) {
+ partitionBlocksWritten[partitionId]++;
+ }
}
public long getBlocksWritten(int partitionId) {
- return partitionBlocksWritten[partitionId];
+ if (blockNumberCheckEnabled) {
+ return partitionBlocksWritten[partitionId];
+ }
+ return -1L;
}
public long getTaskAttemptId() {
return taskAttemptId;
}
public String encode() {
+ final long start = System.currentTimeMillis();
int partitions = partitionRecordsWritten.length;
- ByteBuffer buffer =
- ByteBuffer.allocate(2 * Long.BYTES + Integer.BYTES + partitions * Long.BYTES * 2);
+ int capacity = 2 * Long.BYTES + Integer.BYTES + partitions * Long.BYTES;
+ if (blockNumberCheckEnabled) {
+ capacity += partitions * Long.BYTES;
+ }
+ ByteBuffer buffer = ByteBuffer.allocate(capacity);
buffer.putLong(taskId);
buffer.putLong(taskAttemptId);
buffer.putInt(partitions);
for (long records : partitionRecordsWritten) {
buffer.putLong(records);
}
- for (long blocks : partitionBlocksWritten) {
- buffer.putLong(blocks);
+ if (blockNumberCheckEnabled) {
+ for (long blocks : partitionBlocksWritten) {
+ buffer.putLong(blocks);
+ }
}
- return new String(buffer.array(), ISO_8859_1);
+ byte[] compressed = ZstdCodec.getInstance(rssConf).compress(buffer.array());
Review Comment:
Could you reuse our compressCodec instead of using `ZstdCodec` directly?
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#2652] feat(spark): Add compression for task write stats [uniffle]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2666:
URL: https://github.com/apache/uniffle/pull/2666#issuecomment-3495502221
## Test Results
3 150 files 3 150 suites 6h 47m 39s ⏱️
1 210 tests 1 209 ✅ 1 💤 0 ❌
15 314 runs 15 299 ✅ 15 💤 0 ❌
Results for commit 8e40bb8f.
[test-results]:data:application/gzip;base64,H4sIAHxODGkC/03MSw6DIBSF4a0Yxh0AgkA308AFElKVhseo6d6LxgfD83H5v8iH2WX0HEbC8WNAuYbSb1uTLiGuTShjXDVq72W7IJTgc75yBdgNq9ve4bPZBV6HucH9y6UU0yGprnuVj4Qd86pyqtRlR5Wf0FX33UchLksobSDpGDZGeqtHENZgIYFMkzFOWKY8gKfMEWEE+v0BlfOa5hQBAAA=
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] [#2652] feat(spark): Add compression for task write stats [uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on PR #2666:
URL: https://github.com/apache/uniffle/pull/2666#issuecomment-3500254006
this PR is the first step to compress the write stats, next is the possible pfor to compress. @jerqi
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org