[ 
https://issues.apache.org/jira/browse/HUDI-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17378357#comment-17378357
 ] 

ASF GitHub Bot commented on HUDI-2029:
--------------------------------------

rmahindra123 commented on a change in pull request #3128:
URL: https://github.com/apache/hudi/pull/3128#discussion_r667255510



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/util/collection/DiskBasedMap.java
##########
@@ -395,4 +417,48 @@ public int compareTo(ValueMetadata o) {
       return Long.compare(this.offsetOfValue, o.offsetOfValue);
     }
   }
+
+  private static class DiskCompressionInstance implements Serializable {
+    public static final int DISK_COMPRESSION_INITIAL_BUFFER_SIZE = 1048576;
+
+    // Caching ByteArrayOutputStreams to avoid recreating it for every 
operation
+    private final ByteArrayOutputStream compressBaos;
+    private final ByteArrayOutputStream decompressBaos;
+    private final byte[] decompressBuffer;
+
+    DiskCompressionInstance() {
+      compressBaos = new 
ByteArrayOutputStream(DISK_COMPRESSION_INITIAL_BUFFER_SIZE);
+      decompressBaos = new 
ByteArrayOutputStream(DISK_COMPRESSION_INITIAL_BUFFER_SIZE);
+      decompressBuffer = new byte[8192];
+    }
+
+    public byte[] compressBytes(final byte [] value) throws IOException {
+      compressBaos.reset();

Review comment:
       sorry did not follow here.




-- 
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: commits-unsubscr...@hudi.apache.org

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


> Implement compression for DiskBasedMap in Spillable Map
> -------------------------------------------------------
>
>                 Key: HUDI-2029
>                 URL: https://issues.apache.org/jira/browse/HUDI-2029
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: Performance
>            Reporter: Rajesh Mahindra
>            Assignee: Rajesh Mahindra
>            Priority: Major
>              Labels: pull-request-available
>
> Implement compression for DiskBasedMap in Spillable MapĀ 
> Without compression, DiskBasedMap is causing more spilling to disk than 
> RockDb.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to