slfan1989 commented on code in PR #5169:
URL: https://github.com/apache/hadoop/pull/5169#discussion_r1040937723


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/security/RouterDelegationTokenSecretManager.java:
##########
@@ -137,6 +141,29 @@ public void storeNewToken(RMDelegationTokenIdentifier 
identifier,
     }
   }
 
+  /**
+   * The Router Supports Store new Token.
+   *
+   * @param identifier RMDelegationToken.
+   * @param tokenInfo DelegationTokenInformation.
+   */
+  public void storeNewToken(RMDelegationTokenIdentifier identifier,
+      DelegationTokenInformation tokenInfo) {
+    try {
+      String token =
+          
RouterDelegationTokenSupport.encodeDelegationTokenInformation(tokenInfo);
+      long renewDate = tokenInfo.getRenewDate();
+
+      federationFacade.storeNewToken(identifier, renewDate, token);
+    } catch (Exception e) {
+      if (!shouldIgnoreException(e)) {
+        LOG.error("Error in storing RMDelegationToken with sequence number: 
{}.",
+            identifier.getSequenceNumber());
+        ExitUtil.terminate(1, e);

Review Comment:
   Thank you for your question. In YARN Federation, for Client, Router plays a 
role similar to RM. Our code here refers to the code of RM. From my personal 
point of view, I think it should still maintain the same processing logic as 
RM, which will be better.
   
   RMDelegationTokenSecretManager#storeNewToken
   ```
    protected void storeNewToken(RMDelegationTokenIdentifier identifier,
         long renewDate) {
       try {
         LOG.info("storing RMDelegation token with sequence number: "
             + identifier.getSequenceNumber());
         rm.getRMContext().getStateStore().storeRMDelegationToken(identifier,
             renewDate);
       } catch (Exception e) {
         if (!shouldIgnoreException(e)) {
           LOG.error("Error in storing RMDelegationToken with sequence number: "
               + identifier.getSequenceNumber());
           ExitUtil.terminate(1, e);
         }
       }
     }
   ```
   



-- 
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]

Reply via email to