From 8b03514eaf8e540ee51f61f6c7278aac0976b5e8 Mon Sep 17 00:00:00 2001 From: Abhishek Das Date: Mon, 31 Jan 2022 15:19:43 -0800 Subject: [PATCH] HADOOP-18100: Change scope of inner classes in InodeTree to make them accessible outside package Fixes #3950 Signed-off-by: Owen O'Malley Cherry-picked from 3684c7f6 by Owen O'Malley --- .../org/apache/hadoop/fs/viewfs/FsGetter.java | 8 ++++--- .../apache/hadoop/fs/viewfs/InodeTree.java | 24 +++++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/FsGetter.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/FsGetter.java index 071af11e63b..c72baac25fb 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/FsGetter.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/FsGetter.java @@ -20,15 +20,17 @@ package org.apache.hadoop.fs.viewfs; import java.io.IOException; import java.net.URI; -import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; /** * File system instance getter. */ -@Private -class FsGetter { +@InterfaceAudience.LimitedPrivate({"Common"}) +@InterfaceStability.Unstable +public class FsGetter { /** * Gets new file system instance of given uri. diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java index 9a5671c43d6..05a1e93fc46 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java @@ -81,7 +81,7 @@ abstract class InodeTree { private List> regexMountPointList = new ArrayList>(); - static class MountPoint { + public static class MountPoint { String src; INodeLink target; @@ -89,6 +89,22 @@ abstract class InodeTree { src = srcPath; target = mountLink; } + + /** + * Returns the source of mount point. + * @return The source + */ + public String getSource() { + return this.src; + } + + /** + * Returns the target link. + * @return The target INode link + */ + public INodeLink getTarget() { + return this.target; + } } /** @@ -256,7 +272,7 @@ abstract class InodeTree { * For a merge, each target is checked to be dir when created but if target * is changed later it is then ignored (a dir with null entries) */ - static class INodeLink extends INode { + public static class INodeLink extends INode { final URI[] targetDirLinkList; private T targetFileSystem; // file system object created from the link. // Function to initialize file system. Only applicable for simple links @@ -290,7 +306,7 @@ abstract class InodeTree { * Get the target of the link. If a merge link then it returned * as "," separated URI list. */ - Path getTargetLink() { + public Path getTargetLink() { StringBuilder result = new StringBuilder(targetDirLinkList[0].toString()); // If merge link, use "," as separator between the merged URIs for (int i = 1; i < targetDirLinkList.length; ++i) { @@ -933,7 +949,7 @@ abstract class InodeTree { } } - List> getMountPoints() { + public List> getMountPoints() { return mountPoints; }