ByteYue commented on code in PR #32416:
URL: https://github.com/apache/doris/pull/32416#discussion_r1528661095
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsResource.java:
##########
@@ -63,16 +71,63 @@ public HdfsResource(String name) {
properties = Maps.newHashMap();
}
+ private static void pingHdfs(String hdfsUri, Map<String, String>
properties) throws DdlException {
+ String testFile = hdfsUri + "/test_hdfs_valid.txt";
+ Map<String, String> propertiesPing = new HashMap<>();
+ propertiesPing.put(HADOOP_FS_NAME, hdfsUri);
+ properties.putAll(propertiesPing);
+ DFSFileSystem dfsSystem = new DFSFileSystem(properties);
Review Comment:
I've tested this pr with one hdfs resource and found out that this
DFSFileSystem is not initialized correctly. The `operations` filed would be
null if you only create one DFSFileSystem with `new DFSFileSystem`. Then you'll
get
```
java.lang.NullPointerException: Cannot invoke
"org.apache.doris.fs.operations.HDFSFileOperations.openWriter(org.apache.doris.fs.operations.OpParams)"
because "this.operations" is null
at
org.apache.doris.fs.remote.dfs.DFSFileSystem.directUpload(DFSFileSystem.java:276)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.catalog.HdfsResource.pingHdfs(HdfsResource.java:83)
~[doris-fe.jar:1.2-SNAPSHOT]
```
You might consider using the `nativeFileSystem(String remotePath)` function
to get one valid DFSFileSystem instance.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]