zjf2012 commented on code in PR #495:
URL: https://github.com/apache/incubator-uniffle/pull/495#discussion_r1092694245
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java:
##########
@@ -140,6 +125,29 @@ public boolean hasNext() {
return recordsIterator.hasNext();
}
+ private int uncompress(CompressedShuffleBlock compressedBlock, ByteBuffer
compressedData) {
+ long compressedDataLength = compressedData.limit() -
compressedData.position();
+ compressedBytesLength += compressedDataLength;
+ shuffleReadMetrics.incRemoteBytesRead(compressedDataLength);
+
+ int uncompressedLen = compressedBlock.getUncompressLength();
+ if (codec != null) {
+ if (uncompressedData == null || uncompressedData.capacity() <
uncompressedLen) {
+ // todo: support off-heap bytebuffer
+ uncompressedData = ByteBuffer.allocate(uncompressedLen);
+ }
+ uncompressedData.clear();
+ long startDecompress = System.currentTimeMillis();
+ codec.decompress(compressedData, uncompressedLen, uncompressedData, 0);
+ unCompressedBytesLength += uncompressedLen;
+ long decompressDuration = System.currentTimeMillis() - startDecompress;
+ decompressTime += decompressDuration;
+ } else {
+ uncompressedData = compressedData;
Review Comment:
> But we are adding up compressedBytes in L130?
>
> Should we be consistent?
I think I need to rename compressedBytesLength to something like
rawByteLength which is better for both compressed and uncompressed cases.
--
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]