brumi1024 commented on code in PR #4471:
URL: https://github.com/apache/hadoop/pull/4471#discussion_r1064710808
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/VariableContext.java:
##########
@@ -149,6 +154,11 @@ public String get(String name) {
String ret = variables.get(name);
return ret == null ? "" : ret;
}
+
+ public String getOriginal(String name) {
+ String ret = originalVariables.get(name);
+ return ret;
Review Comment:
Nit: just for the sake of symmetry this could be inlined, like the rest of
the getters in this class.
##########
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:
Nit: is this actually needed? cleanName returns the original name if it
contains no dots, and it seems like the same logic is implemented here.
Previous uses of cleanName also didn't create this logic separately.
--
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]