Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,41 @@ public static void addLinkNfly(final Configuration conf, final String src,
targets);
}


/**
* Add a LinkRegex to the config for the specified mount table.
* @param conf
* @param mountTableName
* @param srcRegex
* @param targetStr
*/
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
* @param mountTableName
* @param srcRegex
* @param targetStr
* @param interceptorSettings
*/
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,23 @@ 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";

/**
* Config capacity of mount point resolution cache.
* Value <= 0 means disable cache.
*/
String CONFIG_VIEWFS_PATH_RESOLUTION_CACHE_CAPACITY
= "fs.viewfs.path.resolution.cache.capacity";
int CONFIG_VIEWFS_PATH_RESOLUTION_CACHE_CAPACITY_DEFAULT = 0;
}
Loading