bharatviswa504 commented on a change in pull request #1528: HDDS-2181. Ozone 
Manager should send correct ACL type in ACL requests…
URL: https://github.com/apache/hadoop/pull/1528#discussion_r333275611
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
 ##########
 @@ -169,7 +173,22 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
     OmKeyInfo omKeyInfo = null;
     try {
       // check Acl
-      checkBucketAcls(ozoneManager, volumeName, bucketName, keyName);
+      // Native authorizer requires client id as part of keyname to check
+      // write ACL on key. Add client id to key name if ozone native
+      // authorizer is configured.
+      Configuration config = ozoneManager.getConfiguration();
+      if (OmUtils.isNativeAuthorizerEnabled(config)) {
 
 Review comment:
   I think here, instead of reading this from config every time for each 
operation, as this is in hot path, we can make add an method in OzoneManager, 
to return true/false depending on Authorizer.
   
   
https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java#L474
   We can declare a variable boolean isNativeAuthorizer in OzoneManager. And 
set to true. And then we can expose a method to return this variable value 
through isNativeAuthorizer() 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to