diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 02fbc028bbd..b949aa98ae0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -2718,11 +2718,21 @@ public class HMaster extends HRegionServer implements MasterServices { } } - void checkInitialized() - throws PleaseHoldException, ServerNotRunningYetException, MasterNotRunningException { + public static class MasterStoppedException extends DoNotRetryIOException { + MasterStoppedException() { + super(); + } + } + + void checkInitialized() throws PleaseHoldException, ServerNotRunningYetException, + MasterNotRunningException, MasterStoppedException { checkServiceStarted(); - if (!isInitialized()) throw new PleaseHoldException("Master is initializing"); - if (isStopped()) throw new MasterNotRunningException(); + if (!isInitialized()) { + throw new PleaseHoldException("Master is initializing"); + } + if (isStopped()) { + throw new MasterStoppedException(); + } } /**