Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public Groups(Configuration conf, final Timer timer) {
JniBasedUnixGroupsMappingWithFallback.class,
GroupMappingServiceProvider.class),
conf);

cacheTimeout =
conf.getLong(CommonConfigurationKeys.HADOOP_SECURITY_GROUPS_CACHE_SECS,
CommonConfigurationKeys.HADOOP_SECURITY_GROUPS_CACHE_SECS_DEFAULT) * 1000;
Expand All @@ -131,7 +130,11 @@ public Groups(Configuration conf, final Timer timer) {
CommonConfigurationKeys.
HADOOP_SECURITY_GROUPS_CACHE_BACKGROUND_RELOAD_THREADS_DEFAULT);
parseStaticMapping(conf);

if(cacheTimeout<=0){
throw new IllegalArgumentException(
"hadoop.security.groups.cache.secs should be larger than 0",
new IllegalArgumentException("hadoop.security.groups.cache.secs should be larger than 0"));
}
this.timer = timer;
this.cache = CacheBuilder.newBuilder()
.refreshAfterWrite(cacheTimeout, TimeUnit.MILLISECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Expand Down