cshuo commented on code in PR #13535:
URL: https://github.com/apache/hudi/pull/13535#discussion_r2194499066
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FlinkReaderContextFactory.java:
##########
@@ -27,23 +27,22 @@
import org.apache.flink.table.data.RowData;
import java.util.Collections;
-import java.util.function.Supplier;
/**
* Factory for creating a Flink-specific reader context.
* This context is used specifically for table services such as compaction and
clustering.
*/
public class FlinkReaderContextFactory implements
ReaderContextFactory<RowData> {
private final HoodieTableMetaClient metaClient;
+ private final InternalSchemaManager internalSchemaManager;
public FlinkReaderContextFactory(HoodieTableMetaClient metaClient) {
this.metaClient = metaClient;
+ this.internalSchemaManager =
InternalSchemaManager.get(metaClient.getStorageConf().unwrapAs(Configuration.class),
metaClient);
}
@Override
public HoodieReaderContext<RowData> getContext() {
- Supplier<InternalSchemaManager> internalSchemaManager = () ->
InternalSchemaManager.get(metaClient.getStorageConf().unwrapAs(Configuration.class),
metaClient);
Review Comment:
`FlinkReaderContextFactory#getContext` is called to create reader context
perf FileSlice during clustering or compaction. If `internalSchemaManager` is
instantiated in `getContext`, meta files will be listed for each file slice
reading.
--
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]