diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index b8546fa4533..a6a42244e21 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -1,5 +1,4 @@ /** - * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -1415,15 +1414,25 @@ public interface Admin extends Abortable, Closeable { throws IOException; /** + *
* Shuts down the HBase cluster. - * + *
+ *+ * Notice that, a success shutdown call may ends with an error since the remote server has already + * been shutdown. + *
* @throws IOException if a remote or network exception occurs */ void shutdown() throws IOException; /** + ** Shuts down the current HBase master only. Does not shutdown the cluster. - * + *
+ *+ * Notice that, a success stopMaster call may ends with an error since the remote server has + * already been shutdown. + *
* @throws IOException if a remote or network exception occurs * @see #shutdown() */ diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java index 4c51026b06a..63cfe1f0c9c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java @@ -55,7 +55,6 @@ public class TestMasterShutdown { ** Starts with three masters. Tells the active master to shutdown the cluster. * Verifies that all masters are properly shutdown. - * @throws Exception */ @Test public void testMasterShutdown() throws Exception { @@ -130,17 +129,18 @@ public class TestMasterShutdown { public void run() { LOG.info("Before call to shutdown master"); try { - try (Connection connection = - ConnectionFactory.createConnection(util.getConfiguration())) { + try ( + Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) { try (Admin admin = connection.getAdmin()) { admin.shutdown(); } } - LOG.info("After call to shutdown master"); - cluster.waitOnMaster(MASTER_INDEX); } catch (Exception e) { + LOG.info("Error while calling Admin.shutdown, which is expected: " + e.getMessage()); } - }; + LOG.info("After call to shutdown master"); + cluster.waitOnMaster(MASTER_INDEX); + } }; shutdownThread.start(); LOG.info("Called master join on " + master.getName());