diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java index 46c485b1d9a..f58c3f4de99 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java @@ -153,7 +153,9 @@ public abstract class ZKFailoverController { public HAServiceTarget getLocalTarget() { return localTarget; } - + + HAServiceState getServiceState() { return serviceState; } + public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.fatal("Automatic failover is not enabled for " + localTarget + "." + diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/MiniZKFCCluster.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/MiniZKFCCluster.java index b0d6d6250a3..5aee61166ff 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/MiniZKFCCluster.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/MiniZKFCCluster.java @@ -163,8 +163,8 @@ public class MiniZKFCCluster { */ public void waitForHAState(int idx, HAServiceState state) throws Exception { - DummyHAService svc = getService(idx); - while (svc.state != state) { + DummyZKFC svc = getZkfc(idx); + while (svc.getServiceState() != state) { ctx.checkException(); Thread.sleep(50); }