[
https://issues.apache.org/jira/browse/HUDI-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17380972#comment-17380972
]
ASF GitHub Bot commented on HUDI-2029:
--------------------------------------
nsivabalan commented on a change in pull request #3128:
URL: https://github.com/apache/hudi/pull/3128#discussion_r669909750
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/collection/BitCaskDiskMap.java
##########
@@ -188,21 +204,25 @@ public R get(Object key) {
}
private R get(ValueMetadata entry) {
- return get(entry, getRandomAccessFile());
+ return get(entry, getRandomAccessFile(), isCompressionEnabled);
}
- public static <R> R get(ValueMetadata entry, RandomAccessFile file) {
+ public static <R> R get(ValueMetadata entry, RandomAccessFile file, boolean
isCompressionEnabled) {
try {
- return SerializationUtils
- .deserialize(SpillableMapUtils.readBytesFromDisk(file,
entry.getOffsetOfValue(), entry.getSizeOfValue()));
+ byte[] bytesFromDisk = SpillableMapUtils.readBytesFromDisk(file,
entry.getOffsetOfValue(), entry.getSizeOfValue());
+ if (isCompressionEnabled) {
+ return
SerializationUtils.deserialize(DISK_COMPRESSION_REF.get().decompressBytes(bytesFromDisk));
+ }
Review comment:
not required to fix in this patch, but something to keep in mind. would
be good to have an explicit else block for line 216. this "if" block is just
one line and so its fine. But if its a large "if" block, then reader/dev might
might wonder that some code path may not return from within "if" block and
hence we have a return outside of "if" block.
So, whenever you have if else, try to always explicitly add else block.
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
##########
@@ -200,7 +200,7 @@ protected void initializeIncomingRecordsMap() {
LOG.info("MaxMemoryPerPartitionMerge => " + memoryForMerge);
this.keyToNewRecords = new ExternalSpillableMap<>(memoryForMerge,
config.getSpillableMapBasePath(),
new DefaultSizeEstimator(), new
HoodieRecordSizeEstimator(tableSchema),
- config.getSpillableDiskMapType());
+ config.getSpillableDiskMapType(),
config.isBitCaskDiskMapCompressionEnabled());
Review comment:
Do you wanna make change in HoodieMergedLogRecordScanner as well ? Or
thats planned for a follow up PR
--
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]
> 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)