diff --git a/CHANGES.txt b/CHANGES.txt index d5099dc0aa0..99088c3ae30 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -965,6 +965,7 @@ Release 0.21.0 - Unreleased HBASE-3066 We don't put the port for hregionserver up into znode since new master HBASE-2825 Scans respect row locks + HBASE-3070 Add to hbaseadmin means of shutting down a regionserver NEW FEATURES HBASE-1961 HBase EC2 scripts diff --git a/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 279ee6ba308..c2ba277fff6 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -1006,6 +1006,16 @@ public class HBaseAdmin implements Abortable { } } + /** + * Stop the designated regionserver. + * @throws IOException if a remote or network exception occurs + */ + public synchronized void stopRegionServer(final HServerAddress hsa) + throws IOException { + HRegionInterface rs = this.connection.getHRegionConnection(hsa); + rs.stop("Called by admin client " + this.connection.toString()); + } + /** * @return cluster status * @throws IOException if a remote or network exception occurs diff --git a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index fbdec0b375c..dc3f68c90e0 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -64,7 +64,6 @@ import org.apache.hadoop.hbase.util.SoftValueSortedMap; import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.hbase.zookeeper.RootRegionTracker; import org.apache.hadoop.hbase.zookeeper.ZKTableDisable; -import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.ipc.RemoteException; import org.apache.zookeeper.KeeperException; @@ -271,6 +270,12 @@ public class HConnectionManager { this.masterChecked = false; } + @Override + public String toString() { + // Return our zk identifier ... it 'hconnection + zk sessionid'. + return this.zooKeeper.toString(); + } + private long getPauseTime(int tries) { int ntries = tries; if (ntries >= HConstants.RETRY_BACKOFF.length) {