danny0405 commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2265590896
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedMergeHandle.java:
##########
@@ -75,13 +85,60 @@
public class FileGroupReaderBasedMergeHandle<T, I, K, O> extends
HoodieWriteMergeHandle<T, I, K, O> {
private static final Logger LOG =
LoggerFactory.getLogger(FileGroupReaderBasedMergeHandle.class);
- private final HoodieReaderContext<T> readerContext;
- private final CompactionOperation operation;
+ private final Option<CompactionOperation> operation;
private final String maxInstantTime;
+ private HoodieReaderContext<T> readerContext;
private HoodieReadStats readStats;
- private final HoodieRecord.HoodieRecordType recordType;
- private final Option<HoodieCDCLogger> cdcLogger;
+ private HoodieRecord.HoodieRecordType recordType;
+ private Option<HoodieCDCLogger> cdcLogger;
+ private Option<RecordLevelIndexCallback> recordIndexCallbackOpt;
+ private Option<SecondaryIndexCallback> secondaryIndexCallbackOpt;
+ private final boolean isCompaction;
+ private final TypedProperties props;
+ private Iterator<HoodieRecord> incomingRecordsItr;
+ /**
+ * Constructor for Copy-On-Write (COW) merge path.
+ * Takes in a base path and an iterator of records to be merged with that
file.
+ * @param config instance of {@link HoodieWriteConfig} to use.
+ * @param instantTime instant time of the current commit.
+ * @param hoodieTable instance of {@link HoodieTable} being updated.
+ * @param recordItr iterator of records to be merged with the file.
+ * @param partitionPath partition path of the base file.
+ * @param fileId file ID of the base file.
+ * @param taskContextSupplier instance of {@link TaskContextSupplier} to use.
+ * @param keyGeneratorOpt optional instance of {@link BaseKeyGenerator} to
use for extracting keys from records.
+ * @param readerContext instance of {@link HoodieReaderContext} to use while
merging for accessing fields and transforming records.
+ */
+ public FileGroupReaderBasedMergeHandle(HoodieWriteConfig config, String
instantTime, HoodieTable<T, I, K, O> hoodieTable,
+ Iterator<HoodieRecord<T>> recordItr,
String partitionPath, String fileId,
+ TaskContextSupplier
taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt,
HoodieReaderContext<T> readerContext) {
Review Comment:
do we need to pass around the `readerContext` explicitly here? can we use
`hoodieTable.getContext.getReaderContextFactoryForWrite` instead?
--
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]