Skip to content

Commit 6d001e5

Browse files
committed
Address review comments.
1 parent 5d3699f commit 6d001e5

3 files changed

Lines changed: 3 additions & 86 deletions

File tree

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package org.apache.hadoop.security;
1919

20-
import org.apache.hadoop.HadoopIllegalArgumentException;
2120
import org.apache.hadoop.classification.InterfaceAudience;
2221
import org.apache.hadoop.classification.InterfaceStability;
2322
import org.apache.hadoop.conf.Configuration;
@@ -49,14 +48,7 @@ private static synchronized String getSynchronously() {
4948
HADOOP_SECURITY_SASL_MECHANISM_DEFAULT);
5049
LOG.debug("{} = {} (conf)", HADOOP_SECURITY_SASL_MECHANISM_KEY, confValue);
5150

52-
if (envValue != null && confValue != null) {
53-
if (!envValue.equals(confValue)) {
54-
throw new HadoopIllegalArgumentException("SASL Mechanism mismatched: env "
55-
+ SASL_MECHANISM_ENV + " is " + envValue + " but conf "
56-
+ HADOOP_SECURITY_SASL_MECHANISM_KEY + " is " + confValue);
57-
}
58-
}
59-
51+
// env has a higher precedence than conf
6052
mechanism = envValue != null ? envValue
6153
: confValue != null ? confValue
6254
: HADOOP_SECURITY_SASL_MECHANISM_DEFAULT;
@@ -69,8 +61,8 @@ public static String getMechanism() {
6961
return value != null ? value : getSynchronously();
7062
}
7163

72-
public static boolean isDefaultMechanism(String mechanism) {
73-
return HADOOP_SECURITY_SASL_MECHANISM_DEFAULT.equals(mechanism);
64+
public static boolean isDefaultMechanism(String saslMechanism) {
65+
return HADOOP_SECURITY_SASL_MECHANISM_DEFAULT.equals(saslMechanism);
7466
}
7567

7668
private SaslMechanismFactory() {}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ private AuthMethod(byte code, String mechanismName) {
241241
AuthMethod(byte code, Supplier<String> mechanismName) {
242242
this.code = code;
243243
this.mechanismName = mechanismName;
244-
LOG.debug("{} {}: code={}, mechanism=\"{}\"",
245-
getClass().getSimpleName(), name(), code, mechanismName);
246244
}
247245

248246
private static final int FIRST_CODE = values()[0].code;

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestAuthMethod.java

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)