yihua commented on code in PR #11208:
URL: https://github.com/apache/hudi/pull/11208#discussion_r1599209434
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/storage/HoodieHadoopIOFactory.java:
##########
@@ -19,28 +19,40 @@
package org.apache.hudi.io.storage;
+import org.apache.hudi.common.fs.ConsistencyGuard;
import org.apache.hudi.common.model.HoodieRecord;
import org.apache.hudi.common.util.ReflectionUtils;
import org.apache.hudi.exception.HoodieException;
import org.apache.hudi.io.hadoop.HoodieAvroFileReaderFactory;
import org.apache.hudi.io.hadoop.HoodieAvroFileWriterFactory;
+import org.apache.hudi.storage.HoodieStorage;
+import org.apache.hudi.storage.StorageConfiguration;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.storage.hadoop.HoodieHadoopStorage;
/**
* Creates readers and writers for AVRO record payloads.
* Currently uses reflection to support SPARK record payloads but
* this ability should be removed with [HUDI-7746]
*/
public class HoodieHadoopIOFactory extends HoodieIOFactory {
+ protected final StorageConfiguration<?> storageConf;
Review Comment:
Can the `storageConf` member be put into `HoodieIOFactory`?
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java:
##########
@@ -58,27 +58,10 @@
public class HoodieHadoopStorage extends HoodieStorage {
private final FileSystem fs;
- public HoodieHadoopStorage(HoodieStorage storage) {
Review Comment:
Is this moved to somewhere else?
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieHFileRecordReader.java:
##########
@@ -59,8 +59,8 @@ public HoodieHFileRecordReader(Configuration conf, InputSplit
split, JobConf job
StoragePath path = convertToStoragePath(fileSplit.getPath());
StorageConfiguration<?> storageConf = HadoopFSUtils.getStorageConf(conf);
HoodieConfig hoodieConfig = getReaderConfigs(storageConf);
- reader =
HoodieIOFactory.getIOFactory(storageConf).getReaderFactory(HoodieRecord.HoodieRecordType.AVRO)
- .getFileReader(hoodieConfig, HadoopFSUtils.getStorageConf(conf), path,
HoodieFileFormat.HFILE, Option.empty());
+ reader =
HoodieIOFactory.getIOFactory(HadoopFSUtils.getStorageConf(conf)).getReaderFactory(HoodieRecord.HoodieRecordType.AVRO)
Review Comment:
nit: use `storageConf` directly?
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeRecordReaderUtils.java:
##########
@@ -312,8 +312,8 @@ public static Schema addPartitionFields(Schema schema,
List<String> partitioning
public static HoodieFileReader getBaseFileReader(Path path, JobConf conf)
throws IOException {
StorageConfiguration<?> storageConf = HadoopFSUtils.getStorageConf(conf);
HoodieConfig hoodieConfig = getReaderConfigs(storageConf);
- return
HoodieIOFactory.getIOFactory(storageConf).getReaderFactory(HoodieRecord.HoodieRecordType.AVRO)
- .getFileReader(hoodieConfig, HadoopFSUtils.getStorageConf(conf),
convertToStoragePath(path));
+ return
HoodieIOFactory.getIOFactory(HadoopFSUtils.getStorageConf(conf)).getReaderFactory(HoodieRecord.HoodieRecordType.AVRO)
Review Comment:
Same here for using `storageConf`
--
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]