[
https://issues.apache.org/jira/browse/YARN-5956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15882124#comment-15882124
]
Sunil G commented on YARN-5956:
-------------------------------
Thanks [~lewuathe] for updating the patch. We are almost there.
A major comment, In getApplicationAttemptReport, getApplicationAttempts,
getContainerReport and getContaines, below code is added.
{code}
UserGroupInformation callerUGI = getCallerUgi(appId,
AuditConstants.GET_CONTAINER_REPORT);
RMApp application = verifyUserAccessForRMApp(appId, callerUGI,
AuditConstants.GET_CONTAINER_REPORT,
ApplicationAccessType.VIEW_APP);
boolean allowAccess = checkAccess(callerUGI, application.getUser(),
ApplicationAccessType.VIEW_APP, application);
{code}
Here *verifyUserAccessForRMApp* is already checking {{checkAccess}} for
*VIEW_APP* internally. SO we can avoid duplicate check in all these getters.
Then some more cleanup could be done as *allowAccess* will be true after the
new *verifyUserAccessForRMApp* call. Do you agree?
> Refactor ClientRMService
> ------------------------
>
> Key: YARN-5956
> URL: https://issues.apache.org/jira/browse/YARN-5956
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: resourcemanager
> Affects Versions: 3.0.0-alpha2
> Reporter: Kai Sasaki
> Assignee: Kai Sasaki
> Priority: Minor
> Attachments: YARN-5956.01.patch, YARN-5956.02.patch,
> YARN-5956.03.patch, YARN-5956.04.patch, YARN-5956.05.patch,
> YARN-5956.06.patch, YARN-5956.07.patch, YARN-5956.08.patch,
> YARN-5956.09.patch, YARN-5956.10.patch
>
>
> Some refactoring can be done in {{ClientRMService}}.
> - Remove redundant variable declaration
> - Fill in missing javadocs
> - Proper variable access modifier
> - Fix some typos in method name and exception messages
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]