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 d22d9e19fb1..fd02a487764 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 @@ -26,6 +26,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import java.util.concurrent.Future; import java.util.regex.Pattern; @@ -58,6 +59,7 @@ import org.apache.hadoop.hbase.snapshot.HBaseSnapshotException; import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException; import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; import org.apache.hadoop.hbase.snapshot.UnknownSnapshotException; +import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; /** @@ -916,15 +918,43 @@ public interface Admin extends Abortable, Closeable { /** * Compact all regions on the region server. Asynchronous operation in that this method requests - * that a Compaction run and then it returns. It does not wait on the completion of Compaction - * (it can take a while). + * that a Compaction run and then it returns. It does not wait on the completion of Compaction (it + * can take a while). * @param sn the region server name * @param major if it's major compaction - * @throws IOException + * @throws IOException if a remote or network exception occurs * @throws InterruptedException + * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use + * {@link #compactRegionServer(ServerName)} or + * {@link #majorCompactRegionServer(ServerName)}. */ - void compactRegionServer(ServerName sn, boolean major) - throws IOException, InterruptedException; + @Deprecated + default void compactRegionServer(ServerName sn, boolean major) throws IOException, + InterruptedException { + if (major) { + majorCompactRegionServer(sn); + } else { + compactRegionServer(sn); + } + } + + /** + * Compact all regions on the region server. Asynchronous operation in that this method requests + * that a Compaction run and then it returns. It does not wait on the completion of Compaction (it + * can take a while). + * @param serverName the region server name + * @throws IOException if a remote or network exception occurs + */ + void compactRegionServer(ServerName serverName) throws IOException; + + /** + * Major compact all regions on the region server. Asynchronous operation in that this method + * requests that a Compaction run and then it returns. It does not wait on the completion of + * Compaction (it can take a while). + * @param serverName the region server name + * @throws IOException if a remote or network exception occurs + */ + void majorCompactRegionServer(ServerName serverName) throws IOException; /** * Move the region r to dest. @@ -1380,14 +1410,75 @@ public interface Admin extends Abortable, Closeable { */ ClusterStatus getClusterStatus(EnumSet