hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [2/2] hbase git commit: HBASE-14767 - Remove deprecated functions from HBaseAdmin Deprecated in HBASE-12083 (1.0.0, 2.0.0, 0.99.2) - HBaseAdmin(Configuration)
Date Sat, 07 Nov 2015 02:24:03 GMT
HBASE-14767 - Remove deprecated functions from HBaseAdmin Deprecated in HBASE-12083 (1.0.0, 2.0.0, 0.99.2) - HBaseAdmin(Configuration)

  Deprecated in HBASE-10479 (0.99.0, hbase-10070)
  - HBaseAdmin(Connection)

  Deprecated in HBASE-11826 (0.99.0, 1.0.0, 2.0.0)
  - flush()
  - compact()
  - majorCompact()
  - split()
  - getCompactionState()

- Changes many declarations from HBaseAdmin to Admin
(Apekshit)

Signed-off-by: stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/08963189
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/08963189
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/08963189

Branch: refs/heads/master
Commit: 08963189a298504e4e4ae70a1a139112a2eba59e
Parents: 9cce912
Author: Apekshit(Appy) Sharma <appy@cloudera.com>
Authored: Wed Nov 4 21:32:18 2015 -0800
Committer: stack <stack@apache.org>
Committed: Fri Nov 6 16:23:55 2015 -1000

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/HBaseAdmin.java  | 233 -------------------
 .../hadoop/hbase/mob/ExpiredMobFileCleaner.java |  11 +-
 .../hadoop/hbase/mob/mapreduce/Sweeper.java     |  11 +-
 .../hadoop/hbase/HBaseTestingUtility.java       |  22 +-
 .../apache/hadoop/hbase/TestAcidGuarantees.java |   4 +-
 .../org/apache/hadoop/hbase/TestIOFencing.java  |   4 +-
 .../apache/hadoop/hbase/client/TestAdmin1.java  |   2 +-
 .../apache/hadoop/hbase/client/TestAdmin2.java  |  10 +-
 .../hadoop/hbase/client/TestFromClientSide.java |  35 ++-
 .../hbase/client/TestFromClientSide3.java       |  31 ++-
 .../hadoop/hbase/filter/TestFilterWrapper.java  |   4 +-
 .../hbase/io/encoding/TestChangingEncoding.java |   2 +-
 .../encoding/TestLoadAndSwitchEncodeOnDisk.java |   4 +-
 .../master/TestAssignmentManagerOnCluster.java  |   3 +-
 .../hbase/master/TestMasterStatusServlet.java   |  12 +-
 .../master/handler/TestEnableTableHandler.java  |  22 +-
 .../hbase/mob/TestMobDataBlockEncoding.java     |   8 +-
 .../hbase/namespace/TestNamespaceAuditor.java   |   4 +-
 .../hbase/regionserver/TestCompactionState.java |  14 +-
 .../hbase/regionserver/TestMobStoreScanner.java |   4 +-
 .../regionserver/TestRegionServerMetrics.java   |   4 +-
 .../regionserver/TestRemoveRegionMetrics.java   |   4 +-
 .../regionserver/TestScannerWithBulkload.java   |   9 +-
 .../TestSplitTransactionOnCluster.java          |  29 ++-
 .../regionserver/TestSplitWalDataLoss.java      |   4 +-
 .../TestCompactionWithThroughputController.java |   4 +-
 .../replication/TestReplicationSmallTests.java  |   9 +-
 ...sibilityLabelReplicationWithExpAsString.java |   6 +-
 .../TestVisibilityLabelsReplication.java        |   6 +-
 .../hadoop/hbase/util/BaseTestHBaseFsck.java    |   6 +-
 .../hadoop/hbase/util/TestHBaseFsckTwoRS.java   |   2 +-
 .../util/hbck/OfflineMetaRebuildTestCore.java   |  16 --
 hbase-shell/src/main/ruby/hbase/admin.rb        |  77 +++---
 .../hadoop/hbase/thrift/ThriftServerRunner.java |  25 +-
 src/main/asciidoc/_chapters/cp.adoc             |  10 +-
 src/main/asciidoc/_chapters/external_apis.adoc  |   5 +-
 36 files changed, 210 insertions(+), 446 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
index 82bfee7..ba369c0 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
@@ -210,52 +210,17 @@ public class HBaseAdmin implements Admin {
   private final int retryLongerMultiplier;
   private final int syncWaitTimeout;
   private boolean aborted;
-  private boolean cleanupConnectionOnClose = false; // close the connection in close()
-  private boolean closed = false;
   private int operationTimeout;
 
   private RpcRetryingCallerFactory rpcCallerFactory;
 
   private NonceGenerator ng;
 
-  /**
-   * Constructor.
-   * See {@link #HBaseAdmin(Connection connection)}
-   *
-   * @param c Configuration object. Copied internally.
-   * @deprecated Constructing HBaseAdmin objects manually has been deprecated.
-   * Use {@link Connection#getAdmin()} to obtain an instance of {@link Admin} instead.
-   */
-  @Deprecated
-  public HBaseAdmin(Configuration c)
-  throws MasterNotRunningException, ZooKeeperConnectionException, IOException {
-    this(ConnectionFactory.createConnection(new Configuration(c)));
-    this.cleanupConnectionOnClose = true;
-  }
-
   @Override
   public int getOperationTimeout() {
     return operationTimeout;
   }
 
-
-  /**
-   * Constructor for externally managed Connections.
-   * The connection to master will be created when required by admin functions.
-   *
-   * @param connection The Connection instance to use
-   * @throws MasterNotRunningException
-   * @throws ZooKeeperConnectionException are not
-   *  thrown anymore but kept into the interface for backward api compatibility
-   * @deprecated Constructing HBaseAdmin objects manually has been deprecated.
-   * Use {@link Connection#getAdmin()} to obtain an instance of {@link Admin} instead.
-   */
-  @Deprecated
-  public HBaseAdmin(Connection connection)
-      throws MasterNotRunningException, ZooKeeperConnectionException {
-    this((ClusterConnection)connection);
-  }
-
   HBaseAdmin(ClusterConnection connection) {
     this.conf = connection.getConfiguration();
     this.connection = connection;
@@ -1854,31 +1819,6 @@ public class HBaseAdmin implements Admin {
     flush(regionServerPair.getSecond(), regionServerPair.getFirst());
   }
 
-  /**
-   * @deprecated Use {@link #flush(org.apache.hadoop.hbase.TableName)} or {@link #flushRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void flush(final String tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    flush(Bytes.toBytes(tableNameOrRegionName));
-  }
-
-  /**
-   * @deprecated Use {@link #flush(org.apache.hadoop.hbase.TableName)} or {@link #flushRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void flush(final byte[] tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    try {
-      flushRegion(tableNameOrRegionName);
-    } catch (IllegalArgumentException e) {
-      // Unknown region.  Try table.
-      flush(TableName.valueOf(tableNameOrRegionName));
-    }
-  }
-
   private void flush(final ServerName sn, final HRegionInfo hri)
   throws IOException {
     AdminService.BlockingInterface admin = this.connection.getAdmin(sn);
@@ -1910,30 +1850,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #compact(org.apache.hadoop.hbase.TableName)} or {@link #compactRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void compact(final String tableNameOrRegionName)
-  throws IOException {
-    compact(Bytes.toBytes(tableNameOrRegionName));
-  }
-
-  /**
-   * @deprecated Use {@link #compact(org.apache.hadoop.hbase.TableName)} or {@link #compactRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void compact(final byte[] tableNameOrRegionName)
-  throws IOException {
-    try {
-      compactRegion(tableNameOrRegionName, null, false);
-    } catch (IllegalArgumentException e) {
-      compact(TableName.valueOf(tableNameOrRegionName), null, false, CompactType.NORMAL);
-    }
-  }
-
-  /**
    * {@inheritDoc}
    */
   @Override
@@ -1952,31 +1868,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #compact(org.apache.hadoop.hbase.TableName)} or {@link #compactRegion
-   * (byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void compact(String tableOrRegionName, String columnFamily)
-    throws IOException {
-    compact(Bytes.toBytes(tableOrRegionName), Bytes.toBytes(columnFamily));
-  }
-
-  /**
-   * @deprecated Use {@link #compact(org.apache.hadoop.hbase.TableName)} or {@link #compactRegion
-   * (byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void compact(final byte[] tableNameOrRegionName, final byte[] columnFamily)
-  throws IOException {
-    try {
-      compactRegion(tableNameOrRegionName, columnFamily, false);
-    } catch (IllegalArgumentException e) {
-      // Bad region, try table
-      compact(TableName.valueOf(tableNameOrRegionName), columnFamily, false, CompactType.NORMAL);
-    }
-  }
-
-  /**
    * {@inheritDoc}
    */
   @Override
@@ -2006,31 +1897,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #majorCompact(org.apache.hadoop.hbase.TableName)} or {@link
-   * #majorCompactRegion(byte[])} instead.
-   */
-  @Deprecated
-  public void majorCompact(final String tableNameOrRegionName)
-  throws IOException {
-    majorCompact(Bytes.toBytes(tableNameOrRegionName));
-  }
-
-  /**
-   * @deprecated Use {@link #majorCompact(org.apache.hadoop.hbase.TableName)} or {@link
-   * #majorCompactRegion(byte[])} instead.
-   */
-  @Deprecated
-  public void majorCompact(final byte[] tableNameOrRegionName)
-  throws IOException {
-    try {
-      compactRegion(tableNameOrRegionName, null, true);
-    } catch (IllegalArgumentException e) {
-      // Invalid region, try table
-      compact(TableName.valueOf(tableNameOrRegionName), null, true, CompactType.NORMAL);
-    }
-  }
-
-  /**
    * {@inheritDoc}
    */
   @Override
@@ -2049,31 +1915,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #majorCompact(org.apache.hadoop.hbase.TableName,
-   * byte[])} or {@link #majorCompactRegion(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void majorCompact(final String tableNameOrRegionName, final String columnFamily)
-  throws IOException {
-    majorCompact(Bytes.toBytes(tableNameOrRegionName), Bytes.toBytes(columnFamily));
-  }
-
-  /**
-   * @deprecated Use {@link #majorCompact(org.apache.hadoop.hbase.TableName,
-   * byte[])} or {@link #majorCompactRegion(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void majorCompact(final byte[] tableNameOrRegionName, final byte[] columnFamily)
-  throws IOException {
-    try {
-      compactRegion(tableNameOrRegionName, columnFamily, true);
-    } catch (IllegalArgumentException e) {
-      // Invalid region, try table
-      compact(TableName.valueOf(tableNameOrRegionName), columnFamily, true, CompactType.NORMAL);
-    }
-  }
-
-  /**
    * Compact a table.
    * Asynchronous operation.
    *
@@ -2479,26 +2320,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName)} or {@link #splitRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void split(final String tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    split(Bytes.toBytes(tableNameOrRegionName));
-  }
-
-  /**
-   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName)} or {@link #splitRegion
-   * (byte[])} instead.
-   */
-  @Deprecated
-  public void split(final byte[] tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    split(tableNameOrRegionName, null);
-  }
-
-  /**
    * {@inheritDoc}
    */
   @Override
@@ -2555,31 +2376,6 @@ public class HBaseAdmin implements Admin {
     split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint);
   }
 
-  /**
-   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName,
-   * byte[])} or {@link #splitRegion(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void split(final String tableNameOrRegionName,
-    final String splitPoint) throws IOException {
-    split(Bytes.toBytes(tableNameOrRegionName), Bytes.toBytes(splitPoint));
-  }
-
-  /**
-   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName,
-   * byte[])} or {@link #splitRegion(byte[], byte[])} instead.
-   */
-  @Deprecated
-  public void split(final byte[] tableNameOrRegionName,
-      final byte [] splitPoint) throws IOException {
-    try {
-      splitRegion(tableNameOrRegionName, splitPoint);
-    } catch (IllegalArgumentException e) {
-      // Bad region, try table
-      split(TableName.valueOf(tableNameOrRegionName), splitPoint);
-    }
-  }
-
   @VisibleForTesting
   public void split(final ServerName sn, final HRegionInfo hri,
       byte[] splitPoint) throws IOException {
@@ -3077,10 +2873,6 @@ public class HBaseAdmin implements Admin {
 
   @Override
   public synchronized void close() throws IOException {
-    if (cleanupConnectionOnClose && this.connection != null && !this.closed) {
-      this.connection.close();
-      this.closed = true;
-    }
   }
 
   /**
@@ -3240,31 +3032,6 @@ public class HBaseAdmin implements Admin {
   }
 
   /**
-   * @deprecated Use {@link #getCompactionState(org.apache.hadoop.hbase.TableName)} or {@link
-   * #getCompactionStateForRegion(byte[])} instead.
-   */
-  @Deprecated
-  public CompactionState getCompactionState(final String tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    return getCompactionState(Bytes.toBytes(tableNameOrRegionName));
-  }
-
-  /**
-   * @deprecated Use {@link #getCompactionState(org.apache.hadoop.hbase.TableName)} or {@link
-   * #getCompactionStateForRegion(byte[])} instead.
-   */
-  @Deprecated
-  public CompactionState getCompactionState(final byte[] tableNameOrRegionName)
-  throws IOException, InterruptedException {
-    try {
-      return getCompactionStateForRegion(tableNameOrRegionName);
-    } catch (IllegalArgumentException e) {
-      // Invalid region, try table
-      return getCompactionState(TableName.valueOf(tableNameOrRegionName));
-    }
-  }
-
-  /**
    * Take a snapshot for the given table. If the table is enabled, a FLUSH-type snapshot will be
    * taken. If the table is disabled, an offline snapshot is taken.
    * <p>

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
index a43e6e7..7279c99 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
@@ -31,6 +31,9 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -95,7 +98,8 @@ public class ExpiredMobFileCleaner extends Configured implements Tool {
     String familyName = args[1];
     TableName tn = TableName.valueOf(tableName);
     HBaseAdmin.checkHBaseAvailable(getConf());
-    HBaseAdmin admin = new HBaseAdmin(getConf());
+    Connection connection = ConnectionFactory.createConnection(getConf());
+    Admin admin = connection.getAdmin();
     try {
       HTableDescriptor htd = admin.getTableDescriptor(tn);
       HColumnDescriptor family = htd.getFamily(Bytes.toBytes(familyName));
@@ -114,6 +118,11 @@ public class ExpiredMobFileCleaner extends Configured implements Tool {
       } catch (IOException e) {
         LOG.error("Failed to close the HBaseAdmin.", e);
       }
+      try {
+        connection.close();
+      } catch (IOException e) {
+        LOG.error("Failed to close the connection.", e);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java
index e20186e..8547c8c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/Sweeper.java
@@ -29,6 +29,9 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.util.Tool;
@@ -65,7 +68,8 @@ public class Sweeper extends Configured implements Tool {
     Configuration conf = getConf();
     // make sure the target HBase exists.
     HBaseAdmin.checkHBaseAvailable(conf);
-    HBaseAdmin admin = new HBaseAdmin(conf);
+    Connection connection = ConnectionFactory.createConnection(getConf());
+    Admin admin = connection.getAdmin();
     try {
       FileSystem fs = FileSystem.get(conf);
       TableName tn = TableName.valueOf(tableName);
@@ -86,6 +90,11 @@ public class Sweeper extends Configured implements Tool {
       } catch (IOException e) {
         System.out.println("Failed to close the HBaseAdmin: " + e.getMessage());
       }
+      try {
+        connection.close();
+      } catch (IOException e) {
+        System.out.println("Failed to close the connection: " + e.getMessage());
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 021f626..137e6f3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -58,6 +58,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.BufferedMutator;
+import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Consistency;
@@ -1176,7 +1177,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
    */
   public void shutdownMiniHBaseCluster() throws IOException {
     if (hbaseAdmin != null) {
-      hbaseAdmin.close0();
+      hbaseAdmin.close();
       hbaseAdmin = null;
     }
 
@@ -2693,28 +2694,13 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
   public synchronized HBaseAdmin getHBaseAdmin()
   throws IOException {
     if (hbaseAdmin == null){
-      this.hbaseAdmin = new HBaseAdminForTests(getConnection());
+      this.hbaseAdmin = (HBaseAdmin) getConnection().getAdmin();
     }
     return hbaseAdmin;
   }
 
-  private HBaseAdminForTests hbaseAdmin = null;
-  private static class HBaseAdminForTests extends HBaseAdmin {
-    public HBaseAdminForTests(Connection connection) throws MasterNotRunningException,
-        ZooKeeperConnectionException, IOException {
-      super(connection);
-    }
-
-    @Override
-    public synchronized void close() throws IOException {
-      LOG.warn("close() called on HBaseAdmin instance returned from " +
-        "HBaseTestingUtility.getHBaseAdmin()");
-    }
+  private HBaseAdmin hbaseAdmin = null;
 
-    private synchronized void close0() throws IOException {
-      super.close();
-    }
-  }
 
   /**
    * Returns a ZooKeeperWatcher instance.

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
index 27b480d..5450148 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java
@@ -28,10 +28,10 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.MultithreadedTestUtil.RepeatingTestThread;
 import org.apache.hadoop.hbase.MultithreadedTestUtil.TestContext;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -304,7 +304,7 @@ public class TestAcidGuarantees implements Tool {
     }
     // Add a flusher
     ctx.addThread(new RepeatingTestThread(ctx) {
-      HBaseAdmin admin = util.getHBaseAdmin();
+      Admin admin = util.getHBaseAdmin();
       public void doAnAction() throws Exception {
         try {
           admin.flush(TABLE_NAME);

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java
index c2a23d6..304638a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java
@@ -307,7 +307,7 @@ public class TestIOFencing {
       assertTrue(compactingRegion.countStoreFiles() > 1);
       final byte REGION_NAME[] = compactingRegion.getRegionInfo().getRegionName();
       LOG.info("Asking for compaction");
-      ((HBaseAdmin)admin).majorCompact(TABLE_NAME.getName());
+      admin.majorCompact(TABLE_NAME);
       LOG.info("Waiting for compaction to be about to start");
       compactingRegion.waitForCompactionToBlock();
       LOG.info("Starting a new server");
@@ -348,7 +348,7 @@ public class TestIOFencing {
       // If we survive the split keep going...
       // Now we make sure that the region isn't totally confused.  Load up more rows.
       TEST_UTIL.loadNumericRows(table, FAMILY, FIRST_BATCH_COUNT, FIRST_BATCH_COUNT + SECOND_BATCH_COUNT);
-      ((HBaseAdmin)admin).majorCompact(TABLE_NAME.getName());
+      admin.majorCompact(TABLE_NAME);
       startWaitTime = System.currentTimeMillis();
       while (newRegion.compactCount == 0) {
         Thread.sleep(1000);

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java
index 0ba51b0..eabff98 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java
@@ -1203,7 +1203,7 @@ public class TestAdmin1 {
     // the element at index 1 would be a replica (since the metareader gives us ordered
     // regions). Try splitting that region via the split API . Should fail
     try {
-      TEST_UTIL.getHBaseAdmin().split(regions.get(1).getFirst().getRegionName());
+      TEST_UTIL.getHBaseAdmin().splitRegion(regions.get(1).getFirst().getRegionName());
     } catch (IllegalArgumentException ex) {
       gotException = true;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
index fe311a6..0f286b6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
@@ -465,10 +465,10 @@ public class TestAdmin2 {
         onlineRegions.contains(info));
   }
 
-  private HBaseAdmin createTable(byte[] TABLENAME) throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+  private Admin createTable(TableName tableName) throws IOException {
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLENAME));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     HColumnDescriptor hcd = new HColumnDescriptor("value");
 
     htd.addFamily(hcd);
@@ -517,10 +517,10 @@ public class TestAdmin2 {
 
   @Test (timeout=300000)
   public void testMoveToPreviouslyAssignedRS() throws IOException, InterruptedException {
-    byte[] tableName = Bytes.toBytes("testMoveToPreviouslyAssignedRS");
     MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
     HMaster master = cluster.getMaster();
-    HBaseAdmin localAdmin = createTable(tableName);
+    TableName tableName = TableName.valueOf("testMoveToPreviouslyAssignedRS");
+    Admin localAdmin = createTable(tableName);
     List<HRegionInfo> tableRegions = localAdmin.getTableRegions(tableName);
     HRegionInfo hri = tableRegions.get(0);
     AssignmentManager am = master.getAssignmentManager();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
index 9c9ec87..8734aea 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
@@ -551,7 +551,7 @@ public class TestFromClientSide {
   private List<HRegionLocation> splitTable(final Table t)
   throws IOException, InterruptedException {
     // Split this table in two.
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.split(t.getName());
     admin.close();
     List<HRegionLocation> regions = waitOnSplit(t);
@@ -1661,7 +1661,7 @@ public class TestFromClientSide {
 
   @Test
   public void testDeleteFamilyVersion() throws Exception {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     TableName TABLE = TableName.valueOf("testDeleteFamilyVersion");
 
     byte [][] QUALIFIERS = makeNAscii(QUALIFIER, 1);
@@ -1706,7 +1706,7 @@ public class TestFromClientSide {
     byte [][] VALUES = makeN(VALUE, 5);
     long [] ts = {1000, 2000, 3000, 4000, 5000};
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY, 5);
     Put put = null;
     Result result = null;
@@ -3546,7 +3546,7 @@ public class TestFromClientSide {
 
     TableName TABLE = TableName.valueOf("testUpdatesWithMajorCompaction");
     Table hTable = TEST_UTIL.createTable(TABLE, FAMILY, 10);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     // Write a column with values at timestamp 1, 2 and 3
     byte[] row = Bytes.toBytes("row2");
@@ -3605,10 +3605,9 @@ public class TestFromClientSide {
   @Test
   public void testMajorCompactionBetweenTwoUpdates() throws Exception {
 
-    String tableName = "testMajorCompactionBetweenTwoUpdates";
-    TableName TABLE = TableName.valueOf(tableName);
-    Table hTable = TEST_UTIL.createTable(TABLE, FAMILY, 10);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    TableName tableName = TableName.valueOf("testMajorCompactionBetweenTwoUpdates");
+    Table hTable = TEST_UTIL.createTable(tableName, FAMILY, 10);
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     // Write a column with values at timestamp 1, 2 and 3
     byte[] row = Bytes.toBytes("row3");
@@ -4048,10 +4047,10 @@ public class TestFromClientSide {
     TEST_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY);
     Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
     Table t = conn.getTable(tableName);
-    HBaseAdmin ha = new HBaseAdmin(conn);
-    assertTrue(ha.tableExists(tableName));
+    Admin admin = conn.getAdmin();
+    assertTrue(admin.tableExists(tableName));
     assertTrue(t.get(new Get(ROW)).isEmpty());
-    ha.close();
+    admin.close();
   }
 
   /**
@@ -4066,8 +4065,8 @@ public class TestFromClientSide {
     TEST_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY);
     Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration());
     Table t = conn.getTable(tableName);
-    try (HBaseAdmin ha = new HBaseAdmin(conn)) {
-      assertTrue(ha.tableExists(tableName));
+    try (Admin admin = conn.getAdmin()) {
+      assertTrue(admin.tableExists(tableName));
       assertTrue(t.get(new Get(ROW)).isEmpty());
     }
 
@@ -4081,10 +4080,10 @@ public class TestFromClientSide {
     assertTrue(cluster.waitForActiveAndReadyMaster());
 
     // test that the same unmanaged connection works with a new
-    // HBaseAdmin and can connect to the new master;
-    try (HBaseAdmin newAdmin = new HBaseAdmin(conn)) {
-      assertTrue(newAdmin.tableExists(tableName));
-      assertTrue(newAdmin.getClusterStatus().getServersSize() == SLAVES + 1);
+    // Admin and can connect to the new master;
+    try (Admin admin = conn.getAdmin()) {
+      assertTrue(admin.tableExists(tableName));
+      assertTrue(admin.getClusterStatus().getServersSize() == SLAVES + 1);
     }
   }
 
@@ -6350,7 +6349,7 @@ public class TestFromClientSide {
     HColumnDescriptor fam = new HColumnDescriptor(FAMILY);
     htd.addFamily(fam);
     byte[][] KEYS = HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE;
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.createTable(htd, KEYS);
     List<HRegionInfo> regions = admin.getTableRegions(htd.getTableName());
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java
index ece98c1..96bc59f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java
@@ -149,17 +149,16 @@ public class TestFromClientSide3 {
      */
     TEST_UTIL.getConfiguration().setInt("hbase.hstore.compaction.min", 3);
 
-    String tableName = "testAdvancedConfigOverride";
-    TableName TABLE = TableName.valueOf(tableName);
-    Table hTable = TEST_UTIL.createTable(TABLE, FAMILY, 10);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    TableName tableName = TableName.valueOf("testAdvancedConfigOverride");
+    Table hTable = TEST_UTIL.createTable(tableName, FAMILY, 10);
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     ClusterConnection connection = (ClusterConnection) TEST_UTIL.getConnection();
 
     // Create 3 store files.
     byte[] row = Bytes.toBytes(random.nextInt());
-    performMultiplePutAndFlush(admin, hTable, row, FAMILY, 3, 100);
+    performMultiplePutAndFlush((HBaseAdmin) admin, hTable, row, FAMILY, 3, 100);
 
-    try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TABLE)) {
+    try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName)) {
       // Verify we have multiple store files.
       HRegionLocation loc = locator.getRegionLocation(row, true);
       byte[] regionName = loc.getRegionInfo().getRegionName();
@@ -167,7 +166,7 @@ public class TestFromClientSide3 {
       assertTrue(ProtobufUtil.getStoreFiles(server, regionName, FAMILY).size() > 1);
 
       // Issue a compaction request
-      admin.compact(TABLE.getName());
+      admin.compact(tableName);
 
       // poll wait for the compactions to happen
       for (int i = 0; i < 10 * 1000 / 40; ++i) {
@@ -189,19 +188,19 @@ public class TestFromClientSide3 {
       LOG.info("hbase.hstore.compaction.min should now be 5");
       HTableDescriptor htd = new HTableDescriptor(hTable.getTableDescriptor());
       htd.setValue("hbase.hstore.compaction.min", String.valueOf(5));
-      admin.modifyTable(TABLE, htd);
+      admin.modifyTable(tableName, htd);
       Pair<Integer, Integer> st;
-      while (null != (st = admin.getAlterStatus(TABLE)) && st.getFirst() > 0) {
+      while (null != (st = admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
         LOG.debug(st.getFirst() + " regions left to update");
         Thread.sleep(40);
       }
       LOG.info("alter status finished");
 
       // Create 3 more store files.
-      performMultiplePutAndFlush(admin, hTable, row, FAMILY, 3, 10);
+      performMultiplePutAndFlush((HBaseAdmin) admin, hTable, row, FAMILY, 3, 10);
 
       // Issue a compaction request
-      admin.compact(TABLE.getName());
+      admin.compact(tableName);
 
       // This time, the compaction request should not happen
       Thread.sleep(10 * 1000);
@@ -216,15 +215,15 @@ public class TestFromClientSide3 {
       HColumnDescriptor hcd = new HColumnDescriptor(htd.getFamily(FAMILY));
       hcd.setValue("hbase.hstore.compaction.min", String.valueOf(2));
       htd.modifyFamily(hcd);
-      admin.modifyTable(TABLE, htd);
-      while (null != (st = admin.getAlterStatus(TABLE)) && st.getFirst() > 0) {
+      admin.modifyTable(tableName, htd);
+      while (null != (st = admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
         LOG.debug(st.getFirst() + " regions left to update");
         Thread.sleep(40);
       }
       LOG.info("alter status finished");
 
       // Issue a compaction request
-      admin.compact(TABLE.getName());
+      admin.compact(tableName);
 
       // poll wait for the compactions to happen
       for (int i = 0; i < 10 * 1000 / 40; ++i) {
@@ -251,8 +250,8 @@ public class TestFromClientSide3 {
       hcd = new HColumnDescriptor(htd.getFamily(FAMILY));
       hcd.setValue("hbase.hstore.compaction.min", null);
       htd.modifyFamily(hcd);
-      admin.modifyTable(TABLE, htd);
-      while (null != (st = admin.getAlterStatus(TABLE)) && st.getFirst() > 0) {
+      admin.modifyTable(tableName, htd);
+      while (null != (st = admin.getAlterStatus(tableName)) && st.getFirst() > 0) {
         LOG.debug(st.getFirst() + " regions left to update");
         Thread.sleep(40);
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java
index efbddf8..9e1c011 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java
@@ -36,9 +36,9 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.MasterNotRunningException;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -65,7 +65,7 @@ public class TestFilterWrapper {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static Configuration conf = null;
-  private static HBaseAdmin admin = null;
+  private static Admin admin = null;
   private static TableName name = TableName.valueOf("test");
   private static Connection connection;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java
index d7e555d..9665041 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java
@@ -220,7 +220,7 @@ public class TestChangingEncoding {
   private void compactAndWait() throws IOException, InterruptedException {
     LOG.debug("Compacting table " + tableName);
     HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.majorCompact(tableName);
 
     // Waiting for the compaction to start, at least .5s.

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java
index 0fbe6f0..42c66e6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java
@@ -23,11 +23,11 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HRegionLocation;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.testclassification.IOTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
@@ -67,7 +67,7 @@ public class TestLoadAndSwitchEncodeOnDisk extends
 
   @Test(timeout=TIMEOUT_MS)
   public void loadTest() throws Exception {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     compression = Compression.Algorithm.GZ; // used for table setup
     super.loadTest();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
index 51861d6..703d54e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
@@ -51,7 +51,6 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.UnknownRegionException;
 import org.apache.hadoop.hbase.Waiter;
 import org.apache.hadoop.hbase.client.Admin;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.coordination.ZkCoordinatedStateManager;
@@ -86,7 +85,7 @@ public class TestAssignmentManagerOnCluster {
   private final static byte[] FAMILY = Bytes.toBytes("FAMILY");
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   final static Configuration conf = TEST_UTIL.getConfiguration();
-  private static HBaseAdmin admin;
+  private static Admin admin;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
index b23ca78..baac248 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterStatusServlet.java
@@ -30,8 +30,12 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.*;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -57,7 +61,7 @@ public class TestMasterStatusServlet {
 
   private HMaster master;
   private Configuration conf;
-  private HBaseAdmin admin;
+  private Admin admin;
 
   static final ServerName FAKE_HOST =
       ServerName.valueOf("fakehost", 12345, 1234567890);
@@ -110,7 +114,7 @@ public class TestMasterStatusServlet {
     Mockito.doReturn(rms).when(master).getRegionServerMetrics();
 
     // Mock admin
-    admin = Mockito.mock(HBaseAdmin.class);
+    admin = Mockito.mock(Admin.class);
   }
 
   private void setupMockTables() throws IOException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
index 38343da..a260d50 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
@@ -36,8 +36,8 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Table;
@@ -82,7 +82,7 @@ public class TestEnableTableHandler {
     final TableName tableName = TableName.valueOf("testEnableTableWithNoRegionServers");
     final MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
     final HMaster m = cluster.getMaster();
-    final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    final Admin admin = TEST_UTIL.getHBaseAdmin();
     final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     admin.createTable(desc);
@@ -143,7 +143,7 @@ public class TestEnableTableHandler {
   public void testDeleteForSureClearsAllTableRowsFromMeta()
   throws IOException, InterruptedException {
     final TableName tableName = TableName.valueOf("testDeleteForSureClearsAllTableRowsFromMeta");
-    final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    final Admin admin = TEST_UTIL.getHBaseAdmin();
     final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     try {
@@ -211,13 +211,7 @@ public class TestEnableTableHandler {
     }
   }
 
-  public static void createTable(HBaseTestingUtility testUtil, HTableDescriptor htd,
-    byte [][] splitKeys)
-  throws Exception {
-    createTable(testUtil, testUtil.getHBaseAdmin(), htd, splitKeys);
-  }
-
-  public static void createTable(HBaseTestingUtility testUtil, HBaseAdmin admin,
+  public static void createTable(HBaseTestingUtility testUtil,
     HTableDescriptor htd, byte [][] splitKeys)
   throws Exception {
     // NOTE: We need a latch because admin is not sync,
@@ -225,6 +219,7 @@ public class TestEnableTableHandler {
     MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster()
       .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName());
     observer.tableCreationLatch = new CountDownLatch(1);
+    Admin admin = testUtil.getHBaseAdmin();
     if (splitKeys != null) {
       admin.createTable(htd, splitKeys);
     } else {
@@ -237,17 +232,12 @@ public class TestEnableTableHandler {
 
   public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName)
   throws Exception {
-    deleteTable(testUtil, testUtil.getHBaseAdmin(), tableName);
-  }
-
-  public static void deleteTable(HBaseTestingUtility testUtil, HBaseAdmin admin,
-    TableName tableName)
-  throws Exception {
     // NOTE: We need a latch because admin is not sync,
     // so the postOp coprocessor method may be called after the admin operation returned.
     MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster()
       .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName());
     observer.tableDeletionLatch = new CountDownLatch(1);
+    Admin admin = testUtil.getHBaseAdmin();
     try {
       admin.disableTable(tableName);
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java
index 8ad6f95..a376c96 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java
@@ -24,7 +24,11 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.*;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -43,7 +47,7 @@ public class TestMobDataBlockEncoding {
   private final static byte [] qf2 = Bytes.toBytes("qualifier2");
   protected final byte[] qf3 = Bytes.toBytes("qualifier3");
   private static Table table;
-  private static HBaseAdmin admin;
+  private static Admin admin;
   private static HColumnDescriptor hcd;
   private static HTableDescriptor desc;
   private static Random random = new Random();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
index 764cf13..7ded3d3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
@@ -50,9 +50,9 @@ import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Waiter;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.Table;
@@ -100,7 +100,7 @@ public class TestNamespaceAuditor {
       withTimeout(this.getClass()).withLookingForStuckThread(true).build();
   private static final Log LOG = LogFactory.getLog(TestNamespaceAuditor.class);
   private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
-  private static HBaseAdmin ADMIN;
+  private static Admin ADMIN;
   private String prefix = "TestNamespaceAuditor";
 
   @BeforeClass

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
index 22b2163..4715d53 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
@@ -30,7 +30,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState;
@@ -89,7 +89,7 @@ public class TestCompactionState {
     Table ht = null;
     try {
       ht = TEST_UTIL.createTable(table, family);
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       try {
         admin.compact(table, fakecf);
       } catch (IOException ioe) {
@@ -137,18 +137,18 @@ public class TestCompactionState {
       int countBefore = countStoreFilesInFamilies(regions, families);
       int countBeforeSingleFamily = countStoreFilesInFamily(regions, family);
       assertTrue(countBefore > 0); // there should be some data files
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       if (expectedState == CompactionState.MINOR) {
         if (singleFamily) {
-          admin.compact(table.getName(), family);
+          admin.compact(table, family);
         } else {
-          admin.compact(table.getName());
+          admin.compact(table);
         }
       } else {
         if (singleFamily) {
-          admin.majorCompact(table.getName(), family);
+          admin.majorCompact(table, family);
         } else {
-          admin.majorCompact(table.getName());
+          admin.majorCompact(table);
         }
       }
       long curt = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
index f3af63a4..4781f23 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
@@ -33,9 +33,9 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -67,7 +67,7 @@ public class TestMobStoreScanner {
   private final static byte [] qf2 = Bytes.toBytes("qualifier2");
   protected final byte[] qf3 = Bytes.toBytes("qualifier3");
   private static Table table;
-  private static HBaseAdmin admin;
+  private static Admin admin;
   private static HColumnDescriptor hcd;
   private static HTableDescriptor desc;
   private static Random random = new Random();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
index 67fedcd..0a95210 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
@@ -436,7 +436,8 @@ public class TestRegionServerMetrics {
     hcd.setMobEnabled(true);
     hcd.setMobThreshold(0);
     htd.addFamily(hcd);
-    HBaseAdmin admin = new HBaseAdmin(conf);
+    Connection connection = ConnectionFactory.createConnection(conf);
+    Admin admin = connection.getAdmin();
     HTable t = TEST_UTIL.createTable(htd, new byte[0][0], conf);
     Region region = rs.getOnlineRegions(tableName).get(0);
     t.setAutoFlush(true, true);
@@ -485,5 +486,6 @@ public class TestRegionServerMetrics {
         serverSource);
     t.close();
     admin.close();
+    connection.close();
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
index 8a4910d..9e1a61e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
@@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.Table;
@@ -76,7 +76,7 @@ public class TestRemoveRegionMetrics {
     TableName tableName = TableName.valueOf(tableNameString);
     Table t = TEST_UTIL.createTable(tableName, Bytes.toBytes("D"));
     TEST_UTIL.waitUntilAllRegionsAssigned(t.getName());
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     HRegionInfo regionInfo;
     byte[] row =  Bytes.toBytes("r1");
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
index 5bcf6e8..623d75b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
@@ -32,7 +32,6 @@ import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.client.Admin;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.Result;
@@ -73,7 +72,7 @@ public class TestScannerWithBulkload {
   public void testBulkLoad() throws Exception {
     TableName tableName = TableName.valueOf("testBulkLoad");
     long l = System.currentTimeMillis();
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     createTable(admin, tableName);
     Scan scan = createScan();
     final Table table = init(admin, l, scan, tableName);
@@ -177,7 +176,7 @@ public class TestScannerWithBulkload {
     return hfilePath;
   }
 
-  private Table init(HBaseAdmin admin, long l, Scan scan, TableName tableName) throws Exception {
+  private Table init(Admin admin, long l, Scan scan, TableName tableName) throws Exception {
     Table table = TEST_UTIL.getConnection().getTable(tableName);
     Put put0 = new Put(Bytes.toBytes("row1"));
     put0.add(new KeyValue(Bytes.toBytes("row1"), Bytes.toBytes("col"), Bytes.toBytes("q"), l,
@@ -211,7 +210,7 @@ public class TestScannerWithBulkload {
   public void testBulkLoadWithParallelScan() throws Exception {
     final TableName tableName = TableName.valueOf("testBulkLoadWithParallelScan");
       final long l = System.currentTimeMillis();
-    final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    final Admin admin = TEST_UTIL.getHBaseAdmin();
     createTable(admin, tableName);
     Scan scan = createScan();
     final Table table = init(admin, l, scan, tableName);
@@ -253,7 +252,7 @@ public class TestScannerWithBulkload {
   public void testBulkLoadNativeHFile() throws Exception {
     TableName tableName = TableName.valueOf("testBulkLoadNativeHFile");
     long l = System.currentTimeMillis();
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     createTable(admin, tableName);
     Scan scan = createScan();
     final Table table = init(admin, l, scan, tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
index 2549a4f..4b12cff 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
@@ -63,7 +63,6 @@ import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Consistency;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
@@ -120,7 +119,7 @@ import com.google.protobuf.ServiceException;
 public class TestSplitTransactionOnCluster {
   private static final Log LOG =
     LogFactory.getLog(TestSplitTransactionOnCluster.class);
-  private HBaseAdmin admin = null;
+  private Admin admin = null;
   private MiniHBaseCluster cluster = null;
   private static final int NB_SERVERS = 3;
   private static CountDownLatch latch = new CountDownLatch(1);
@@ -201,7 +200,7 @@ public class TestSplitTransactionOnCluster {
         Coprocessor.PRIORITY_USER, region.getBaseConf());
 
       // split async
-      this.admin.split(region.getRegionInfo().getRegionName(), new byte[] {42});
+      this.admin.splitRegion(region.getRegionInfo().getRegionName(), new byte[] {42});
 
       // we have to wait until the SPLITTING state is seen by the master
       FailingSplitRegionObserver observer = (FailingSplitRegionObserver) region
@@ -365,9 +364,9 @@ public class TestSplitTransactionOnCluster {
 
       // Now try splitting.... should fail.  And each should successfully
       // rollback.
-      this.admin.split(hri.getRegionNameAsString());
-      this.admin.split(hri.getRegionNameAsString());
-      this.admin.split(hri.getRegionNameAsString());
+      this.admin.splitRegion(hri.getRegionName());
+      this.admin.splitRegion(hri.getRegionName());
+      this.admin.splitRegion(hri.getRegionName());
       // Wait around a while and assert count of regions remains constant.
       for (int i = 0; i < 10; i++) {
         Thread.sleep(100);
@@ -427,7 +426,7 @@ public class TestSplitTransactionOnCluster {
       LOG.info("Daughter we are going to split: " + daughter);
       // Compact first to ensure we have cleaned up references -- else the split
       // will fail.
-      this.admin.compact(daughter.getRegionName());
+      this.admin.compactRegion(daughter.getRegionName());
       daughters = cluster.getRegions(tableName);
       HRegion daughterRegion = null;
       for (HRegion r: daughters) {
@@ -488,13 +487,13 @@ public class TestSplitTransactionOnCluster {
         String val = "Val" + i;
         p.addColumn("col".getBytes(), "ql".getBytes(), val.getBytes());
         table.put(p);
-        admin.flush(userTableName.getName());
+        admin.flush(userTableName);
         Delete d = new Delete(row.getBytes());
         // Do a normal delete
         table.delete(d);
-        admin.flush(userTableName.getName());
+        admin.flush(userTableName);
       }
-      admin.majorCompact(userTableName.getName());
+      admin.majorCompact(userTableName);
       List<HRegionInfo> regionsOfTable = TESTING_UTIL.getMiniHBaseCluster()
           .getMaster().getAssignmentManager().getRegionStates()
           .getRegionsOfTable(userTableName);
@@ -508,8 +507,8 @@ public class TestSplitTransactionOnCluster {
       p = new Put("row8".getBytes());
       p.addColumn("col".getBytes(), "ql".getBytes(), "val".getBytes());
       table.put(p);
-      admin.flush(userTableName.getName());
-      admin.split(hRegionInfo.getRegionName(), "row7".getBytes());
+      admin.flush(userTableName);
+      admin.splitRegion(hRegionInfo.getRegionName(), "row7".getBytes());
       regionsOfTable = TESTING_UTIL.getMiniHBaseCluster().getMaster()
           .getAssignmentManager().getRegionStates()
           .getRegionsOfTable(userTableName);
@@ -585,7 +584,7 @@ public class TestSplitTransactionOnCluster {
       HRegionServer server = cluster.getRegionServer(tableRegionIndex);
       printOutRegions(server, "Initial regions: ");
 
-      this.admin.split(hri.getRegionNameAsString());
+      this.admin.splitRegion(hri.getRegionName());
       checkAndGetDaughters(tableName);
 
       HMaster master = abortAndWaitForMaster();
@@ -750,7 +749,7 @@ public class TestSplitTransactionOnCluster {
     }
   }
 
-  private void insertData(final TableName tableName, HBaseAdmin admin, Table t) throws IOException,
+  private void insertData(final TableName tableName, Admin admin, Table t) throws IOException,
       InterruptedException {
     Put p = new Put(Bytes.toBytes("row1"));
     p.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("q1"), Bytes.toBytes("1"));
@@ -1142,7 +1141,7 @@ public class TestSplitTransactionOnCluster {
 
   private void split(final HRegionInfo hri, final HRegionServer server, final int regionCount)
       throws IOException, InterruptedException {
-    this.admin.split(hri.getRegionNameAsString());
+    this.admin.splitRegion(hri.getRegionName());
     for (int i = 0; ProtobufUtil.getOnlineRegions(
         server.getRSRpcServices()).size() <= regionCount && i < 300; i++) {
       LOG.debug("Waiting on region to split");

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
index 826d06f..870a3bf 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
@@ -33,9 +33,9 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Table;
@@ -77,7 +77,7 @@ public class TestSplitWalDataLoss {
     testUtil.getConfiguration().setInt("hbase.regionserver.msginterval", 30000);
     testUtil.getConfiguration().setBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false);
     testUtil.startMiniCluster(2);
-    HBaseAdmin admin = testUtil.getHBaseAdmin();
+    Admin admin = testUtil.getHBaseAdmin();
     admin.createNamespace(namespace);
     admin.createTable(new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(family)));
     testUtil.waitTableAvailable(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java
index 9374fdb..4456ef2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactionWithThroughputController.java
@@ -32,9 +32,9 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.regionserver.DefaultStoreEngine;
@@ -80,7 +80,7 @@ public class TestCompactionWithThroughputController {
   }
 
   private Store prepareData() throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
index 30249fd..b050f49 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
@@ -42,7 +42,6 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -521,7 +520,7 @@ public class TestReplicationSmallTests extends TestReplicationBase {
     final String colFam = "cf1";
     final int numOfTables = 3;
 
-    HBaseAdmin hadmin = utility1.getHBaseAdmin();
+    Admin hadmin = utility1.getHBaseAdmin();
 
     // Create Tables
     for (int i = 0; i < numOfTables; i++) {
@@ -552,9 +551,9 @@ public class TestReplicationSmallTests extends TestReplicationBase {
 
     // drop tables
     for (int i = 0; i < numOfTables; i++) {
-      String ht = tName + i;
-      hadmin.disableTable(ht);
-      hadmin.deleteTable(ht);
+      TableName tableName = TableName.valueOf(tName + i);
+      hadmin.disableTable(tableName);
+      hadmin.deleteTable(tableName);
     }
 
     hadmin.close();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java
index c1d4d01..fecff07 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java
@@ -37,10 +37,10 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.Tag;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.client.replication.ReplicationAdmin;
@@ -141,10 +141,10 @@ public class TestVisibilityLabelReplicationWithExpAsString extends TestVisibilit
     HColumnDescriptor desc = new HColumnDescriptor(fam);
     desc.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
     table.addFamily(desc);
-    try (HBaseAdmin hBaseAdmin = TEST_UTIL.getHBaseAdmin()) {
+    try (Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin()) {
       hBaseAdmin.createTable(table);
     }
-    try (HBaseAdmin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin()){
+    try (Admin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin()){
       hBaseAdmin1.createTable(table);
     }
     addLabels();

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java
index 00186c1..8414813 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java
@@ -45,11 +45,11 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Tag;
 import org.apache.hadoop.hbase.TagRewriteCell;
 import org.apache.hadoop.hbase.TagType;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -186,7 +186,7 @@ public class TestVisibilityLabelsReplication {
     // Wait for the labels table to become available
     TEST_UTIL.waitTableEnabled(LABELS_TABLE_NAME.getName(), 50000);
     TEST_UTIL1.startMiniCluster(1);
-    HBaseAdmin hBaseAdmin = TEST_UTIL.getHBaseAdmin();
+    Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin();
     HTableDescriptor table = new HTableDescriptor(TABLE_NAME);
     HColumnDescriptor desc = new HColumnDescriptor(fam);
     desc.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
@@ -198,7 +198,7 @@ public class TestVisibilityLabelsReplication {
         hBaseAdmin.close();
       }
     }
-    HBaseAdmin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin();
+    Admin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin();
     try {
       hBaseAdmin1.createTable(table);
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java
index e91d0e1..a5a710f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java
@@ -272,8 +272,6 @@ public class BaseTestHBaseFsck {
    *
    * It will set tbl which needs to be closed after test
    *
-   * @param tableName
-   * @param replicaCount
    * @throws Exception
    */
   void setupTableWithRegionReplica(TableName tablename, int replicaCount) throws Exception {
@@ -296,7 +294,7 @@ public class BaseTestHBaseFsck {
   /**
    * Setup a clean table with a mob-enabled column.
    *
-   * @param tableName The name of a table to be created.
+   * @param tablename The name of a table to be created.
    * @throws Exception
    */
   void setupMobTable(TableName tablename) throws Exception {
@@ -349,7 +347,7 @@ public class BaseTestHBaseFsck {
   /**
    * Get region info from local cluster.
    */
-  Map<ServerName, List<String>> getDeployedHRIs(final HBaseAdmin admin) throws IOException {
+  Map<ServerName, List<String>> getDeployedHRIs(final Admin admin) throws IOException {
     ClusterStatus status = admin.getClusterStatus();
     Collection<ServerName> regionServers = status.getServers();
     Map<ServerName, List<String>> mm =

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java
index b3bd355..17f8637 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java
@@ -190,7 +190,7 @@ public class TestHBaseFsckTwoRS extends BaseTestHBaseFsck {
       // different regions with the same start/endkeys since it doesn't
       // differentiate on ts/regionId!  We actually need to recheck
       // deployments!
-      while (findDeployedHSI(getDeployedHRIs((HBaseAdmin) admin), hriDupe) == null) {
+      while (findDeployedHSI(getDeployedHRIs(admin), hriDupe) == null) {
         Thread.sleep(250);
       }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java
index a14f845..e767f3a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java
@@ -158,22 +158,6 @@ public class OfflineMetaRebuildTestCore {
     tbl.put(puts);
   }
 
-  /**
-   * delete table in preparation for next test
-   *
-   * @param tablename
-   * @throws IOException
-   */
-  void deleteTable(HBaseAdmin admin, String tablename) throws IOException {
-    try {
-      byte[] tbytes = Bytes.toBytes(tablename);
-      admin.disableTable(tbytes);
-      admin.deleteTable(tbytes);
-    } catch (Exception e) {
-      // Do nothing.
-    }
-  }
-
   protected void deleteRegion(Configuration conf, final Table tbl,
       byte[] startKey, byte[] endKey) throws IOException {
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index e680e9c..03703bc 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -51,30 +51,34 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Requests a table or region flush
     def flush(table_or_region_name)
-      @admin.flush(table_or_region_name)
+      begin
+        @admin.flushRegion(table_or_region_name.to_java_bytes);
+      rescue java.lang.IllegalArgumentException => e
+        # Unknown region. Try table.
+        @admin.flush(TableName.valueOf(table_or_region_name));
+      end
     end
 
     #----------------------------------------------------------------------------------------------
     # Requests a table or region or column family compaction
     def compact(table_or_region_name, family = nil, type = "NORMAL")
+      family_bytes = nil
+      unless family.nil?
+        family_bytes = family.to_java_bytes
+      end
+      compact_type = nil
       if type == "NORMAL"
-        if family == nil
-          @admin.compact(table_or_region_name)
-        else
-          # We are compacting a column family within a region.
-          @admin.compact(table_or_region_name, family)
-        end
+        compact_type = org.apache.hadoop.hbase.client.Admin::CompactType::NORMAL
       elsif type == "MOB"
-        if family == nil
-          @admin.compact(org.apache.hadoop.hbase.TableName.valueOf(table_or_region_name),
-          org.apache.hadoop.hbase.client.Admin::CompactType::MOB)
-        else
-          # We are compacting a mob column family within a table.
-          @admin.compact(org.apache.hadoop.hbase.TableName.valueOf(table_or_region_name), family.to_java_bytes,
-          org.apache.hadoop.hbase.client.Admin::CompactType::MOB)
-        end
+        compact_type = org.apache.hadoop.hbase.client.Admin::CompactType::MOB
       else
-         raise ArgumentError, "only NORMAL or MOB accepted for type!"
+        raise ArgumentError, "only NORMAL or MOB accepted for type!"
+      end
+
+      begin
+        @admin.compactRegion(table_or_region_name.to_java_bytes, family_bytes, false)
+      rescue java.lang.IllegalArgumentException => e
+        @admin.compact(TableName.valueOf(table_or_region_name), family_bytes, false, compact_type)
       end
     end
 
@@ -86,25 +90,24 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Requests a table or region or column family major compaction
     def major_compact(table_or_region_name, family = nil, type = "NORMAL")
+      family_bytes = nil
+      unless family.nil?
+        family_bytes = family.to_java_bytes
+      end
+      compact_type = nil
       if type == "NORMAL"
-        if family == nil
-          @admin.majorCompact(table_or_region_name)
-        else
-          # We are major compacting a column family within a region or table.
-          @admin.majorCompact(table_or_region_name, family)
-        end
+        compact_type = org.apache.hadoop.hbase.client.Admin::CompactType::NORMAL
       elsif type == "MOB"
-        if family == nil
-          @admin.majorCompact(org.apache.hadoop.hbase.TableName.valueOf(table_or_region_name),
-          org.apache.hadoop.hbase.client.Admin::CompactType::MOB)
-        else
-          # We are major compacting a mob column family within a table.
-          @admin.majorCompact(org.apache.hadoop.hbase.TableName.valueOf(table_or_region_name),
-          family.to_java_bytes, org.apache.hadoop.hbase.client.Admin::CompactType::MOB)
-        end
+        compact_type = org.apache.hadoop.hbase.client.Admin::CompactType::MOB
       else
         raise ArgumentError, "only NORMAL or MOB accepted for type!"
       end
+
+      begin
+        @admin.majorCompactRegion(table_or_region_name.to_java_bytes, family_bytes)
+      rescue java.lang.IllegalArgumentException => e
+        @admin.majorCompact(TableName.valueOf(table_or_region_name), family_bytes, compact_type)
+      end
     end
 
     #----------------------------------------------------------------------------------------------
@@ -117,11 +120,15 @@ module Hbase
 
     #----------------------------------------------------------------------------------------------
     # Requests a table or region split
-    def split(table_or_region_name, split_point)
-      if split_point == nil
-        @admin.split(table_or_region_name)
-      else
-        @admin.split(table_or_region_name, split_point)
+    def split(table_or_region_name, split_point = nil)
+      split_point_bytes = nil
+      unless split_point.nil?
+        split_point_bytes = split_point.to_java_bytes
+      end
+      begin
+        @admin.splitRegion(table_or_region_name.to_java_bytes, split_point_bytes)
+      rescue java.lang.IllegalArgumentException => e
+        @admin.split(TableName.valueOf(table_or_region_name), split_point_bytes)
       end
     end
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 462c86b..c5e44d5 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -68,7 +68,6 @@ import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.Increment;
 import org.apache.hadoop.hbase.client.OperationWithAttributes;
 import org.apache.hadoop.hbase.client.Put;
@@ -772,26 +771,34 @@ public class ThriftServerRunner implements Runnable {
       }
     }
 
+    // ThriftServerRunner.compact should be deprecated and replaced with methods specific to
+    // table and region.
     @Override
     public void compact(ByteBuffer tableNameOrRegionName) throws IOError {
       try {
-        // TODO: HBaseAdmin.compact(byte[]) deprecated and not trivial to replace here.
-        // ThriftServerRunner.compact should be deprecated and replaced with methods specific to
-        // table and region.
-        ((HBaseAdmin) getAdmin()).compact(getBytes(tableNameOrRegionName));
+        try {
+          getAdmin().compactRegion(getBytes(tableNameOrRegionName));
+        } catch (IllegalArgumentException e) {
+          // Invalid region, try table
+          getAdmin().compact(TableName.valueOf(getBytes(tableNameOrRegionName)));
+        }
       } catch (IOException e) {
         LOG.warn(e.getMessage(), e);
         throw new IOError(Throwables.getStackTraceAsString(e));
       }
     }
 
+    // ThriftServerRunner.majorCompact should be deprecated and replaced with methods specific
+    // to table and region.
     @Override
     public void majorCompact(ByteBuffer tableNameOrRegionName) throws IOError {
       try {
-        // TODO: HBaseAdmin.majorCompact(byte[]) deprecated and not trivial to replace here.
-        // ThriftServerRunner.majorCompact should be deprecated and replaced with methods specific
-        // to table and region.
-        ((HBaseAdmin) getAdmin()).majorCompact(getBytes(tableNameOrRegionName));
+        try {
+          getAdmin().compactRegion(getBytes(tableNameOrRegionName));
+        } catch (IllegalArgumentException e) {
+          // Invalid region, try table
+          getAdmin().compact(TableName.valueOf(getBytes(tableNameOrRegionName)));
+        }
       } catch (IOException e) {
         LOG.warn(e.getMessage(), e);
         throw new IOError(Throwables.getStackTraceAsString(e));

http://git-wip-us.apache.org/repos/asf/hbase/blob/08963189/src/main/asciidoc/_chapters/cp.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/cp.adoc b/src/main/asciidoc/_chapters/cp.adoc
index 8c56036..45944b4 100644
--- a/src/main/asciidoc/_chapters/cp.adoc
+++ b/src/main/asciidoc/_chapters/cp.adoc
@@ -396,10 +396,11 @@ coprocessor.jar| org.myname.hbase.Coprocessor.RegionObserverExample|1073741823|'
 +
 [source,java]
 ----
-String tableName = "users";
+TableName tableName = TableName.valueOf("users");
 String path = "hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.jar";
 Configuration conf = HBaseConfiguration.create();
-HBaseAdmin admin = new HBaseAdmin(conf);
+Connection connection = ConnectionFactory.createConnection(conf);
+Admin admin = connection.getAdmin();
 admin.disableTable(tableName);
 HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName);
 HColumnDescriptor columnFamily1 = new HColumnDescriptor("personalDet");
@@ -460,10 +461,11 @@ attached to this table, if any. For example:
 +
 [source,java]
 ----
-String tableName = "users";
+TableName tableName = TableName.valueOf("users");
 String path = "hdfs://<namenode>:<port>/user/<hadoop-user>/coprocessor.jar";
 Configuration conf = HBaseConfiguration.create();
-HBaseAdmin admin = new HBaseAdmin(conf);
+Connection connection = ConnectionFactory.createConnection(conf);
+Admin admin = connection.getAdmin();
 admin.disableTable(tableName);
 HTableDescriptor hTableDescriptor = new HTableDescriptor(tableName);
 HColumnDescriptor columnFamily1 = new HColumnDescriptor("personalDet");


Mime
View raw message