hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [2/3] HBASE-11068 Update code to use Admin factory method instead of constructor
Date Mon, 04 Aug 2014 18:43:29 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java
index e16d99a..1dfcfbd 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java
@@ -62,7 +62,7 @@ public class TestCloneSnapshotFromClient {
   private int snapshot0Rows;
   private int snapshot1Rows;
   private TableName tableName;
-  private HBaseAdmin admin;
+  private Admin admin;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
@@ -148,7 +148,7 @@ public class TestCloneSnapshotFromClient {
   @Test(expected=SnapshotDoesNotExistException.class)
   public void testCloneNonExistentSnapshot() throws IOException, InterruptedException {
     String snapshotName = "random-snapshot-" + System.currentTimeMillis();
-    String tableName = "random-table-" + System.currentTimeMillis();
+    TableName tableName = TableName.valueOf("random-table-" + System.currentTimeMillis());
     admin.cloneSnapshot(snapshotName, tableName);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/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 4c1fc43..975140c 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
@@ -5450,7 +5450,7 @@ public class TestFromClientSide {
   }
 
   private void checkTableIsLegal(HTableDescriptor htd) throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.createTable(htd);
     assertTrue(admin.tableExists(htd.getTableName()));
     admin.disableTable(htd.getTableName());
@@ -5458,7 +5458,7 @@ public class TestFromClientSide {
   }
 
   private void checkTableIsIllegal(HTableDescriptor htd) throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     try {
       admin.createTable(htd);
       fail();

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/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 e19f44c..64ced17 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
@@ -405,7 +405,7 @@ public class TestFromClientSide3 {
   @Test
   public void testGetEmptyRow() throws Exception {
     //Create a table and put in 1 row
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(Bytes.toBytes("test")));
     desc.addFamily(new HColumnDescriptor(FAMILY));
     admin.createTable(desc);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
index 5ba831b..f67f491 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java
@@ -66,7 +66,7 @@ public class TestRestoreSnapshotFromClient {
   private int snapshot0Rows;
   private int snapshot1Rows;
   private TableName tableName;
-  private HBaseAdmin admin;
+  private Admin admin;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java
index 30b682b..b300dfa 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java
@@ -189,7 +189,7 @@ public class TestSnapshotCloneIndependence {
     FileSystem fs = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
     Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
 
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     final long startTime = System.currentTimeMillis();
     final TableName localTableName =
         TableName.valueOf(STRING_TABLE_NAME + startTime);
@@ -210,7 +210,7 @@ public class TestSnapshotCloneIndependence {
       if (!online) {
         admin.enableTable(localTableName);
       }
-      byte[] cloneTableName = Bytes.toBytes("test-clone-" + localTableName);
+      TableName cloneTableName = TableName.valueOf("test-clone-" + localTableName);
       admin.cloneSnapshot(snapshotName, cloneTableName);
 
       HTable clonedTable = new HTable(UTIL.getConfiguration(), cloneTableName);
@@ -267,7 +267,7 @@ public class TestSnapshotCloneIndependence {
     Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
 
     // Create a table
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     final long startTime = System.currentTimeMillis();
     final TableName localTableName =
         TableName.valueOf(STRING_TABLE_NAME + startTime);
@@ -286,7 +286,7 @@ public class TestSnapshotCloneIndependence {
       admin.enableTable(localTableName);
     }
 
-    byte[] cloneTableName = Bytes.toBytes("test-clone-" + localTableName);
+    TableName cloneTableName = TableName.valueOf("test-clone-" + localTableName);
 
     // Clone the snapshot
     byte[] snapshotName = Bytes.toBytes(snapshotNameAsString);
@@ -323,7 +323,7 @@ public class TestSnapshotCloneIndependence {
     Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
 
     // Create a table
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     final long startTime = System.currentTimeMillis();
     final TableName localTableName =
         TableName.valueOf(STRING_TABLE_NAME + startTime);
@@ -339,7 +339,7 @@ public class TestSnapshotCloneIndependence {
     if (!online) {
       admin.enableTable(localTableName);
     }
-    byte[] cloneTableName = Bytes.toBytes("test-clone-" + localTableName);
+    TableName cloneTableName = TableName.valueOf("test-clone-" + localTableName);
 
     // Clone the snapshot
     byte[] snapshotName = Bytes.toBytes(snapshotNameAsString);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
index 873bfb3..b5c1359 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
@@ -125,7 +125,7 @@ public class TestSnapshotFromClient {
    */
   @Test (timeout=300000)
   public void testMetaTablesSnapshot() throws Exception {
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     byte[] snapshotName = Bytes.toBytes("metaSnapshot");
 
     try {
@@ -143,7 +143,7 @@ public class TestSnapshotFromClient {
    */
   @Test (timeout=300000)
   public void testSnapshotDeletionWithRegex() throws Exception {
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     // make sure we don't fail on listing snapshots
     SnapshotTestingUtils.assertNoSnapshots(admin);
 
@@ -179,7 +179,7 @@ public class TestSnapshotFromClient {
    */
   @Test (timeout=300000)
   public void testOfflineTableSnapshot() throws Exception {
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     // make sure we don't fail on listing snapshots
     SnapshotTestingUtils.assertNoSnapshots(admin);
 
@@ -232,7 +232,7 @@ public class TestSnapshotFromClient {
 
   @Test (timeout=300000)
   public void testSnapshotFailsOnNonExistantTable() throws Exception {
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     // make sure we don't fail on listing snapshots
     SnapshotTestingUtils.assertNoSnapshots(admin);
     String tableName = "_not_a_table";
@@ -241,7 +241,7 @@ public class TestSnapshotFromClient {
     boolean fail = false;
     do {
     try {
-      admin.getTableDescriptor(Bytes.toBytes(tableName));
+      admin.getTableDescriptor(TableName.valueOf(tableName));
       fail = true;
           LOG.error("Table:" + tableName + " already exists, checking a new name");
       tableName = tableName+"!";
@@ -252,7 +252,7 @@ public class TestSnapshotFromClient {
 
     // snapshot the non-existant table
     try {
-      admin.snapshot("fail", tableName);
+      admin.snapshot("fail", TableName.valueOf(tableName));
       fail("Snapshot succeeded even though there is not table.");
     } catch (SnapshotCreationException e) {
       LOG.info("Correctly failed to snapshot a non-existant table:" + e.getMessage());
@@ -263,7 +263,7 @@ public class TestSnapshotFromClient {
   public void testOfflineTableSnapshotWithEmptyRegions() throws Exception {
     // test with an empty table with one region
 
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     // make sure we don't fail on listing snapshots
     SnapshotTestingUtils.assertNoSnapshots(admin);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java
index 965316f..f441d59 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java
@@ -83,7 +83,7 @@ public class TestSnapshotMetadata {
   private static final int BLOCK_SIZE = 98;
   private static final int MAX_VERSIONS = 8;
 
-  private HBaseAdmin admin;
+  private Admin admin;
   private String originalTableDescription;
   private HTableDescriptor originalTableDescriptor;
   TableName originalTableName;
@@ -185,7 +185,7 @@ public class TestSnapshotMetadata {
   public void testDescribeMatchesAfterClone() throws Exception {
     // Clone the original table
     final String clonedTableNameAsString = "clone" + originalTableName;
-    final byte[] clonedTableName = Bytes.toBytes(clonedTableNameAsString);
+    final TableName clonedTableName = TableName.valueOf(clonedTableNameAsString);
     final String snapshotNameAsString = "snapshot" + originalTableName
         + System.currentTimeMillis();
     final byte[] snapshotName = Bytes.toBytes(snapshotNameAsString);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java
index 8b2dd1d..8d7c6d5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java
@@ -88,7 +88,7 @@ public class TestTableSnapshotScanner {
     } else {
       util.createTable(tableName, FAMILIES);
     }
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     // put some stuff in the table
     HTable table = new HTable(util.getConfiguration(), tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java
index b02cb60..919fd24 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java
@@ -51,7 +51,7 @@ public class TestConstraint {
       .getLog(TestConstraint.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");
@@ -72,7 +72,7 @@ public class TestConstraint {
   public void testConstraintPasses() throws Exception {
     // create the table
     // it would be nice if this was also a method on the util
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     for (byte[] family : new byte[][] { dummy, test }) {
       desc.addFamily(new HColumnDescriptor(family));
     }
@@ -103,7 +103,7 @@ public class TestConstraint {
 
     // create the table
     // it would be nice if this was also a method on the util
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     for (byte[] family : new byte[][] { dummy, test }) {
       desc.addFamily(new HColumnDescriptor(family));
     }
@@ -140,7 +140,7 @@ public class TestConstraint {
   @Test
   public void testDisableConstraint() throws Throwable {
     // create the table
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     // add a family to the table
     for (byte[] family : new byte[][] { dummy, test }) {
       desc.addFamily(new HColumnDescriptor(family));
@@ -175,7 +175,7 @@ public class TestConstraint {
   @Test
   public void testDisableConstraints() throws Throwable {
     // create the table
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     // add a family to the table
     for (byte[] family : new byte[][] { dummy, test }) {
       desc.addFamily(new HColumnDescriptor(family));
@@ -207,7 +207,7 @@ public class TestConstraint {
   @Test
   public void testIsUnloaded() throws Exception {
     // create the table
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     // add a family to the table
     for (byte[] family : new byte[][] { dummy, test }) {
       desc.addFamily(new HColumnDescriptor(family));

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java
index 5e94262..850aedb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java
@@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.*;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.TestServerCustomProtocol;
@@ -55,7 +56,7 @@ public class TestClassLoading {
 
   private static MiniDFSCluster cluster;
 
-  static final String tableName = "TestClassLoading";
+  static final TableName tableName = TableName.valueOf("TestClassLoading");
   static final String cpName1 = "TestCP1";
   static final String cpName2 = "TestCP2";
   static final String cpName3 = "TestCP3";
@@ -137,7 +138,7 @@ public class TestClassLoading {
     LOG.info("Copied jar file to HDFS: " + jarFileOnHDFS2);
 
     // create a table that references the coprocessors
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor("test"));
       // without configuration values
     htd.setValue("COPROCESSOR$1", jarFileOnHDFS1.toString() + "|" + cpName1 +
@@ -145,7 +146,7 @@ public class TestClassLoading {
       // with configuration values
     htd.setValue("COPROCESSOR$2", jarFileOnHDFS2.toString() + "|" + cpName2 +
       "|" + Coprocessor.PRIORITY_USER + "|k1=v1,k2=v2,k3=v3");
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       if (admin.isTableEnabled(tableName)) {
         admin.disableTable(tableName);
@@ -166,7 +167,7 @@ public class TestClassLoading {
     MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster();
     for (HRegion region:
         hbase.getRegionServer(0).getOnlineRegionsLocalContext()) {
-      if (region.getRegionNameAsString().startsWith(tableName)) {
+      if (region.getRegionNameAsString().startsWith(tableName.getNameAsString())) {
         foundTableRegion = true;
         CoprocessorEnvironment env;
         env = region.getCoprocessorHost().findCoprocessorEnvironment(cpName1);
@@ -226,7 +227,7 @@ public class TestClassLoading {
     htd.addFamily(new HColumnDescriptor("test"));
     htd.setValue("COPROCESSOR$1", getLocalPath(jarFile) + "|" + cpName3 + "|" +
       Coprocessor.PRIORITY_USER);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.createTable(htd);
     waitForTable(htd.getTableName());
 
@@ -252,7 +253,7 @@ public class TestClassLoading {
     htd.addFamily(new HColumnDescriptor("test"));
     htd.setValue("COPROCESSOR$1", getLocalPath(jarFile) + "|" + cpName4 + "|" +
       Coprocessor.PRIORITY_USER);
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.createTable(htd);
     waitForTable(htd.getTableName());
 
@@ -296,7 +297,7 @@ public class TestClassLoading {
         " | org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver | | k=v ";
 
     // create a table that references the jar
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor("test"));
 
     // add 3 coprocessors by setting htd attributes directly.
@@ -314,7 +315,7 @@ public class TestClassLoading {
     htd.addCoprocessor(cpName6, new Path(getLocalPath(jarFile6)),
         Coprocessor.PRIORITY_USER, kvs);
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       if (admin.isTableEnabled(tableName)) {
         admin.disableTable(tableName);
@@ -333,7 +334,7 @@ public class TestClassLoading {
     MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster();
     for (HRegion region:
         hbase.getRegionServer(0).getOnlineRegionsLocalContext()) {
-      if (region.getRegionNameAsString().startsWith(tableName)) {
+      if (region.getRegionNameAsString().startsWith(tableName.getNameAsString())) {
         found_1 = found_1 ||
             (region.getCoprocessorHost().findCoprocessor(cpName1) != null);
         found_2 = found_2 ||
@@ -398,7 +399,7 @@ public class TestClassLoading {
     LOG.info("Copied jar file to HDFS: " + jarFileOnHDFS);
 
     // create a table that references the coprocessors
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor("test"));
       // without configuration values
     htd.setValue("COPROCESSOR$1", jarFileOnHDFS.toString() + "|" + cpName1 +
@@ -406,7 +407,7 @@ public class TestClassLoading {
       // with configuration values
     htd.setValue("COPROCESSOR$2", jarFileOnHDFS.toString() + "|" + cpName2 +
       "|" + Coprocessor.PRIORITY_USER + "|k1=v1,k2=v2,k3=v3");
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       if (admin.isTableEnabled(tableName)) {
         admin.disableTable(tableName);
@@ -422,7 +423,7 @@ public class TestClassLoading {
     MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster();
     for (HRegion region:
         hbase.getRegionServer(0).getOnlineRegionsLocalContext()) {
-      if (region.getRegionNameAsString().startsWith(tableName)) {
+      if (region.getRegionNameAsString().startsWith(tableName.getNameAsString())) {
         CoprocessorEnvironment env;
         env = region.getCoprocessorHost().findCoprocessorEnvironment(cpName1);
         if (env != null) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
index c121c57..e67bb9a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
@@ -30,6 +30,7 @@ import java.util.Map;
 import java.util.NavigableMap;
 import java.util.TreeMap;
 
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -283,7 +284,7 @@ public class TestCoprocessorEndpoint {
 
   @Test
   public void testMasterCoprocessorService() throws Throwable {
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     final TestProtos.EchoRequestProto request =
         TestProtos.EchoRequestProto.newBuilder().setMessage("hello").build();
     TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service =
@@ -314,7 +315,7 @@ public class TestCoprocessorEndpoint {
 
   @Test
   public void testMasterCoprocessorError() throws Throwable {
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service =
         TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(admin.coprocessorService());
     try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java
index 513032a..fc57493 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MediumTests;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
@@ -85,7 +86,7 @@ public class TestMasterCoprocessorExceptionWithAbort {
       HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_TABLE));
       htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
       try {
-        HBaseAdmin admin = UTIL.getHBaseAdmin();
+        Admin admin = UTIL.getHBaseAdmin();
         admin.createTable(htd);
         fail("BuggyMasterObserver failed to throw an exception.");
       } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java
index a99dbcf..b832547 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java
@@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MediumTests;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
@@ -191,7 +192,7 @@ public class TestMasterCoprocessorExceptionWithRemove {
 
     boolean threwDNRE = false;
     try {
-      HBaseAdmin admin = UTIL.getHBaseAdmin();
+      Admin admin = UTIL.getHBaseAdmin();
       admin.createTable(htd1);
     } catch (IOException e) {
       if (e.getClass().getName().equals("org.apache.hadoop.hbase.DoNotRetryIOException")) {
@@ -218,7 +219,7 @@ public class TestMasterCoprocessorExceptionWithRemove {
     // by creating another table: should not have a problem this time.
     HTableDescriptor htd2 = new HTableDescriptor(TableName.valueOf(TEST_TABLE2));
     htd2.addFamily(new HColumnDescriptor(TEST_FAMILY2));
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     try {
       admin.createTable(htd2);
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
index acdd3af..79acf4c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.ServerName;
 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.master.AssignmentManager;
@@ -1012,9 +1013,8 @@ public class TestMasterObserver {
 
   private static HBaseTestingUtility UTIL = new HBaseTestingUtility();
   private static byte[] TEST_SNAPSHOT = Bytes.toBytes("observed_snapshot");
-  private static TableName TEST_TABLE =
-      TableName.valueOf("observed_table");
-  private static byte[] TEST_CLONE = Bytes.toBytes("observed_clone");
+  private static TableName TEST_TABLE = TableName.valueOf("observed_table");
+  private static TableName TEST_CLONE = TableName.valueOf("observed_clone");
   private static byte[] TEST_FAMILY = Bytes.toBytes("fam1");
   private static byte[] TEST_FAMILY2 = Bytes.toBytes("fam2");
   private static byte[] TEST_FAMILY3 = Bytes.toBytes("fam3");
@@ -1073,7 +1073,7 @@ public class TestMasterObserver {
     // create a table
     HTableDescriptor htd = new HTableDescriptor(TEST_TABLE);
     htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
 
     tableCreationLatch = new CountDownLatch(1);
     admin.createTable(htd);
@@ -1236,7 +1236,7 @@ public class TestMasterObserver {
     // create a table
     HTableDescriptor htd = new HTableDescriptor(TEST_TABLE);
     htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
 
     tableCreationLatch = new CountDownLatch(1);
     admin.createTable(htd);
@@ -1294,7 +1294,7 @@ public class TestMasterObserver {
 
 
     // create a table
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     admin.createNamespace(NamespaceDescriptor.create(testNamespace).build());
     assertTrue("Test namespace should be created", cp.wasCreateNamespaceCalled());
 
@@ -1332,7 +1332,7 @@ public class TestMasterObserver {
     assertTrue("Test namespace should not be created", cp.preCreateNamespaceCalledOnly());
   }
 
-  private void modifyTableSync(HBaseAdmin admin, TableName tableName, HTableDescriptor htd)
+  private void modifyTableSync(Admin admin, TableName tableName, HTableDescriptor htd)
       throws IOException {
     admin.modifyTable(tableName, htd);
     //wait until modify table finishes

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java
index 7928b36..13cb906 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java
@@ -33,6 +33,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.Durability;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -157,7 +158,7 @@ public class TestOpenTableInCoprocessor {
     other.addFamily(new HColumnDescriptor(family));
 
 
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     admin.createTable(primary);
     admin.createTable(other);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java
index acad744..6997ef5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java
@@ -31,6 +31,8 @@ import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.KeyValue;
 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.Delete;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
@@ -52,7 +54,7 @@ import org.junit.experimental.categories.Category;
 @Category(MediumTests.class)
 public class TestRegionObserverBypass {
   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[] row2 = Bytes.toBytes("r2");
@@ -75,7 +77,7 @@ public class TestRegionObserverBypass {
 
   @Before
   public void setUp() throws Exception {
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     if (admin.tableExists(tableName)) {
       if (admin.isTableEnabled(tableName)) {
         admin.disableTable(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java
index 7bf31cd..27b807f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java
@@ -46,6 +46,7 @@ import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Durability;
@@ -486,14 +487,14 @@ public class TestRegionObserverInterface {
    */
   @Test
   public void testCompactionOverride() throws Exception {
-    byte[] compactTable = Bytes.toBytes("TestCompactionOverride");
-    HBaseAdmin admin = util.getHBaseAdmin();
+    TableName compactTable = TableName.valueOf("TestCompactionOverride");
+    Admin admin = util.getHBaseAdmin();
     if (admin.tableExists(compactTable)) {
       admin.disableTable(compactTable);
       admin.deleteTable(compactTable);
     }
 
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(compactTable));
+    HTableDescriptor htd = new HTableDescriptor(compactTable);
     htd.addFamily(new HColumnDescriptor(A));
     htd.addCoprocessor(EvenOnlyCompactor.class.getName());
     admin.createTable(htd);
@@ -515,7 +516,7 @@ public class TestRegionObserverInterface {
 
     // force a compaction
     long ts = System.currentTimeMillis();
-    admin.flush(compactTable);
+    admin.flush(compactTable.toBytes());
     // wait for flush
     for (int i=0; i<10; i++) {
       if (compactor.lastFlush >= ts) {
@@ -527,7 +528,7 @@ public class TestRegionObserverInterface {
     LOG.debug("Flush complete");
 
     ts = compactor.lastFlush;
-    admin.majorCompact(compactTable);
+    admin.majorCompact(compactTable.toBytes());
     // wait for compaction
     for (int i=0; i<30; i++) {
       if (compactor.lastCompaction >= ts) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java
index 376c38b..5c05169 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.HRegionInfo;
 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.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -254,7 +255,7 @@ public class TestRegionObserverScannerOpenHook {
     desc.addCoprocessor(NoDataFromCompaction.class.getName(), null, Coprocessor.PRIORITY_HIGHEST,
       null);
 
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     admin.createTable(desc);
 
     HTable table = new HTable(conf, desc.getTableName());

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
index 0a70543..085348e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
@@ -33,6 +33,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
@@ -85,7 +86,7 @@ public class TestRowProcessorEndpoint {
 
   static final Log LOG = LogFactory.getLog(TestRowProcessorEndpoint.class);
 
-  private static final byte[] TABLE = Bytes.toBytes("testtable");
+  private static final TableName TABLE = TableName.valueOf("testtable");
   private final static byte[] ROW = Bytes.toBytes("testrow");
   private final static byte[] ROW2 = Bytes.toBytes("testrow2");
   private final static byte[] FAM = Bytes.toBytes("friendlist");

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java
index e82b357..18b9864 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellScanner;
 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.client.HTable;
 import org.apache.hadoop.hbase.client.Result;
@@ -149,7 +150,7 @@ public abstract class TableSnapshotInputFormatTestBase {
     } else {
       util.createTable(tableName, FAMILIES);
     }
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     // put some stuff in the table
     HTable table = new HTable(util.getConfiguration(), tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java
index e960945..39d1bab 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.ServerName;
+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;
@@ -183,7 +184,7 @@ public class TestAssignmentListener {
   @Test(timeout=60000)
   public void testAssignmentListener() throws IOException, InterruptedException {
     AssignmentManager am = TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager();
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
 
     DummyAssignmentListener listener = new DummyAssignmentListener();
     am.registerListener(listener);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/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 f77fff5..989b9f9 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
@@ -48,6 +48,7 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.UnknownRegionException;
 import org.apache.hadoop.hbase.Waiter;
 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.HTable;
 import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
@@ -82,7 +83,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;
 
   static void setupOnce() throws Exception {
     // Using the our load balancer to control region plans
@@ -302,7 +303,7 @@ public class TestAssignmentManagerOnCluster {
   public void testMoveRegionOfDeletedTable() throws Exception {
     TableName table =
         TableName.valueOf("testMoveRegionOfDeletedTable");
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     try {
       HRegionInfo hri = createTableAndGetOneRegion(table);
 
@@ -807,11 +808,11 @@ public class TestAssignmentManagerOnCluster {
    */
   @Test (timeout=60000)
   public void testAssignDisabledRegion() throws Exception {
-    String table = "testAssignDisabledRegion";
+    TableName table = TableName.valueOf("testAssignDisabledRegion");
     MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
     MyMaster master = null;
     try {
-      HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(table));
+      HTableDescriptor desc = new HTableDescriptor(table);
       desc.addFamily(new HColumnDescriptor(FAMILY));
       admin.createTable(desc);
 
@@ -839,7 +840,7 @@ public class TestAssignmentManagerOnCluster {
       am.unassign(hri, true);
       assertTrue(regionStates.isRegionOffline(hri));
     } finally {
-      TEST_UTIL.deleteTable(Bytes.toBytes(table));
+      TEST_UTIL.deleteTable(table);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
index 85b35a5..87c34be 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
@@ -781,7 +781,7 @@ public class TestDistributedLogSplitting {
     makeHLog(hrs.getWAL(), regions, "table", "family", NUM_LOG_LINES, 100);
     
     LOG.info("Disabling table\n");
-    TEST_UTIL.getHBaseAdmin().disableTable(Bytes.toBytes("disableTable"));
+    TEST_UTIL.getHBaseAdmin().disableTable(TableName.valueOf("disableTable"));
     
     // abort RS
     LOG.info("Aborting region server: " + hrs.getServerName());
@@ -1361,7 +1361,7 @@ public class TestDistributedLogSplitting {
   HTable installTable(ZooKeeperWatcher zkw, String tname, String fname, int nrs, 
       int existingRegions) throws Exception {
     // Create a table with regions
-    byte [] table = Bytes.toBytes(tname);
+    TableName table = TableName.valueOf(tname);
     byte [] family = Bytes.toBytes(fname);
     LOG.info("Creating table with " + nrs + " regions");
     HTable ht = TEST_UTIL.createTable(table, family);
@@ -1617,7 +1617,7 @@ public class TestDistributedLogSplitting {
           final HRegionServer destRS = hrs;
           // the RS doesn't have regions of the specified table so we need move one to this RS
           List<HRegionInfo> tableRegions =
-              TEST_UTIL.getHBaseAdmin().getTableRegions(Bytes.toBytes(tableName));
+              TEST_UTIL.getHBaseAdmin().getTableRegions(TableName.valueOf(tableName));
           final HRegionInfo hri = tableRegions.get(0);
           TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(),
             Bytes.toBytes(destRS.getServerName().getServerName()));

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
index b600f4d..6bfb618 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
@@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.*;
 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.HTable;
 import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos;
@@ -47,7 +48,7 @@ public class TestMaster {
   private static final TableName TABLENAME =
       TableName.valueOf("TestMaster");
   private static final byte[] FAMILYNAME = Bytes.toBytes("fam");
-  private static HBaseAdmin admin;
+  private static Admin admin;
 
   @BeforeClass
   public static void beforeAllTests() throws Exception {
@@ -147,9 +148,9 @@ public class TestMaster {
 
   @Test
   public void testMoveThrowsPleaseHoldException() throws IOException {
-    byte[] tableName = Bytes.toBytes("testMoveThrowsPleaseHoldException");
+    TableName tableName = TableName.valueOf("testMoveThrowsPleaseHoldException");
     HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster();
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     HColumnDescriptor hcd = new HColumnDescriptor("value");
     htd.addFamily(hcd);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
index dcb4c16..7ed455e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
@@ -67,7 +67,7 @@ public class TestMasterRestartAfterDisablingTable {
     HMaster master = cluster.getMaster();
 
     // Create a table with regions
-    byte[] table = Bytes.toBytes("tableRestart");
+    TableName table = TableName.valueOf("tableRestart");
     byte[] family = Bytes.toBytes("family");
     log("Creating table with " + NUM_REGIONS_TO_CREATE + " regions");
     HTable ht = TEST_UTIL.createTable(table, family);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
index b24ab6e..d2ab764 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
@@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -76,7 +77,7 @@ public class  TestRollingRestart {
     HMaster master = cluster.getMaster();
 
     // Create a table with regions
-    byte [] table = Bytes.toBytes("tableRestart");
+    TableName table = TableName.valueOf("tableRestart");
     byte [] family = Bytes.toBytes("family");
     log("Creating table with " + NUM_REGIONS_TO_CREATE + " regions");
     HTable ht = TEST_UTIL.createTable(table, family);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java
index 61052bd..3bb7bba 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java
@@ -48,6 +48,7 @@ import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableNotDisabledException;
 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.coprocessor.BaseMasterObserver;
 import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
@@ -114,7 +115,7 @@ public class TestTableLockManager {
     Future<Object> shouldFinish = executor.submit(new Callable<Object>() {
       @Override
       public Object call() throws Exception {
-        HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+        Admin admin = TEST_UTIL.getHBaseAdmin();
         admin.deleteColumn(TABLE_NAME, FAMILY);
         return null;
       }
@@ -123,7 +124,7 @@ public class TestTableLockManager {
     deleteColumn.await();
 
     try {
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       admin.addColumn(TABLE_NAME, new HColumnDescriptor(NEW_FAMILY));
       fail("Was expecting TableLockTimeoutException");
     } catch (LockTimeoutException ex) {
@@ -166,7 +167,7 @@ public class TestTableLockManager {
     Future<Object> alterTableFuture = executor.submit(new Callable<Object>() {
       @Override
       public Object call() throws Exception {
-        HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+        Admin admin = TEST_UTIL.getHBaseAdmin();
         admin.addColumn(TABLE_NAME, new HColumnDescriptor(NEW_FAMILY));
         LOG.info("Added new column family");
         HTableDescriptor tableDesc = admin.getTableDescriptor(TABLE_NAME);
@@ -177,7 +178,7 @@ public class TestTableLockManager {
     Future<Object> disableTableFuture = executor.submit(new Callable<Object>() {
       @Override
       public Object call() throws Exception {
-        HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+        Admin admin = TEST_UTIL.getHBaseAdmin();
         admin.disableTable(TABLE_NAME);
         assertTrue(admin.isTableDisabled(TABLE_NAME));
         admin.deleteTable(TABLE_NAME);
@@ -243,7 +244,7 @@ public class TestTableLockManager {
   public void testDelete() throws Exception {
     prepareMiniCluster();
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     admin.disableTable(TABLE_NAME);
     admin.deleteTable(TABLE_NAME);
 
@@ -327,7 +328,7 @@ public class TestTableLockManager {
     loadTool.setConf(TEST_UTIL.getConfiguration());
     int numKeys = 10000;
     final TableName tableName = TableName.valueOf("testTableReadLock");
-    final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    final Admin admin = TEST_UTIL.getHBaseAdmin();
     final HTableDescriptor desc = new HTableDescriptor(tableName);
     final byte[] family = Bytes.toBytes("test_cf");
     desc.addFamily(new HColumnDescriptor(family));

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java
index f1c5adc..16321b4 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java
@@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.HConstants;
 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.client.HTable;
 import org.apache.hadoop.hbase.master.HMaster;
@@ -278,7 +279,7 @@ public class TestSnapshotFromMaster {
    */
   @Test(timeout = 300000)
   public void testSnapshotHFileArchiving() throws Exception {
-    HBaseAdmin admin = UTIL.getHBaseAdmin();
+    Admin admin = UTIL.getHBaseAdmin();
     // make sure we don't fail on listing snapshots
     SnapshotTestingUtils.assertNoSnapshots(admin);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestCreateTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestCreateTableHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestCreateTableHandler.java
index 3e51f0a..0038225 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestCreateTableHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestCreateTableHandler.java
@@ -69,10 +69,10 @@ public class TestCreateTableHandler {
 
   @Test (timeout=300000)
   public void testCreateTableCalledTwiceAndFirstOneInProgress() throws Exception {
-    final byte[] tableName = Bytes.toBytes("testCreateTableCalledTwiceAndFirstOneInProgress");
+    final TableName tableName = TableName.valueOf("testCreateTableCalledTwiceAndFirstOneInProgress");
     final MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
     final HMaster m = cluster.getMaster();
-    final HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     final HRegionInfo[] hRegionInfos = new HRegionInfo[] { new HRegionInfo(desc.getTableName(), null,
         null) };
@@ -96,10 +96,10 @@ public class TestCreateTableHandler {
 
   @Test (timeout=300000)
   public void testCreateTableWithSplitRegion() throws Exception {
-    final byte[] tableName = Bytes.toBytes("testCreateTableWithSplitRegion");
+    final TableName tableName = TableName.valueOf("testCreateTableWithSplitRegion");
     final MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
     final HMaster m = cluster.getMaster();
-    final HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     byte[] splitPoint = Bytes.toBytes("split-point");
     long ts = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
index 8f90fa6..97182df 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.LargeTests;
+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.util.Bytes;
@@ -97,7 +98,7 @@ public class TestTableDeleteFamilyHandler {
   @Test
   public void deleteColumnFamilyWithMultipleRegions() throws Exception {
 
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     HTableDescriptor beforehtd = admin.getTableDescriptor(TABLENAME);
 
     FileSystem fs = TEST_UTIL.getDFSCluster().getFileSystem();
@@ -135,7 +136,7 @@ public class TestTableDeleteFamilyHandler {
 
     // TEST - Disable and delete the column family
     admin.disableTable(TABLENAME);
-    admin.deleteColumn(TABLENAME.getName(), "cf2");
+    admin.deleteColumn(TABLENAME, Bytes.toBytes("cf2"));
 
     // 5 - Check if only 2 column families exist in the descriptor
     HTableDescriptor afterhtd = admin.getTableDescriptor(TABLENAME);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDescriptorModification.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDescriptorModification.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDescriptorModification.java
index 5102dab..7fdb72a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDescriptorModification.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDescriptorModification.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.LargeTests;
 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;
@@ -80,7 +81,7 @@ public class TestTableDescriptorModification {
 
   @Test
   public void testModifyTable() throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with one family
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     baseHtd.addFamily(new HColumnDescriptor(FAMILY_0));
@@ -103,7 +104,7 @@ public class TestTableDescriptorModification {
 
   @Test
   public void testAddColumn() throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with two families
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     baseHtd.addFamily(new HColumnDescriptor(FAMILY_0));
@@ -123,7 +124,7 @@ public class TestTableDescriptorModification {
 
   @Test
   public void testDeleteColumn() throws IOException {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+    Admin admin = TEST_UTIL.getHBaseAdmin();
     // Create a table with two families
     HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME);
     baseHtd.addFamily(new HColumnDescriptor(FAMILY_0));
@@ -144,7 +145,7 @@ public class TestTableDescriptorModification {
 
   private void verifyTableDescriptor(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/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestNamespaceUpgrade.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestNamespaceUpgrade.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestNamespaceUpgrade.java
index 0744361..fe399a1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestNamespaceUpgrade.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestNamespaceUpgrade.java
@@ -93,7 +93,8 @@ public class TestNamespaceUpgrade {
       {"1","2","3","4","5","6","7","8","9"};
   private final static String currentKeys[] =
       {"1","2","3","4","5","6","7","8","9","A"};
-  private final static String tables[] = {"foo", "ns1.foo","ns.two.foo"};
+  private final static TableName tables[] =
+    {TableName.valueOf("foo"), TableName.valueOf("ns1.foo"), TableName.valueOf("ns.two.foo")};
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
@@ -133,7 +134,7 @@ public class TestNamespaceUpgrade {
     doFsCommand(shell, new String [] {"-lsr", "/"});
     TEST_UTIL.startMiniHBaseCluster(1, 1);
 
-    for(String table: tables) {
+    for(TableName table: tables) {
       int count = 0;
       for(Result res: new HTable(TEST_UTIL.getConfiguration(), table).getScanner(new Scan())) {
         assertEquals(currentKeys[count++], Bytes.toString(res.getRow()));
@@ -150,7 +151,7 @@ public class TestNamespaceUpgrade {
       count++;
     }
     assertEquals(3, count);
-    assertFalse(TEST_UTIL.getHBaseAdmin().tableExists("_acl_"));
+    assertFalse(TEST_UTIL.getHBaseAdmin().tableExists(TableName.valueOf("_acl_")));
 
     //verify ACL table was compacted
     List<HRegion> regions = TEST_UTIL.getMiniHBaseCluster().getRegions(secureTable.getName());
@@ -197,8 +198,8 @@ public class TestNamespaceUpgrade {
   public void testSnapshots() throws IOException, InterruptedException {
     String snapshots[][] = {snapshot1Keys, snapshot2Keys};
     for(int i = 1; i <= snapshots.length; i++) {
-      for(String table: tables) {
-        TEST_UTIL.getHBaseAdmin().cloneSnapshot(table+"_snapshot"+i, table+"_clone"+i);
+      for(TableName table: tables) {
+        TEST_UTIL.getHBaseAdmin().cloneSnapshot(table+"_snapshot"+i, TableName.valueOf(table+"_clone"+i));
         FSUtils.logFileSystemState(FileSystem.get(TEST_UTIL.getConfiguration()),
             FSUtils.getRootDir(TEST_UTIL.getConfiguration()),
             LOG);
@@ -216,14 +217,15 @@ public class TestNamespaceUpgrade {
   public void testRenameUsingSnapshots() throws Exception {
     String newNS = "newNS";
     TEST_UTIL.getHBaseAdmin().createNamespace(NamespaceDescriptor.create(newNS).build());
-    for(String table: tables) {
+    for(TableName table: tables) {
       int count = 0;
       for(Result res: new HTable(TEST_UTIL.getConfiguration(), table).getScanner(new
           Scan())) {
         assertEquals(currentKeys[count++], Bytes.toString(res.getRow()));
       }
       TEST_UTIL.getHBaseAdmin().snapshot(table + "_snapshot3", table);
-      final String newTableName = newNS + TableName.NAMESPACE_DELIM + table + "_clone3";
+      final TableName newTableName =
+        TableName.valueOf(newNS + TableName.NAMESPACE_DELIM + table + "_clone3");
       TEST_UTIL.getHBaseAdmin().cloneSnapshot(table + "_snapshot3", newTableName);
       Thread.sleep(1000);
       count = 0;
@@ -233,14 +235,14 @@ public class TestNamespaceUpgrade {
       }
       FSUtils.logFileSystemState(TEST_UTIL.getTestFileSystem(), TEST_UTIL.getDefaultRootDirPath()
           , LOG);
-      Assert.assertEquals(newTableName, currentKeys.length, count);
-      TEST_UTIL.getHBaseAdmin().flush(newTableName);
-      TEST_UTIL.getHBaseAdmin().majorCompact(newTableName);
+      Assert.assertEquals(newTableName + "", currentKeys.length, count);
+      TEST_UTIL.getHBaseAdmin().flush(newTableName.toBytes());
+      TEST_UTIL.getHBaseAdmin().majorCompact(newTableName.toBytes());
       TEST_UTIL.waitFor(30000, new Waiter.Predicate<IOException>() {
         @Override
         public boolean evaluate() throws IOException {
           try {
-            return TEST_UTIL.getHBaseAdmin().getCompactionState(newTableName) ==
+            return TEST_UTIL.getHBaseAdmin().getCompactionState(newTableName.toBytes()) ==
                 AdminProtos.GetRegionInfoResponse.CompactionState.NONE;
           } catch (InterruptedException e) {
             throw new IOException(e);
@@ -251,10 +253,11 @@ public class TestNamespaceUpgrade {
 
     String nextNS = "nextNS";
     TEST_UTIL.getHBaseAdmin().createNamespace(NamespaceDescriptor.create(nextNS).build());
-    for(String table: tables) {
-      String srcTable = newNS + TableName.NAMESPACE_DELIM + table + "_clone3";
+    for(TableName table: tables) {
+      TableName srcTable = TableName.valueOf(newNS + TableName.NAMESPACE_DELIM + table + "_clone3");
       TEST_UTIL.getHBaseAdmin().snapshot(table + "_snapshot4", srcTable);
-      String newTableName = nextNS + TableName.NAMESPACE_DELIM + table + "_clone4";
+      TableName newTableName =
+        TableName.valueOf(nextNS + TableName.NAMESPACE_DELIM + table + "_clone4");
       TEST_UTIL.getHBaseAdmin().cloneSnapshot(table+"_snapshot4", newTableName);
       FSUtils.logFileSystemState(TEST_UTIL.getTestFileSystem(), TEST_UTIL.getDefaultRootDirPath(),
         LOG);
@@ -263,7 +266,7 @@ public class TestNamespaceUpgrade {
           Scan())) {
         assertEquals(currentKeys[count++], Bytes.toString(res.getRow()));
       }
-      Assert.assertEquals(newTableName, currentKeys.length, count);
+      Assert.assertEquals(newTableName + "", currentKeys.length, count);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java
index 7d03beb..94a991d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java
@@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.SmallTests;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.junit.AfterClass;
 import static org.junit.Assert.assertArrayEquals;
@@ -59,7 +60,7 @@ public class TestProcedureManager {
 
   @Test
   public void testSimpleProcedureManager() throws IOException {
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
 
     byte[] result = admin.execProcedureWithRet(SimpleMasterProcedureManager.SIMPLE_SIGNATURE,
         "mytest", new HashMap<String, String>());

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
index daa6800..eabf75f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
@@ -113,7 +113,7 @@ public class TestEncryptionKeyRotation {
     hcd.setEncryptionKey(EncryptionUtil.wrapKey(conf,
       conf.get(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY, User.getCurrent().getShortName()),
       secondCFKey));
-    TEST_UTIL.getHBaseAdmin().modifyColumn(htd.getName(), hcd);
+    TEST_UTIL.getHBaseAdmin().modifyColumn(htd.getTableName(), hcd);
     Thread.sleep(5000); // Need a predicate for online schema change
 
     // And major compact

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
index e77b129..5cad147 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.NotServingRegionException;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.ipc.PayloadCarryingRpcController;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.Stoppable;
@@ -223,7 +224,7 @@ public class TestEndToEndSplitTransaction {
     HTable table;
     TableName tableName;
     byte[] family;
-    HBaseAdmin admin;
+    Admin admin;
     HRegionServer rs;
 
     RegionSplitter(HTable table) throws IOException {
@@ -398,7 +399,7 @@ public class TestEndToEndSplitTransaction {
 
   /* some utility methods for split tests */
 
-  public static void flushAndBlockUntilDone(HBaseAdmin admin, HRegionServer rs, byte[] regionName)
+  public static void flushAndBlockUntilDone(Admin admin, HRegionServer rs, byte[] regionName)
       throws IOException, InterruptedException {
     log("flushing region: " + Bytes.toStringBinary(regionName));
     admin.flush(regionName);
@@ -409,7 +410,7 @@ public class TestEndToEndSplitTransaction {
     }
   }
 
-  public static void compactAndBlockUntilDone(HBaseAdmin admin, HRegionServer rs, byte[] regionName)
+  public static void compactAndBlockUntilDone(Admin admin, HRegionServer rs, byte[] regionName)
       throws IOException, InterruptedException {
     log("Compacting region: " + Bytes.toStringBinary(regionName));
     admin.majorCompact(regionName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
index b0c47c7..2c4ac95 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
@@ -29,6 +29,7 @@ import org.apache.hadoop.hbase.HRegionInfo;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
@@ -58,22 +59,21 @@ public class TestHRegionOnCluster {
     TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
 
     try {
-      final byte[] TABLENAME = Bytes
-          .toBytes("testDataCorrectnessReplayingRecoveredEdits");
+      final TableName TABLENAME = TableName.valueOf("testDataCorrectnessReplayingRecoveredEdits");
       final byte[] FAMILY = Bytes.toBytes("family");
       MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
       HMaster master = cluster.getMaster();
 
       // Create table
-      HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(TABLENAME));
+      HTableDescriptor desc = new HTableDescriptor(TABLENAME);
       desc.addFamily(new HColumnDescriptor(FAMILY));
-      HBaseAdmin hbaseAdmin = TEST_UTIL.getHBaseAdmin();
+      Admin hbaseAdmin = TEST_UTIL.getHBaseAdmin();
       hbaseAdmin.createTable(desc);
 
       assertTrue(hbaseAdmin.isTableAvailable(TABLENAME));
 
       // Put data: r1->v1
-      Log.info("Loading r1 to v1 into " + Bytes.toString(TABLENAME));
+      Log.info("Loading r1 to v1 into " + TABLENAME);
       HTable table = new HTable(TEST_UTIL.getConfiguration(), TABLENAME);
       putDataAndVerify(table, "r1", FAMILY, "v1", 1);
 
@@ -95,7 +95,7 @@ public class TestHRegionOnCluster {
       } while (cluster.getServerWith(regionInfo.getRegionName()) == originServerNum);
 
       // Put data: r2->v2
-      Log.info("Loading r2 to v2 into " + Bytes.toString(TABLENAME));
+      Log.info("Loading r2 to v2 into " + TABLENAME);
       putDataAndVerify(table, "r2", FAMILY, "v2", 2);
 
       TEST_UTIL.waitUntilAllRegionsAssigned(table.getName());
@@ -108,7 +108,7 @@ public class TestHRegionOnCluster {
       } while (cluster.getServerWith(regionInfo.getRegionName()) == targetServerNum);
 
       // Put data: r3->v3
-      Log.info("Loading r3 to v3 into " + Bytes.toString(TABLENAME));
+      Log.info("Loading r3 to v3 into " + TABLENAME);
       putDataAndVerify(table, "r3", FAMILY, "v3", 3);
 
       // Kill target server
@@ -125,7 +125,7 @@ public class TestHRegionOnCluster {
       cluster.getRegionServerThreads().get(originServerNum).join();
 
       // Put data: r4->v4
-      Log.info("Loading r4 to v4 into " + Bytes.toString(TABLENAME));
+      Log.info("Loading r4 to v4 into " + TABLENAME);
       putDataAndVerify(table, "r4", FAMILY, "v4", 4);
 
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
index 6981415..38624fe 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.UnknownRegionException;
 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.HTable;
 import org.apache.hadoop.hbase.client.Put;
@@ -89,7 +90,7 @@ public class TestRegionMergeTransactionOnCluster {
   static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
   private static HMaster master;
-  private static HBaseAdmin admin;
+  private static Admin admin;
 
   static void setupOnce() throws Exception {
     // Start a cluster

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java
index 95d2df0..c453723 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.TableExistsException;
 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.Durability;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -57,7 +58,7 @@ import org.junit.experimental.categories.Category;
  * w.r.t. essential column family optimization
  */
 public class TestSCVFWithMiniCluster {
-  private static final String HBASE_TABLE_NAME = "TestSCVFWithMiniCluster";
+  private static final TableName HBASE_TABLE_NAME = TableName.valueOf("TestSCVFWithMiniCluster");
 
   private static final byte[] FAMILY_A = Bytes.toBytes("a");
   private static final byte[] FAMILY_B = Bytes.toBytes("b");
@@ -77,7 +78,7 @@ public class TestSCVFWithMiniCluster {
 
     util.startMiniCluster(1);
 
-    HBaseAdmin admin = util.getHBaseAdmin();
+    Admin admin = util.getHBaseAdmin();
     destroy(admin, HBASE_TABLE_NAME);
     create(admin, HBASE_TABLE_NAME, FAMILY_A, FAMILY_B);
     admin.close();
@@ -215,9 +216,9 @@ public class TestSCVFWithMiniCluster {
     verify(scan);
   }
 
-  private static void create(HBaseAdmin admin, String tableName, byte[]... families)
+  private static void create(Admin admin, TableName tableName, byte[]... families)
       throws IOException {
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     for (byte[] family : families) {
       HColumnDescriptor colDesc = new HColumnDescriptor(family);
       colDesc.setMaxVersions(1);
@@ -231,7 +232,7 @@ public class TestSCVFWithMiniCluster {
     }
   }
 
-  private static void destroy(HBaseAdmin admin, String tableName) throws IOException {
+  private static void destroy(Admin admin, TableName tableName) throws IOException {
     try {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java
index 0e464d9..d259933 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Tag;
+import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
@@ -114,7 +115,7 @@ public class TestTags {
       // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE);
       colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE);
       desc.addFamily(colDesc);
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       admin.createTable(desc);
       byte[] value = Bytes.toBytes("value");
       table = new HTable(TEST_UTIL.getConfiguration(), tableName);
@@ -192,7 +193,7 @@ public class TestTags {
       // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE);
       colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE);
       desc.addFamily(colDesc);
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       admin.createTable(desc);
 
       table = new HTable(TEST_UTIL.getConfiguration(), tableName);
@@ -295,7 +296,7 @@ public class TestTags {
       colDesc.setBlockCacheEnabled(true);
       colDesc.setDataBlockEncoding(encoding);
       desc.addFamily(colDesc);
-      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      Admin admin = TEST_UTIL.getHBaseAdmin();
       admin.createTable(desc);
       try {
         table = new HTable(TEST_UTIL.getConfiguration(), tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
index 79fdee2..9fc9f09 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MediumTests;
 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.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
@@ -49,7 +50,7 @@ import org.junit.experimental.categories.Category;
 public class TestLogRollAbort {
   private static final Log LOG = LogFactory.getLog(TestLogRolling.class);
   private static MiniDFSCluster dfsCluster;
-  private static HBaseAdmin admin;
+  private static Admin admin;
   private static MiniHBaseCluster cluster;
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
index 9941940..a47c826 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
@@ -47,6 +47,7 @@ import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.LargeTests;
 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.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
@@ -84,7 +85,7 @@ public class TestLogRolling  {
   private byte[] value;
   private FileSystem fs;
   private MiniDFSCluster dfsCluster;
-  private HBaseAdmin admin;
+  private Admin admin;
   private MiniHBaseCluster cluster;
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/46fea6e0/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java
index adebc6b..876b089 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java
@@ -34,6 +34,7 @@ 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.rest.client.Client;
 import org.apache.hadoop.hbase.rest.client.Cluster;
@@ -101,8 +102,8 @@ public class RowResourceBase {
 
   @Before
   public void beforeMethod() throws Exception {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    if (admin.tableExists(TABLE)) {
+    Admin admin = TEST_UTIL.getHBaseAdmin();
+    if (admin.tableExists(TableName.valueOf(TABLE))) {
       TEST_UTIL.deleteTable(Bytes.toBytes(TABLE));
     }
     HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
@@ -113,8 +114,8 @@ public class RowResourceBase {
 
   @After
   public void afterMethod() throws Exception {
-    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    if (admin.tableExists(TABLE)) {
+    Admin admin = TEST_UTIL.getHBaseAdmin();
+    if (admin.tableExists(TableName.valueOf(TABLE))) {
       TEST_UTIL.deleteTable(Bytes.toBytes(TABLE));
     }
   }


Mime
View raw message