File tree Expand file tree Collapse file tree
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import static org .apache .hadoop .fs .CommonConfigurationKeys .HADOOP_KERBEROS_MIN_SECONDS_BEFORE_RELOGIN_DEFAULT ;
2222import static org .apache .hadoop .fs .CommonConfigurationKeys .HADOOP_USER_GROUP_METRICS_PERCENTILES_INTERVALS ;
2323import static org .apache .hadoop .fs .CommonConfigurationKeysPublic .HADOOP_TOKEN_FILES ;
24+ import static org .apache .hadoop .fs .CommonConfigurationKeysPublic .HADOOP_SECURITY_GROUPS_CACHE_SECS ;
25+ import static org .apache .hadoop .fs .CommonConfigurationKeysPublic .HADOOP_SECURITY_GROUPS_CACHE_SECS_DEFAULT ;
2426import static org .apache .hadoop .security .UGIExceptionMessages .*;
2527import static org .apache .hadoop .util .PlatformName .IBM_JAVA ;
2628
@@ -304,6 +306,11 @@ private static void ensureInitialized() {
304306 private static synchronized void initialize (Configuration conf ,
305307 boolean overrideNameRules ) {
306308 authenticationMethod = SecurityUtil .getAuthenticationMethod (conf );
309+ long cacheTimeout = conf .getLong (HADOOP_SECURITY_GROUPS_CACHE_SECS , HADOOP_SECURITY_GROUPS_CACHE_SECS_DEFAULT ) * 1000 ;
310+ if (cacheTimeout <=0 ){
311+ throw new IllegalArgumentException ("hadoop.security.groups.cache.secs should be larger than 0" ,
312+ new IllegalArgumentException ("hadoop.security.groups.cache.secs should be larger than 0" ));
313+ }
307314 if (overrideNameRules || !HadoopKerberosName .hasRulesBeenSet ()) {
308315 try {
309316 HadoopKerberosName .setConfiguration (conf );
You can’t perform that action at this time.
0 commit comments