the-other-tim-brown commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2271842003
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedMergeHandle.java:
##########
@@ -251,6 +353,30 @@ public List<WriteStatus> close() {
}
}
+ private Option<BaseFileUpdateCallback<T>> createCallback() {
+ List<BaseFileUpdateCallback<T>> callbacks = new ArrayList<>();
+ // Handle CDC workflow.
+ if (cdcLogger.isPresent()) {
+ callbacks.add(new CDCCallback<>(cdcLogger.get(), readerContext));
+ }
+ // record index callback
+ recordIndexCallbackOpt.ifPresent(callbacks::add);
+ // Stream secondary index stats.
+ if (isSecondaryIndexStatsStreamingWritesEnabled) {
+ this.secondaryIndexCallbackOpt = Option.of(new SecondaryIndexCallback<>(
+ partitionPath,
+ writeSchemaWithMetaFields,
+ readerContext,
+ writeStatus,
+ secondaryIndexDefns
+ ));
+ } else {
+ this.secondaryIndexCallbackOpt = Option.empty();
+ }
+ secondaryIndexCallbackOpt.ifPresent(callbacks::add);
+ return callbacks.isEmpty() ? Option.empty() :
Option.of(CompositeCallback.of(callbacks));
Review Comment:
The static constructor will just return the first callback if there is a
single element
--
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]