hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [3/3] git commit: HBASE-11068 Update code to use Admin factory method instead of constructor
Date Mon, 04 Aug 2014 18:42:50 GMT
HBASE-11068 Update code to use Admin factory method instead of constructor


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

Branch: refs/heads/master
Commit: e91e2659a7f4afedde58a9ed28d440e31546cb91
Parents: 757b13d
Author: stack <stack@apache.org>
Authored: Mon Aug 4 11:42:38 2014 -0700
Committer: stack <stack@apache.org>
Committed: Mon Aug 4 11:42:38 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/IntegrationTestIngest.java     |  2 +-
 .../IntegrationTestIngestWithEncryption.java    | 13 ++--
 .../hbase/IntegrationTestManyRegions.java       | 13 ++--
 .../hbase/IntegrationTestRegionReplicaPerf.java |  5 +-
 .../StripeCompactionsPerformanceEvaluation.java | 11 ++--
 .../hadoop/hbase/chaos/actions/Action.java      |  5 +-
 .../hbase/chaos/actions/AddColumnAction.java    | 12 ++--
 .../chaos/actions/ChangeBloomFilterAction.java  | 13 ++--
 .../chaos/actions/ChangeCompressionAction.java  |  8 ++-
 .../chaos/actions/ChangeEncodingAction.java     | 12 ++--
 .../chaos/actions/ChangeVersionsAction.java     |  8 ++-
 .../CompactRandomRegionOfTableAction.java       | 12 ++--
 .../hbase/chaos/actions/CompactTableAction.java |  3 +-
 .../actions/FlushRandomRegionOfTableAction.java | 12 ++--
 .../hbase/chaos/actions/FlushTableAction.java   | 12 ++--
 ...MergeRandomAdjacentRegionsOfTableAction.java | 12 ++--
 .../actions/MoveRandomRegionOfTableAction.java  | 12 ++--
 .../chaos/actions/MoveRegionsOfTableAction.java | 12 ++--
 .../hbase/chaos/actions/RemoveColumnAction.java |  8 ++-
 .../chaos/actions/SnapshotTableAction.java      |  8 ++-
 .../actions/SplitRandomRegionOfTableAction.java | 12 ++--
 .../chaos/actions/TruncateTableAction.java      |  3 +-
 .../mapreduce/IntegrationTestBulkLoad.java      |  5 +-
 .../mapreduce/IntegrationTestImportTsv.java     |  3 +-
 .../test/IntegrationTestLoadAndVerify.java      |  3 +-
 ...stTimeBoundedRequestsWithRegionReplicas.java |  7 +-
 .../trace/IntegrationTestSendTraceRequests.java | 20 +++---
 .../org/apache/hadoop/hbase/tool/Canary.java    | 15 +++--
 .../hadoop/hbase/util/HBaseFsckRepair.java      |  3 +-
 .../hadoop/hbase/HBaseTestingUtility.java       | 36 ++++++-----
 .../hadoop/hbase/PerformanceEvaluation.java     |  3 +-
 .../TestHColumnDescriptorDefaultVersions.java   |  9 +--
 .../hadoop/hbase/TestMetaTableAccessor.java     |  3 +-
 .../org/apache/hadoop/hbase/TestNamespace.java  | 13 ++--
 .../hadoop/hbase/backup/TestHFileArchiving.java |  3 +-
 .../apache/hadoop/hbase/client/TestAdmin.java   | 32 ++++-----
 .../client/TestClientOperationInterrupt.java    |  5 +-
 .../client/TestCloneSnapshotFromClient.java     |  4 +-
 .../hadoop/hbase/client/TestFromClientSide.java |  4 +-
 .../hbase/client/TestFromClientSide3.java       |  2 +-
 .../client/TestRestoreSnapshotFromClient.java   |  2 +-
 .../client/TestSnapshotCloneIndependence.java   | 12 ++--
 .../hbase/client/TestSnapshotFromClient.java    | 14 ++--
 .../hbase/client/TestSnapshotMetadata.java      |  4 +-
 .../hbase/client/TestTableSnapshotScanner.java  |  2 +-
 .../hadoop/hbase/constraint/TestConstraint.java | 12 ++--
 .../hbase/coprocessor/TestClassLoading.java     | 25 +++----
 .../coprocessor/TestCoprocessorEndpoint.java    |  5 +-
 ...TestMasterCoprocessorExceptionWithAbort.java |  3 +-
 ...estMasterCoprocessorExceptionWithRemove.java |  5 +-
 .../hbase/coprocessor/TestMasterObserver.java   | 14 ++--
 .../coprocessor/TestOpenTableInCoprocessor.java |  3 +-
 .../coprocessor/TestRegionObserverBypass.java   |  6 +-
 .../TestRegionObserverInterface.java            | 11 ++--
 .../TestRegionObserverScannerOpenHook.java      |  3 +-
 .../coprocessor/TestRowProcessorEndpoint.java   |  3 +-
 .../TableSnapshotInputFormatTestBase.java       |  3 +-
 .../hbase/master/TestAssignmentListener.java    |  3 +-
 .../master/TestAssignmentManagerOnCluster.java  | 11 ++--
 .../master/TestDistributedLogSplitting.java     |  6 +-
 .../apache/hadoop/hbase/master/TestMaster.java  |  7 +-
 .../TestMasterRestartAfterDisablingTable.java   |  2 +-
 .../hadoop/hbase/master/TestRollingRestart.java |  3 +-
 .../hbase/master/TestTableLockManager.java      | 13 ++--
 .../master/cleaner/TestSnapshotFromMaster.java  |  3 +-
 .../master/handler/TestCreateTableHandler.java  |  8 +--
 .../handler/TestTableDeleteFamilyHandler.java   |  5 +-
 .../TestTableDescriptorModification.java        |  9 +--
 .../hbase/migration/TestNamespaceUpgrade.java   | 33 +++++-----
 .../hbase/procedure/TestProcedureManager.java   |  3 +-
 .../regionserver/TestEncryptionKeyRotation.java |  2 +-
 .../TestEndToEndSplitTransaction.java           |  7 +-
 .../regionserver/TestHRegionOnCluster.java      | 16 ++---
 .../TestRegionMergeTransactionOnCluster.java    |  3 +-
 .../regionserver/TestSCVFWithMiniCluster.java   | 11 ++--
 .../hadoop/hbase/regionserver/TestTags.java     |  7 +-
 .../regionserver/wal/TestLogRollAbort.java      |  3 +-
 .../hbase/regionserver/wal/TestLogRolling.java  |  3 +-
 .../hadoop/hbase/rest/RowResourceBase.java      |  9 +--
 .../hadoop/hbase/rest/TestGzipFilter.java       |  7 +-
 .../hadoop/hbase/rest/TestMultiRowResource.java |  7 +-
 .../hadoop/hbase/rest/TestScannerResource.java  |  9 +--
 .../hbase/rest/TestScannersWithFilters.java     |  7 +-
 .../hbase/rest/TestScannersWithLabels.java      |  9 +--
 .../hadoop/hbase/rest/TestSchemaResource.java   | 14 ++--
 .../hadoop/hbase/rest/TestTableResource.java    | 13 ++--
 .../apache/hadoop/hbase/rest/TestTableScan.java |  7 +-
 .../hbase/rest/client/TestRemoteTable.java      |  9 +--
 .../security/access/TestAccessController.java   | 23 ++++---
 .../access/TestCellACLWithMultipleVersions.java |  3 +-
 .../hbase/security/access/TestCellACLs.java     |  3 +-
 .../access/TestScanEarlyTermination.java        |  3 +-
 .../security/access/TestTablePermissions.java   |  3 +-
 .../visibility/TestVisibilityLabels.java        |  3 +-
 .../TestVisibilityLabelsWithDeletes.java        | 21 +++---
 .../hbase/snapshot/SnapshotTestingUtils.java    | 33 +++++-----
 .../hbase/snapshot/TestExportSnapshot.java      |  3 +-
 .../snapshot/TestFlushSnapshotFromClient.java   | 68 +++++++++-----------
 .../TestRestoreFlushSnapshotFromClient.java     |  5 +-
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 29 +++++----
 .../util/hbck/OfflineMetaRebuildTestCore.java   |  3 +-
 101 files changed, 522 insertions(+), 432 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java
index f71ff20..0994b8f 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java
@@ -126,7 +126,7 @@ public class IntegrationTestIngest extends IntegrationTestBase {
   }
 
   private void deleteTableIfNecessary() throws IOException {
-    if (util.getHBaseAdmin().tableExists(getTablename())) {
+    if (util.getHBaseAdmin().tableExists(TableName.valueOf(getTablename()))) {
       util.deleteTable(Bytes.toBytes(getTablename()));
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java
index 588b0de..72c5689 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Waiter.Predicate;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.io.crypto.KeyProviderForTesting;
 import org.apache.hadoop.hbase.io.hfile.HFile;
@@ -78,20 +79,20 @@ public class IntegrationTestIngestWithEncryption extends IntegrationTestIngest {
 
     // Update the test table schema so HFiles from this point will be written with
     // encryption features enabled.
-    final HBaseAdmin admin = util.getHBaseAdmin();
+    final Admin admin = util.getHBaseAdmin();
     HTableDescriptor tableDescriptor =
-        new HTableDescriptor(admin.getTableDescriptor(Bytes.toBytes(getTablename())));
+        new HTableDescriptor(admin.getTableDescriptor(TableName.valueOf(getTablename())));
     for (HColumnDescriptor columnDescriptor: tableDescriptor.getColumnFamilies()) {
       columnDescriptor.setEncryptionType("AES");
       LOG.info("Updating CF schema for " + getTablename() + "." +
         columnDescriptor.getNameAsString());
-      admin.disableTable(getTablename());
-      admin.modifyColumn(getTablename(), columnDescriptor);
-      admin.enableTable(getTablename());
+      admin.disableTable(TableName.valueOf(getTablename()));
+      admin.modifyColumn(TableName.valueOf(getTablename()), columnDescriptor);
+      admin.enableTable(TableName.valueOf(getTablename()));
       util.waitFor(30000, 1000, true, new Predicate<IOException>() {
         @Override
         public boolean evaluate() throws IOException {
-          return admin.isTableAvailable(getTablename());
+          return admin.isTableAvailable(TableName.valueOf(getTablename()));
         }
       });
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
index d6bc2e2..30f3d53 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.RegionSplitter;
 import org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm;
@@ -49,7 +50,7 @@ public class IntegrationTestManyRegions {
 
   protected static final Log LOG
     = LogFactory.getLog(IntegrationTestManyRegions.class);
-  protected static final String TABLE_NAME = CLASS_NAME;
+  protected static final TableName TABLE_NAME = TableName.valueOf(CLASS_NAME);
   protected static final String COLUMN_NAME = "f";
   protected static final String REGION_COUNT_KEY
     = String.format("hbase.%s.regions", CLASS_NAME);
@@ -80,7 +81,7 @@ public class IntegrationTestManyRegions {
     util.initializeCluster(REGION_SERVER_COUNT);
     LOG.info("Cluster initialized");
 
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     if (admin.tableExists(TABLE_NAME)) {
       LOG.info(String.format("Deleting existing table %s.", TABLE_NAME));
       if (admin.isTableEnabled(TABLE_NAME)) admin.disableTable(TABLE_NAME);
@@ -93,7 +94,7 @@ public class IntegrationTestManyRegions {
   @After
   public void tearDown() throws IOException {
     LOG.info("Cleaning up after test.");
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     if (admin.tableExists(TABLE_NAME)) {
       if (admin.isTableEnabled(TABLE_NAME)) admin.disableTable(TABLE_NAME);
       admin.deleteTable(TABLE_NAME);
@@ -122,10 +123,10 @@ public class IntegrationTestManyRegions {
 
   private static class Worker implements Runnable {
     private final CountDownLatch doneSignal;
-    private final HBaseAdmin admin;
+    private final Admin admin;
     private boolean success = false;
 
-    public Worker(final CountDownLatch doneSignal, final HBaseAdmin admin) {
+    public Worker(final CountDownLatch doneSignal, final Admin admin) {
       this.doneSignal = doneSignal;
       this.admin = admin;
     }
@@ -137,7 +138,7 @@ public class IntegrationTestManyRegions {
     @Override
     public void run() {
       long startTime, endTime;
-      HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(TABLE_NAME));
+      HTableDescriptor desc = new HTableDescriptor(TABLE_NAME);
       desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
       SplitAlgorithm algo = new RegionSplitter.HexStringSplit();
       byte[][] splits = algo.split(REGION_COUNT);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java
index 8471cb4..999ed51 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java
@@ -29,6 +29,7 @@ import org.apache.hadoop.hbase.chaos.actions.RestartRsHoldingTableAction;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
 import org.apache.hadoop.hbase.chaos.policies.PeriodicRandomActionPolicy;
 import org.apache.hadoop.hbase.chaos.policies.Policy;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.ipc.RpcClient;
 import org.apache.hadoop.hbase.regionserver.DisabledRegionSplitPolicy;
@@ -86,9 +87,9 @@ public class IntegrationTestRegionReplicaPerf extends IntegrationTestBase {
    */
   static class PerfEvalCallable implements Callable<TimingResult> {
     private final Queue<String> argv = new LinkedList<String>();
-    private final HBaseAdmin admin;
+    private final Admin admin;
 
-    public PerfEvalCallable(HBaseAdmin admin, String argv) {
+    public PerfEvalCallable(Admin admin, String argv) {
       // TODO: this API is awkward, should take HConnection, not HBaseAdmin
       this.admin = admin;
       this.argv.addAll(Arrays.asList(argv.split(" ")));

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java
index c77f8c4..c4697b4 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java
@@ -49,8 +49,8 @@ import org.junit.Assert;
 @InterfaceAudience.Private
 public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool {
   private static final Log LOG = LogFactory.getLog(StripeCompactionsPerformanceEvaluation.class);
-  private static final String TABLE_NAME =
-      StripeCompactionsPerformanceEvaluation.class.getSimpleName();
+  private static final TableName TABLE_NAME =
+    TableName.valueOf(StripeCompactionsPerformanceEvaluation.class.getSimpleName());
   private static final byte[] COLUMN_FAMILY = Bytes.toBytes("CF");
   private static final int MIN_NUM_SERVERS = 1;
 
@@ -199,9 +199,8 @@ public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool {
     status(String.format("%s test starting on %d servers; preloading 0 to %d and writing to %d",
         description, numServers, startKey, endKey));
 
-    TableName tn = TableName.valueOf(TABLE_NAME);
     if (preloadKeys > 0) {
-      MultiThreadedWriter preloader = new MultiThreadedWriter(dataGen, conf, tn);
+      MultiThreadedWriter preloader = new MultiThreadedWriter(dataGen, conf, TABLE_NAME);
       long time = System.currentTimeMillis();
       preloader.start(0, startKey, writeThreads);
       preloader.waitForFinish();
@@ -214,8 +213,8 @@ public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool {
       Thread.sleep(waitTime);
     }
 
-    MultiThreadedWriter writer = new MultiThreadedWriter(dataGen, conf, tn);
-    MultiThreadedReader reader = new MultiThreadedReader(dataGen, conf, tn, 100);
+    MultiThreadedWriter writer = new MultiThreadedWriter(dataGen, conf, TABLE_NAME);
+    MultiThreadedReader reader = new MultiThreadedReader(dataGen, conf, TABLE_NAME, 100);
     // reader.getMetrics().enable();
     reader.linkToWriter(writer);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
index 3ead509..dea412f 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.ServerLoad;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -129,7 +130,7 @@ public class Action {
 
     LOG.info("Moving " + victimRegions.size() + " regions from " + fromServers.size()
         + " servers to " + toServers.size() + " different servers");
-    HBaseAdmin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
+    Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
     for (byte[] victimRegion : victimRegions) {
       int targetIx = RandomUtils.nextInt(toServers.size());
       admin.move(victimRegion, Bytes.toBytes(toServers.get(targetIx).getServerName()));
@@ -137,7 +138,7 @@ public class Action {
   }
 
   protected void forceBalancer() throws Exception {
-    HBaseAdmin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
+    Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
     boolean result = admin.balancer();
     if (!result) {
       LOG.error("Balancer didn't succeed");

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
index 24c0dcb..aa29b78 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java
@@ -23,6 +23,8 @@ import java.io.IOException;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -30,13 +32,11 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Action the adds a column family to a table.
  */
 public class AddColumnAction extends Action {
-  private final byte[] tableName;
-  private final String tableNameString;
-  private HBaseAdmin admin;
+  private final TableName tableName;
+  private Admin admin;
 
   public AddColumnAction(String tableName) {
-    tableNameString = tableName;
-    this.tableName = Bytes.toBytes(tableName);
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
@@ -55,7 +55,7 @@ public class AddColumnAction extends Action {
       columnDescriptor = new HColumnDescriptor(RandomStringUtils.randomAlphabetic(5));
     }
 
-    LOG.debug("Performing action: Adding " + columnDescriptor + " to " + tableNameString);
+    LOG.debug("Performing action: Adding " + columnDescriptor + " to " + tableName);
 
     tableDescriptor.addFamily(columnDescriptor);
     admin.modifyTable(tableName, tableDescriptor);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java
index 3479f46..62db382 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java
@@ -23,6 +23,8 @@ import java.util.Random;
 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.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.regionserver.BloomType;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -32,30 +34,27 @@ import org.apache.hadoop.hbase.util.Bytes;
  * table
  */
 public class ChangeBloomFilterAction extends Action {
-  private final byte[] tableNameBytes;
   private final long sleepTime;
-  private final String tableName;
+  private final TableName tableName;
 
   public ChangeBloomFilterAction(String tableName) {
     this(-1, tableName);
   }
 
   public ChangeBloomFilterAction(int sleepTime, String tableName) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
     this.sleepTime = sleepTime;
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
   public void perform() throws Exception {
     Random random = new Random();
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Change bloom filter on all columns of table "
         + tableName);
-    HTableDescriptor tableDescriptor = admin.getTableDescriptor(Bytes
-        .toBytes(tableName));
+    HTableDescriptor tableDescriptor = admin.getTableDescriptor(tableName);
     HColumnDescriptor[] columnDescriptors = tableDescriptor.getColumnFamilies();
 
     if (columnDescriptors == null || columnDescriptors.length == 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
index eefc7fa..07deb3d 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java
@@ -23,6 +23,8 @@ import java.util.Random;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.io.compress.Compression.Algorithm;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -31,15 +33,15 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Action that changes the compression algorithm on a column family from a list of tables.
  */
 public class ChangeCompressionAction extends Action {
-  private final byte[] tableName;
+  private final TableName tableName;
   private final String tableNameString;
 
-  private HBaseAdmin admin;
+  private Admin admin;
   private Random random;
 
   public ChangeCompressionAction(String tableName) {
     tableNameString = tableName;
-    this.tableName = Bytes.toBytes(tableName);
+    this.tableName = TableName.valueOf(tableName);
     this.random = new Random();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java
index d2864ab..e44c132 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java
@@ -23,6 +23,8 @@ import java.util.Random;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -31,15 +33,13 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Action that changes the encoding on a column family from a list of tables.
  */
 public class ChangeEncodingAction extends Action {
-  private final byte[] tableName;
-  private final String tableNameString;
+  private final TableName tableName;
 
-  private HBaseAdmin admin;
+  private Admin admin;
   private Random random;
 
   public ChangeEncodingAction(String tableName) {
-    tableNameString = tableName;
-    this.tableName = Bytes.toBytes(tableName);
+    this.tableName = TableName.valueOf(tableName);
     this.random = new Random();
   }
 
@@ -58,7 +58,7 @@ public class ChangeEncodingAction extends Action {
       return;
     }
 
-    LOG.debug("Performing action: Changing encodings on " + tableNameString);
+    LOG.debug("Performing action: Changing encodings on " + tableName);
     // possible DataBlockEncoding id's
     int[] possibleIds = {0, 2, 3, 4/*, 6*/};
     for (HColumnDescriptor descriptor : columnDescriptors) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java
index af84de8..48799e6 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java
@@ -23,6 +23,8 @@ import java.util.Random;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -32,15 +34,15 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Always keeps at least 1 as the number of versions.
  */
 public class ChangeVersionsAction extends Action {
-  private final byte[] tableName;
+  private final TableName tableName;
   private final String tableNameString;
 
-  private HBaseAdmin admin;
+  private Admin admin;
   private Random random;
 
   public ChangeVersionsAction(String tableName) {
     tableNameString = tableName;
-    this.tableName = Bytes.toBytes(tableName);
+    this.tableName = TableName.valueOf(tableName);
     this.random = new Random();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
index e18f82a..410859a 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java
@@ -23,7 +23,9 @@ import java.util.List;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -31,10 +33,9 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Region that queues a compaction of a random region from the table.
  */
 public class CompactRandomRegionOfTableAction extends Action {
-  private final byte[] tableNameBytes;
   private final int majorRatio;
   private final long sleepTime;
-  private final String tableName;
+  private final TableName tableName;
 
   public CompactRandomRegionOfTableAction(
       String tableName, float majorRatio) {
@@ -43,21 +44,20 @@ public class CompactRandomRegionOfTableAction extends Action {
 
   public CompactRandomRegionOfTableAction(
       int sleepTime, String tableName, float majorRatio) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
     this.majorRatio = (int) (100 * majorRatio);
     this.sleepTime = sleepTime;
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     boolean major = RandomUtils.nextInt(100) < majorRatio;
 
     LOG.info("Performing action: Compact random region of table "
       + tableName + ", major=" + major);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.isEmpty()) {
       LOG.info("Table " + tableName + " doesn't have regions to compact");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
index 1a3e151..63af0b8 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions;
 
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -47,7 +48,7 @@ public class CompactTableAction extends Action {
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     boolean major = RandomUtils.nextInt(100) < majorRatio;
 
     LOG.info("Performing action: Compact table " + tableName + ", major=" + major);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
index 3012d68..671bf2b 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java
@@ -22,7 +22,9 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -30,27 +32,25 @@ import org.apache.hadoop.hbase.util.Bytes;
 * Action that tries to flush a random region of a table.
 */
 public class FlushRandomRegionOfTableAction extends Action {
-  private final byte[] tableNameBytes;
   private final long sleepTime;
-  private final String tableName;
+  private final TableName tableName;
 
   public FlushRandomRegionOfTableAction(String tableName) {
    this (-1, tableName);
   }
 
   public FlushRandomRegionOfTableAction(int sleepTime, String tableName) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
     this.sleepTime = sleepTime;
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Flush random region of table " + tableName);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.isEmpty()) {
       LOG.info("Table " + tableName + " doesn't have regions to flush");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
index e032165..4ae21d1 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java
@@ -19,6 +19,8 @@
 package org.apache.hadoop.hbase.chaos.actions;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -26,28 +28,26 @@ import org.apache.hadoop.hbase.util.Bytes;
 * Action that tries to flush a table.
 */
 public class FlushTableAction extends Action {
-  private final byte[] tableNameBytes;
   private final long sleepTime;
-  private final String tableName;
+  private final TableName tableName;
 
   public FlushTableAction(String tableName) {
     this(-1, tableName);
   }
 
   public FlushTableAction(int sleepTime, String tableName) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
     this.sleepTime = sleepTime;
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Flush table " + tableName);
     try {
-      admin.flush(tableNameBytes);
+      admin.flush(tableName.toBytes());
     } catch (Exception ex) {
       LOG.warn("Flush failed, might be caused by other chaos: " + ex.getMessage());
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
index f5235d4..ecb58da 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java
@@ -23,6 +23,8 @@ import java.util.List;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -30,8 +32,7 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Action to merge regions of a table.
  */
 public class MergeRandomAdjacentRegionsOfTableAction extends Action {
-  private final byte[] tableNameBytes;
-  private final String tableName;
+  private final TableName tableName;
   private final long sleepTime;
 
   public MergeRandomAdjacentRegionsOfTableAction(String tableName) {
@@ -39,18 +40,17 @@ public class MergeRandomAdjacentRegionsOfTableAction extends Action {
   }
 
   public MergeRandomAdjacentRegionsOfTableAction(int sleepTime, String tableName) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
     this.sleepTime = sleepTime;
   }
 
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Merge random adjacent regions of table " + tableName);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.size() < 2) {
       LOG.info("Table " + tableName + " doesn't have enough regions to merge");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java
index e8a2b0e..0981fb5 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java
@@ -22,7 +22,9 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -31,8 +33,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 */
 public class MoveRandomRegionOfTableAction extends Action {
   private final long sleepTime;
-  private final byte[] tableNameBytes;
-  private final String tableName;
+  private final TableName tableName;
 
   public MoveRandomRegionOfTableAction(String tableName) {
     this(-1, tableName);
@@ -40,8 +41,7 @@ public class MoveRandomRegionOfTableAction extends Action {
 
   public MoveRandomRegionOfTableAction(long sleepTime, String tableName) {
     this.sleepTime = sleepTime;
-    this.tableNameBytes = Bytes.toBytes(tableName);
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
@@ -51,10 +51,10 @@ public class MoveRandomRegionOfTableAction extends Action {
     }
 
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Move random region of table " + tableName);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.isEmpty()) {
       LOG.info("Table " + tableName + " doesn't have regions to move");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
index d40ef07..50d1948 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java
@@ -25,7 +25,9 @@ import java.util.List;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.factories.MonkeyConstants;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -34,8 +36,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 */
 public class MoveRegionsOfTableAction extends Action {
   private final long sleepTime;
-  private final byte[] tableNameBytes;
-  private final String tableName;
+  private final TableName tableName;
   private final long maxTime;
 
   public MoveRegionsOfTableAction(String tableName) {
@@ -44,8 +45,7 @@ public class MoveRegionsOfTableAction extends Action {
 
   public MoveRegionsOfTableAction(long sleepTime, long maxSleepTime, String tableName) {
     this.sleepTime = sleepTime;
-    this.tableNameBytes = Bytes.toBytes(tableName);
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
     this.maxTime = maxSleepTime;
   }
 
@@ -55,12 +55,12 @@ public class MoveRegionsOfTableAction extends Action {
       Thread.sleep(sleepTime);
     }
 
-    HBaseAdmin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
+    Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin();
     Collection<ServerName> serversList = admin.getClusterStatus().getServers();
     ServerName[] servers = serversList.toArray(new ServerName[serversList.size()]);
 
     LOG.info("Performing action: Move regions of table " + tableName);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.isEmpty()) {
       LOG.info("Table " + tableName + " doesn't have regions to move");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
index 9251100..bfcf1b5 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
@@ -24,6 +24,8 @@ import java.util.Set;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -31,15 +33,15 @@ import org.apache.hadoop.hbase.util.Bytes;
  * Action that removes a column family.
  */
 public class RemoveColumnAction extends Action {
-  private final byte[] tableName;
+  private final TableName tableName;
   private final Set<String> protectedColumns;
   private final String tableNameString;
-  private HBaseAdmin admin;
+  private Admin admin;
   private Random random;
 
   public RemoveColumnAction(String tableName, Set<String> protectedColumns) {
     tableNameString = tableName;
-    this.tableName = Bytes.toBytes(tableName);
+    this.tableName = TableName.valueOf(tableName);
     this.protectedColumns = protectedColumns;
     random = new Random();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java
index 31ccf44..c0dedaa 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java
@@ -19,13 +19,15 @@
 package org.apache.hadoop.hbase.chaos.actions;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 
 /**
 * Action that tries to take a snapshot of a table.
 */
 public class SnapshotTableAction extends Action {
-  private final String tableName;
+  private final TableName tableName;
   private final long sleepTime;
 
   public SnapshotTableAction(String tableName) {
@@ -33,7 +35,7 @@ public class SnapshotTableAction extends Action {
   }
 
   public SnapshotTableAction(int sleepTime, String tableName) {
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
     this.sleepTime = sleepTime;
   }
 
@@ -41,7 +43,7 @@ public class SnapshotTableAction extends Action {
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
     String snapshotName = tableName + "-it-" + System.currentTimeMillis();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Snapshot table " + tableName);
     admin.snapshot(snapshotName, tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
index 0c0685c..d0c3419 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java
@@ -22,7 +22,9 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
 
@@ -30,27 +32,25 @@ import org.apache.hadoop.hbase.util.Bytes;
 * Action that tries to split a random region of a table.
 */
 public class SplitRandomRegionOfTableAction extends Action {
-  private final byte[] tableNameBytes;
   private final long sleepTime;
-  private final String tableName;
+  private final TableName tableName;
 
   public SplitRandomRegionOfTableAction(String tableName) {
     this(-1, tableName);
   }
 
   public SplitRandomRegionOfTableAction(int sleepTime, String tableName) {
-    this.tableNameBytes = Bytes.toBytes(tableName);
     this.sleepTime = sleepTime;
-    this.tableName = tableName;
+    this.tableName = TableName.valueOf(tableName);
   }
 
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     LOG.info("Performing action: Split random region of table " + tableName);
-    List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
+    List<HRegionInfo> regions = admin.getTableRegions(tableName);
     if (regions == null || regions.isEmpty()) {
       LOG.info("Table " + tableName + " doesn't have regions to split");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java
index c8e87ae..05a72cf 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java
@@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.chaos.actions;
 import java.util.Random;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.TableName;
 
@@ -39,7 +40,7 @@ public class TruncateTableAction extends Action {
   @Override
   public void perform() throws Exception {
     HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     boolean preserveSplits = random.nextBoolean();
     LOG.info("Performing action: Truncate table " + tableName.getNameAsString() +

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
index fa02f3c..1e2203a 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.IntegrationTests;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Consistency;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -196,7 +197,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase {
     if (replicaCount == NUM_REPLICA_COUNT_DEFAULT) return;
 
     TableName t = TableName.valueOf(getTablename());
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     HTableDescriptor desc = admin.getTableDescriptor(t);
     desc.addCoprocessor(SlowMeCoproScanOperations.class.getName());
     HBaseTestingUtility.modifyTableSync(admin, desc);
@@ -226,7 +227,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase {
   }
 
   private void setupTable() throws IOException, InterruptedException {
-    if (util.getHBaseAdmin().tableExists(getTablename())) {
+    if (util.getHBaseAdmin().tableExists(TableName.valueOf(getTablename()))) {
       util.deleteTable(getTablename());
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
index 68012a3..766c66f 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.IntegrationTests;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.Type;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
@@ -274,7 +275,7 @@ public class IntegrationTestImportTsv implements Configurable, Tool {
       } catch (Exception e) {
         throw new IOException("Underlying MapReduce job failed. Aborting commit.", e);
       } finally {
-        if (util.getHBaseAdmin().tableExists(table)) {
+        if (util.getHBaseAdmin().tableExists(TableName.valueOf(table))) {
           util.deleteTable(table);
         }
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
index a1da601..322dd81 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.IntegrationTestBase;
 import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.IntegrationTests;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
@@ -382,7 +383,7 @@ public void cleanUpCluster() throws Exception {
     HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_NAME));
     htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
 
-    HBaseAdmin admin = getTestingUtil(getConf()).getHBaseAdmin();
+    Admin admin = getTestingUtil(getConf()).getHBaseAdmin();
     admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), 40);
 
     doLoad(getConf(), htd);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java
index eb3bb70..083fca2 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.IntegrationTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.factories.MonkeyFactory;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Consistency;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
@@ -156,7 +157,7 @@ public class IntegrationTestTimeBoundedRequestsWithRegionReplicas extends Integr
 
     // flush the table
     LOG.info("Flushing the table");
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     admin.flush(getTablename());
 
     // re-open the regions to make sure that the replicas are up to date
@@ -166,8 +167,8 @@ public class IntegrationTestTimeBoundedRequestsWithRegionReplicas extends Integr
       Threads.sleep(refreshTime);
     } else {
       LOG.info("Reopening the table");
-      admin.disableTable(getTablename());
-      admin.enableTable(getTablename());
+      admin.disableTable(TableName.valueOf(getTablename()));
+      admin.enableTable(TableName.valueOf(getTablename()));
     }
 
     // We should only start the ChaosMonkey after the readers are started and have cached

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java
index dc15a95..86ccff3 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java
@@ -25,6 +25,8 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.IntegrationTestingUtility;
 import org.apache.hadoop.hbase.IntegrationTests;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -58,11 +60,11 @@ public class IntegrationTestSendTraceRequests extends AbstractHBaseTool {
 
   public static final String TABLE_NAME_DEFAULT = "SendTracesTable";
   public static final String COLUMN_FAMILY_DEFAULT = "D";
-  private String tableName = TABLE_NAME_DEFAULT;
-  private String familyName = COLUMN_FAMILY_DEFAULT;
+  private TableName tableName = TableName.valueOf(TABLE_NAME_DEFAULT);
+  private byte[] familyName = Bytes.toBytes(COLUMN_FAMILY_DEFAULT);
   private IntegrationTestingUtility util;
   private Random random = new Random();
-  private HBaseAdmin admin;
+  private Admin admin;
   private SpanReceiverHost receiverHost;
 
   public static void main(String[] args) throws Exception {
@@ -83,8 +85,8 @@ public class IntegrationTestSendTraceRequests extends AbstractHBaseTool {
     String tableNameString = cmd.getOptionValue(TABLE_ARG, TABLE_NAME_DEFAULT);
     String familyString = cmd.getOptionValue(CF_ARG, COLUMN_FAMILY_DEFAULT);
 
-    this.tableName = tableNameString;
-    this.familyName = familyString;
+    this.tableName = TableName.valueOf(tableNameString);
+    this.familyName = Bytes.toBytes(familyString);
   }
 
   @Override
@@ -248,20 +250,18 @@ public class IntegrationTestSendTraceRequests extends AbstractHBaseTool {
           Put p = new Put(Bytes.toBytes(rk));
           for (int y = 0; y < 10; y++) {
             random.nextBytes(value);
-            p.add(Bytes.toBytes(familyName),
-                Bytes.toBytes(random.nextLong()),
-                value);
+            p.add(familyName, Bytes.toBytes(random.nextLong()), value);
           }
           ht.put(p);
         }
         if ((x % 1000) == 0) {
-          admin.flush(Bytes.toBytes(tableName));
+          admin.flush(tableName.toBytes());
         }
       } finally {
         traceScope.close();
       }
     }
-    admin.flush(Bytes.toBytes(tableName));
+    admin.flush(tableName.toBytes());
     return rowKeys;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
index 2667eaa..489aaf1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
@@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.TableNotEnabledException;
 import org.apache.hadoop.hbase.TableNotFoundException;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -453,7 +454,7 @@ public final class Canary implements Tool {
    * Canary entry point for specified table.
    * @throws Exception
    */
-  public static void sniff(final HBaseAdmin admin, TableName tableName) throws Exception {
+  public static void sniff(final Admin admin, TableName tableName) throws Exception {
     sniff(admin, new StdOutSink(), tableName.getNameAsString());
   }
 
@@ -461,10 +462,10 @@ public final class Canary implements Tool {
    * Canary entry point for specified table.
    * @throws Exception
    */
-  private static void sniff(final HBaseAdmin admin, final Sink sink, String tableName)
+  private static void sniff(final Admin admin, final Sink sink, String tableName)
       throws Exception {
-    if (admin.isTableAvailable(tableName)) {
-      sniff(admin, sink, admin.getTableDescriptor(tableName.getBytes()));
+    if (admin.isTableAvailable(TableName.valueOf(tableName))) {
+      sniff(admin, sink, admin.getTableDescriptor(TableName.valueOf(tableName)));
     } else {
       LOG.warn(String.format("Table %s is not available", tableName));
     }
@@ -473,7 +474,7 @@ public final class Canary implements Tool {
   /*
    * Loops over regions that owns this table, and output some information abouts the state.
    */
-  private static void sniff(final HBaseAdmin admin, final Sink sink, HTableDescriptor tableDesc)
+  private static void sniff(final Admin admin, final Sink sink, HTableDescriptor tableDesc)
       throws Exception {
     HTable table = null;
 
@@ -484,7 +485,7 @@ public final class Canary implements Tool {
     }
 
     try {
-      for (HRegionInfo region : admin.getTableRegions(tableDesc.getName())) {
+      for (HRegionInfo region : admin.getTableRegions(tableDesc.getTableName())) {
         try {
           sniffRegion(admin, sink, region, table);
         } catch (Exception e) {
@@ -502,7 +503,7 @@ public final class Canary implements Tool {
    * failure.
    */
   private static void sniffRegion(
-      final HBaseAdmin admin,
+      final Admin admin,
       final Sink sink,
       HRegionInfo region,
       HTable table) throws Exception {

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
index 2852cab..641fd36 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HTable;
@@ -143,7 +144,7 @@ public class HBaseFsckRepair {
    * Contacts a region server and waits up to hbase.hbck.close.timeout ms
    * (default 120s) to close the region.  This bypasses the active hmaster.
    */
-  public static void closeRegionSilentlyAndWait(HBaseAdmin admin,
+  public static void closeRegionSilentlyAndWait(Admin admin,
       ServerName server, HRegionInfo region) throws IOException, InterruptedException {
     HConnection connection = admin.getConnection();
     AdminService.BlockingInterface rs = connection.getAdmin(server);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/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 53a3b93..c67f3f8 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
@@ -54,11 +54,13 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.Waiter.Predicate;
+import org.apache.hadoop.hbase.client.Admin;
 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.HConnection;
+import org.apache.hadoop.hbase.client.HConnectionManager;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
@@ -1468,7 +1470,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
   /**
    * Modify a table, synchronous. Waiting logic similar to that of {@code admin.rb#alter_status}.
    */
-  public static void modifyTableSync(HBaseAdmin admin, HTableDescriptor desc)
+  public static void modifyTableSync(Admin admin, HTableDescriptor desc)
       throws IOException, InterruptedException {
     admin.modifyTable(desc.getTableName(), desc);
     Pair<Integer, Integer> status = new Pair<Integer, Integer>() {{
@@ -1494,7 +1496,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
   /**
    * Set the number of Region replicas.
    */
-  public static void setReplicas(HBaseAdmin admin, TableName table, int replicaCount)
+  public static void setReplicas(Admin admin, TableName table, int replicaCount)
       throws IOException, InterruptedException {
     admin.disableTable(table);
     HTableDescriptor desc = admin.getTableDescriptor(table);
@@ -2041,8 +2043,8 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     HConnection conn = table.getConnection();
     conn.clearRegionCache();
     // assign all the new regions IF table is enabled.
-    HBaseAdmin admin = getHBaseAdmin();
-    if (admin.isTableEnabled(table.getTableName())) {
+    Admin admin = getHBaseAdmin();
+    if (admin.isTableEnabled(table.getName())) {
       for(HRegionInfo hri : newRegions) {
         admin.assign(hri.getRegionName());
       }
@@ -2469,15 +2471,15 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
   }
 
   /**
-   * Returns a HBaseAdmin instance.
+   * Returns a Admin instance.
    * This instance is shared between HBaseTestingUtility instance users.
    * Closing it has no effect, it will be closed automatically when the
    * cluster shutdowns
    *
-   * @return The HBaseAdmin instance.
+   * @return An Admin instance.
    * @throws IOException
    */
-  public synchronized HBaseAdmin getHBaseAdmin()
+  public synchronized Admin getHBaseAdmin()
   throws IOException {
     if (hbaseAdmin == null){
       hbaseAdmin = new HBaseAdminForTests(getConfiguration());
@@ -2648,7 +2650,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     waitTableAvailable(getHBaseAdmin(), table, 30000);
   }
 
-  public void waitTableAvailable(HBaseAdmin admin, byte[] table)
+  public void waitTableAvailable(Admin admin, byte[] table)
       throws InterruptedException, IOException {
     waitTableAvailable(admin, table, 30000);
   }
@@ -2665,10 +2667,10 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     waitTableAvailable(getHBaseAdmin(), table, timeoutMillis);
   }
 
-  public void waitTableAvailable(HBaseAdmin admin, byte[] table, long timeoutMillis)
+  public void waitTableAvailable(Admin admin, byte[] table, long timeoutMillis)
   throws InterruptedException, IOException {
     long startWait = System.currentTimeMillis();
-    while (!admin.isTableAvailable(table)) {
+    while (!admin.isTableAvailable(TableName.valueOf(table))) {
       assertTrue("Timed out waiting for table to become available " +
         Bytes.toStringBinary(table),
         System.currentTimeMillis() - startWait < timeoutMillis);
@@ -2690,7 +2692,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     waitTableEnabled(getHBaseAdmin(), table, 30000);
   }
 
-  public void waitTableEnabled(HBaseAdmin admin, byte[] table)
+  public void waitTableEnabled(Admin admin, byte[] table)
       throws InterruptedException, IOException {
     waitTableEnabled(admin, table, 30000);
   }
@@ -2709,12 +2711,13 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     waitTableEnabled(getHBaseAdmin(), table, timeoutMillis);
   }
 
-  public void waitTableEnabled(HBaseAdmin admin, byte[] table, long timeoutMillis)
+  public void waitTableEnabled(Admin admin, byte[] table, long timeoutMillis)
   throws InterruptedException, IOException {
+    TableName tableName = TableName.valueOf(table);
     long startWait = System.currentTimeMillis();
     waitTableAvailable(admin, table, timeoutMillis);
     long remainder = System.currentTimeMillis() - startWait;
-    while (!admin.isTableEnabled(table)) {
+    while (!admin.isTableEnabled(tableName)) {
       assertTrue("Timed out waiting for table to become available and enabled " +
          Bytes.toStringBinary(table),
          System.currentTimeMillis() - remainder < timeoutMillis);
@@ -2726,7 +2729,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     // Below we do a get.  The get will retry if a NotServeringRegionException or a
     // RegionOpeningException.  It is crass but when done all will be online.
     try {
-      Canary.sniff(admin, TableName.valueOf(table));
+      Canary.sniff(admin, tableName);
     } catch (Exception e) {
       throw new IOException(e);
     }
@@ -3276,7 +3279,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
     }
 
     int totalNumberOfRegions = 0;
-    HBaseAdmin admin = new HBaseAdmin(conf);
+    HConnection unmanagedConnection = HConnectionManager.createConnection(conf);
+    Admin admin = unmanagedConnection.getAdmin();
+
     try {
       // create a table a pre-splits regions.
       // The number of splits is set as:
@@ -3303,6 +3308,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
           " already exists, continuing");
     } finally {
       admin.close();
+      unmanagedConnection.close();
     }
     return totalNumberOfRegions;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index d31c843..2ac4135 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -47,6 +47,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Consistency;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Get;
@@ -272,7 +273,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
    * {@code opts.presplitRegions} is specified or when the existing table's
    * region replica count doesn't match {@code opts.replicas}.
    */
-  static boolean checkTable(HBaseAdmin admin, TestOptions opts) throws IOException {
+  static boolean checkTable(Admin admin, TestOptions opts) throws IOException {
     TableName tableName = TableName.valueOf(opts.tableName);
     boolean needsDelete = false, exists = admin.tableExists(tableName);
     boolean isReadCmd = opts.cmdName.toLowerCase().contains("read")

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
index 3625a89..83aba8e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.master.MasterFileSystem;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -76,7 +77,7 @@ public class TestHColumnDescriptorDefaultVersions {
 
   @Test
   public void testCreateTableWithDefault() throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with one family
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
@@ -97,7 +98,7 @@ public class TestHColumnDescriptorDefaultVersions {
     TEST_UTIL.getConfiguration().setInt("hbase.column.max.version", 3);
     TEST_UTIL.startMiniCluster(1);
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with one family
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     HColumnDescriptor hcd = new HColumnDescriptor(FAMILY);
@@ -119,7 +120,7 @@ public class TestHColumnDescriptorDefaultVersions {
     TEST_UTIL.getConfiguration().setInt("hbase.column.max.version", 3);
     TEST_UTIL.startMiniCluster(1);
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with one family
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     HColumnDescriptor hcd =
@@ -140,7 +141,7 @@ public class TestHColumnDescriptorDefaultVersions {
 
   private void verifyHColumnDescriptor(int expected, final TableName tableName,
       final byte[]... families) throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     // Verify descriptor from master
     HTableDescriptor htd = admin.getTableDescriptor(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java
index a633027..1448bf2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java
@@ -29,6 +29,7 @@ import java.util.Random;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HConnection;
@@ -209,7 +210,7 @@ public class TestMetaTableAccessor {
     assertFalse(MetaTableAccessor.tableExists(hConnection, name));
     UTIL.createTable(name, HConstants.CATALOG_FAMILY);
     assertTrue(MetaTableAccessor.tableExists(hConnection, name));
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     admin.disableTable(name);
     admin.deleteTable(name);
     assertFalse(MetaTableAccessor.tableExists(hConnection, name));

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
index bdde696..66d23d9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java
@@ -33,6 +33,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -58,7 +59,7 @@ public class TestNamespace {
   private static HMaster master;
   protected final static int NUM_SLAVES_BASE = 4;
   private static HBaseTestingUtility TEST_UTIL;
-  protected static HBaseAdmin admin;
+  protected static Admin admin;
   protected static HBaseCluster cluster;
   private static ZKNamespaceManager zkNamespaceManager;
   private String prefix = "TestNamespace";
@@ -198,8 +199,8 @@ public class TestNamespace {
     String nsName = prefix+"_"+testName;
     LOG.info(testName);
 
-    byte[] tableName = Bytes.toBytes("my_table");
-    byte[] tableNameFoo = Bytes.toBytes(nsName+":my_table");
+    TableName tableName = TableName.valueOf("my_table");
+    TableName tableNameFoo = TableName.valueOf(nsName+":my_table");
     //create namespace and verify
     admin.createNamespace(NamespaceDescriptor.create(nsName).build());
     TEST_UTIL.createTable(tableName, Bytes.toBytes(nsName));
@@ -276,13 +277,13 @@ public class TestNamespace {
 
   @Test
   public void createTableInSystemNamespace() throws Exception {
-    String tableName = "hbase:createTableInSystemNamespace";
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    TableName tableName = TableName.valueOf("hbase:createTableInSystemNamespace");
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     HColumnDescriptor colDesc = new HColumnDescriptor("cf1");
     desc.addFamily(colDesc);
     admin.createTable(desc);
     assertEquals(0, admin.listTables().length);
-    assertTrue(admin.tableExists(Bytes.toBytes(tableName)));
+    assertTrue(admin.tableExists(tableName));
     admin.disableTable(desc.getTableName());
     admin.deleteTable(desc.getTableName());
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
index 1694d09..a486f4b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
@@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.master.cleaner.HFileCleaner;
 import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy;
@@ -117,7 +118,7 @@ public class TestHFileArchiving {
         TableName.valueOf("testRemovesRegionDirOnArchive");
     UTIL.createTable(TABLE_NAME, TEST_FAM);
 
-    final HBaseAdmin admin = UTIL.getHBaseAdmin();
+    final Admin admin = UTIL.getHBaseAdmin();
 
     // get the current store files for the region
     List<HRegion> servingRegions = UTIL.getHBaseCluster().getRegions(TABLE_NAME);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
index 23a930a..c24b4e1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
@@ -88,9 +88,6 @@ public class TestAdmin {
   final Log LOG = LogFactory.getLog(getClass());
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private Admin admin;
-  // We use actual HBaseAdmin instance instead of going via Admin interface in
-  // here because makes use of an internal HBA method (TODO: Fix.).
-  private HBaseAdmin rawAdminInstance;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
@@ -110,7 +107,7 @@ public class TestAdmin {
 
   @Before
   public void setUp() throws Exception {
-    this.admin = this.rawAdminInstance = TEST_UTIL.getHBaseAdmin();
+    this.admin = TEST_UTIL.getHBaseAdmin();
   }
 
   @After
@@ -151,11 +148,12 @@ public class TestAdmin {
   @Test (timeout=300000)
   public void testDeleteEditUnknownColumnFamilyAndOrTable() throws IOException {
     // Test we get exception if we try to
-    final String nonexistent = "nonexistent";
-    HColumnDescriptor nonexistentHcd = new HColumnDescriptor(nonexistent);
+    final TableName nonexistentTable = TableName.valueOf("nonexistent");
+    final byte[] nonexistentColumn = Bytes.toBytes("nonexistent");
+    HColumnDescriptor nonexistentHcd = new HColumnDescriptor(nonexistentColumn);
     Exception exception = null;
     try {
-      this.admin.addColumn(TableName.valueOf(nonexistent), nonexistentHcd);
+      this.admin.addColumn(nonexistentTable, nonexistentHcd);
     } catch (IOException e) {
       exception = e;
     }
@@ -163,7 +161,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      this.admin.deleteTable(TableName.valueOf(nonexistent));
+      this.admin.deleteTable(nonexistentTable);
     } catch (IOException e) {
       exception = e;
     }
@@ -171,7 +169,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      this.admin.deleteColumn(TableName.valueOf(nonexistent), Bytes.toBytes(nonexistent));
+      this.admin.deleteColumn(nonexistentTable, nonexistentColumn);
     } catch (IOException e) {
       exception = e;
     }
@@ -179,7 +177,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      this.admin.disableTable(TableName.valueOf(nonexistent));
+      this.admin.disableTable(nonexistentTable);
     } catch (IOException e) {
       exception = e;
     }
@@ -187,7 +185,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      this.admin.enableTable(TableName.valueOf(nonexistent));
+      this.admin.enableTable(nonexistentTable);
     } catch (IOException e) {
       exception = e;
     }
@@ -195,7 +193,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      this.admin.modifyColumn(TableName.valueOf(nonexistent), nonexistentHcd);
+      this.admin.modifyColumn(nonexistentTable, nonexistentHcd);
     } catch (IOException e) {
       exception = e;
     }
@@ -203,7 +201,7 @@ public class TestAdmin {
 
     exception = null;
     try {
-      HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(nonexistent));
+      HTableDescriptor htd = new HTableDescriptor(nonexistentTable);
       htd.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY));
       this.admin.modifyTable(htd.getTableName(), htd);
     } catch (IOException e) {
@@ -1759,6 +1757,10 @@ public class TestAdmin {
 
   @Test (timeout=300000)
   public void testGetRegion() throws Exception {
+    // We use actual HBaseAdmin instance instead of going via Admin interface in
+    // here because makes use of an internal HBA method (TODO: Fix.).
+    HBaseAdmin rawAdmin = new HBaseAdmin(TEST_UTIL.getConfiguration());
+
     final String name = "testGetRegion";
     LOG.info("Started " + name);
     final byte [] nameBytes = Bytes.toBytes(name);
@@ -1768,9 +1770,9 @@ public class TestAdmin {
     HRegionLocation regionLocation = t.getRegionLocation("mmm");
     HRegionInfo region = regionLocation.getRegionInfo();
     byte[] regionName = region.getRegionName();
-    Pair<HRegionInfo, ServerName> pair = rawAdminInstance.getRegion(regionName);
+    Pair<HRegionInfo, ServerName> pair = rawAdmin.getRegion(regionName);
     assertTrue(Bytes.equals(regionName, pair.getFirst().getRegionName()));
-    pair = rawAdminInstance.getRegion(region.getEncodedNameAsBytes());
+    pair = rawAdmin.getRegion(region.getEncodedNameAsBytes());
     assertTrue(Bytes.equals(regionName, pair.getFirst().getRegionName()));
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e91e2659/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
index b1a99ef..bcae508 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.MediumTests;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
 import org.apache.hadoop.hbase.coprocessor.ObserverContext;
@@ -50,7 +51,7 @@ public class TestClientOperationInterrupt {
   private static final Log LOG = LogFactory.getLog(TestClientOperationInterrupt.class);
 
   private static HBaseTestingUtility util;
-  private static final byte[] tableName = Bytes.toBytes("test");
+  private static final TableName tableName = TableName.valueOf("test");
   private static final byte[] dummy = Bytes.toBytes("dummy");
   private static final byte[] row1 = Bytes.toBytes("r1");
   private static final byte[] test = Bytes.toBytes("test");
@@ -73,7 +74,7 @@ public class TestClientOperationInterrupt {
     util = new HBaseTestingUtility(conf);
     util.startMiniCluster();
 
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       if (admin.isTableEnabled(tableName)) {
         admin.disableTable(tableName);


Mime
View raw message