abhishekdas99 commented on a change in pull request #3996:
URL: https://github.com/apache/hadoop/pull/3996#discussion_r825754092
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
##########
@@ -216,19 +216,19 @@ public boolean equals(Object obj) {
/**
* Array of target FileSystem URIs.
*/
- private final URI[] targetFileSystemURIs;
+ private final String[] targetFileSystemPaths;
- MountPoint(Path srcPath, URI[] targetFs) {
+ MountPoint(Path srcPath, String[] targetFs) {
mountedOnPath = srcPath;
- targetFileSystemURIs = targetFs;
+ targetFileSystemPaths = targetFs;
}
public Path getMountedOnPath() {
return mountedOnPath;
}
- public URI[] getTargetFileSystemURIs() {
- return targetFileSystemURIs;
+ public String[] getTargetFileSystemPaths() {
Review comment:
Added getTargetFileSystemURIs where we are returning URI[]. Also added
method to return targetFileSystem Paths.
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java
##########
@@ -294,11 +294,11 @@ void addLink(final String pathComponent, final
INodeLink<T> link)
*/
INodeLink(final String pathToNode, final UserGroupInformation aUgi,
Function<URI, T> createFileSystemMethod,
- final URI aTargetDirLink) {
+ final String aTargetDirLink) throws URISyntaxException {
super(pathToNode, aUgi);
targetFileSystem = null;
- targetDirLinkList = new URI[1];
- targetDirLinkList[0] = aTargetDirLink;
+ targetDirLinkList = new String[1];
+ targetDirLinkList[0] = new URI(aTargetDirLink).toString();
Review comment:
In the previous implementation, we were creating the URI object from the
target file system path. If the path is not a valid URI, the filesystem
initialization should have failed. As we are not keeping the URI object
anymore, this ensures we are not dealing with an invalid URI and new URI object
validates the target filesystem path.
--
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]