felixwluo commented on PR #32416: URL: https://github.com/apache/doris/pull/32416#issuecomment-2004059969
okay I'll adjust it and test it. AlexYue ***@***.***>于2024年3月18日 周一22:22写道: > ***@***.**** requested changes on this pull request. > ------------------------------ > > In fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsResource.java > <https://github.com/apache/doris/pull/32416#discussion_r1528661095>: > > > @@ -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); > > 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. > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/doris/pull/32416#pullrequestreview-1943231865>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/A7KEOOMSYFYURNBDTYYVWE3YY32BTAVCNFSM6AAAAABE3NXREOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNBTGIZTCOBWGU> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- 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]
