This is an automated email from the ASF dual-hosted git repository.
danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 25bbff64cf [minor] Following HUDI-4207, remote the new wrapper #init
method (#5865)
25bbff64cf is described below
commit 25bbff64cf9bb05adda36af4d830abd81655a2d7
Author: Danny Chan <[email protected]>
AuthorDate: Wed Jun 15 08:48:13 2022 +0800
[minor] Following HUDI-4207, remote the new wrapper #init method (#5865)
---
.../main/java/org/apache/hudi/io/HoodieMergeHandle.java | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
index 4d6427880c..a85df2a230 100644
---
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
+++
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
@@ -118,14 +118,16 @@ public class HoodieMergeHandle<T extends
HoodieRecordPayload, I, K, O> extends H
Iterator<HoodieRecord<T>> recordItr, String
partitionPath, String fileId,
TaskContextSupplier taskContextSupplier,
Option<BaseKeyGenerator> keyGeneratorOpt) {
this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId,
taskContextSupplier,
- getLatestBaseFile(hoodieTable, partitionPath, fileId),
keyGeneratorOpt);
+ getLatestBaseFile(hoodieTable, partitionPath, fileId),
keyGeneratorOpt);
}
public HoodieMergeHandle(HoodieWriteConfig config, String instantTime,
HoodieTable<T, I, K, O> hoodieTable,
Iterator<HoodieRecord<T>> recordItr, String
partitionPath, String fileId,
TaskContextSupplier taskContextSupplier,
HoodieBaseFile baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
super(config, instantTime, partitionPath, fileId, hoodieTable,
taskContextSupplier);
- init(recordItr, baseFile, keyGeneratorOpt);
+ init(fileId, recordItr);
+ init(fileId, partitionPath, baseFile);
+ validateAndSetAndKeyGenProps(keyGeneratorOpt, config.populateMetaFields());
}
/**
@@ -138,7 +140,8 @@ public class HoodieMergeHandle<T extends
HoodieRecordPayload, I, K, O> extends H
this.keyToNewRecords = keyToNewRecords;
this.useWriterSchemaForCompaction = true;
this.preserveMetadata =
config.isPreserveHoodieCommitMetadataForCompaction();
- init(null, dataFileToBeMerged, keyGeneratorOpt);
+ init(fileId, this.partitionPath, dataFileToBeMerged);
+ validateAndSetAndKeyGenProps(keyGeneratorOpt, config.populateMetaFields());
}
private void validateAndSetAndKeyGenProps(Option<BaseKeyGenerator>
keyGeneratorOpt, boolean populateMetaFields) {
@@ -146,14 +149,6 @@ public class HoodieMergeHandle<T extends
HoodieRecordPayload, I, K, O> extends H
this.keyGeneratorOpt = keyGeneratorOpt;
}
- private void init(Iterator<HoodieRecord<T>> recordItr, HoodieBaseFile
baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
- if (recordItr != null) {
- init(this.fileId, recordItr);
- }
- init(this.fileId, this.partitionPath, baseFile);
- validateAndSetAndKeyGenProps(keyGeneratorOpt,
this.config.populateMetaFields());
- }
-
public static HoodieBaseFile getLatestBaseFile(HoodieTable<?, ?, ?, ?>
hoodieTable, String partitionPath, String fileId) {
Option<HoodieBaseFile> baseFileOp =
hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
if (!baseFileOp.isPresent()) {