java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.placement.csmappingrule.MappingRuleMatchers

public class MappingRuleMatchers extends Object
This class contains all the matcher and some helper methods to generate them.
  • Method Details

    • createUserMatcher

      public static MappingRuleMatcher createUserMatcher(String userName)
      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

      public static MappingRuleMatcher createUserGroupMatcher(String groupName)
      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

      public static MappingRuleMatcher createUserGroupMatcher(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. Only matches if both matches.
      Parameters:
      userName - The username to be matched
      groupName - The groupName to be matched
      Returns:
      AndMatcher with two matchers one for userName and one for primaryGroup
    • createApplicationNameMatcher

      public static MappingRuleMatcher createApplicationNameMatcher(String name)
      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

      public static MappingRuleMatcher createAllMatcher()
      Convenience method to create a matcher that matches all
      Returns:
      MatchAllMatcher.