From 38dedc2f07ea1d4052422b31d0358ef89262936d Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Sat, 11 Oct 2014 18:32:47 -0700 Subject: [PATCH] YARN-2668 yarn-registry JAR won't link against ZK 3.4.5. (stevel) --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../hadoop/registry/client/impl/zk/RegistrySecurity.java | 6 +++--- .../registry/client/impl/zk/ZookeeperConfigOptions.java | 2 +- .../registry/secure/TestSecureRMRegistryOperations.java | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 70a6f08212b..97b44bf5dd5 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -589,6 +589,8 @@ Release 2.6.0 - UNRELEASED YARN-2652 Add hadoop-yarn-registry package under hadoop-yarn. (stevel) + YARN-2668 yarn-registry JAR won't link against ZK 3.4.5. (stevel) + YARN-2598 GHS should show N/A instead of null for the inaccessible information (Zhijie Shen via mayank) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java index 6484d287f3e..6d5792eabc4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java @@ -31,7 +31,6 @@ import org.apache.hadoop.service.ServiceStateException; import org.apache.hadoop.util.ZKUtil; import org.apache.zookeeper.Environment; import org.apache.zookeeper.ZooDefs; -import org.apache.zookeeper.client.ZooKeeperSaslClient; import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.Id; import org.apache.zookeeper.server.auth.DigestAuthenticationProvider; @@ -758,7 +757,7 @@ public class RegistrySecurity extends AbstractService { * Important:This is JVM-wide */ public static void disableZookeeperClientSASL() { - System.setProperty(ZooKeeperSaslClient.ENABLE_CLIENT_SASL_KEY, "false"); + System.setProperty(ZookeeperConfigOptions.PROP_ZK_ENABLE_SASL_CLIENT, "false"); } /** @@ -766,7 +765,8 @@ public class RegistrySecurity extends AbstractService { * @return true if the SASL client system property is set. */ public static boolean isClientSASLEnabled() { - return ZooKeeperSaslClient.isEnabled(); + return Boolean.valueOf(System.getProperty( + ZookeeperConfigOptions.PROP_ZK_ENABLE_SASL_CLIENT, "true")); } /** diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java index 711e27c9c1d..d81f24b7d64 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ZookeeperConfigOptions.java @@ -47,7 +47,7 @@ public interface ZookeeperConfigOptions { * but revert to classic authentication/anonymous access on failure. */ String PROP_ZK_ENABLE_SASL_CLIENT = - ZooKeeperSaslClient.ENABLE_CLIENT_SASL_KEY; + "zookeeper.sasl.client"; /** * Default flag for the ZK client: {@value}. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureRMRegistryOperations.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureRMRegistryOperations.java index bb953405d40..41760d644ef 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureRMRegistryOperations.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/test/java/org/apache/hadoop/registry/secure/TestSecureRMRegistryOperations.java @@ -138,8 +138,6 @@ public class TestSecureRMRegistryOperations extends AbstractSecureRegistryTest { assertFalse("RegistrySecurity.isClientSASLEnabled()==true", RegistrySecurity.isClientSASLEnabled()); - assertFalse("ZooKeeperSaslClient.isEnabled()==true", - ZooKeeperSaslClient.isEnabled()); operations.list(PATH_SYSTEM_SERVICES); }