hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [1/2] HBASE-12038 Replace internal uses of signatures with byte[] and String tableNames to use the TableName equivalents (Solomon Duskis)
Date Tue, 30 Sep 2014 23:36:04 GMT
Repository: hbase
Updated Branches:
  refs/heads/master c4107d530 -> b5783795c


http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
index b272993..b1230bb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java
@@ -111,7 +111,7 @@ public class TestCellACLs extends SecureTestUtil {
     rsHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1,
conf);
 
     // Wait for the ACL table to become available
-    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME.getName());
+    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
 
     // create a set of test users
     USER_OWNER = User.createUserForTesting(conf, "owner", new String[0]);
@@ -133,7 +133,7 @@ public class TestCellACLs extends SecureTestUtil {
     htd.setOwner(USER_OWNER);
     htd.addFamily(hcd);
     admin.createTable(htd, new byte[][] { Bytes.toBytes("s") });
-    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName().getName());
+    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java
index 0b1fb64..f4b3882 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java
@@ -99,7 +99,7 @@ public class TestScanEarlyTermination extends SecureTestUtil {
     rsHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1,
conf);
 
     // Wait for the ACL table to become available
-    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME.getName());
+    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
 
     // create a set of test users
     USER_OWNER = User.createUserForTesting(conf, "owner", new String[0]);
@@ -129,7 +129,7 @@ public class TestScanEarlyTermination extends SecureTestUtil {
 
     admin.createTable(htd);
 
-    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName().getName());
+    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java
index 7bdf55a..b795127 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java
@@ -98,7 +98,7 @@ public class TestTablePermissions {
     UTIL.startMiniCluster();
 
     // Wait for the ACL table to become available
-    UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME.getName());
+    UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
 
     ZKW = new ZooKeeperWatcher(UTIL.getConfiguration(),
       "TestTablePermissions", ABORTABLE);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java
index 03510dc..d4f5d67 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java
@@ -124,7 +124,7 @@ public class TestVisibilityLabelsWithACL {
       public Void run() throws Exception {
         Scan s = new Scan();
         s.setAuthorizations(new Authorizations(SECRET, CONFIDENTIAL));
-        Table t = new HTable(conf, table.getTableName());
+        Table t = new HTable(conf, table.getName());
         try {
           ResultScanner scanner = t.getScanner(s);
           Result result = scanner.next();
@@ -153,7 +153,7 @@ public class TestVisibilityLabelsWithACL {
       public Void run() throws Exception {
         Scan s = new Scan();
         s.setAuthorizations(new Authorizations(SECRET, CONFIDENTIAL));
-        Table t = new HTable(conf, table.getTableName());
+        Table t = new HTable(conf, table.getName());
         try {
           ResultScanner scanner = t.getScanner(s);
           Result[] result = scanner.next(5);
@@ -179,7 +179,7 @@ public class TestVisibilityLabelsWithACL {
       public Void run() throws Exception {
         Get g = new Get(row1);
         g.setAuthorizations(new Authorizations(SECRET, CONFIDENTIAL));
-        Table t = new HTable(conf, table.getTableName());
+        Table t = new HTable(conf, table.getName());
         try {
           Result result = t.get(g);
           assertTrue(!result.isEmpty());
@@ -208,7 +208,7 @@ public class TestVisibilityLabelsWithACL {
       public Void run() throws Exception {
         Get g = new Get(row1);
         g.setAuthorizations(new Authorizations(SECRET, CONFIDENTIAL));
-        Table t = new HTable(conf, table.getTableName());
+        Table t = new HTable(conf, table.getName());
         try {
           Result result = t.get(g);
           assertTrue(result.isEmpty());

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDefaultVisLabelService.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDefaultVisLabelService.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDefaultVisLabelService.java
index c8f2222..cb5fff1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDefaultVisLabelService.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDefaultVisLabelService.java
@@ -145,7 +145,7 @@ public class TestVisibilityLabelsWithDefaultVisLabelService extends TestVisibili
     // Scan the visibility label
     Scan s = new Scan();
     s.setAuthorizations(new Authorizations(VisibilityUtils.SYSTEM_LABEL));
-    Table ht = new HTable(conf, LABELS_TABLE_NAME.getName());
+    Table ht = new HTable(conf, LABELS_TABLE_NAME);
     int i = 0;
     try {
       ResultScanner scanner = ht.getScanner(s);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java
index 78ec873..19d5965 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java
@@ -49,6 +49,6 @@ public class TestSecureExportSnapshot extends TestExportSnapshot {
     TEST_UTIL.startMiniMapReduceCluster();
 
     // Wait for the ACL table to become available
-    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME.getName());
+    TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java
index a63620a..e8d22b8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcessBasedCluster.java
@@ -62,7 +62,7 @@ public class TestProcessBasedCluster {
           HTestConst.DEFAULT_CF_STR_SET,
           HColumnDescriptor.DEFAULT_VERSIONS, COLS_PER_ROW, FLUSHES, NUM_REGIONS,
           ROWS_PER_FLUSH);
-      Table table = new HTable(TEST_UTIL.getConfiguration(), HTestConst.DEFAULT_TABLE_BYTES);
+      Table table = new HTable(TEST_UTIL.getConfiguration(), HTestConst.DEFAULT_TABLE);
       ResultScanner scanner = table.getScanner(HTestConst.DEFAULT_CF_BYTES);
       Result result;
       int rows = 0;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
index 451da3c..c55f946 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java
@@ -280,8 +280,7 @@ public class TestRegionSplitter {
         final Configuration conf = UTIL.getConfiguration();
         conf.setInt("split.count", numRegions);
         SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
-        RegionSplitter.createPresplitTable(tableName.getNameAsString(), splitAlgo,
-                new String[] {CF_NAME}, conf);
+        RegionSplitter.createPresplitTable(tableName, splitAlgo, new String[] {CF_NAME},
conf);
         verifyBounds(expectedBounds, tableName);
     }
 
@@ -301,7 +300,7 @@ public class TestRegionSplitter {
         // Set this larger than the number of splits so RegionSplitter won't block
         conf.setInt("split.outstanding", 5);
         SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
-        RegionSplitter.rollingSplit(tableName.getNameAsString(), splitAlgo, conf);
+        RegionSplitter.rollingSplit(tableName, splitAlgo, conf);
         verifyBounds(expectedBounds, tableName);
     }
 
@@ -328,6 +327,7 @@ public class TestRegionSplitter {
                     startBoundaryIndex+1);
             assertEquals(0, Bytes.compareTo(regionEnd, expectedRegionEnd));
         }
+        hTable.close();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5783795/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestHTablePool.java
----------------------------------------------------------------------
diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestHTablePool.java
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestHTablePool.java
index 891ea57..7cc0061 100644
--- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestHTablePool.java
+++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestHTablePool.java
@@ -42,14 +42,14 @@ import org.junit.runners.Suite;
 @Category({ClientTests.class, MediumTests.class})
 public class TestHTablePool {
   private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
-  private final static byte[] TABLENAME = Bytes.toBytes("TestHTablePool");
+  private final static String TABLENAME = "TestHTablePool";
 
   public abstract static class TestHTablePoolType {
 
     @BeforeClass
     public static void setUpBeforeClass() throws Exception {
       TEST_UTIL.startMiniCluster(1);
-      TEST_UTIL.createTable(TABLENAME, HConstants.CATALOG_FAMILY);
+      TEST_UTIL.createTable(TableName.valueOf(TABLENAME), HConstants.CATALOG_FAMILY);
     }
 
     @AfterClass
@@ -63,7 +63,7 @@ public class TestHTablePool {
 		public void testTableWithStringName() throws Exception {
 			HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
 					Integer.MAX_VALUE, getPoolType());
-			String tableName = Bytes.toString(TABLENAME);
+			String tableName = TABLENAME;
 
 			// Request a table from an empty pool
 			Table table = pool.getTable(tableName);
@@ -132,7 +132,7 @@ public class TestHTablePool {
     public void testProxyImplementationReturned() {
       HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
           Integer.MAX_VALUE);
-      String tableName = Bytes.toString(TABLENAME);// Request a table from
+      String tableName = TABLENAME;// Request a table from
                               // an
                               // empty pool
       Table table = pool.getTable(tableName);
@@ -145,7 +145,7 @@ public class TestHTablePool {
     public void testDeprecatedUsagePattern() throws IOException {
       HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
           Integer.MAX_VALUE);
-      String tableName = Bytes.toString(TABLENAME);// Request a table from
+      String tableName = TABLENAME;// Request a table from
                               // an
                               // empty pool
 
@@ -167,14 +167,14 @@ public class TestHTablePool {
     public void testReturnDifferentTable() throws IOException {
       HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
           Integer.MAX_VALUE);
-      String tableName = Bytes.toString(TABLENAME);// Request a table from
+      String tableName = TABLENAME;// Request a table from
                               // an
                               // empty pool
 
       // get table will return proxy implementation
       final Table table = pool.getTable(tableName);
       HTableInterface alienTable = new HTable(TEST_UTIL.getConfiguration(),
-          TABLENAME) {
+          TableName.valueOf(TABLENAME)) {
         // implementation doesn't matter as long the table is not from
         // pool
       };
@@ -191,7 +191,7 @@ public class TestHTablePool {
     public void testHTablePoolCloseTwice() throws Exception {
       HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
           Integer.MAX_VALUE, getPoolType());
-      String tableName = Bytes.toString(TABLENAME);
+      String tableName = TABLENAME;
 
       // Request a table from an empty pool
       Table table = pool.getTable(tableName);
@@ -278,12 +278,12 @@ public class TestHTablePool {
 			}
 
 			Assert.assertEquals(4,
-					pool.getCurrentPoolSize(Bytes.toString(TABLENAME)));
+					pool.getCurrentPoolSize(TABLENAME));
 
 			pool.closeTablePool(TABLENAME);
 
 			Assert.assertEquals(0,
-					pool.getCurrentPoolSize(Bytes.toString(TABLENAME)));
+					pool.getCurrentPoolSize(TABLENAME));
 		}
 	}
 
@@ -354,12 +354,12 @@ public class TestHTablePool {
 			}
 
 			Assert.assertEquals(1,
-					pool.getCurrentPoolSize(Bytes.toString(TABLENAME)));
+					pool.getCurrentPoolSize(TABLENAME));
 
 			pool.closeTablePool(TABLENAME);
 
 			Assert.assertEquals(0,
-					pool.getCurrentPoolSize(Bytes.toString(TABLENAME)));
+					pool.getCurrentPoolSize(TABLENAME));
 		}
 	}
 


Mime
View raw message