peterxcli commented on code in PR #11257:
URL: https://github.com/apache/ozone/pull/11257#discussion_r4119770509


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/S3AuthenticationContext.java:
##########


Review Comment:
   looks like this is now only used by `OMThreadContext`, if you think there 
would not be other class uses it, then we can just inline this class into 
`OMThreadContext`
   
   become:
   ```java
   public final class OMThreadContext {
       ...
       private final S3Authentication s3Auth;
       private final STSTokenIdentifier stsToken;
   
       private static void install(Server.Call call, S3Authentication s3Auth, 
STSTokenIdentifier stsToken) {
          if (call == null) {
            Server.getCurCall().remove();
          } else {
            Server.getCurCall().set(call);
          }
          OzoneManager.setS3Auth(s3Auth);
          OzoneManager.setStsTokenIdentifier(stsToken);
        }
   
        public Scope applyToCurrentThread() {
          Scope scope = new Scope(Server.getCurCall().get(), 
OzoneManager.getS3Auth(),
              OzoneManager.getStsTokenIdentifier(), createCall(userInfo));
          install(scope.currentCall, s3Auth, stsToken);
          return scope;
        }
   
        public static final class Scope implements AutoCloseable {
                ...
   
                public void close() {
                  // ...
                  install(previousCall, previousS3Auth, previousStsToken); 
                  closed = true;
                }
   ```



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