rmahindra123 commented on a change in pull request #3128:
URL: https://github.com/apache/hudi/pull/3128#discussion_r667254510
##########
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];
Review comment:
Yes, it is dynamic and uses ByteArrayOutputStream (decompressBaos).
decompressBuffer is just a intermediate buffer that reads from the inputStream
and writes to the outputstream, aka decompressBaos. So 8192 is the max bytes
read at a given time.
--
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]