zjf2012 commented on code in PR #495:
URL: https://github.com/apache/incubator-uniffle/pull/495#discussion_r1071970445


##########
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:
   the "unCompressedBytesLength" is for decompressing. If 
spark.shuffle.compress is set to false, I think we don't need to add to 
"unCompressedBytesLength".  Am I right?



-- 
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]

Reply via email to