HDFS-15598: ViewHDFS#canonicalizeUri should not be restricted to DFS only API. (#2339). Contributed by Uma Maheswara Rao G.
Co-authored-by: Uma Maheswara Rao G <umagangumalla@cloudera.com>
This commit is contained in:
parent
00c4de63cf
commit
899dea2a21
|
@ -97,7 +97,7 @@ import static org.apache.hadoop.fs.viewfs.Constants.CONFIG_VIEWFS_IGNORE_PORT_IN
|
||||||
* the mount table name.
|
* the mount table name.
|
||||||
* (3) If there are no mount links configured with the initializing uri's
|
* (3) If there are no mount links configured with the initializing uri's
|
||||||
* hostname as the mount table name, then it will automatically consider the
|
* hostname as the mount table name, then it will automatically consider the
|
||||||
* current uri as fallback( ex: fs.viewfs.mounttable.<mycluster>.linkFallBack)
|
* current uri as fallback( ex: fs.viewfs.mounttable.<mycluster>.linkFallback)
|
||||||
* target fs uri.
|
* target fs uri.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@InterfaceAudience.LimitedPrivate({ "MapReduce", "HBase", "Hive" })
|
@InterfaceAudience.LimitedPrivate({ "MapReduce", "HBase", "Hive" })
|
||||||
|
@ -354,4 +354,9 @@ public class ViewFileSystemOverloadScheme extends ViewFileSystem {
|
||||||
.getMyFs();
|
.getMyFs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@InterfaceAudience.LimitedPrivate("HDFS")
|
||||||
|
public URI canonicalizeUri(URI uri) {
|
||||||
|
return super.canonicalizeUri(uri);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1072,16 +1072,7 @@ public class ViewDistributedFileSystem extends DistributedFileSystem {
|
||||||
return super.canonicalizeUri(uri);
|
return super.canonicalizeUri(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewFileSystemOverloadScheme.MountPathInfo<FileSystem> mountPathInfo = null;
|
return vfs.canonicalizeUri(uri);
|
||||||
try {
|
|
||||||
mountPathInfo = this.vfs.getMountPathInfo(new Path(uri), getConf());
|
|
||||||
} catch (IOException e) {
|
|
||||||
LOGGER.warn("Failed to resolve the uri as mount path", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
checkDFS(mountPathInfo.getTargetFs(), "canonicalizeUri");
|
|
||||||
return ((DistributedFileSystem) mountPathInfo.getTargetFs())
|
|
||||||
.canonicalizeUri(uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue