Package org.apache.hadoop.fs.viewfs
Class ConfigUtil
java.lang.Object
org.apache.hadoop.fs.viewfs.ConfigUtil
Utilities for config variables of the viewFs See
ViewFs-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddLink(Configuration conf, String mountTableName, String src, URI target) Add a link to the config for the specified mount tablestatic voidaddLink(Configuration conf, String src, URI target) Add a link to the config for the default mount tablestatic voidaddLinkFallback(Configuration conf, String mountTableName, URI target) Add a LinkFallback to the config for the specified mount table.static voidaddLinkFallback(Configuration conf, URI target) Add a LinkFallback to the config for the default mount table.static voidaddLinkMerge(Configuration conf, String mountTableName, URI[] targets) Add a LinkMerge to the config for the specified mount table.static voidaddLinkMerge(Configuration conf, URI[] targets) Add a LinkMerge to the config for the default mount table.static voidaddLinkMergeSlash(Configuration conf, String mountTableName, URI target) Add a LinkMergeSlash to the config for the specified mount table.static voidaddLinkMergeSlash(Configuration conf, URI target) Add a LinkMergeSlash to the config for the default mount table.static voidaddLinkNfly(Configuration conf, String mountTableName, String src, String settings, String targets) Add nfly link to configuration for the given mount table.static voidaddLinkNfly(Configuration conf, String mountTableName, String src, String settings, URI... targets) Add nfly link to configuration for the given mount table.static voidaddLinkNfly(Configuration conf, String src, URI... targets) static voidaddLinkRegex(Configuration conf, String mountTableName, String srcRegex, String targetStr, String interceptorSettings) Add a LinkRegex to the config for the specified mount table.static StringGet the config variable prefix for the default mount tablestatic StringgetConfigViewFsPrefix(String mountTableName) Get the config variable prefix for the specified mount tablestatic StringGet the name of the default mount table to use.static StringgetHomeDirValue(Configuration conf) Get the value of the home dir conf value for default mount tablestatic StringgetHomeDirValue(Configuration conf, String mountTableName) Get the value of the home dir conf value for specified mount tablestatic booleanCheck the bool config whether nested mount point is supported.static voidsetHomeDirConf(Configuration conf, String homedir) Add config variable for homedir for default mount tablestatic voidsetHomeDirConf(Configuration conf, String mountTableName, String homedir) Add config variable for homedir the specified mount tablestatic voidsetIsNestedMountPointSupported(Configuration conf, boolean isNestedMountPointSupported) Set the bool value isNestedMountPointSupported in config.
-
Constructor Details
-
ConfigUtil
public ConfigUtil()
-
-
Method Details
-
getConfigViewFsPrefix
Get the config variable prefix for the specified mount table- Parameters:
mountTableName- - the name of the mount table- Returns:
- the config variable prefix for the specified mount table
-
getConfigViewFsPrefix
Get the config variable prefix for the default mount table- Returns:
- the config variable prefix for the default mount table
-
addLink
Add a link to the config for the specified mount table- Parameters:
conf- - add the link to this confmountTableName- mountTable.src- - the src path nametarget- - the target URI link
-
addLink
Add a link to the config for the default mount table- Parameters:
conf- - add the link to this confsrc- - the src path nametarget- - the target URI link
-
addLinkMergeSlash
Add a LinkMergeSlash to the config for the specified mount table.- Parameters:
conf- configuration.mountTableName- mountTable.target- target.
-
addLinkMergeSlash
Add a LinkMergeSlash to the config for the default mount table.- Parameters:
conf- configuration.target- targets.
-
addLinkFallback
Add a LinkFallback to the config for the specified mount table.- Parameters:
conf- configuration.mountTableName- mountTable.target- targets.
-
addLinkFallback
Add a LinkFallback to the config for the default mount table.- Parameters:
conf- configuration.target- targets.
-
addLinkMerge
Add a LinkMerge to the config for the specified mount table.- Parameters:
conf- configuration.mountTableName- mountTable.targets- targets.
-
addLinkMerge
Add a LinkMerge to the config for the default mount table.- Parameters:
conf- configuration.targets- targets array.
-
addLinkNfly
public static void addLinkNfly(Configuration conf, String mountTableName, String src, String settings, String targets) Add nfly link to configuration for the given mount table.- Parameters:
conf- configuration.mountTableName- mount table.src- src.settings- settings.targets- targets.
-
addLinkNfly
public static void addLinkNfly(Configuration conf, String mountTableName, String src, String settings, URI... targets) Add nfly link to configuration for the given mount table.- Parameters:
conf- configuration.mountTableName- mount table.src- src.settings- settings.targets- targets.
-
addLinkNfly
-
addLinkRegex
public static void addLinkRegex(Configuration conf, String mountTableName, String srcRegex, String targetStr, String interceptorSettings) Add a LinkRegex to the config for the specified mount table.- Parameters:
conf- - get mountable config from this confmountTableName- - the mountable name of the regex config itemsrcRegex- - the src path regex expression that applies to this configtargetStr- - the string of target pathinterceptorSettings- - the serialized interceptor string to be applied while resolving the mapping
-
setHomeDirConf
Add config variable for homedir for default mount table- Parameters:
conf- - add to this confhomedir- - the home dir path starting with slash
-
setHomeDirConf
Add config variable for homedir the specified mount table- Parameters:
conf- - add to this confhomedir- - the home dir path starting with slashmountTableName- - the mount table.
-
getHomeDirValue
Get the value of the home dir conf value for default mount table- Parameters:
conf- - from this conf- Returns:
- home dir value, null if variable is not in conf
-
getHomeDirValue
Get the value of the home dir conf value for specified mount table- Parameters:
conf- - from this confmountTableName- - the mount table- Returns:
- home dir value, null if variable is not in conf
-
getDefaultMountTableName
Get the name of the default mount table to use. IfConstants.CONFIG_VIEWFS_DEFAULT_MOUNT_TABLE_NAME_KEYis specified, it's value is returned. Otherwise,Constants.CONFIG_VIEWFS_DEFAULT_MOUNT_TABLEis returned.- Parameters:
conf- Configuration to use.- Returns:
- the name of the default mount table to use.
-
isNestedMountPointSupported
Check the bool config whether nested mount point is supported. Default: true- Parameters:
conf- - from this conf- Returns:
- whether nested mount point is supported
-
setIsNestedMountPointSupported
public static void setIsNestedMountPointSupported(Configuration conf, boolean isNestedMountPointSupported) Set the bool value isNestedMountPointSupported in config.- Parameters:
conf- - from this confisNestedMountPointSupported- - whether nested mount point is supported
-