sumitagrawl commented on code in PR #4537:
URL: https://github.com/apache/ozone/pull/4537#discussion_r1159413333


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -105,7 +105,8 @@ public OMRequest preExecute(OzoneManager ozoneManager) 
throws IOException {
 
     return getOmRequest().toBuilder()
         .setCommitKeyRequest(commitKeyRequest.toBuilder()
-            .setKeyArgs(newKeyArgs)).setUserInfo(getUserInfo()).build();
+            .setKeyArgs(newKeyArgs))
+        .setUserInfo(getUserIfNotExists(ozoneManager)).build();

Review Comment:
   Its not dummy, its original request building with setting only userInfo and 
layout.
   To support modification of request content to build by parent, a builder 
need to be exposed in parent class, which derived class can manipulate.
   
   OMClientRequest {
       OMRequest.Builder builder = getOmRequest().toBuilder();
       public void preExecute(...) {
         builder
         .setUserInfo(getUserIfNotExists(ozoneManager))
         .build();
      }
   }
   DeriveClass extends OMClientRequest {
       public void preExecute(...) {
         // do modification
        builder.setCommitKeyRequest(...);
      }
   }
   
   But still we are having 2 way to get UserInfo() , This also need to support 
modify by derived class,
   --- for rpc, getUserInfo(ozoneManager)
   --- for including non-rpc also, getUserIfNotExists(ozoneManager)
   
   @adoroszlai If we need change all classes to use parent as per above way, we 
can raise another JIRA for this refactoring.
   Please suggest if we need this changes...



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