yihua commented on code in PR #11208:
URL: https://github.com/apache/hudi/pull/11208#discussion_r1599206501
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/hadoop/HoodieAvroFileReaderFactory.java:
##########
@@ -36,60 +34,48 @@
import java.io.IOException;
public class HoodieAvroFileReaderFactory extends HoodieFileReaderFactory {
- public static final String HBASE_AVRO_HFILE_READER =
"org.apache.hudi.io.hadoop.HoodieHBaseAvroHFileReader";
+
+ public HoodieAvroFileReaderFactory(StorageConfiguration<?> storageConf) {
+ super(storageConf);
+ }
@Override
- protected HoodieFileReader newParquetFileReader(StorageConfiguration<?>
conf, StoragePath path) {
- return new HoodieAvroParquetReader(conf, path);
+ protected HoodieFileReader newParquetFileReader(StoragePath path) {
+ return new HoodieAvroParquetReader(storageConf, path);
}
@Override
protected HoodieFileReader newHFileFileReader(HoodieConfig hoodieConfig,
- StorageConfiguration<?> conf,
StoragePath path,
Option<Schema> schemaOption)
throws IOException {
if (isUseNativeHFileReaderEnabled(hoodieConfig)) {
- return new HoodieNativeAvroHFileReader(conf, path, schemaOption);
+ return new HoodieNativeAvroHFileReader(storageConf, path, schemaOption);
}
- try {
- if (schemaOption.isPresent()) {
- return (HoodieFileReader)
ReflectionUtils.loadClass(HBASE_AVRO_HFILE_READER,
- new Class<?>[] {StorageConfiguration.class, StoragePath.class,
Option.class}, conf, path, schemaOption);
- }
- return (HoodieFileReader)
ReflectionUtils.loadClass(HBASE_AVRO_HFILE_READER,
- new Class<?>[] {StorageConfiguration.class, StoragePath.class},
conf, path);
- } catch (HoodieException e) {
- throw new IOException("Cannot instantiate HoodieHBaseAvroHFileReader",
e);
+ if (schemaOption.isPresent()) {
+ return new HoodieHBaseAvroHFileReader(storageConf, path, schemaOption);
Review Comment:
Good catch! Could you check separately on all the reflection usage on
`HoodieStorage`, readers and writers and see if they are still needed?
--
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]