Class MappingRuleMatchers
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleMatchers
This class contains all the matcher and some helper methods to generate them.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAndMatcher is a basic boolean matcher which takes multiple other matcher as it's arguments, and on match it checks if all of them are true.static classMatchAllMatcher is a matcher which matches everything.static classOrMatcher is a basic boolean matcher which takes multiple other matcher as its arguments, and on match it checks if any of them are true.static classThe GroupMatcher will check if any of the user's groups match the provided group name.static classVariableMatcher will check if a provided variable's value matches the provided value. -
Method Summary
Modifier and TypeMethodDescriptionstatic MappingRuleMatcherConvenience method to create a matcher that matches allstatic MappingRuleMatcherConvenience method to create a variable matcher which matches against the submitted application's name.static MappingRuleMatchercreateUserGroupMatcher(String groupName) Convenience method to create a group matcher which matches against the groups of the user.static MappingRuleMatchercreateUserGroupMatcher(String userName, String groupName) Convenience method to create a composite matcher which matches against the user's user name and the user's primary group.static MappingRuleMatchercreateUserMatcher(String userName) Convenience method to create a variable matcher which matches against the username.
-
Method Details
-
createUserMatcher
Convenience method to create a variable matcher which matches against the username.- Parameters:
userName- The username to be matched- Returns:
- VariableMatcher with %user as the variable
-
createUserGroupMatcher
Convenience method to create a group matcher which matches against the groups of the user.- Parameters:
groupName- The groupName to be matched- Returns:
- UserGroupMatcher
-
createUserGroupMatcher
Convenience method to create a composite matcher which matches against the user's user name and the user's primary group. Only matches if both matches.- Parameters:
userName- The username to be matchedgroupName- The groupName to be matched- Returns:
- AndMatcher with two matchers one for userName and one for primaryGroup
-
createApplicationNameMatcher
Convenience method to create a variable matcher which matches against the submitted application's name.- Parameters:
name- The name to be matched- Returns:
- VariableMatcher with %application as the variable
-
createAllMatcher
Convenience method to create a matcher that matches all- Returns:
- MatchAllMatcher.
-