[minor] Following HUDI-4207, remote the new wrapper #init method (#5865)
This commit is contained in:
@@ -125,7 +125,9 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload, I, K, O> extends H
|
|||||||
Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
|
Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
|
||||||
TaskContextSupplier taskContextSupplier, HoodieBaseFile baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
|
TaskContextSupplier taskContextSupplier, HoodieBaseFile baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
|
||||||
super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
|
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.keyToNewRecords = keyToNewRecords;
|
||||||
this.useWriterSchemaForCompaction = true;
|
this.useWriterSchemaForCompaction = true;
|
||||||
this.preserveMetadata = config.isPreserveHoodieCommitMetadataForCompaction();
|
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) {
|
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;
|
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) {
|
public static HoodieBaseFile getLatestBaseFile(HoodieTable<?, ?, ?, ?> hoodieTable, String partitionPath, String fileId) {
|
||||||
Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
|
Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
|
||||||
if (!baseFileOp.isPresent()) {
|
if (!baseFileOp.isPresent()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user