avijayanhwx commented on a change in pull request #2635:
URL: https://github.com/apache/ozone/pull/2635#discussion_r710303802



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSecretManager.java
##########
@@ -157,11 +161,23 @@ public Builder setOmServiceId(String serviceId) {
       this.omServiceId = serviceId;
       return this;
     }
+
+    public Builder setOMMultiTenantManager(OMMultiTenantManager
+                                               multiTenantManager) {
+      this.omMultiTenantManager = multiTenantManager;
+      return this;
+    }
+
   }
 
   @Override
   public OzoneTokenIdentifier createIdentifier() {
-    return OzoneTokenIdentifier.newInstance();
+    OzoneTokenIdentifier tokenId = OzoneTokenIdentifier.newInstance();
+    if (multiTenantManager != null) {
+      tokenId.setGetUserForAccessId(
+          multiTenantManager::getUserNameGivenAccessId);

Review comment:
       I don't mind moving the functional reference one step higher. The reason 
I kept a reference of the MultiTenantManager instance inside the ODTSM is 
because this class is a "management" class and is long lived. As opposed to the 
OzoneTokenIdentifier class that is a short lived entity. I do not see any more 
uses of the OMTM in the ODTSM as of now though. 




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