public class MappingRule extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_MAPPING |
static String |
GROUP_MAPPING |
static String |
USER_MAPPING |
Constructor and Description |
---|
MappingRule(MappingRuleMatcher matcher,
MappingRuleAction action) |
Modifier and Type | Method and Description |
---|---|
static MappingRule |
createLegacyRule(String source,
String path)
Creates a MappingRule object from the legacy style configuration.
|
static MappingRule |
createLegacyRule(String type,
String source,
String path)
Creates a MappingRule object from the legacy style configuration.
|
MappingRuleResult |
evaluate(VariableContext variables)
This method evaluates the rule, and returns the MappingRuleResult, if
the rule matches, skip action otherwise.
|
MappingRuleResult |
getFallback()
Returns the associated action's fallback.
|
String |
toString() |
void |
validate(MappingRuleValidationContext ctx) |
public static final String USER_MAPPING
public static final String GROUP_MAPPING
public static final String APPLICATION_MAPPING
public MappingRule(MappingRuleMatcher matcher, MappingRuleAction action)
public MappingRuleResult evaluate(VariableContext variables)
variables
- The variable context, which contains all the variablespublic MappingRuleResult getFallback()
public static MappingRule createLegacyRule(String source, String path)
source
- This part of the rule determines which applications the rule
will be appliedpath
- The path where the application is to be placedpublic static MappingRule createLegacyRule(String type, String source, String path)
type
- The type of the rule, can be
'u' for user mapping, 'g' for group mapping or
'a' for application mappingsource
- This part of the rule determines which submissions this rule
should apply to (eg. if type is 'u', source will match
against the user name)path
- The path where the application is to be placedpublic void validate(MappingRuleValidationContext ctx) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.