You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by um...@apache.org on 2020/09/26 04:21:24 UTC
[hadoop] branch trunk updated: HDFS-15598: ViewHDFS#canonicalizeUri
should not be restricted to DFS only API. (#2339). Contributed by Uma
Maheswara Rao G.
This is an automated email from the ASF dual-hosted git repository.
umamahesh pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 899dea2 HDFS-15598: ViewHDFS#canonicalizeUri should not be restricted to DFS only API. (#2339). Contributed by Uma Maheswara Rao G.
899dea2 is described below
commit 899dea2a21d1016dff2bef9e22b9f9c7b908067f
Author: Uma Maheswara Rao G <um...@apache.org>
AuthorDate: Fri Sep 25 21:21:01 2020 -0700
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 <um...@cloudera.com>
---
.../apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java | 7 ++++++-
.../org/apache/hadoop/hdfs/ViewDistributedFileSystem.java | 11 +----------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java
index 5353e93..60d14d3 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemOverloadScheme.java
@@ -97,7 +97,7 @@ import static org.apache.hadoop.fs.viewfs.Constants.CONFIG_VIEWFS_IGNORE_PORT_IN
* the mount table name.
* (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
- * current uri as fallback( ex: fs.viewfs.mounttable.<mycluster>.linkFallBack)
+ * current uri as fallback( ex: fs.viewfs.mounttable.<mycluster>.linkFallback)
* target fs uri.
*****************************************************************************/
@InterfaceAudience.LimitedPrivate({ "MapReduce", "HBase", "Hive" })
@@ -354,4 +354,9 @@ public class ViewFileSystemOverloadScheme extends ViewFileSystem {
.getMyFs();
}
+ @Override
+ @InterfaceAudience.LimitedPrivate("HDFS")
+ public URI canonicalizeUri(URI uri) {
+ return super.canonicalizeUri(uri);
+ }
}
\ No newline at end of file
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ViewDistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ViewDistributedFileSystem.java
index 2894a24..70ba886 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ViewDistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ViewDistributedFileSystem.java
@@ -1072,16 +1072,7 @@ public class ViewDistributedFileSystem extends DistributedFileSystem {
return super.canonicalizeUri(uri);
}
- ViewFileSystemOverloadScheme.MountPathInfo<FileSystem> mountPathInfo = null;
- 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);
+ return vfs.canonicalizeUri(uri);
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org