HADOOP-9906. Move HAZKUtil to o.a.h.util.ZKUtil and make inner-classes public (Karthik Kambatla via Sandy Ryza)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1518307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
53b04516fe
commit
f70e947392
|
@ -111,6 +111,9 @@ Release 2.1.1-beta - UNRELEASED
|
||||||
|
|
||||||
HADOOP-9886. Turn warning message in RetryInvocationHandler to debug (arpit)
|
HADOOP-9886. Turn warning message in RetryInvocationHandler to debug (arpit)
|
||||||
|
|
||||||
|
HADOOP-9906. Move HAZKUtil to o.a.h.util.ZKUtil and make inner-classes
|
||||||
|
public (Karthik Kambatla via Sandy Ryza)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.HadoopIllegalArgumentException;
|
import org.apache.hadoop.HadoopIllegalArgumentException;
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.classification.InterfaceStability;
|
import org.apache.hadoop.classification.InterfaceStability;
|
||||||
import org.apache.hadoop.ha.HAZKUtil.ZKAuthInfo;
|
import org.apache.hadoop.util.ZKUtil.ZKAuthInfo;
|
||||||
import org.apache.hadoop.util.StringUtils;
|
import org.apache.hadoop.util.StringUtils;
|
||||||
import org.apache.zookeeper.data.ACL;
|
import org.apache.zookeeper.data.ACL;
|
||||||
import org.apache.zookeeper.KeeperException;
|
import org.apache.zookeeper.KeeperException;
|
||||||
|
@ -47,7 +47,6 @@ import org.apache.zookeeper.KeeperException.Code;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,7 +36,8 @@ import org.apache.hadoop.ha.ActiveStandbyElector.ActiveNotFoundException;
|
||||||
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
||||||
import org.apache.hadoop.ha.HAServiceProtocol.StateChangeRequestInfo;
|
import org.apache.hadoop.ha.HAServiceProtocol.StateChangeRequestInfo;
|
||||||
import org.apache.hadoop.ha.HAServiceProtocol.RequestSource;
|
import org.apache.hadoop.ha.HAServiceProtocol.RequestSource;
|
||||||
import org.apache.hadoop.ha.HAZKUtil.ZKAuthInfo;
|
import org.apache.hadoop.util.ZKUtil;
|
||||||
|
import org.apache.hadoop.util.ZKUtil.ZKAuthInfo;
|
||||||
import org.apache.hadoop.ha.HealthMonitor.State;
|
import org.apache.hadoop.ha.HealthMonitor.State;
|
||||||
import org.apache.hadoop.ipc.Server;
|
import org.apache.hadoop.ipc.Server;
|
||||||
import org.apache.hadoop.security.AccessControlException;
|
import org.apache.hadoop.security.AccessControlException;
|
||||||
|
@ -313,18 +314,18 @@ public abstract class ZKFailoverController {
|
||||||
ZK_SESSION_TIMEOUT_DEFAULT);
|
ZK_SESSION_TIMEOUT_DEFAULT);
|
||||||
// Parse ACLs from configuration.
|
// Parse ACLs from configuration.
|
||||||
String zkAclConf = conf.get(ZK_ACL_KEY, ZK_ACL_DEFAULT);
|
String zkAclConf = conf.get(ZK_ACL_KEY, ZK_ACL_DEFAULT);
|
||||||
zkAclConf = HAZKUtil.resolveConfIndirection(zkAclConf);
|
zkAclConf = ZKUtil.resolveConfIndirection(zkAclConf);
|
||||||
List<ACL> zkAcls = HAZKUtil.parseACLs(zkAclConf);
|
List<ACL> zkAcls = ZKUtil.parseACLs(zkAclConf);
|
||||||
if (zkAcls.isEmpty()) {
|
if (zkAcls.isEmpty()) {
|
||||||
zkAcls = Ids.CREATOR_ALL_ACL;
|
zkAcls = Ids.CREATOR_ALL_ACL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse authentication from configuration.
|
// Parse authentication from configuration.
|
||||||
String zkAuthConf = conf.get(ZK_AUTH_KEY);
|
String zkAuthConf = conf.get(ZK_AUTH_KEY);
|
||||||
zkAuthConf = HAZKUtil.resolveConfIndirection(zkAuthConf);
|
zkAuthConf = ZKUtil.resolveConfIndirection(zkAuthConf);
|
||||||
List<ZKAuthInfo> zkAuths;
|
List<ZKAuthInfo> zkAuths;
|
||||||
if (zkAuthConf != null) {
|
if (zkAuthConf != null) {
|
||||||
zkAuths = HAZKUtil.parseAuth(zkAuthConf);
|
zkAuths = ZKUtil.parseAuth(zkAuthConf);
|
||||||
} else {
|
} else {
|
||||||
zkAuths = Collections.emptyList();
|
zkAuths = Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.mockito.Mockito;
|
||||||
import org.apache.hadoop.HadoopIllegalArgumentException;
|
import org.apache.hadoop.HadoopIllegalArgumentException;
|
||||||
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
||||||
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveNotFoundException;
|
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveNotFoundException;
|
||||||
import org.apache.hadoop.ha.HAZKUtil.ZKAuthInfo;
|
import org.apache.hadoop.util.ZKUtil.ZKAuthInfo;
|
||||||
import org.apache.hadoop.test.GenericTestUtils;
|
import org.apache.hadoop.test.GenericTestUtils;
|
||||||
|
|
||||||
public class TestActiveStandbyElector {
|
public class TestActiveStandbyElector {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.UUID;
|
||||||
import org.apache.commons.logging.impl.Log4JLogger;
|
import org.apache.commons.logging.impl.Log4JLogger;
|
||||||
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
import org.apache.hadoop.ha.ActiveStandbyElector.ActiveStandbyElectorCallback;
|
||||||
import org.apache.hadoop.ha.ActiveStandbyElector.State;
|
import org.apache.hadoop.ha.ActiveStandbyElector.State;
|
||||||
import org.apache.hadoop.ha.HAZKUtil.ZKAuthInfo;
|
import org.apache.hadoop.util.ZKUtil.ZKAuthInfo;
|
||||||
import org.apache.hadoop.util.Shell;
|
import org.apache.hadoop.util.Shell;
|
||||||
import org.apache.log4j.Level;
|
import org.apache.log4j.Level;
|
||||||
import org.apache.zookeeper.ZooDefs.Ids;
|
import org.apache.zookeeper.ZooDefs.Ids;
|
||||||
|
|
Loading…
Reference in New Issue