hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] viirya commented on a change in pull request #2201: HADOOP-17125. Using snappy-java in SnappyCodec
Date Wed, 09 Sep 2020 16:14:41 GMT

viirya commented on a change in pull request #2201:
URL: https://github.com/apache/hadoop/pull/2201#discussion_r485738846



##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/snappy/SnappyDecompressor.java
##########
@@ -276,13 +258,27 @@ public void end() {
     // do nothing
   }
 
-  private native static void initIDs();
+  private int decompressBytesDirect() throws IOException {
+    if (compressedDirectBufLen == 0) {
+      return 0;
+    } else {
+      // Set the position and limit of `compressedDirectBuf` for reading
+      compressedDirectBuf.position(0).limit(compressedDirectBufLen);
+      // There is compressed input, decompress it now.
+      int size = Snappy.uncompressedLength((ByteBuffer) compressedDirectBuf);
+      if (size > uncompressedDirectBuf.capacity()) {

Review comment:
       `decompressDirect` also calls `decompressBytesDirect`, but the `uncompressedDirectBuf`
is passed in as an argument. I think it has danger to assume `uncompressedDirectBuf` is always
reset.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message