-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-15891. provide Regex Based Mount Point In Inode Tree #2185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
01a2419
d66b86b
2f3ae03
d540c6b
c609d13
e25945d
8786ee8
1cb9b50
4c543ea
fa30c5e
c494bfe
226f8f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,42 @@ public static void addLinkNfly(final Configuration conf, final String src, | |
| addLinkNfly(conf, getDefaultMountTableName(conf), src, null, targets); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Add a LinkRegex to the config for the specified mount table. | ||
| * @param conf - get mountable config from this conf | ||
| * @param mountTableName - the mountable name of the regex config item | ||
| * @param srcRegex - the src path regex expression that applies to this config | ||
| * @param targetStr - the string of target path | ||
| */ | ||
|
||
| public static void addLinkRegex( | ||
| Configuration conf, final String mountTableName, | ||
| final String srcRegex, final String targetStr) { | ||
| addLinkRegex(conf, mountTableName, srcRegex, targetStr, null); | ||
| } | ||
|
|
||
| /** | ||
| * Add a LinkRegex to the config for the specified mount table. | ||
| * @param conf - get mountable config from this conf | ||
| * @param mountTableName - the mountable name of the regex config item | ||
| * @param srcRegex - the src path regex expression that applies to this config | ||
| * @param targetStr - the string of target path | ||
| * @param interceptorSettings - the serialized interceptor string to be | ||
| * applied while resolving the mapping | ||
| */ | ||
| public static void addLinkRegex( | ||
| Configuration conf, final String mountTableName, final String srcRegex, | ||
| final String targetStr, final String interceptorSettings) { | ||
| String prefix = getConfigViewFsPrefix(mountTableName) + "." | ||
| + Constants.CONFIG_VIEWFS_LINK_REGEX + "."; | ||
| if ((interceptorSettings != null) && (!interceptorSettings.isEmpty())) { | ||
| prefix = prefix + interceptorSettings | ||
| + RegexMountPoint.SETTING_SRCREGEX_SEP; | ||
| } | ||
| String key = prefix + srcRegex; | ||
| conf.set(key, targetStr); | ||
| } | ||
|
|
||
| /** | ||
| * Add config variable for homedir for default mount table | ||
| * @param conf - add to this conf | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,17 +86,34 @@ public interface Constants { | |
| */ | ||
| String CONFIG_VIEWFS_LINK_MERGE_SLASH = "linkMergeSlash"; | ||
|
|
||
| /** | ||
| * Config variable for specifying a regex link which uses regular expressions | ||
| * as source and target could use group captured in src. | ||
| * E.g. (^/(?<firstDir>\\w+), /prefix-${firstDir}) => | ||
| * (/path1/file1 => /prefix-path1/file1) | ||
| */ | ||
| String CONFIG_VIEWFS_LINK_REGEX = "linkRegex"; | ||
|
|
||
| FsPermission PERMISSION_555 = new FsPermission((short) 0555); | ||
|
|
||
| String CONFIG_VIEWFS_RENAME_STRATEGY = "fs.viewfs.rename.strategy"; | ||
|
|
||
| /** | ||
| * Enable ViewFileSystem to cache all children filesystems in inner cache. | ||
|
||
| * The children filesystems generated by regex mount points won't be cached. | ||
| */ | ||
| String CONFIG_VIEWFS_ENABLE_INNER_CACHE = "fs.viewfs.enable.inner.cache"; | ||
|
|
||
| boolean CONFIG_VIEWFS_ENABLE_INNER_CACHE_DEFAULT = true; | ||
|
|
||
| /** | ||
| * Whether to evict cached children file times on ViewFileSystem::close(). | ||
| */ | ||
| String CONFIG_VIEWFS_INNER_CACHE_EVICT_ON_CLOSE = | ||
| "fs.viewfs.inner.cache.evict.on.close"; | ||
|
|
||
| boolean CONFIG_VIEWFS_INNER_CACHE_EVICT_ON_CLOSE_DEFAULT = false; | ||
|
|
||
| /** | ||
| * Enable ViewFileSystem to show mountlinks as symlinks. | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.