CTTY commented on code in PR #17781:
URL: https://github.com/apache/hudi/pull/17781#discussion_r2785082677
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -81,25 +85,113 @@ public final class HoodieFileGroupReader<T> implements
Closeable {
private HoodieFileGroupRecordBuffer<T> recordBuffer;
private ClosableIterator<T> baseFileIterator;
private final Option<UnaryOperator<T>> outputConverter;
+ @Getter
private final HoodieReadStats readStats;
// Callback to run custom logic on updates to the base files for the file
group
private final Option<BaseFileUpdateCallback<T>> fileGroupUpdateCallback;
// The list of instant times read from the log blocks, this value is used by
the log-compaction to allow optimized log-block scans
+ @Getter
private List<String> validBlockInstants = Collections.emptyList();
private BufferedRecordConverter<T> bufferedRecordConverter;
- private HoodieFileGroupReader(HoodieReaderContext<T> readerContext,
HoodieStorage storage, String tablePath,
- String latestCommitTime, HoodieSchema
dataSchema, HoodieSchema requestedSchema,
- Option<InternalSchema> internalSchemaOpt,
HoodieTableMetaClient hoodieTableMetaClient, TypedProperties props,
- ReaderParameters readerParameters, InputSplit
inputSplit, Option<BaseFileUpdateCallback<T>> updateCallback,
- FileGroupRecordBufferLoader<T>
recordBufferLoader) {
+ @Builder(setterPrefix = "with")
+ private HoodieFileGroupReader(
+ HoodieReaderContext<T> readerContext,
+ String latestCommitTime,
+ HoodieSchema dataSchema,
+ HoodieSchema requestedSchema,
+ Option<InternalSchema> internalSchemaOpt,
+ HoodieTableMetaClient hoodieTableMetaClient,
+ TypedProperties props,
+ Option<HoodieBaseFile> baseFileOption,
+ Stream<HoodieLogFile> logFiles,
+ String partitionPath,
+ Long start,
+ Long length,
+ Iterator<? extends HoodieRecord> recordIterator,
+ Boolean shouldUseRecordPosition,
+ Boolean allowInflightInstants,
+ Boolean emitDelete,
+ Boolean sortOutput,
+ Option<BaseFileUpdateCallback<T>> fileGroupUpdateCallback,
+ FileGroupRecordBufferLoader<T> recordBufferLoader) {
+
+ // Validations
+ ValidationUtils.checkArgument(readerContext != null, "Reader context is
required");
+ ValidationUtils.checkArgument(hoodieTableMetaClient != null, "Hoodie table
meta client is required");
+ ValidationUtils.checkArgument(latestCommitTime != null, "Latest commit
time is required");
+ ValidationUtils.checkArgument(dataSchema != null, "Data schema is
required");
+ ValidationUtils.checkArgument(requestedSchema != null, "Requested schema
is required");
+ ValidationUtils.checkArgument(props != null, "Props is required");
+ ValidationUtils.checkArgument(partitionPath != null, "Partition path is
required");
+
+ // Handle defaults
Review Comment:
Do you think we can use `Builder.Default` instead of null checking like
below?
--
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]