szilard-nemeth commented on code in PR #4471:
URL: https://github.com/apache/hadoop/pull/4471#discussion_r1065113707
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/CSMappingPlacementRule.java:
##########
@@ -228,7 +228,11 @@ private VariableContext createVariableContext(
ApplicationSubmissionContext asc, String user) {
VariableContext vctx = new VariableContext();
- vctx.put("%user", cleanName(user));
+ String cleanedName = cleanName(user);
+ if (!user.equals(cleanedName)) {
+ vctx.putOriginal("%user", user);
+ }
+ vctx.put("%user", cleanedName);
Review Comment:
Yeah, the whole point is that if we don't keep the originalName separately
(e.g. test.user) then the VariableMatcher will try to match for test_dot_user
instead) so subsequent mapping rule actions won't be applied.
Just try this out by commenting out the code block you think is unnecessary,
the test called
TestCSMappingPlacementRule#testOriginalUserNameWithDotCanBeUsedInMatchExpression
will fail immediately)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]