[
https://issues.apache.org/jira/browse/YARN-11502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17728781#comment-17728781
]
ASF GitHub Bot commented on YARN-11502:
---------------------------------------
slfan1989 commented on code in PR #5705:
URL: https://github.com/apache/hadoop/pull/5705#discussion_r1214487424
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java:
##########
@@ -590,18 +590,9 @@ private Map<String, Token<AMRMTokenIdentifier>>
recoverSubClusterAMRMTokenIdenti
// Save the registration request. This will be used for registering with
// secondary sub-clusters using UAMs, as well as re-register later
this.amRegistrationRequest = request;
- if (getNMStateStore() != null) {
- try {
- RegisterApplicationMasterRequestPBImpl pb =
- (RegisterApplicationMasterRequestPBImpl)
- this.amRegistrationRequest;
- getNMStateStore().storeAMRMProxyAppContextEntry(this.attemptId,
- NMSS_REG_REQUEST_KEY, pb.getProto().toByteArray());
- } catch (Exception e) {
- LOG.error("Error storing AMRMProxy application context entry for "
- + this.attemptId, e);
- }
- }
+ RegisterApplicationMasterRequestPBImpl requestPB =
(RegisterApplicationMasterRequestPBImpl)
Review Comment:
Thank you very much for your help reviewing the code, I have fixed this
issue.
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java:
##########
@@ -590,18 +590,9 @@ private Map<String, Token<AMRMTokenIdentifier>>
recoverSubClusterAMRMTokenIdenti
// Save the registration request. This will be used for registering with
// secondary sub-clusters using UAMs, as well as re-register later
this.amRegistrationRequest = request;
- if (getNMStateStore() != null) {
- try {
- RegisterApplicationMasterRequestPBImpl pb =
- (RegisterApplicationMasterRequestPBImpl)
- this.amRegistrationRequest;
- getNMStateStore().storeAMRMProxyAppContextEntry(this.attemptId,
- NMSS_REG_REQUEST_KEY, pb.getProto().toByteArray());
- } catch (Exception e) {
- LOG.error("Error storing AMRMProxy application context entry for "
- + this.attemptId, e);
- }
- }
+ RegisterApplicationMasterRequestPBImpl requestPB =
(RegisterApplicationMasterRequestPBImpl)
Review Comment:
Thank you very much for your help reviewing the code! I have fixed this
issue.
> Refactor AMRMProxy#FederationInterceptor#registerApplicationMaster
> ------------------------------------------------------------------
>
> Key: YARN-11502
> URL: https://issues.apache.org/jira/browse/YARN-11502
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: amrmproxy, federation, nodemanager
> Affects Versions: 3.4.0
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Major
> Labels: pull-request-available
>
> Refactor the code of FederationInterceptor#registerApplicationMaster to
> improve code readability and remove redundancy.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]