Skip to content

Commit 133fac4

Browse files
authored
Update Groups.java
1 parent 31aa4f5 commit 133fac4

File tree

1 file changed

+5
-1
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security

1 file changed

+5
-1
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ public Groups(Configuration conf, final Timer timer) {
131131
CommonConfigurationKeys.
132132
HADOOP_SECURITY_GROUPS_CACHE_BACKGROUND_RELOAD_THREADS_DEFAULT);
133133
parseStaticMapping(conf);
134-
134+
if(cacheTimeout<=0){
135+
throw new IllegalArgumentException(
136+
"hadoop.security.groups.cache.secs should be larger than 0",
137+
new IllegalArgumentException("hadoop.security.groups.cache.secs should be larger than 0"));
138+
}
135139
this.timer = timer;
136140
this.cache = CacheBuilder.newBuilder()
137141
.refreshAfterWrite(cacheTimeout, TimeUnit.MILLISECONDS)

0 commit comments

Comments
 (0)