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 aa2213043b2..dcab9f42dbb 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 @@ -2729,11 +2729,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(); + } } /**