tillrohrmann commented on a change in pull request #11189: 
[FLINK-16236][yarn][hotfix] fix Yarn secure test not loading correct context 
factory
URL: https://github.com/apache/flink/pull/11189#discussion_r394865266
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/security/contexts/HadoopSecurityContextFactory.java
 ##########
 @@ -53,17 +54,13 @@ public boolean isCompatibleWith(SecurityConfiguration 
securityConfig) {
        }
 
        @Override
-       public SecurityContext createContext(SecurityConfiguration 
securityConfig) {
+       public SecurityContext createContext(SecurityConfiguration 
securityConfig) throws SecurityContextInitializeException {
                try {
-                       Class.forName(
-                               
"org.apache.hadoop.security.UserGroupInformation",
-                               false,
-                               
HadoopSecurityContextFactory.class.getClassLoader());
                        UserGroupInformation loginUser = 
UserGroupInformation.getLoginUser();
 
 Review comment:
   I think the reflective lookup of the class `UserGroupInformation` is useless 
if we directly depend on `UserGroupInformation` here. If Hadoop is not on the 
classpath, then this whole class won't load due to this. I think this defies 
the purpose of the reflective lookup.

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

Reply via email to