HBASE-12042 Replace internal uses of HTable(Configuration, String) with 
HTable(Configuration, TableName) (Solomon Duskis)


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

Branch: refs/heads/branch-1
Commit: 1e821bc02a99e9e79e89eba596a31557abbb584d
Parents: e7c610b
Author: Enis Soztutar <[email protected]>
Authored: Mon Sep 29 18:39:44 2014 -0700
Committer: Enis Soztutar <[email protected]>
Committed: Mon Sep 29 19:39:18 2014 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/MetaTableAccessor.java  |  13 ++
 .../org/apache/hadoop/hbase/client/Admin.java   |   2 +-
 .../example/TestRowCountEndpoint.java           |   3 +-
 .../actions/RestartRsHoldingTableAction.java    |   3 +-
 .../mapreduce/IntegrationTestImportTsv.java     |  16 +-
 .../test/IntegrationTestLoadAndVerify.java      |   2 +-
 .../hbase/mapreduce/HRegionPartitioner.java     |   6 +-
 .../apache/hadoop/hbase/mapreduce/Import.java   |   7 +-
 .../hadoop/hbase/mapreduce/ImportTsv.java       |  11 +-
 .../hbase/mapreduce/TableInputFormat.java       |   3 +-
 .../hbase/mapreduce/TableOutputFormat.java      |   3 +-
 .../hadoop/hbase/mapreduce/WALPlayer.java       |   2 +-
 .../replication/VerifyReplication.java          |   3 +-
 .../org/apache/hadoop/hbase/tool/Canary.java    |  11 +-
 .../hadoop/hbase/HBaseTestingUtility.java       |  18 +-
 .../hadoop/hbase/TestFullLogReconstruction.java |   2 +-
 .../hadoop/hbase/TestGlobalMemStoreSize.java    |   2 +-
 .../hadoop/hbase/TestHBaseTestingUtility.java   |   2 +-
 .../apache/hadoop/hbase/TestInfoServers.java    |   7 +-
 .../apache/hadoop/hbase/TestMultiVersions.java  |   4 +-
 .../org/apache/hadoop/hbase/TestZooKeeper.java  |   4 +-
 .../apache/hadoop/hbase/client/TestAdmin.java   |  43 +++--
 .../client/TestClientScannerRPCTimeout.java     |   2 +-
 .../hadoop/hbase/client/TestFromClientSide.java | 135 +++++++-------
 .../hbase/client/TestFromClientSide3.java       |  10 +-
 .../hadoop/hbase/client/TestMultiParallel.java  |   7 +-
 .../hadoop/hbase/client/TestScannerTimeout.java |   3 +-
 .../client/TestScannersFromClientSide.java      |   5 +-
 .../client/TestSnapshotCloneIndependence.java   |   2 +-
 .../hbase/client/TestTimestampsFilter.java      |   6 +-
 .../hbase/coprocessor/TestHTableWrapper.java    |   6 +-
 .../coprocessor/TestOpenTableInCoprocessor.java |   2 +-
 .../hbase/filter/TestColumnRangeFilter.java     |   2 +-
 .../TestFuzzyRowAndColumnRangeFilter.java       |   3 +-
 .../hadoop/hbase/fs/TestBlockReorder.java       |   3 +-
 .../hbase/io/encoding/TestChangingEncoding.java |  10 +-
 .../hbase/mapred/TestTableInputFormat.java      |   2 +-
 .../hadoop/hbase/mapred/TestTableMapReduce.java |   8 +-
 .../hbase/mapred/TestTableMapReduceUtil.java    |   5 +-
 .../hadoop/hbase/mapreduce/TestCopyTable.java   |  17 +-
 .../hbase/mapreduce/TestHRegionPartitioner.java |   5 +-
 .../hbase/mapreduce/TestImportExport.java       |  22 +--
 .../TestImportTSVWithOperationAttributes.java   |   9 +-
 .../TestImportTSVWithVisibilityLabels.java      |  22 ++-
 .../hadoop/hbase/mapreduce/TestImportTsv.java   |  13 +-
 .../TestLoadIncrementalHFilesSplitRecovery.java |  54 +++---
 .../mapreduce/TestMultiTableInputFormat.java    |   4 +-
 .../mapreduce/TestMultithreadedTableMapper.java |  10 +-
 .../hadoop/hbase/mapreduce/TestRowCounter.java  |   4 +-
 .../mapreduce/TestTableInputFormatScanBase.java |   3 +-
 .../hbase/mapreduce/TestTableMapReduce.java     |   2 +-
 .../hbase/mapreduce/TestTableMapReduceBase.java |   3 +-
 .../hadoop/hbase/mapreduce/TestWALPlayer.java   |   8 +-
 .../hadoop/hbase/master/TestMasterFailover.java |   2 +-
 .../hbase/master/TestMasterTransitions.java     |  13 +-
 .../hadoop/hbase/master/TestRestartCluster.java |  24 +--
 .../hbase/regionserver/TestCompactionState.java |   5 +-
 .../TestEncryptionRandomKeying.java             |   6 +-
 .../regionserver/TestHRegionServerBulkLoad.java |  23 ++-
 .../hbase/regionserver/TestRegionReplicas.java  |   2 +-
 .../regionserver/TestRegionServerMetrics.java   |  14 +-
 .../regionserver/TestRegionServerNoMaster.java  |   5 +-
 .../regionserver/TestScannerWithBulkload.java   |  11 +-
 .../regionserver/TestServerCustomProtocol.java  |   3 +-
 .../TestSplitTransactionOnCluster.java          |  71 ++++----
 .../regionserver/wal/TestLogRollAbort.java      |   8 +-
 .../regionserver/wal/TestLogRollPeriod.java     |  10 +-
 .../hbase/regionserver/wal/TestLogRolling.java  |  26 ++-
 .../regionserver/TestReplicationSink.java       |  15 +-
 .../TestVisibilityLabelsWithDeletes.java        | 182 +++++++++----------
 .../TestVisibilityWithCheckAuths.java           |  12 +-
 .../hadoop/hbase/trace/TestHTraceHooks.java     |   3 +-
 .../apache/hadoop/hbase/util/TestHBaseFsck.java |   6 +-
 .../hbase/util/TestHBaseFsckEncryption.java     |   6 +-
 .../hadoop/hbase/util/TestRegionSplitter.java   |  24 ++-
 75 files changed, 522 insertions(+), 503 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
index d3dfa99..f7dbbc6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
@@ -882,8 +882,21 @@ public class MetaTableAccessor {
    * @return Count or regions in table <code>tableName</code>
    * @throws IOException
    */
+  @Deprecated
   public static int getRegionCount(final Configuration c, final String 
tableName)
       throws IOException {
+    return getRegionCount(c, TableName.valueOf(tableName));
+  }
+
+  /**
+   * Count regions in <code>hbase:meta</code> for passed table.
+   * @param c Configuration object
+   * @param tableName table name to count regions for
+   * @return Count or regions in table <code>tableName</code>
+   * @throws IOException
+   */
+  public static int getRegionCount(final Configuration c, final TableName 
tableName)
+      throws IOException {
     HTable t = new HTable(c, tableName);
     try {
       return t.getRegionLocations().size();

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 8ea8f41..c31fed2 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -125,7 +125,7 @@ public interface Admin extends Abortable, Closeable {
   /**
    * Method for getting the tableDescriptor
    *
-   * @param tableName as a byte []
+   * @param tableName as a {@link TableName}
    * @return the tableDescriptor
    * @throws org.apache.hadoop.hbase.TableNotFoundException
    * @throws IOException if a remote or network exception occurs

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRowCountEndpoint.java
----------------------------------------------------------------------
diff --git 
a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRowCountEndpoint.java
 
b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRowCountEndpoint.java
index cc16483..01a9aa5 100644
--- 
a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRowCountEndpoint.java
+++ 
b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRowCountEndpoint.java
@@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.coprocessor.example;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.MediumTests;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Table;
@@ -59,7 +60,7 @@ public class TestRowCountEndpoint {
         RowCountEndpoint.class.getName());
 
     TEST_UTIL.startMiniCluster();
-    TEST_UTIL.createTable(TEST_TABLE, TEST_FAMILY);
+    TEST_UTIL.createTable(TableName.valueOf(TEST_TABLE), new 
byte[][]{TEST_FAMILY});
   }
 
   // @Ignore @AfterClass

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java
----------------------------------------------------------------------
diff --git 
a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java
 
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java
index b6c1f2e..ffeab0e 100644
--- 
a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java
+++ 
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java
@@ -24,6 +24,7 @@ import java.util.Collection;
 import org.apache.commons.lang.math.RandomUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 
 /**
@@ -43,7 +44,7 @@ public class RestartRsHoldingTableAction extends 
RestartActionBaseAction {
     HTable table = null;
     try {
       Configuration conf = 
context.getHBaseIntegrationTestingUtility().getConfiguration();
-      table = new HTable(conf, tableName);
+      table = new HTable(conf, TableName.valueOf(tableName));
     } catch (IOException e) {
       LOG.debug("Error creating HTable used to get list of region locations.", 
e);
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 465b046..190d92b 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
@@ -41,6 +41,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;
@@ -129,10 +130,10 @@ public class IntegrationTestImportTsv implements 
Configurable, Tool {
    * Verify the data described by <code>simple_tsv</code> matches
    * <code>simple_expected</code>.
    */
-  protected void doLoadIncrementalHFiles(Path hfiles, String tableName)
+  protected void doLoadIncrementalHFiles(Path hfiles, TableName tableName)
       throws Exception {
 
-    String[] args = { hfiles.toString(), tableName };
+    String[] args = { hfiles.toString(), tableName.getNameAsString() };
     LOG.info(format("Running LoadIncrememntalHFiles with args: %s", 
Arrays.asList(args)));
     assertEquals("Loading HFiles failed.",
       0, ToolRunner.run(new LoadIncrementalHFiles(new 
Configuration(getConf())), args));
@@ -181,9 +182,10 @@ public class IntegrationTestImportTsv implements 
Configurable, Tool {
   @Test
   public void testGenerateAndLoad() throws Exception {
     LOG.info("Running test testGenerateAndLoad.");
-    String table = NAME + "-" + UUID.randomUUID();
+    TableName table = TableName.valueOf(NAME + "-" + UUID.randomUUID());
     String cf = "d";
-    Path hfiles = new Path(util.getDataTestDirOnTestFS(table), "hfiles");
+    Path hfiles = new Path(
+        util.getDataTestDirOnTestFS(table.getNameAsString()), "hfiles");
 
     String[] args = {
         format("-D%s=%s", ImportTsv.BULK_OUTPUT_CONF_KEY, hfiles),
@@ -192,11 +194,11 @@ public class IntegrationTestImportTsv implements 
Configurable, Tool {
         // configure the test harness to NOT delete the HFiles after they're
         // generated. We need those for doLoadIncrementalHFiles
         format("-D%s=false", TestImportTsv.DELETE_AFTER_LOAD_CONF),
-        table
+        table.getNameAsString()
     };
 
     // run the job, complete the load.
-    util.createTable(table, cf);
+    util.createTable(table, new String[]{cf});
     Tool t = TestImportTsv.doMROnTableTest(util, cf, simple_tsv, args);
     doLoadIncrementalHFiles(hfiles, table);
 
@@ -205,7 +207,7 @@ public class IntegrationTestImportTsv implements 
Configurable, Tool {
 
     // clean up after ourselves.
     util.deleteTable(table);
-    util.cleanupDataTestDirOnTestFS(table);
+    util.cleanupDataTestDirOnTestFS(table.getNameAsString());
     LOG.info("testGenerateAndLoad completed successfully.");
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 064d099..24dafa5 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
@@ -179,7 +179,7 @@ public void cleanUpCluster() throws Exception {
       recordsToWrite = conf.getLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT);
       String tableName = conf.get(TABLE_NAME_KEY, TABLE_NAME_DEFAULT);
       numBackReferencesPerRow = conf.getInt(NUM_BACKREFS_KEY, 
NUM_BACKREFS_DEFAULT);
-      table = new HTable(conf, tableName);
+      table = new HTable(conf, TableName.valueOf(tableName));
       table.setWriteBufferSize(4*1024*1024);
       table.setAutoFlush(false, true);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java
index d572839..f88d959 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java
@@ -27,6 +27,7 @@ import 
org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
@@ -122,8 +123,9 @@ implements Configurable {
   public void setConf(Configuration configuration) {
     this.conf = HBaseConfiguration.create(configuration);
     try {
-      this.table = new HTable(this.conf,
-        configuration.get(TableOutputFormat.OUTPUT_TABLE));
+      TableName tableName = TableName.valueOf(configuration
+          .get(TableOutputFormat.OUTPUT_TABLE));
+      this.table = new HTable(this.conf, tableName);
     } catch (IOException e) {
       LOG.error(e);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
index aee06b4..b6beadc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java
@@ -39,6 +39,7 @@ import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Durability;
@@ -396,8 +397,8 @@ public class Import {
    */
   public static Job createSubmittableJob(Configuration conf, String[] args)
   throws IOException {
-    String tableName = args[0];
-    conf.set(TABLE_NAME, tableName);
+    TableName tableName = TableName.valueOf(args[0]);
+    conf.set(TABLE_NAME, tableName.getNameAsString());
     Path inputDir = new Path(args[1]);
     Job job = new Job(conf, NAME + "_" + tableName);
     job.setJarByClass(Importer.class);
@@ -430,7 +431,7 @@ public class Import {
       // No reducers.  Just write straight to table.  Call initTableReducerJob
       // because it sets up the TableOutputFormat.
       job.setMapperClass(Importer.class);
-      TableMapReduceUtil.initTableReducerJob(tableName, null, job);
+      TableMapReduceUtil.initTableReducerJob(tableName.getNameAsString(), 
null, job);
       job.setNumReduceTasks(0);
     }
     return job;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
index 0c34fa2..c01957f 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
@@ -414,9 +414,9 @@ public class ImportTsv extends Configured implements Tool {
     Class mapperClass = mapperClassName != null ?
         Class.forName(mapperClassName) : DEFAULT_MAPPER;
 
-    String tableName = args[0];
+    TableName tableName = TableName.valueOf(args[0]);
     Path inputDir = new Path(args[1]);
-    String jobName = conf.get(JOB_NAME_CONF_KEY,NAME + "_" + tableName);
+    String jobName = conf.get(JOB_NAME_CONF_KEY,NAME + "_" + 
tableName.getNameAsString());
     Job job = new Job(conf, jobName);
     job.setJarByClass(mapperClass);
     FileInputFormat.setInputPaths(job, inputDir);
@@ -460,7 +460,8 @@ public class ImportTsv extends Configured implements Tool {
       }
       // No reducers. Just write straight to table. Call initTableReducerJob
       // to set up the TableOutputFormat.
-      TableMapReduceUtil.initTableReducerJob(tableName, null, job);
+      TableMapReduceUtil.initTableReducerJob(tableName.getNameAsString(), null,
+          job);
       job.setNumReduceTasks(0);
     }
 
@@ -470,9 +471,9 @@ public class ImportTsv extends Configured implements Tool {
     return job;
   }
 
-  private static void createTable(Admin admin, String tableName, String[] 
columns)
+  private static void createTable(Admin admin, TableName tableName, String[] 
columns)
       throws IOException {
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor htd = new HTableDescriptor(tableName);
     Set<String> cfSet = new HashSet<String>();
     for (String aColumn : columns) {
       if (TsvParser.ROWKEY_COLUMN_SPEC.equals(aColumn)

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
index 40fb21e..c7fa29e 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
@@ -27,6 +27,7 @@ import 
org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -96,7 +97,7 @@ implements Configurable {
   @Override
   public void setConf(Configuration configuration) {
     this.conf = configuration;
-    String tableName = conf.get(INPUT_TABLE);
+    TableName tableName = TableName.valueOf(conf.get(INPUT_TABLE));
     try {
       setHTable(new HTable(new Configuration(conf), tableName));
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
index 454bc28..52b8e45 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Mutation;
@@ -204,7 +205,7 @@ implements Configurable {
       if (zkClientPort != 0) {
         this.conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClientPort);
       }
-      this.table = new HTable(this.conf, tableName);
+      this.table = new HTable(this.conf, TableName.valueOf(tableName));
       this.table.setAutoFlush(false, true);
       LOG.info("Created table instance for "  + tableName);
     } catch(IOException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
index 898d6bb..39b573d 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
@@ -245,7 +245,7 @@ public class WALPlayer extends Configured implements Tool {
       if (tables.length != 1) {
         throw new IOException("Exactly one table must be specified for the 
bulk export option");
       }
-      HTable table = new HTable(conf, tables[0]);
+      HTable table = new HTable(conf, TableName.valueOf(tables[0]));
       job.setMapperClass(HLogKeyValueMapper.class);
       job.setReducerClass(KeyValueSortReducer.class);
       Path outputDir = new Path(hfileOutPath);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
index 61caf58..ca41780 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
@@ -121,7 +121,8 @@ public class VerifyReplication extends Configured 
implements Tool {
             Configuration peerConf = HBaseConfiguration.create(conf);
             ZKUtil.applyClusterKeyToConf(peerConf, zkClusterKey);
 
-            Table replicatedTable = new HTable(peerConf, conf.get(NAME + 
".tableName"));
+            TableName tableName = TableName.valueOf(conf.get(NAME + 
".tableName"));
+            Table replicatedTable = new HTable(peerConf, tableName);
             scan.setStartRow(value.getRow());
             replicatedScanner = replicatedTable.getScanner(scan);
             return null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 9b11291..d5cdb39 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
@@ -606,7 +606,7 @@ public final class Canary implements Tool {
 
     private void monitorRegionServers(Map<String, List<HRegionInfo>> 
rsAndRMap) {
       String serverName = null;
-      String tableName = null;
+      TableName tableName = null;
       HRegionInfo region = null;
       Table table = null;
       Get get = null;
@@ -620,7 +620,7 @@ public final class Canary implements Tool {
         // always get the first region
         region = entry.getValue().get(0);
         try {
-          tableName = region.getTable().getNameAsString();
+          tableName = region.getTable();
           table = new HTable(this.admin.getConfiguration(), tableName);
           startKey = region.getStartKey();
           // Can't do a get on empty start row so do a Scan of first element 
if any instead.
@@ -638,17 +638,18 @@ public final class Canary implements Tool {
             s.close();
             stopWatch.stop();
           }
-          this.getSink().publishReadTiming(tableName, serverName, 
stopWatch.getTime());
+          this.getSink().publishReadTiming(tableName.getNameAsString(),
+              serverName, stopWatch.getTime());
         } catch (TableNotFoundException tnfe) {
           // This is ignored because it doesn't imply that the regionserver is 
dead
         } catch (TableNotEnabledException tnee) {
           // This is considered a success since we got a response.
           LOG.debug("The targeted table was disabled.  Assuming success.");
         } catch (DoNotRetryIOException dnrioe) {
-            this.getSink().publishReadFailure(tableName, serverName);
+            this.getSink().publishReadFailure(tableName.getNameAsString(), 
serverName);
             LOG.error(dnrioe);
         } catch (IOException e) {
-          this.getSink().publishReadFailure(tableName, serverName);
+          this.getSink().publishReadFailure(tableName.getNameAsString(), 
serverName);
           LOG.error(e);
           this.errorCode = ERROR_EXIT_CODE;
         } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 cec27df..8cd2e15 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
@@ -1073,9 +1073,9 @@ public class HBaseTestingUtility extends 
HBaseCommonTestingUtility {
    * @return An HTable instance for the created table.
    * @throws IOException
    */
-  public HTable createTable(String tableName, String family)
+  public HTable createTable(TableName tableName, String family)
   throws IOException{
-    return createTable(TableName.valueOf(tableName), new String[]{family});
+    return createTable(tableName, new String[]{family});
   }
 
   /**
@@ -2147,20 +2147,6 @@ public class HBaseTestingUtility extends 
HBaseCommonTestingUtility {
    * @throws IOException
    * @throws InterruptedException
    */
-  public HRegionServer getRSForFirstRegionInTable(byte[] tableName)
-      throws IOException, InterruptedException {
-    return getRSForFirstRegionInTable(TableName.valueOf(tableName));
-  }
-  /**
-   * Tool to get the reference to the region server object that holds the
-   * region of the specified user table.
-   * It first searches for the meta rows that contain the region of the
-   * specified table, then gets the index of that RS, and finally retrieves
-   * the RS's reference.
-   * @param tableName user table to lookup in hbase:meta
-   * @return region server that holds it, null if the row doesn't exist
-   * @throws IOException
-   */
   public HRegionServer getRSForFirstRegionInTable(TableName tableName)
       throws IOException, InterruptedException {
     List<byte[]> metaRows = getMetaTableRows(tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java
index f4ffa2b..ce68852 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java
@@ -37,7 +37,7 @@ public class TestFullLogReconstruction {
   private final static HBaseTestingUtility
       TEST_UTIL = new HBaseTestingUtility();
 
-  private final static byte[] TABLE_NAME = Bytes.toBytes("tabletest");
+  private final static TableName TABLE_NAME = TableName.valueOf("tabletest");
   private final static byte[] FAMILY = Bytes.toBytes("family");
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
index 893c2d5..c00a92c 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
@@ -71,7 +71,7 @@ public class TestGlobalMemStoreSize {
     byte [] table = Bytes.toBytes("TestGlobalMemStoreSize");
     byte [] family = Bytes.toBytes("family");
     LOG.info("Creating table with " + regionNum + " regions");
-    HTable ht = TEST_UTIL.createTable(table, family);
+    HTable ht = TEST_UTIL.createTable(TableName.valueOf(table), family);
     int numRegions = TEST_UTIL.createMultiRegions(conf, ht, family,
         regionNum);
     assertEquals(regionNum,numRegions);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
index cb01558..d5f83d7 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
@@ -81,7 +81,7 @@ public class TestHBaseTestingUtility {
       htu2.startMiniCluster();
       htu3.startMiniCluster();
 
-      final byte[] TABLE_NAME = Bytes.toBytes("test");
+      final TableName TABLE_NAME = TableName.valueOf("test");
       final byte[] FAM_NAME = Bytes.toBytes("fam");
       final byte[] ROW = Bytes.toBytes("row");
       final byte[] QUAL_NAME = Bytes.toBytes("qual");

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java
index f6d2746..b6742ff 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java
@@ -97,17 +97,16 @@ public class TestInfoServers {
 
   @Test
   public void testMasterServerReadOnly() throws Exception {
-    String sTableName = "testMasterServerReadOnly";
-    byte[] tableName = Bytes.toBytes(sTableName);
+    TableName tableName = TableName.valueOf("testMasterServerReadOnly");
     byte[] cf = Bytes.toBytes("d");
     UTIL.createTable(tableName, cf);
     new HTable(UTIL.getConfiguration(), tableName).close();
     int port = UTIL.getHBaseCluster().getMaster().getInfoServer().getPort();
     assertDoesNotContainContent(
-      new URL("http://localhost:"; + port + "/table.jsp?name=" + sTableName + 
"&action=split&key="),
+      new URL("http://localhost:"; + port + "/table.jsp?name=" + tableName + 
"&action=split&key="),
       "Table action request accepted");
     assertDoesNotContainContent(
-      new URL("http://localhost:"; + port + "/table.jsp?name=" + sTableName),
+      new URL("http://localhost:"; + port + "/table.jsp?name=" + tableName),
       "Actions:");
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java
index e619d5e..08835aa 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java
@@ -142,7 +142,7 @@ public class TestMultiVersions {
     this.admin.createTable(desc);
     Put put = new Put(row, timestamp1);
     put.add(contents, contents, value1);
-    Table table = new HTable(UTIL.getConfiguration(), tableName);
+    Table table = new HTable(UTIL.getConfiguration(), desc.getTableName());
     table.put(put);
     // Shut down and restart the HBase cluster
     table.close();
@@ -151,7 +151,7 @@ public class TestMultiVersions {
     UTIL.startMiniHBaseCluster(1, NUM_SLAVES);
     // Make a new connection.  Use new Configuration instance because old one
     // is tied to an HConnection that has since gone stale.
-    table = new HTable(new Configuration(UTIL.getConfiguration()), tableName);
+    table = new HTable(new Configuration(UTIL.getConfiguration()), 
desc.getTableName());
     // Overwrite previous value
     put = new Put(row, timestamp2);
     put.add(contents, contents, value2);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
index 877b727..f8bf6ee 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java
@@ -260,7 +260,7 @@ public class TestZooKeeper {
     }
 
     Table table =
-      new HTable(new Configuration(TEST_UTIL.getConfiguration()), tableName);
+      new HTable(new Configuration(TEST_UTIL.getConfiguration()), 
desc.getTableName());
     Put put = new Put(Bytes.toBytes("testrow"));
     put.add(Bytes.toBytes("fam"),
         Bytes.toBytes("col"), Bytes.toBytes("testdata"));
@@ -545,7 +545,7 @@ public class TestZooKeeper {
       admin.createTable(htd, SPLIT_KEYS);
       ZooKeeperWatcher zooKeeperWatcher = 
HBaseTestingUtility.getZooKeeperWatcher(TEST_UTIL);
       ZKAssign.blockUntilNoRIT(zooKeeperWatcher);
-      table = new HTable(TEST_UTIL.getConfiguration(), tableName);
+      table = new HTable(TEST_UTIL.getConfiguration(), htd.getTableName());
       Put p;
       int numberOfPuts;
       for (numberOfPuts = 0; numberOfPuts < 6; numberOfPuts++) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 c9a2bb0..04bd466 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
@@ -301,8 +301,8 @@ public class TestAdmin {
     final byte [] row = Bytes.toBytes("row");
     final byte [] qualifier = Bytes.toBytes("qualifier");
     final byte [] value = Bytes.toBytes("value");
-    final byte [] table1 = Bytes.toBytes("testDisableAndEnableTable1");
-    final byte [] table2 = Bytes.toBytes("testDisableAndEnableTable2");
+    final TableName table1 = TableName.valueOf("testDisableAndEnableTable1");
+    final TableName table2 = TableName.valueOf("testDisableAndEnableTable2");
     Table ht1 = TEST_UTIL.createTable(table1, HConstants.CATALOG_FAMILY);
     Table ht2 = TEST_UTIL.createTable(table2, HConstants.CATALOG_FAMILY);
     Put put = new Put(row);
@@ -351,8 +351,7 @@ public class TestAdmin {
   public void testCreateTable() throws IOException {
     HTableDescriptor [] tables = admin.listTables();
     int numTables = tables.length;
-    TEST_UTIL.createTable(Bytes.toBytes("testCreateTable"),
-      HConstants.CATALOG_FAMILY).close();
+    TEST_UTIL.createTable(TableName.valueOf("testCreateTable"), 
HConstants.CATALOG_FAMILY).close();
     tables = this.admin.listTables();
     assertEquals(numTables + 1, tables.length);
     assertTrue("Table must be enabled.", TEST_UTIL.getHBaseCluster()
@@ -412,7 +411,7 @@ public class TestAdmin {
     htd.addFamily(fam2);
     htd.addFamily(fam3);
     this.admin.createTable(htd);
-    Table table = new HTable(TEST_UTIL.getConfiguration(), "myTestTable");
+    Table table = new HTable(TEST_UTIL.getConfiguration(), htd.getTableName());
     HTableDescriptor confirmedHtd = table.getTableDescriptor();
     assertEquals(htd.compareTo(confirmedHtd), 0);
     table.close();
@@ -1224,7 +1223,7 @@ public class TestAdmin {
     admin.createTable(htd1);
     admin.createTable(htd2);
     // Before fix, below would fail throwing a NoServerForRegionException.
-    new HTable(TEST_UTIL.getConfiguration(), name).close();
+    new HTable(TEST_UTIL.getConfiguration(), htd2.getTableName()).close();
   }
 
   /***
@@ -1261,7 +1260,7 @@ public class TestAdmin {
    */
   @Test (timeout=300000)
   public void testReadOnlyTable() throws Exception {
-    byte [] name = Bytes.toBytes("testReadOnlyTable");
+    TableName name = TableName.valueOf("testReadOnlyTable");
     Table table = TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY);
     byte[] value = Bytes.toBytes("somedata");
     // This used to use an empty row... That must have been a bug
@@ -1307,7 +1306,7 @@ public class TestAdmin {
    */
   @Test (expected=TableExistsException.class, timeout=300000)
   public void testTableExistsExceptionWithATable() throws IOException {
-    final byte [] name = Bytes.toBytes("testTableExistsExceptionWithATable");
+    final TableName name = 
TableName.valueOf("testTableExistsExceptionWithATable");
     TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY).close();
     TEST_UTIL.createTable(name, HConstants.CATALOG_FAMILY);
   }
@@ -1345,8 +1344,9 @@ public class TestAdmin {
    */
   @Test (expected=TableNotFoundException.class, timeout=300000)
   public void testTableNotFoundExceptionWithoutAnyTables() throws IOException {
-    Table ht =
-        new 
HTable(TEST_UTIL.getConfiguration(),"testTableNotFoundExceptionWithoutAnyTables");
+    TableName tableName = TableName
+        .valueOf("testTableNotFoundExceptionWithoutAnyTables");
+    Table ht = new HTable(TEST_UTIL.getConfiguration(), tableName);
     ht.get(new Get("e".getBytes()));
   }
 
@@ -1387,7 +1387,7 @@ public class TestAdmin {
     createTableWithDefaultConf(TABLENAME);
 
     HRegionInfo info = null;
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
+    HRegionServer rs = 
TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
     List<HRegionInfo> onlineRegions = 
ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
@@ -1445,7 +1445,7 @@ public class TestAdmin {
     byte[] TABLENAME = Bytes.toBytes("TestHBACloseRegion3");
     createTableWithDefaultConf(TABLENAME);
 
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
+    HRegionServer rs = 
TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
 
     try {
       List<HRegionInfo> onlineRegions = 
ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
@@ -1469,7 +1469,7 @@ public class TestAdmin {
     byte[] TABLENAME = 
Bytes.toBytes("TestHBACloseRegionWhenServerNameIsEmpty");
     createTableWithDefaultConf(TABLENAME);
 
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
+    HRegionServer rs = 
TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
 
     try {
       List<HRegionInfo> onlineRegions = 
ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
@@ -1493,7 +1493,7 @@ public class TestAdmin {
     createTableWithDefaultConf(TABLENAME);
 
     HRegionInfo info = null;
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
+    HRegionServer rs = 
TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
 
     List<HRegionInfo> onlineRegions = 
ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
     for (HRegionInfo regionInfo : onlineRegions) {
@@ -1576,7 +1576,7 @@ public class TestAdmin {
       v.append(className);
     }
     byte[] value = Bytes.toBytes(v.toString());
-    HRegionServer regionServer = startAndWriteData("TestLogRolling", value);
+    HRegionServer regionServer = 
startAndWriteData(TableName.valueOf("TestLogRolling"), value);
     LOG.info("after writing there are "
         + HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL()) + " 
log files");
 
@@ -1656,19 +1656,19 @@ public class TestAdmin {
         "hbase.regionserver.hlog.lowreplication.rolllimit", 3);
   }
 
-  private HRegionServer startAndWriteData(String tableName, byte[] value)
+  private HRegionServer startAndWriteData(TableName tableName, byte[] value)
   throws IOException, InterruptedException {
     // When the hbase:meta table can be opened, the region servers are running
     new HTable(
       TEST_UTIL.getConfiguration(), TableName.META_TABLE_NAME).close();
 
     // Create the test table and open it
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(tableName));
+    HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY));
     admin.createTable(desc);
     Table table = new HTable(TEST_UTIL.getConfiguration(), tableName);
 
-    HRegionServer regionServer = 
TEST_UTIL.getRSForFirstRegionInTable(Bytes.toBytes(tableName));
+    HRegionServer regionServer = 
TEST_UTIL.getRSForFirstRegionInTable(tableName);
     for (int i = 1; i <= 256; i++) { // 256 writes should cause 8 log rolls
       Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i)));
       put.add(HConstants.CATALOG_FAMILY, null, value);
@@ -1769,10 +1769,9 @@ public class TestAdmin {
     // 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);
-    HTable t = TEST_UTIL.createTable(nameBytes, HConstants.CATALOG_FAMILY);
+    final TableName tableName = TableName.valueOf("testGetRegion");
+    LOG.info("Started " + tableName);
+    HTable t = TEST_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY);
     TEST_UTIL.createMultiRegions(t, HConstants.CATALOG_FAMILY);
 
     HRegionLocation regionLocation = t.getRegionLocation("mmm");

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
index 546b9ea..ae8bd50 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java
@@ -83,7 +83,7 @@ public class TestClientScannerRPCTimeout {
 
   @Test
   public void testScannerNextRPCTimesout() throws Exception {
-    final byte[] TABLE_NAME = Bytes.toBytes("testScannerNextRPCTimesout");
+    final TableName TABLE_NAME = 
TableName.valueOf("testScannerNextRPCTimesout");
     Table ht = TEST_UTIL.createTable(TABLE_NAME, FAMILY);
     byte[] r1 = Bytes.toBytes("row-1");
     byte[] r2 = Bytes.toBytes("row-2");

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 a38cb1f..22d2e39 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
@@ -181,7 +181,7 @@ public class TestFromClientSide {
      HColumnDescriptor hcd = new HColumnDescriptor(FAMILY)
          .setKeepDeletedCells(true).setMaxVersions(3);
 
-     HTableDescriptor desc = new 
HTableDescriptor(TableName.valueOf(TABLENAME));
+     HTableDescriptor desc = new HTableDescriptor(TABLENAME);
      desc.addFamily(hcd);
      TEST_UTIL.getHBaseAdmin().createTable(desc);
      Configuration c = TEST_UTIL.getConfiguration();
@@ -384,7 +384,7 @@ public class TestFromClientSide {
    */
   @Test
   public void testGetConfiguration() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testGetConfiguration");
+    TableName TABLE = TableName.valueOf("testGetConfiguration");
     byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") };
     Configuration conf = TEST_UTIL.getConfiguration();
     Table table = TEST_UTIL.createTable(TABLE, FAMILIES, conf);
@@ -532,7 +532,7 @@ public class TestFromClientSide {
   @Test
   public void testFilterAcrossMultipleRegions()
   throws IOException, InterruptedException {
-    byte [] name = Bytes.toBytes("testFilterAcrossMutlipleRegions");
+    TableName name = TableName.valueOf("testFilterAcrossMutlipleRegions");
     HTable t = TEST_UTIL.createTable(name, FAMILY);
     int rowCount = TEST_UTIL.loadTable(t, FAMILY, false);
     assertRowCount(t, rowCount);
@@ -1207,7 +1207,7 @@ public class TestFromClientSide {
 
     // Null family (should NOT work)
     try {
-      TEST_UTIL.createTable(TABLE, (byte[])null);
+      TEST_UTIL.createTable(TABLE, new byte[][]{(byte[])null});
       fail("Creating a table with a null family passed, should fail");
     } catch(Exception e) {}
 
@@ -1242,7 +1242,7 @@ public class TestFromClientSide {
 
     // Use a new table
     byte [] TABLE2 = Bytes.toBytes("testNull2");
-    ht = TEST_UTIL.createTable(TABLE2, FAMILY);
+    ht = TEST_UTIL.createTable(TableName.valueOf(TABLE2), FAMILY);
 
     // Empty qualifier, byte[0] instead of null (should work)
     try {
@@ -3596,8 +3596,7 @@ public class TestFromClientSide {
   @Test
   public void testUpdatesWithMajorCompaction() throws Exception {
 
-    String tableName = "testUpdatesWithMajorCompaction";
-    byte [] TABLE = Bytes.toBytes(tableName);
+    TableName TABLE = TableName.valueOf("testUpdatesWithMajorCompaction");
     Table hTable = TEST_UTIL.createTable(TABLE, FAMILY, 10);
     HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
 
@@ -3629,8 +3628,8 @@ public class TestFromClientSide {
     assertEquals("BBB", Bytes.toString(navigableMap.get(2L)));
 
     // Trigger a major compaction
-    admin.flush(tableName);
-    admin.majorCompact(tableName);
+    admin.flush(TABLE);
+    admin.majorCompact(TABLE);
     Thread.sleep(6000);
 
     // Update the value at timestamp 1
@@ -3644,8 +3643,8 @@ public class TestFromClientSide {
     hTable.put(put);
 
     // Trigger a major compaction
-    admin.flush(tableName);
-    admin.majorCompact(tableName);
+    admin.flush(TABLE);
+    admin.majorCompact(TABLE);
     Thread.sleep(6000);
 
     // Check that the values at timestamp 2 and 1 got updated
@@ -3725,7 +3724,7 @@ public class TestFromClientSide {
 
   @Test
   public void testGet_EmptyTable() throws IOException {
-    Table table = TEST_UTIL.createTable(Bytes.toBytes("testGet_EmptyTable"), 
FAMILY);
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testGet_EmptyTable"), FAMILY);
     Get get = new Get(ROW);
     get.addFamily(FAMILY);
     Result r = table.get(get);
@@ -3734,7 +3733,7 @@ public class TestFromClientSide {
 
   @Test
   public void testGet_NullQualifier() throws IOException {
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testGet_NullQualifier"), FAMILY);
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testGet_NullQualifier"), FAMILY);
     Put put = new Put(ROW);
     put.add(FAMILY, QUALIFIER, VALUE);
     table.put(put);
@@ -3757,7 +3756,7 @@ public class TestFromClientSide {
 
   @Test
   public void testGet_NonExistentRow() throws IOException {
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testGet_NonExistentRow"), FAMILY);
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testGet_NonExistentRow"), FAMILY);
     Put put = new Put(ROW);
     put.add(FAMILY, QUALIFIER, VALUE);
     table.put(put);
@@ -3821,7 +3820,7 @@ public class TestFromClientSide {
   public void testPutNoCF() throws IOException {
     final byte[] BAD_FAM = Bytes.toBytes("BAD_CF");
     final byte[] VAL = Bytes.toBytes(100);
-    Table table = TEST_UTIL.createTable(Bytes.toBytes("testPutNoCF"), new 
byte[][]{FAMILY});
+    Table table = TEST_UTIL.createTable(Bytes.toBytes("testPutNoCF"), FAMILY);
 
     boolean caughtNSCFE = false;
 
@@ -4063,10 +4062,10 @@ public class TestFromClientSide {
 
   @Test
   public void testListTables() throws IOException, InterruptedException {
-    byte [] t1 = Bytes.toBytes("testListTables1");
-    byte [] t2 = Bytes.toBytes("testListTables2");
-    byte [] t3 = Bytes.toBytes("testListTables3");
-    byte [][] tables = new byte[][] { t1, t2, t3 };
+    TableName t1 = TableName.valueOf("testListTables1");
+    TableName t2 = TableName.valueOf("testListTables2");
+    TableName t3 = TableName.valueOf("testListTables3");
+    TableName [] tables = new TableName[] { t1, t2, t3 };
     for (int i = 0; i < tables.length; i++) {
       TEST_UTIL.createTable(tables[i], FAMILY);
     }
@@ -4079,12 +4078,12 @@ public class TestFromClientSide {
     for (int i = 0; i < tables.length && i < size; i++) {
       boolean found = false;
       for (int j = 0; j < ts.length; j++) {
-        if (Bytes.equals(ts[j].getTableName().getName(), tables[i])) {
+        if (ts[j].getTableName().equals(tables[i])) {
           found = true;
           break;
         }
       }
-      assertTrue("Not found: " + Bytes.toString(tables[i]), found);
+      assertTrue("Not found: " + tables[i], found);
     }
   }
 
@@ -4095,7 +4094,7 @@ public class TestFromClientSide {
    * @return the created HTable object
    * @throws IOException
    */
-  HTable createUnmangedHConnectionHTable(final byte [] tableName) throws 
IOException {
+  HTable createUnmangedHConnectionHTable(final TableName tableName) throws 
IOException {
     TEST_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY);
     HConnection conn = 
HConnectionManager.createConnection(TEST_UTIL.getConfiguration());
     return (HTable)conn.getTable(tableName);
@@ -4109,7 +4108,7 @@ public class TestFromClientSide {
    */
   @Test
   public void testUnmanagedHConnection() throws IOException {
-    final byte[] tableName = Bytes.toBytes("testUnmanagedHConnection");
+    final TableName tableName = TableName.valueOf("testUnmanagedHConnection");
     HTable t = createUnmangedHConnectionHTable(tableName);
     HBaseAdmin ha = new HBaseAdmin(t.getConnection());
     assertTrue(ha.tableExists(tableName));
@@ -4124,7 +4123,7 @@ public class TestFromClientSide {
    */
   @Test
   public void testUnmanagedHConnectionReconnect() throws Exception {
-    final byte[] tableName = 
Bytes.toBytes("testUnmanagedHConnectionReconnect");
+    final TableName tableName = 
TableName.valueOf("testUnmanagedHConnectionReconnect");
     HTable t = createUnmangedHConnectionHTable(tableName);
     Connection conn = t.getConnection();
     HBaseAdmin ha = new HBaseAdmin(conn);
@@ -4149,8 +4148,8 @@ public class TestFromClientSide {
 
   @Test
   public void testMiscHTableStuff() throws IOException {
-    final byte[] tableAname = Bytes.toBytes("testMiscHTableStuffA");
-    final byte[] tableBname = Bytes.toBytes("testMiscHTableStuffB");
+    final TableName tableAname = TableName.valueOf("testMiscHTableStuffA");
+    final TableName tableBname = TableName.valueOf("testMiscHTableStuffB");
     final byte[] attrName = Bytes.toBytes("TESTATTR");
     final byte[] attrValue = Bytes.toBytes("somevalue");
     byte[] value = Bytes.toBytes("value");
@@ -4192,7 +4191,7 @@ public class TestFromClientSide {
     // to be reloaded.
 
     // Test user metadata
-    HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
+    Admin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
     // make a modifiable descriptor
     HTableDescriptor desc = new HTableDescriptor(a.getTableDescriptor());
     // offline the table
@@ -4210,7 +4209,7 @@ public class TestFromClientSide {
     // Test that attribute changes were applied
     desc = a.getTableDescriptor();
     assertTrue("wrong table descriptor returned",
-      Bytes.compareTo(desc.getTableName().getName(), tableAname) == 0);
+      desc.getTableName().equals(tableAname));
     // check HTD attribute
     value = desc.getValue(attrName);
     assertFalse("missing HTD attribute value", value == null);
@@ -4227,7 +4226,7 @@ public class TestFromClientSide {
 
   @Test
   public void testGetClosestRowBefore() throws IOException, 
InterruptedException {
-    final byte[] tableAname = Bytes.toBytes("testGetClosestRowBefore");
+    final TableName tableAname = TableName.valueOf("testGetClosestRowBefore");
     final byte[] firstRow = Bytes.toBytes("row111");
     final byte[] secondRow = Bytes.toBytes("row222");
     final byte[] thirdRow = Bytes.toBytes("row333");
@@ -4341,7 +4340,7 @@ public class TestFromClientSide {
   @Test
   public void testMultiRowMutation() throws Exception {
     LOG.info("Starting testMultiRowMutation");
-    final byte [] TABLENAME = Bytes.toBytes("testMultiRowMutation");
+    final TableName TABLENAME = TableName.valueOf("testMultiRowMutation");
     final byte [] ROW1 = Bytes.toBytes("testRow1");
 
     Table t = TEST_UTIL.createTable(TABLENAME, FAMILY);
@@ -4372,7 +4371,7 @@ public class TestFromClientSide {
   @Test
   public void testRowMutation() throws Exception {
     LOG.info("Starting testRowMutation");
-    final byte [] TABLENAME = Bytes.toBytes("testRowMutation");
+    final TableName TABLENAME = TableName.valueOf("testRowMutation");
     Table t = TEST_UTIL.createTable(TABLENAME, FAMILY);
     byte [][] QUALIFIERS = new byte [][] {
         Bytes.toBytes("a"), Bytes.toBytes("b")
@@ -4404,7 +4403,7 @@ public class TestFromClientSide {
   @Test
   public void testAppend() throws Exception {
     LOG.info("Starting testAppend");
-    final byte [] TABLENAME = Bytes.toBytes("testAppend");
+    final TableName TABLENAME = TableName.valueOf("testAppend");
     Table t = TEST_UTIL.createTable(TABLENAME, FAMILY);
     byte[] v1 = Bytes.toBytes("42");
     byte[] v2 = Bytes.toBytes("23");
@@ -4455,7 +4454,7 @@ public class TestFromClientSide {
   @Test
   public void testIncrementingInvalidValue() throws Exception {
     LOG.info("Starting testIncrementingInvalidValue");
-    final byte [] TABLENAME = Bytes.toBytes("testIncrementingInvalidValue");
+    final TableName TABLENAME = 
TableName.valueOf("testIncrementingInvalidValue");
     Table ht = TEST_UTIL.createTable(TABLENAME, FAMILY);
     final byte[] COLUMN = Bytes.toBytes("column");
     Put p = new Put(ROW);
@@ -4481,7 +4480,7 @@ public class TestFromClientSide {
   @Test
   public void testIncrementInvalidArguments() throws Exception {
     LOG.info("Starting testIncrementInvalidArguments");
-    final byte[] TABLENAME = Bytes.toBytes("testIncrementInvalidArguments");
+    final TableName TABLENAME = 
TableName.valueOf("testIncrementInvalidArguments");
     Table ht = TEST_UTIL.createTable(TABLENAME, FAMILY);
     final byte[] COLUMN = Bytes.toBytes("column");
     try {
@@ -4536,7 +4535,7 @@ public class TestFromClientSide {
   @Test
   public void testIncrementOutOfOrder() throws Exception {
     LOG.info("Starting testIncrementOutOfOrder");
-    final byte [] TABLENAME = Bytes.toBytes("testIncrementOutOfOrder");
+    final TableName TABLENAME = TableName.valueOf("testIncrementOutOfOrder");
     Table ht = TEST_UTIL.createTable(TABLENAME, FAMILY);
 
     byte [][] QUALIFIERS = new byte [][] {
@@ -4576,7 +4575,7 @@ public class TestFromClientSide {
   @Test
   public void testIncrement() throws Exception {
     LOG.info("Starting testIncrement");
-    final byte [] TABLENAME = Bytes.toBytes("testIncrement");
+    final TableName TABLENAME = TableName.valueOf("testIncrement");
     Table ht = TEST_UTIL.createTable(TABLENAME, FAMILY);
 
     byte [][] ROWS = new byte [][] {
@@ -4647,7 +4646,7 @@ public class TestFromClientSide {
 
   @Test
   public void testClientPoolRoundRobin() throws IOException {
-    final byte[] tableName = Bytes.toBytes("testClientPoolRoundRobin");
+    final TableName tableName = TableName.valueOf("testClientPoolRoundRobin");
 
     int poolSize = 3;
     int numVersions = poolSize * 2;
@@ -4655,8 +4654,7 @@ public class TestFromClientSide {
     conf.set(HConstants.HBASE_CLIENT_IPC_POOL_TYPE, "round-robin");
     conf.setInt(HConstants.HBASE_CLIENT_IPC_POOL_SIZE, poolSize);
 
-    Table table = TEST_UTIL.createTable(tableName, new byte[][] { FAMILY },
-        conf, Integer.MAX_VALUE);
+    Table table = TEST_UTIL.createTable(tableName, new byte[][] { FAMILY }, 
conf, Integer.MAX_VALUE);
 
     final long ts = EnvironmentEdgeManager.currentTime();
     Get get = new Get(ROW);
@@ -4684,7 +4682,7 @@ public class TestFromClientSide {
 
   @Ignore ("Flakey: HBASE-8989") @Test
   public void testClientPoolThreadLocal() throws IOException {
-    final byte[] tableName = Bytes.toBytes("testClientPoolThreadLocal");
+    final TableName tableName = TableName.valueOf("testClientPoolThreadLocal");
 
     int poolSize = Integer.MAX_VALUE;
     int numVersions = 3;
@@ -4770,8 +4768,7 @@ public class TestFromClientSide {
     final byte [] anotherrow = Bytes.toBytes("anotherrow");
     final byte [] value2 = Bytes.toBytes("abcd");
 
-    Table table = TEST_UTIL.createTable(Bytes.toBytes("testCheckAndPut"),
-      new byte [][] {FAMILY});
+    Table table = TEST_UTIL.createTable(TableName.valueOf("testCheckAndPut"), 
FAMILY);
     Put put1 = new Put(ROW);
     put1.add(FAMILY, QUALIFIER, VALUE);
 
@@ -4812,8 +4809,7 @@ public class TestFromClientSide {
     final byte [] value3 = Bytes.toBytes("cccc");
     final byte [] value4 = Bytes.toBytes("dddd");
 
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testCheckAndPutWithCompareOp"),
-        new byte [][] {FAMILY});
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testCheckAndPutWithCompareOp"), 
FAMILY);
 
     Put put2 = new Put(ROW);
     put2.add(FAMILY, QUALIFIER, value2);
@@ -4878,8 +4874,8 @@ public class TestFromClientSide {
     final byte [] value3 = Bytes.toBytes("cccc");
     final byte [] value4 = Bytes.toBytes("dddd");
 
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testCheckAndDeleteWithCompareOp"),
-        new byte [][] {FAMILY});
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testCheckAndDeleteWithCompareOp"),
+        FAMILY);
 
     Put put2 = new Put(ROW);
     put2.add(FAMILY, QUALIFIER, value2);
@@ -4952,7 +4948,7 @@ public class TestFromClientSide {
   @Test
   @SuppressWarnings ("unused")
   public void testScanMetrics() throws Exception {
-    byte [] TABLENAME = Bytes.toBytes("testScanMetrics");
+    TableName TABLENAME = TableName.valueOf("testScanMetrics");
 
     Configuration conf = TEST_UTIL.getConfiguration();
     TEST_UTIL.createTable(TABLENAME, FAMILY);
@@ -5056,13 +5052,12 @@ public class TestFromClientSide {
    */
   @Test
   public void testCacheOnWriteEvictOnClose() throws Exception {
-    byte [] tableName = Bytes.toBytes("testCOWEOCfromClient");
+    TableName tableName = TableName.valueOf("testCOWEOCfromClient");
     byte [] data = Bytes.toBytes("data");
-    HTable table = TEST_UTIL.createTable(tableName, new byte [][] {FAMILY});
+    HTable table = TEST_UTIL.createTable(tableName, FAMILY);
     // get the block cache and region
     String regionName = table.getRegionLocations().firstKey().getEncodedName();
-    HRegion region = TEST_UTIL.getRSForFirstRegionInTable(
-        tableName).getFromOnlineRegions(regionName);
+    HRegion region = 
TEST_UTIL.getRSForFirstRegionInTable(tableName).getFromOnlineRegions(regionName);
     Store store = region.getStores().values().iterator().next();
     CacheConfig cacheConf = store.getCacheConfig();
     cacheConf.setCacheDataOnWrite(true);
@@ -5170,8 +5165,7 @@ public class TestFromClientSide {
    */
   public void testNonCachedGetRegionLocation() throws Exception {
     // Test Initialization.
-    String tableName = "testNonCachedGetRegionLocation";
-    byte [] TABLE = Bytes.toBytes(tableName);
+    TableName TABLE = TableName.valueOf("testNonCachedGetRegionLocation");
     byte [] family1 = Bytes.toBytes("f1");
     byte [] family2 = Bytes.toBytes("f2");
     HTable table = TEST_UTIL.createTable(TABLE, new byte[][] {family1, 
family2}, 10);
@@ -5219,7 +5213,7 @@ public class TestFromClientSide {
     // Test Initialization.
     byte [] startKey = Bytes.toBytes("ddc");
     byte [] endKey = Bytes.toBytes("mmm");
-    byte [] TABLE = Bytes.toBytes("testGetRegionsInRange");
+    TableName TABLE = TableName.valueOf("testGetRegionsInRange");
     HTable table = TEST_UTIL.createTable(TABLE, new byte[][] {FAMILY}, 10);
     int numOfRegions = TEST_UTIL.createMultiRegions(table, FAMILY);
     assertEquals(25, numOfRegions);
@@ -5270,7 +5264,7 @@ public class TestFromClientSide {
 
   @Test
   public void testJira6912() throws Exception {
-    byte [] TABLE = Bytes.toBytes("testJira6912");
+    TableName TABLE = TableName.valueOf("testJira6912");
     Table foo = TEST_UTIL.createTable(TABLE, new byte[][] {FAMILY}, 10);
 
     List<Put> puts = new ArrayList<Put>();
@@ -5296,7 +5290,7 @@ public class TestFromClientSide {
 
   @Test
   public void testScan_NullQualifier() throws IOException {
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testScan_NullQualifier"), FAMILY);
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testScan_NullQualifier"), FAMILY);
     Put put = new Put(ROW);
     put.add(FAMILY, QUALIFIER, VALUE);
     table.put(put);
@@ -5325,7 +5319,7 @@ public class TestFromClientSide {
 
   @Test
   public void testNegativeTimestamp() throws IOException {
-    Table table = 
TEST_UTIL.createTable(Bytes.toBytes("testNegativeTimestamp"), FAMILY);
+    Table table = 
TEST_UTIL.createTable(TableName.valueOf("testNegativeTimestamp"), FAMILY);
 
     try {
       Put put = new Put(ROW, -1);
@@ -5469,8 +5463,8 @@ public class TestFromClientSide {
 
   @Test
   public void testRawScanRespectsVersions() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testRawScan");
-    Table table = TEST_UTIL.createTable(TABLE, new byte[][] { FAMILY });
+    TableName TABLE = TableName.valueOf("testRawScan");
+    Table table = TEST_UTIL.createTable(TABLE, FAMILY);
     byte[] row = Bytes.toBytes("row");
 
     // put the same row 4 times, with different values
@@ -5545,7 +5539,7 @@ public class TestFromClientSide {
   @Test
   public void testSmallScan() throws Exception {
     // Test Initialization.
-    byte[] TABLE = Bytes.toBytes("testSmallScan");
+    TableName TABLE = TableName.valueOf("testSmallScan");
     Table table = TEST_UTIL.createTable(TABLE, FAMILY);
 
     // Insert one row each region
@@ -5581,7 +5575,7 @@ public class TestFromClientSide {
 
   @Test
   public void testSuperSimpleWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testSuperSimpleWithReverseScan");
+    TableName TABLE = TableName.valueOf("testSuperSimpleWithReverseScan");
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
     Put put = new Put(Bytes.toBytes("0-b11111-0000000000000000000"));
     put.add(FAMILY, QUALIFIER, VALUE);
@@ -5627,7 +5621,7 @@ public class TestFromClientSide {
 
   @Test
   public void testFiltersWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testFiltersWithReverseScan");
+    TableName TABLE = TableName.valueOf("testFiltersWithReverseScan");
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
     byte[][] ROWS = makeN(ROW, 10);
     byte[][] QUALIFIERS = { Bytes.toBytes("col0-<d2v1>-<d3v2>"),
@@ -5667,7 +5661,7 @@ public class TestFromClientSide {
 
   @Test
   public void testKeyOnlyFilterWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testKeyOnlyFilterWithReverseScan");
+    TableName TABLE = TableName.valueOf("testKeyOnlyFilterWithReverseScan");
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
     byte[][] ROWS = makeN(ROW, 10);
     byte[][] QUALIFIERS = { Bytes.toBytes("col0-<d2v1>-<d3v2>"),
@@ -5708,7 +5702,7 @@ public class TestFromClientSide {
    */
   @Test
   public void testSimpleMissingWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testSimpleMissingWithReverseScan");
+    TableName TABLE = TableName.valueOf("testSimpleMissingWithReverseScan");
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
     byte[][] ROWS = makeN(ROW, 4);
 
@@ -5773,7 +5767,7 @@ public class TestFromClientSide {
 
   @Test
   public void testNullWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testNullWithReverseScan");
+    TableName TABLE = TableName.valueOf("testNullWithReverseScan");
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
     // Null qualifier (should work)
     Put put = new Put(ROW);
@@ -5785,7 +5779,7 @@ public class TestFromClientSide {
     ht.delete(delete);
     // Use a new table
     byte[] TABLE2 = Bytes.toBytes("testNull2WithReverseScan");
-    ht = TEST_UTIL.createTable(TABLE2, FAMILY);
+    ht = TEST_UTIL.createTable(TableName.valueOf(TABLE2), FAMILY);
     // Empty qualifier, byte[0] instead of null (should work)
     put = new Put(ROW);
     put.add(FAMILY, HConstants.EMPTY_BYTE_ARRAY, VALUE);
@@ -5810,13 +5804,12 @@ public class TestFromClientSide {
 
   @Test
   public void testDeletesWithReverseScan() throws Exception {
-    byte[] TABLE = Bytes.toBytes("testDeletesWithReverseScan");
+    TableName TABLE = TableName.valueOf("testDeletesWithReverseScan");
     byte[][] ROWS = makeNAscii(ROW, 6);
     byte[][] FAMILIES = makeNAscii(FAMILY, 3);
     byte[][] VALUES = makeN(VALUE, 5);
     long[] ts = { 1000, 2000, 3000, 4000, 5000 };
-    Table ht = TEST_UTIL.createTable(TABLE, FAMILIES,
-        TEST_UTIL.getConfiguration(), 3);
+    Table ht = TEST_UTIL.createTable(TABLE, FAMILIES, 
TEST_UTIL.getConfiguration(), 3);
 
     Put put = new Put(ROW);
     put.add(FAMILIES[0], QUALIFIER, ts[0], VALUES[0]);
@@ -5997,7 +5990,7 @@ public class TestFromClientSide {
   @Test
   public void testReversedScanUnderMultiRegions() throws Exception {
     // Test Initialization.
-    byte[] TABLE = Bytes.toBytes("testReversedScanUnderMultiRegions");
+    TableName TABLE = TableName.valueOf("testReversedScanUnderMultiRegions");
     byte[] maxByteArray = ReversedClientScanner.MAX_BYTE_ARRAY;
     byte[][] splitRows = new byte[][] { Bytes.toBytes("005"),
         Bytes.add(Bytes.toBytes("005"), Bytes.multiple(maxByteArray, 16)),
@@ -6054,7 +6047,7 @@ public class TestFromClientSide {
   @Test
   public void testSmallReversedScanUnderMultiRegions() throws Exception {
     // Test Initialization.
-    byte[] TABLE = Bytes.toBytes("testSmallReversedScanUnderMultiRegions");
+    TableName TABLE = 
TableName.valueOf("testSmallReversedScanUnderMultiRegions");
     byte[][] splitRows = new byte[][]{
         Bytes.toBytes("000"), Bytes.toBytes("002"), Bytes.toBytes("004"),
         Bytes.toBytes("006"), Bytes.toBytes("008"), Bytes.toBytes("010")};

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 5858e75..fee836f 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
@@ -337,8 +337,8 @@ public class TestFromClientSide3 {
   public void testHTableExistsMethodMultipleRegionsSingleGet() throws 
Exception {
 
     Table table = TEST_UTIL.createTable(
-      Bytes.toBytes("testHTableExistsMethodMultipleRegionsSingleGet"), new 
byte[][] { FAMILY }, 1,
-      new byte[] { 0x00 }, new byte[] { (byte) 0xff }, 255);
+      TableName.valueOf("testHTableExistsMethodMultipleRegionsSingleGet"), new 
byte[][] { FAMILY },
+      1, new byte[] { 0x00 }, new byte[] { (byte) 0xff }, 255);
     Put put = new Put(ROW);
     put.add(FAMILY, QUALIFIER, VALUE);
 
@@ -356,8 +356,8 @@ public class TestFromClientSide3 {
   @Test
   public void testHTableExistsMethodMultipleRegionsMultipleGets() throws 
Exception {
     HTable table = TEST_UTIL.createTable(
-      Bytes.toBytes("testHTableExistsMethodMultipleRegionsMultipleGets"), new 
byte[][] { FAMILY },
-      1, new byte[] { 0x00 }, new byte[] { (byte) 0xff }, 255);
+      TableName.valueOf("testHTableExistsMethodMultipleRegionsMultipleGets"), 
+      new byte[][] { FAMILY }, 1, new byte[] { 0x00 }, new byte[] { (byte) 
0xff }, 255);
     Put put = new Put(ROW);
     put.add(FAMILY, QUALIFIER, VALUE);
     table.put (put);
@@ -409,7 +409,7 @@ public class TestFromClientSide3 {
     HTableDescriptor desc = new 
HTableDescriptor(TableName.valueOf(Bytes.toBytes("test")));
     desc.addFamily(new HColumnDescriptor(FAMILY));
     admin.createTable(desc);
-    Table table = new HTable(TEST_UTIL.getConfiguration(), "test");
+    Table table = new HTable(TEST_UTIL.getConfiguration(), 
desc.getTableName());
 
     Put put = new Put(ROW_BYTES);
     put.add(FAMILY, COL_QUAL, VAL_BYTES);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
index 5c6769f..98f02ff 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Waiter;
 import org.apache.hadoop.hbase.exceptions.OperationConflictException;
 import org.apache.hadoop.hbase.ipc.RpcClient;
@@ -66,7 +67,7 @@ public class TestMultiParallel {
   private static final byte[] VALUE = Bytes.toBytes("value");
   private static final byte[] QUALIFIER = Bytes.toBytes("qual");
   private static final String FAMILY = "family";
-  private static final String TEST_TABLE = "multi_test_table";
+  private static final TableName TEST_TABLE = 
TableName.valueOf("multi_test_table");
   private static final byte[] BYTES_FAMILY = Bytes.toBytes(FAMILY);
   private static final byte[] ONE_ROW = Bytes.toBytes("xxx");
   private static final byte [][] KEYS = makeKeys();
@@ -78,9 +79,9 @@ public class TestMultiParallel {
     ((Log4JLogger)RpcClient.LOG).getLogger().setLevel(Level.ALL);
     ((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);
     UTIL.startMiniCluster(slaves);
-    HTable t = UTIL.createTable(Bytes.toBytes(TEST_TABLE), 
Bytes.toBytes(FAMILY));
+    HTable t = UTIL.createTable(TEST_TABLE, Bytes.toBytes(FAMILY));
     UTIL.createMultiRegions(t, Bytes.toBytes(FAMILY));
-    UTIL.waitTableEnabled(Bytes.toBytes(TEST_TABLE));
+    UTIL.waitTableEnabled(TEST_TABLE.getName());
     t.close();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java
index e220058..f95ac2c 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.AfterClass;
@@ -47,7 +48,7 @@ public class TestScannerTimeout {
 
   final Log LOG = LogFactory.getLog(getClass());
   private final static byte[] SOME_BYTES = Bytes.toBytes("f");
-  private final static byte[] TABLE_NAME = Bytes.toBytes("t");
+  private final static TableName TABLE_NAME = TableName.valueOf("t");
   private final static int NB_ROWS = 10;
   // Be careful w/ what you set this timer to... it can get in the way of
   // the mini cluster coming up -- the verification in particular.

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
index ee5b4ed..129e714 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.HTestConst;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.filter.ColumnPrefixFilter;
 import org.apache.hadoop.hbase.filter.ColumnRangeFilter;
 import org.apache.hadoop.hbase.master.HMaster;
@@ -103,7 +104,7 @@ public class TestScannersFromClientSide {
    */
   @Test
   public void testScanBatch() throws Exception {
-    byte [] TABLE = Bytes.toBytes("testScanBatch");
+    TableName TABLE = TableName.valueOf("testScanBatch");
     byte [][] QUALIFIERS = HTestConst.makeNAscii(QUALIFIER, 8);
 
     Table ht = TEST_UTIL.createTable(TABLE, FAMILY);
@@ -444,7 +445,7 @@ public class TestScannersFromClientSide {
    */
   @Test
   public void testScanOnReopenedRegion() throws Exception {
-    byte [] TABLE = Bytes.toBytes("testScanOnReopenedRegion");
+    TableName TABLE = TableName.valueOf("testScanOnReopenedRegion");
     byte [][] QUALIFIERS = HTestConst.makeNAscii(QUALIFIER, 2);
 
     HTable ht = TEST_UTIL.createTable(TABLE, FAMILY);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 5f2d2c5..c3855ea 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
@@ -57,7 +57,7 @@ public class TestSnapshotCloneIndependence {
   private static final String STRING_TABLE_NAME = "test";
   private static final String TEST_FAM_STR = "fam";
   private static final byte[] TEST_FAM = Bytes.toBytes(TEST_FAM_STR);
-  private static final byte[] TABLE_NAME = Bytes.toBytes(STRING_TABLE_NAME);
+  private static final TableName TABLE_NAME = 
TableName.valueOf(STRING_TABLE_NAME);
 
   /**
    * Setup the config for the cluster and start it

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
index 3e382ea..1bd11ae 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java
@@ -96,7 +96,7 @@ public class TestTimestampsFilter {
     Cell kvs[];
 
     // create table; set versions to max...
-    Table ht = TEST_UTIL.createTable(TABLE, FAMILIES, Integer.MAX_VALUE);
+    Table ht = TEST_UTIL.createTable(TableName.valueOf(TABLE), FAMILIES, 
Integer.MAX_VALUE);
 
     for (int rowIdx = 0; rowIdx < 5; rowIdx++) {
       for (int colIdx = 0; colIdx < 5; colIdx++) {
@@ -171,7 +171,7 @@ public class TestTimestampsFilter {
     byte [][] FAMILIES = new byte[][] { FAMILY };
 
     // create table; set versions to max...
-    Table ht = TEST_UTIL.createTable(TABLE, FAMILIES, Integer.MAX_VALUE);
+    Table ht = TEST_UTIL.createTable(TableName.valueOf(TABLE), FAMILIES, 
Integer.MAX_VALUE);
 
     Put p = new Put(Bytes.toBytes("row"));
     p.add(FAMILY, Bytes.toBytes("column0"), 3, Bytes.toBytes("value0-3"));
@@ -231,7 +231,7 @@ public class TestTimestampsFilter {
     byte [][] FAMILIES = new byte[][] { FAMILY };
 
     // create table; set versions to max...
-    Table ht = TEST_UTIL.createTable(TABLE, FAMILIES, Integer.MAX_VALUE);
+    Table ht = TEST_UTIL.createTable(TableName.valueOf(TABLE), FAMILIES, 
Integer.MAX_VALUE);
 
     // For row:0, col:0: insert versions 1 through 5.
     putNVersions(ht, FAMILY, 0, 0, 1, 5);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestHTableWrapper.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestHTableWrapper.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestHTableWrapper.java
index cbeb532..8c1e515 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestHTableWrapper.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestHTableWrapper.java
@@ -65,7 +65,7 @@ public class TestHTableWrapper {
 
   private static final HBaseTestingUtility util = new HBaseTestingUtility();
 
-  private static final byte[] TEST_TABLE = Bytes.toBytes("test");
+  private static final TableName TEST_TABLE = TableName.valueOf("test");
   private static final byte[] TEST_FAMILY = Bytes.toBytes("f1");
 
   private static final byte[] ROW_A = Bytes.toBytes("aaa");
@@ -135,7 +135,7 @@ public class TestHTableWrapper {
     CoprocessorEnvironment env = 
cpHost.findCoprocessorEnvironment(implClazz.getName());
     assertEquals(Coprocessor.VERSION, env.getVersion());
     assertEquals(VersionInfo.getVersion(), env.getHBaseVersion());
-    hTableInterface = env.getTable(TableName.valueOf(TEST_TABLE));
+    hTableInterface = env.getTable(TEST_TABLE);
     checkHTableInterfaceMethods();
     cpHost.shutdown(env);
   }
@@ -169,7 +169,7 @@ public class TestHTableWrapper {
   }
 
   private void checkNameAndDescriptor() throws IOException {
-    assertArrayEquals(TEST_TABLE, hTableInterface.getTableName());
+    assertEquals(TEST_TABLE, hTableInterface.getName());
     assertEquals(table.getTableDescriptor(), 
hTableInterface.getTableDescriptor());
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/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 9f81151..27e77db 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
@@ -161,7 +161,7 @@ public class TestOpenTableInCoprocessor {
     admin.createTable(primary);
     admin.createTable(other);
 
-    Table table = new HTable(UTIL.getConfiguration(), "primary");
+    Table table = new HTable(UTIL.getConfiguration(), 
TableName.valueOf("primary"));
     Put p = new Put(new byte[] { 'a' });
     p.add(family, null, new byte[] { 'a' });
     table.put(p);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java
index c501149..f5e3baa 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java
@@ -158,7 +158,7 @@ public class TestColumnRangeFilter {
   public void TestColumnRangeFilterClient() throws Exception {
     String family = "Family";
     String table = "TestColumnRangeFilterClient";
-    Table ht = TEST_UTIL.createTable(Bytes.toBytes(table),
+    Table ht = TEST_UTIL.createTable(TableName.valueOf(table),
         Bytes.toBytes(family), Integer.MAX_VALUE);
 
     List<String> rows = generateRandomWords(10, 8);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java
index d64a5ad..66b346e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.MediumTests;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
@@ -88,7 +89,7 @@ public class TestFuzzyRowAndColumnRangeFilter {
   public void Test() throws Exception {
     String cf = "f";
     String table = "TestFuzzyAndColumnRangeFilterClient";
-    Table ht = TEST_UTIL.createTable(Bytes.toBytes(table),
+    Table ht = TEST_UTIL.createTable(TableName.valueOf(table),
             Bytes.toBytes(cf), Integer.MAX_VALUE);
 
     // 10 byte row key - (2 bytes 4 bytes 4 bytes)

http://git-wip-us.apache.org/repos/asf/hbase/blob/1e821bc0/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java
index eee8c9a..ead2c47 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java
@@ -39,6 +39,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
@@ -260,7 +261,7 @@ public class TestBlockReorder {
     // We use the regionserver file system & conf as we expect it to have the 
hook.
     conf = targetRs.getConfiguration();
     HFileSystem rfs = (HFileSystem) targetRs.getFileSystem();
-    Table h = htu.createTable("table".getBytes(), sb);
+    Table h = htu.createTable(TableName.valueOf("table"), sb);
 
     // Now, we have 4 datanodes and a replication count of 3. So we don't know 
if the datanode
     // with the same node will be used. We can't really stop an existing 
datanode, this would

Reply via email to