瀏覽代碼

YARN-2668 yarn-registry JAR won't link against ZK 3.4.5. (stevel)

Steve Loughran 10 年之前
父節點
當前提交
38dedc2f07

+ 2 - 0
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)
 

+ 3 - 3
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 {
    * <b>Important:</b>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"));
   }
 
   /**

+ 1 - 1
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}.

+ 0 - 2
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);
   }