diff options
author | Sudheesh Katkam <sudheesh@apache.org> | 2017-01-25 18:52:28 -0800 |
---|---|---|
committer | Sudheesh Katkam <sudheesh@apache.org> | 2017-02-24 19:01:42 -0800 |
commit | f445b08149163df465bc851b79d194fcc38ff2b2 (patch) | |
tree | cb0e9b5323ea3e679bbd927a083448ce7ba02d11 /exec/java-exec/src/main/java/org/apache/drill/exec/rpc | |
parent | d732aad2dc59d8db12f6dc64b3a4e60b470d00f6 (diff) |
DRILL-4280: HYGIENE
+ Do not recreate DrillConfig object in PamUserAuthenticator
+ Add new factory method to CaseInsensitiveMap
+ Clean documentation
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/rpc')
2 files changed, 11 insertions, 9 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/PamUserAuthenticator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/PamUserAuthenticator.java index 2928bfbcd..492b14029 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/PamUserAuthenticator.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/PamUserAuthenticator.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -39,7 +39,7 @@ public class PamUserAuthenticator implements UserAuthenticator { @Override public void setup(DrillConfig drillConfig) throws DrillbitStartupException { - profiles = DrillConfig.create().getStringList(ExecConstants.PAM_AUTHENTICATOR_PROFILES); + profiles = drillConfig.getStringList(ExecConstants.PAM_AUTHENTICATOR_PROFILES); // Create a JPAM object so that it triggers loading of native "jpamlib" needed. Issues in loading/finding native // "jpamlib" will be found it Drillbit start rather than when authenticating the first user. diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/UserAuthenticatorFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/UserAuthenticatorFactory.java index d9aa276ac..c7a1338d8 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/UserAuthenticatorFactory.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/UserAuthenticatorFactory.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -29,23 +29,23 @@ import org.apache.drill.exec.exception.DrillbitStartupException; import com.google.common.base.Strings; /** - * Factory class which provides {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator} implementation - * based on the BOOT options. + * Factory class which provides {@link UserAuthenticator} implementation based on the BOOT options. */ public class UserAuthenticatorFactory { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(UserAuthenticatorFactory.class); /** - * Create a {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator} implementation based on BOOT settings in + * Create a {@link UserAuthenticator} implementation based on BOOT settings in * given <i>drillConfig</i>. * * @param config DrillConfig containing BOOT options. - * @return Initialized {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator} implementation instance. + * @return Initialized {@link UserAuthenticator} implementation instance. * It is responsibility of the caller to close the authenticator when no longer needed. * * @throws DrillbitStartupException when no implementation found for given BOOT options. */ - public static UserAuthenticator createAuthenticator(final DrillConfig config, ScanResult scan) throws DrillbitStartupException { + public static UserAuthenticator createAuthenticator(final DrillConfig config, ScanResult scan) + throws DrillbitStartupException { final String authImplConfigured = config.getString(USER_AUTHENTICATOR_IMPL); if (Strings.isNullOrEmpty(authImplConfigured)) { @@ -55,11 +55,13 @@ public class UserAuthenticatorFactory { final Collection<Class<? extends UserAuthenticator>> authImpls = scan.getImplementations(UserAuthenticator.class); + logger.debug("Found UserAuthenticator implementations: {}", authImpls); for(Class<? extends UserAuthenticator> clazz : authImpls) { final UserAuthenticatorTemplate template = clazz.getAnnotation(UserAuthenticatorTemplate.class); if (template == null) { - logger.warn("{} doesn't have {} annotation. Skipping.", clazz.getCanonicalName(), UserAuthenticatorTemplate.class); + logger.warn("{} doesn't have {} annotation. Skipping.", clazz.getCanonicalName(), + UserAuthenticatorTemplate.class); continue; } |