From aff8de8397acf540f25dfffccce7a081d0f31fc1 Mon Sep 17 00:00:00 2001 From: Jan Hentschel Date: Fri, 27 Jan 2017 09:06:52 +0100 Subject: [PATCH] HBASE-17555 Changed calls to deprecated getHBaseAdmin to getAdmin Signed-off-by: Michael Stack --- .../exemplars/client/TestHelloHBase.java | 8 +- .../shaded_client/TestHelloHBase.java | 4 +- .../TestBatchCoprocessorEndpoint.java | 2 +- .../hbase/coprocessor/TestClassLoading.java | 10 +- .../coprocessor/TestCoprocessorEndpoint.java | 6 +- .../TestCoprocessorTableEndpoint.java | 4 +- .../TestRegionServerCoprocessorEndpoint.java | 4 +- .../coprocessor/TestRowProcessorEndpoint.java | 4 +- .../hadoop/hbase/IntegrationTestIngest.java | 2 +- .../IntegrationTestIngestWithEncryption.java | 2 +- .../hbase/IntegrationTestLazyCfLoading.java | 4 +- .../hbase/IntegrationTestManyRegions.java | 2 +- .../IntegrationTestRegionReplicaPerf.java | 10 +- .../hbase/IntegrationTestingUtility.java | 2 +- ...tripeCompactionsPerformanceEvaluation.java | 10 +- .../hadoop/hbase/chaos/actions/Action.java | 4 +- .../hbase/chaos/actions/AddColumnAction.java | 2 +- .../actions/ChangeBloomFilterAction.java | 2 +- .../actions/ChangeCompressionAction.java | 2 +- .../chaos/actions/ChangeEncodingAction.java | 2 +- .../actions/ChangeSplitPolicyAction.java | 2 +- .../chaos/actions/ChangeVersionsAction.java | 2 +- .../hbase/chaos/actions/CompactMobAction.java | 2 +- .../CompactRandomRegionOfTableAction.java | 2 +- .../chaos/actions/CompactTableAction.java | 2 +- .../actions/DecreaseMaxHFileSizeAction.java | 2 +- .../FlushRandomRegionOfTableAction.java | 2 +- .../hbase/chaos/actions/FlushTableAction.java | 2 +- ...rgeRandomAdjacentRegionsOfTableAction.java | 2 +- .../MoveRandomRegionOfTableAction.java | 2 +- .../actions/MoveRegionsOfTableAction.java | 2 +- .../chaos/actions/RemoveColumnAction.java | 2 +- .../chaos/actions/SnapshotTableAction.java | 2 +- .../actions/SplitAllRegionOfTableAction.java | 2 +- .../SplitRandomRegionOfTableAction.java | 2 +- .../chaos/actions/TruncateTableAction.java | 2 +- .../mapreduce/IntegrationTestBulkLoad.java | 8 +- .../hbase/mttr/IntegrationTestMTTR.java | 8 +- .../hbase/rsgroup/IntegrationTestRSGroup.java | 2 +- .../test/IntegrationTestLoadAndVerify.java | 2 +- ...TimeBoundedRequestsWithRegionReplicas.java | 2 +- .../IntegrationTestSendTraceRequests.java | 2 +- .../hadoop/hbase/rest/RowResourceBase.java | 4 +- .../hadoop/hbase/rest/TestGzipFilter.java | 2 +- .../hbase/rest/TestMultiRowResource.java | 2 +- .../rest/TestNamespacesInstanceResource.java | 10 +- .../hbase/rest/TestNamespacesResource.java | 4 +- .../hbase/rest/TestScannerResource.java | 2 +- .../hbase/rest/TestScannersWithFilters.java | 2 +- .../hbase/rest/TestScannersWithLabels.java | 2 +- .../hadoop/hbase/rest/TestSchemaResource.java | 4 +- .../hadoop/hbase/rest/TestTableResource.java | 2 +- .../hadoop/hbase/rest/TestTableScan.java | 6 +- .../hbase/rest/client/TestRemoteTable.java | 2 +- .../hadoop/hbase/rsgroup/TestRSGroups.java | 2 +- .../hbase/rsgroup/TestRSGroupsBase.java | 10 +- .../rsgroup/TestRSGroupsOfflineMode.java | 6 +- .../hadoop/hbase/TestAcidGuarantees.java | 6 +- .../TestHColumnDescriptorDefaultVersions.java | 8 +- .../hadoop/hbase/TestMetaTableAccessor.java | 2 +- .../hadoop/hbase/TestMultiVersions.java | 2 +- .../apache/hadoop/hbase/TestNamespace.java | 2 +- .../apache/hadoop/hbase/TestZooKeeper.java | 6 +- .../hbase/backup/TestHFileArchiving.java | 8 +- .../client/TestBlockEvictionFromClient.java | 6 +- .../client/TestClientOperationInterrupt.java | 2 +- .../client/TestCloneSnapshotFromClient.java | 2 +- .../hadoop/hbase/client/TestEnableTable.java | 12 +- .../hadoop/hbase/client/TestFastFail.java | 4 +- .../hbase/client/TestFromClientSide.java | 28 ++-- .../hbase/client/TestFromClientSide3.java | 8 +- .../apache/hadoop/hbase/client/TestHCM.java | 22 +-- .../TestHTableMultiplexerFlushCache.java | 2 +- .../client/TestIllegalTableDescriptor.java | 4 +- .../hadoop/hbase/client/TestLeaseRenewal.java | 2 +- .../hbase/client/TestMetaWithReplicas.java | 32 ++-- .../TestMobCloneSnapshotFromClient.java | 4 +- .../hbase/client/TestMultiRespectsLimits.java | 2 +- .../hbase/client/TestReplicaWithCluster.java | 30 ++-- .../hbase/client/TestReplicasClient.java | 2 +- .../client/TestRestoreSnapshotFromClient.java | 4 +- .../hbase/client/TestScannerTimeout.java | 2 +- .../hadoop/hbase/client/TestSizeFailures.java | 2 +- .../client/TestSnapshotCloneIndependence.java | 4 +- .../hbase/client/TestSnapshotFromClient.java | 20 +-- .../hbase/client/TestSnapshotMetadata.java | 2 +- .../client/TestTableSnapshotScanner.java | 4 +- .../hbase/constraint/TestConstraint.java | 14 +- ...stMasterCoprocessorExceptionWithAbort.java | 2 +- ...tMasterCoprocessorExceptionWithRemove.java | 4 +- .../hbase/coprocessor/TestMasterObserver.java | 6 +- .../TestOpenTableInCoprocessor.java | 10 +- .../coprocessor/TestRegionObserverBypass.java | 2 +- .../TestRegionObserverScannerOpenHook.java | 2 +- .../hbase/filter/FilterTestingCluster.java | 2 +- .../hbase/filter/TestFilterWrapper.java | 2 +- .../hadoop/hbase/fs/TestBlockReorder.java | 2 +- .../io/encoding/TestChangingEncoding.java | 2 +- .../TestLoadAndSwitchEncodeOnDisk.java | 2 +- .../mapred/TestTableSnapshotInputFormat.java | 6 +- .../TableSnapshotInputFormatTestBase.java | 4 +- .../hbase/mapreduce/TestImportExport.java | 14 +- .../mapreduce/TestLoadIncrementalHFiles.java | 4 +- ...estLoadIncrementalHFilesSplitRecovery.java | 4 +- .../TestMultiTableSnapshotInputFormat.java | 2 +- .../TestTableSnapshotInputFormat.java | 6 +- .../hbase/mapreduce/TestTimeRangeMapRed.java | 2 +- .../hbase/master/TestAssignmentListener.java | 2 +- .../master/TestAssignmentManagerMetrics.java | 2 +- .../TestAssignmentManagerOnCluster.java | 12 +- .../master/TestDistributedLogSplitting.java | 20 +-- .../master/TestGetLastFlushedSequenceId.java | 4 +- .../hadoop/hbase/master/TestMaster.java | 4 +- .../TestMasterRestartAfterDisablingTable.java | 4 +- .../hbase/master/TestRollingRestart.java | 4 +- .../hadoop/hbase/master/TestWarmupRegion.java | 6 +- .../cleaner/TestSnapshotFromMaster.java | 4 +- .../TestSimpleRegionNormalizerOnCluster.java | 2 +- .../TestAddColumnFamilyProcedure.java | 6 +- .../procedure/TestCloneSnapshotProcedure.java | 4 +- .../TestCreateNamespaceProcedure.java | 6 +- .../TestDeleteColumnFamilyProcedure.java | 6 +- ...DeleteColumnFamilyProcedureFromClient.java | 4 +- .../TestDeleteNamespaceProcedure.java | 6 +- .../procedure/TestDeleteTableProcedure.java | 6 +- .../procedure/TestEnableTableProcedure.java | 6 +- .../TestMasterFailoverWithProcedures.java | 8 +- .../procedure/TestMasterProcedureEvents.java | 2 +- .../TestModifyColumnFamilyProcedure.java | 4 +- .../TestModifyNamespaceProcedure.java | 12 +- .../procedure/TestModifyTableProcedure.java | 50 +++--- .../master/procedure/TestProcedureAdmin.java | 4 +- .../TestRestoreSnapshotProcedure.java | 14 +- .../TestSplitTableRegionProcedure.java | 12 +- .../procedure/TestTableDDLProcedureBase.java | 2 +- ...TableDescriptorModificationFromClient.java | 16 +- .../procedure/TestTruncateTableProcedure.java | 8 +- .../hbase/mob/TestExpiredMobFileCleaner.java | 2 +- .../hbase/mob/TestMobDataBlockEncoding.java | 2 +- .../mob/compactions/TestMobCompactor.java | 2 +- .../hbase/namespace/TestNamespaceAuditor.java | 2 +- .../hbase/procedure/TestProcedureManager.java | 2 +- .../hadoop/hbase/quotas/TestQuotaAdmin.java | 6 +- .../hbase/quotas/TestQuotaThrottle.java | 24 +-- .../regionserver/TestCompactSplitThread.java | 4 +- .../regionserver/TestCompactionState.java | 4 +- .../regionserver/TestDeleteMobTable.java | 8 +- .../TestEncryptionKeyRotation.java | 8 +- .../TestEncryptionRandomKeying.java | 4 +- .../TestEndToEndSplitTransaction.java | 2 +- .../regionserver/TestFSErrorsExposed.java | 2 +- .../TestHRegionServerBulkLoad.java | 2 +- .../regionserver/TestJoinedScanners.java | 2 +- .../regionserver/TestMobStoreScanner.java | 2 +- .../TestPerColumnFamilyFlush.java | 10 +- .../TestRegionMergeTransactionOnCluster.java | 19 ++- .../TestRegionReplicaFailover.java | 8 +- .../regionserver/TestRegionServerMetrics.java | 8 +- .../regionserver/TestRemoveRegionMetrics.java | 2 +- .../regionserver/TestSCVFWithMiniCluster.java | 2 +- .../regionserver/TestScannerWithBulkload.java | 6 +- .../TestSplitTransactionOnCluster.java | 4 +- .../regionserver/TestSplitWalDataLoss.java | 2 +- .../hadoop/hbase/regionserver/TestTags.java | 8 +- .../compactions/TestFIFOCompactionPolicy.java | 12 +- ...estCompactionWithThroughputController.java | 10 +- .../TestFlushWithThroughputController.java | 4 +- .../wal/AbstractTestLogRolling.java | 2 +- .../wal/AbstractTestWALReplay.java | 2 +- .../regionserver/wal/TestLogRollAbort.java | 2 +- .../replication/TestMasterReplication.java | 4 +- .../TestMultiSlaveReplication.java | 8 +- ...tReplicationChangingPeerRegionservers.java | 2 +- .../replication/TestReplicationEndpoint.java | 2 +- .../TestReplicationSmallTests.java | 4 +- .../TestReplicationSyncUpTool.java | 4 +- .../replication/TestSerialReplication.java | 20 +-- .../regionserver/TestGlobalThrottler.java | 4 +- .../TestRegionReplicaReplicationEndpoint.java | 26 ++-- .../hbase/security/access/SecureTestUtil.java | 12 +- .../security/access/TestAccessController.java | 20 +-- .../hbase/security/access/TestCellACLs.java | 2 +- ...estCoprocessorWhitelistMasterObserver.java | 2 +- .../access/TestNamespaceCommands.java | 8 +- .../access/TestScanEarlyTermination.java | 2 +- .../security/access/TestTablePermissions.java | 2 +- .../access/TestWithDisabledAuthorization.java | 2 +- ...bilityLabelReplicationWithExpAsString.java | 4 +- .../visibility/TestVisibilityLabels.java | 10 +- .../TestVisibilityLabelsReplication.java | 4 +- .../TestVisibilityLabelsWithDeletes.java | 142 +++++++++--------- .../TestVisibilityWithCheckAuths.java | 4 +- .../snapshot/MobSnapshotTestingUtils.java | 6 +- .../hbase/snapshot/SnapshotTestingUtils.java | 4 +- .../hbase/snapshot/TestExportSnapshot.java | 4 +- .../TestRestoreFlushSnapshotFromClient.java | 4 +- .../snapshot/TestSnapshotClientRetries.java | 6 +- .../hbase/util/TestCoprocessorScanPolicy.java | 6 +- .../hbase/util/TestHBaseFsckEncryption.java | 4 +- .../hadoop/hbase/util/TestHBaseFsckOneRS.java | 2 +- .../util/TestMiniClusterLoadSequential.java | 2 +- .../hadoop/hbase/util/TestRegionMover.java | 2 +- .../util/hbck/OfflineMetaRebuildTestCore.java | 12 +- .../util/hbck/TestOfflineMetaRebuildBase.java | 6 +- .../TestThriftHBaseServiceHandler.java | 2 +- ...stThriftHBaseServiceHandlerWithLabels.java | 2 +- 206 files changed, 649 insertions(+), 648 deletions(-) diff --git a/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java b/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java index 3d9dabda210..4d20919f575 100644 --- a/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java +++ b/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java @@ -58,7 +58,7 @@ public class TestHelloHBase { final String NONEXISTENT_NAMESPACE = "xyzpdq_nonexistent"; final String EXISTING_NAMESPACE = "pdqxyz_myExistingNamespace"; boolean exists; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); exists = HelloHBase.namespaceExists(admin, NONEXISTENT_NAMESPACE); assertEquals("#namespaceExists failed: found nonexistent namespace.", @@ -74,7 +74,7 @@ public class TestHelloHBase { @Test public void testCreateNamespaceAndTable() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HelloHBase.createNamespaceAndTable(admin); boolean namespaceExists @@ -93,7 +93,7 @@ public class TestHelloHBase { @Test public void testPutRowToTable() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createNamespace (NamespaceDescriptor.create(HelloHBase.MY_NAMESPACE_NAME).build()); Table table @@ -110,7 +110,7 @@ public class TestHelloHBase { @Test public void testDeleteRow() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createNamespace (NamespaceDescriptor.create(HelloHBase.MY_NAMESPACE_NAME).build()); Table table diff --git a/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java b/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java index cc5e201267f..e49fbb56fa3 100644 --- a/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java +++ b/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java @@ -58,7 +58,7 @@ public class TestHelloHBase { final String NONEXISTENT_NAMESPACE = "xyzpdq_nonexistent"; final String EXISTING_NAMESPACE = "pdqxyz_myExistingNamespace"; boolean exists; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); exists = HelloHBase.namespaceExists(admin, NONEXISTENT_NAMESPACE); assertEquals("#namespaceExists failed: found nonexistent namespace.", @@ -74,7 +74,7 @@ public class TestHelloHBase { @Test public void testCreateNamespaceAndTable() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HelloHBase.createNamespaceAndTable(admin); boolean namespaceExists diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java index c02343707ae..eecf7a3f0cb 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java @@ -87,7 +87,7 @@ public class TestBatchCoprocessorEndpoint { conf.setStrings(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, ProtobufCoprocessorService.class.getName()); util.startMiniCluster(2); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); HTableDescriptor desc = new HTableDescriptor(TEST_TABLE); desc.addFamily(new HColumnDescriptor(TEST_FAMILY)); admin.createTable(desc, new byte[][]{ROWS[rowSeperator1], ROWS[rowSeperator2]}); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java index f5d2a204d44..0211ab8a40e 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java @@ -150,7 +150,7 @@ public class TestClassLoading { // with configuration values htd.setValue("COPROCESSOR$2", jarFileOnHDFS2.toString() + "|" + cpName2 + "|" + Coprocessor.PRIORITY_USER + "|k1=v1,k2=v2,k3=v3"); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); @@ -231,7 +231,7 @@ public class TestClassLoading { htd.addFamily(new HColumnDescriptor("test")); htd.setValue("COPROCESSOR$1", getLocalPath(jarFile) + "|" + cpName3 + "|" + Coprocessor.PRIORITY_USER); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd); waitForTable(htd.getTableName()); @@ -256,7 +256,7 @@ public class TestClassLoading { htd.addFamily(new HColumnDescriptor("test")); htd.setValue("COPROCESSOR$1", getLocalPath(jarFile) + "|" + cpName4 + "|" + Coprocessor.PRIORITY_USER); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd); waitForTable(htd.getTableName()); @@ -317,7 +317,7 @@ public class TestClassLoading { htd.addCoprocessor(cpName6, new Path(getLocalPath(jarFile6)), Coprocessor.PRIORITY_USER, kvs); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); @@ -408,7 +408,7 @@ public class TestClassLoading { // with configuration values htd.setValue("COPROCESSOR$2", jarFileOnHDFS.toString() + "|" + cpName2 + "|" + Coprocessor.PRIORITY_USER + "|k1=v1,k2=v2,k3=v3"); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java index 7e2577a342e..547b7e9fa1b 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java @@ -94,7 +94,7 @@ public class TestCoprocessorEndpoint { conf.setStrings(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, ProtobufCoprocessorService.class.getName()); util.startMiniCluster(2); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); HTableDescriptor desc = new HTableDescriptor(TEST_TABLE); desc.addFamily(new HColumnDescriptor(TEST_FAMILY)); admin.createTable(desc, new byte[][]{ROWS[rowSeperator1], ROWS[rowSeperator2]}); @@ -296,7 +296,7 @@ public class TestCoprocessorEndpoint { @Test public void testMasterCoprocessorService() throws Throwable { - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); final TestProtos.EchoRequestProto request = TestProtos.EchoRequestProto.newBuilder().setMessage("hello").build(); TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service = @@ -327,7 +327,7 @@ public class TestCoprocessorEndpoint { @Test public void testMasterCoprocessorError() throws Throwable { - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service = TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(admin.coprocessorService()); try { diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java index 4913acf227c..2f228986bc7 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java @@ -126,7 +126,7 @@ public class TestCoprocessorTableEndpoint { } private static final void createTable(HTableDescriptor desc) throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(desc, new byte[][]{ROWS[rowSeperator1], ROWS[rowSeperator2]}); TEST_UTIL.waitUntilAllRegionsAssigned(desc.getTableName()); Table table = TEST_UTIL.getConnection().getTable(desc.getTableName()); @@ -142,7 +142,7 @@ public class TestCoprocessorTableEndpoint { } private static void updateTable(HTableDescriptor desc) throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.disableTable(desc.getTableName()); admin.modifyTable(desc.getTableName(), desc); admin.enableTable(desc.getTableName()); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java index 31646f84100..69742a6f7e8 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java @@ -77,7 +77,7 @@ public class TestRegionServerCoprocessorEndpoint { new CoprocessorRpcUtils.BlockingRpcCallback(); DummyRegionServerEndpointProtos.DummyService service = ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class, - TEST_UTIL.getHBaseAdmin().coprocessorService(serverName)); + TEST_UTIL.getAdmin().coprocessorService(serverName)); service.dummyCall(controller, DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback); assertEquals(DUMMY_VALUE, rpcCallback.get().getValue()); @@ -95,7 +95,7 @@ public class TestRegionServerCoprocessorEndpoint { new CoprocessorRpcUtils.BlockingRpcCallback(); DummyRegionServerEndpointProtos.DummyService service = ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class, - TEST_UTIL.getHBaseAdmin().coprocessorService(serverName)); + TEST_UTIL.getAdmin().coprocessorService(serverName)); service.dummyThrow(controller, DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback); assertEquals(null, rpcCallback.get()); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java index 7bb6e2b34d3..07d20421d0c 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java @@ -132,8 +132,8 @@ public class TestRowProcessorEndpoint { public void prepareTestData() throws Exception { try { - util.getHBaseAdmin().disableTable(TABLE); - util.getHBaseAdmin().deleteTable(TABLE); + util.getAdmin().disableTable(TABLE); + util.getAdmin().deleteTable(TABLE); } catch (Exception e) { // ignore table not found } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java index 5c41fa0dd8e..d4bcacd524a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java @@ -151,7 +151,7 @@ public class IntegrationTestIngest extends IntegrationTestBase { } private void deleteTableIfNecessary() throws IOException { - if (util.getHBaseAdmin().tableExists(getTablename())) { + if (util.getAdmin().tableExists(getTablename())) { util.deleteTable(getTablename()); } } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java index d53160456cc..1f85a51cebf 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithEncryption.java @@ -93,7 +93,7 @@ public class IntegrationTestIngestWithEncryption extends IntegrationTestIngest { // Update the test table schema so HFiles from this point will be written with // encryption features enabled. - final Admin admin = util.getHBaseAdmin(); + final Admin admin = util.getAdmin(); HTableDescriptor tableDescriptor = new HTableDescriptor(admin.getTableDescriptor(getTablename())); for (HColumnDescriptor columnDescriptor: tableDescriptor.getColumnFamilies()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java index 4c57c88f082..548ff53e961 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java @@ -198,12 +198,12 @@ public class IntegrationTestLazyCfLoading { } int serverCount = util.getHBaseClusterInterface().getClusterStatus().getServersSize(); byte[][] splits = new RegionSplitter.HexStringSplit().split(serverCount * REGIONS_PER_SERVER); - util.getHBaseAdmin().createTable(htd, splits); + util.getAdmin().createTable(htd, splits); LOG.info("Created table"); } private void deleteTable() throws Exception { - if (util.getHBaseAdmin().tableExists(TABLE_NAME)) { + if (util.getAdmin().tableExists(TABLE_NAME)) { LOG.info("Deleting table"); util.deleteTable(TABLE_NAME); LOG.info("Deleted table"); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java index fe97e4937eb..88b2e39e379 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestManyRegions.java @@ -85,7 +85,7 @@ public class IntegrationTestManyRegions { UTIL.initializeCluster(REGION_SERVER_COUNT); LOG.info("Cluster initialized"); - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); if (admin.tableExists(TABLE_NAME)) { LOG.info(String.format("Deleting existing table %s.", TABLE_NAME)); if (admin.isTableEnabled(TABLE_NAME)) admin.disableTable(TABLE_NAME); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java index 8f9b92ce8df..e609f0b4940 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestRegionReplicaPerf.java @@ -271,18 +271,18 @@ public class IntegrationTestRegionReplicaPerf extends IntegrationTestBase { // create/populate the table, replicas disabled LOG.debug("Populating table."); - new PerfEvalCallable(util.getHBaseAdmin(), writeOpts).call(); + new PerfEvalCallable(util.getAdmin(), writeOpts).call(); // one last sanity check, then send in the clowns! assertEquals("Table must be created with DisabledRegionSplitPolicy. Broken test.", DisabledRegionSplitPolicy.class.getName(), - util.getHBaseAdmin().getTableDescriptor(tableName).getRegionSplitPolicyClassName()); + util.getAdmin().getTableDescriptor(tableName).getRegionSplitPolicyClassName()); startMonkey(); // collect a baseline without region replicas. for (int i = 0; i < maxIters; i++) { LOG.debug("Launching non-replica job " + (i + 1) + "/" + maxIters); - resultsWithoutReplicas.add(new PerfEvalCallable(util.getHBaseAdmin(), readOpts).call()); + resultsWithoutReplicas.add(new PerfEvalCallable(util.getAdmin(), readOpts).call()); // TODO: sleep to let cluster stabilize, though monkey continues. is it necessary? Thread.sleep(5000l); } @@ -290,14 +290,14 @@ public class IntegrationTestRegionReplicaPerf extends IntegrationTestBase { // disable monkey, enable region replicas, enable monkey cleanUpMonkey("Altering table."); LOG.debug("Altering " + tableName + " replica count to " + replicaCount); - IntegrationTestingUtility.setReplicas(util.getHBaseAdmin(), tableName, replicaCount); + IntegrationTestingUtility.setReplicas(util.getAdmin(), tableName, replicaCount); setUpMonkey(); startMonkey(); // run test with region replicas. for (int i = 0; i < maxIters; i++) { LOG.debug("Launching replica job " + (i + 1) + "/" + maxIters); - resultsWithReplicas.add(new PerfEvalCallable(util.getHBaseAdmin(), replicaReadOpts).call()); + resultsWithReplicas.add(new PerfEvalCallable(util.getAdmin(), replicaReadOpts).call()); // TODO: sleep to let cluster stabilize, though monkey continues. is it necessary? Thread.sleep(5000l); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java index fcda1b00a56..8038758f5b4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java @@ -138,7 +138,7 @@ public class IntegrationTestingUtility extends HBaseTestingUtility { ClusterManager clusterManager = ReflectionUtils.newInstance( clusterManagerClass, conf); setHBaseCluster(new DistributedHBaseCluster(conf, clusterManager)); - getHBaseAdmin(); + getAdmin(); } } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java index a6b502fb647..073de77413d 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java @@ -172,12 +172,12 @@ public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool { } protected void deleteTable() throws Exception { - if (util.getHBaseAdmin().tableExists(TABLE_NAME)) { + if (util.getAdmin().tableExists(TABLE_NAME)) { LOG.info("Deleting table"); - if (!util.getHBaseAdmin().isTableDisabled(TABLE_NAME)) { - util.getHBaseAdmin().disableTable(TABLE_NAME); + if (!util.getAdmin().isTableDisabled(TABLE_NAME)) { + util.getAdmin().disableTable(TABLE_NAME); } - util.getHBaseAdmin().deleteTable(TABLE_NAME); + util.getAdmin().deleteTable(TABLE_NAME); LOG.info("Deleted table"); } } @@ -297,7 +297,7 @@ public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool { } byte[][] splits = new RegionSplitter.HexStringSplit().split( util.getHBaseClusterInterface().getClusterStatus().getServersSize()); - util.getHBaseAdmin().createTable(htd, splits); + util.getAdmin().createTable(htd, splits); } public static class SeqShardedDataGenerator extends LoadTestDataGenerator { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java index fe140e29a76..d1a32b1f09a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java @@ -208,7 +208,7 @@ public class Action { LOG.info("Moving " + victimRegions.size() + " regions from " + fromServers.size() + " servers to " + toServers.size() + " different servers"); - Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin(); for (byte[] victimRegion : victimRegions) { // Don't keep moving regions if we're // trying to stop the monkey. @@ -221,7 +221,7 @@ public class Action { } protected void forceBalancer() throws Exception { - Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin(); boolean result = false; try { result = admin.balancer(); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java index 27268a4632a..f3827473a3a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java @@ -40,7 +40,7 @@ public class AddColumnAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - this.admin = context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + this.admin = context.getHBaseIntegrationTestingUtility().getAdmin(); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java index 684cd629863..576b2203de5 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java @@ -48,7 +48,7 @@ public class ChangeBloomFilterAction extends Action { public void perform() throws Exception { Random random = new Random(); HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Change bloom filter on all columns of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java index 9c7bf45e3ab..df7d5bb4b90 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java @@ -45,7 +45,7 @@ public class ChangeCompressionAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - this.admin = context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + this.admin = context.getHBaseIntegrationTestingUtility().getAdmin(); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java index c4553f15524..1fbf93a5e21 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java @@ -44,7 +44,7 @@ public class ChangeEncodingAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - this.admin = context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + this.admin = context.getHBaseIntegrationTestingUtility().getAdmin(); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java index b5f759f3bcb..9af572831a7 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java @@ -46,7 +46,7 @@ public class ChangeSplitPolicyAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Change split policy of table " + tableName); HTableDescriptor tableDescriptor = admin.getTableDescriptor(tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java index 76e152f19f1..a393b4a6659 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java @@ -45,7 +45,7 @@ public class ChangeVersionsAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - this.admin = context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + this.admin = context.getHBaseIntegrationTestingUtility().getAdmin(); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java index b75bbbdda88..bbb86a128a8 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java @@ -46,7 +46,7 @@ public class CompactMobAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(100) < majorRatio; // Don't try the modify if we're stopping diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java index 114b511ee86..046415f9335 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java @@ -50,7 +50,7 @@ public class CompactRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(100) < majorRatio; LOG.info("Performing action: Compact random region of table " diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java index 796cc43a087..3eab335b82d 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java @@ -45,7 +45,7 @@ public class CompactTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(100) < majorRatio; LOG.info("Performing action: Compact table " + tableName + ", major=" + major); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DecreaseMaxHFileSizeAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DecreaseMaxHFileSizeAction.java index eaada1693bd..98babeb6510 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DecreaseMaxHFileSizeAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DecreaseMaxHFileSizeAction.java @@ -43,7 +43,7 @@ public class DecreaseMaxHFileSizeAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); HTableDescriptor htd = admin.getTableDescriptor(tableName); // Try and get the current value. diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java index c919789f9fb..c5a1156e465 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java @@ -45,7 +45,7 @@ public class FlushRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Flush random region of table " + tableName); List regions = admin.getTableRegions(tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java index ddce57e8b53..50fffead951 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java @@ -41,7 +41,7 @@ public class FlushTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // Don't try the flush if we're stopping if (context.isStopping()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java index 03d310e3a67..aa796abab0b 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java @@ -45,7 +45,7 @@ public class MergeRandomAdjacentRegionsOfTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Merge random adjacent regions of table " + tableName); List regions = admin.getTableRegions(tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java index 96cd0086456..bb8f2443bd9 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java @@ -49,7 +49,7 @@ public class MoveRandomRegionOfTableAction extends Action { } HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Move random region of table " + tableName); List regions = admin.getTableRegions(tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java index d5f0e9652bf..146c63c61cc 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java @@ -54,7 +54,7 @@ public class MoveRegionsOfTableAction extends Action { Thread.sleep(sleepTime); } - Admin admin = this.context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin(); Collection serversList = admin.getClusterStatus().getServers(); ServerName[] servers = serversList.toArray(new ServerName[serversList.size()]); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java index 20bdaa3c1d4..b878d2093a8 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java @@ -46,7 +46,7 @@ public class RemoveColumnAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - this.admin = context.getHBaseIntegrationTestingUtility().getHBaseAdmin(); + this.admin = context.getHBaseIntegrationTestingUtility().getAdmin(); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java index 15b8e86feec..4bd9d1d99ca 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java @@ -42,7 +42,7 @@ public class SnapshotTableAction extends Action { public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); String snapshotName = tableName + "-it-" + System.currentTimeMillis(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // Don't try the snapshot if we're stopping if (context.isStopping()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java index 5b29d00c403..a924f40b063 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java @@ -46,7 +46,7 @@ public class SplitAllRegionOfTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // Don't try the split if we're stopping if (context.isStopping()) { return; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java index 25c80e918cf..de266f5bc02 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java @@ -45,7 +45,7 @@ public class SplitRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); LOG.info("Performing action: Split random region of table " + tableName); List regions = admin.getTableRegions(tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java index 87f91dd0202..4903a07fbff 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java @@ -39,7 +39,7 @@ public class TruncateTableAction extends Action { @Override public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // Don't try the truncate if we're stopping if (context.isStopping()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index 4e85425fe65..e5182699cba 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java @@ -201,7 +201,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { if (replicaCount == NUM_REPLICA_COUNT_DEFAULT) return; TableName t = getTablename(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); HTableDescriptor desc = admin.getTableDescriptor(t); desc.addCoprocessor(SlowMeCoproScanOperations.class.getName()); HBaseTestingUtility.modifyTableSync(admin, desc); @@ -231,7 +231,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { } private void setupTable() throws IOException, InterruptedException { - if (util.getHBaseAdmin().tableExists(getTablename())) { + if (util.getAdmin().tableExists(getTablename())) { util.deleteTable(getTablename()); } @@ -245,7 +245,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { if (replicaCount == NUM_REPLICA_COUNT_DEFAULT) return; TableName t = getTablename(); - HBaseTestingUtility.setReplicas(util.getHBaseAdmin(), t, replicaCount); + HBaseTestingUtility.setReplicas(util.getAdmin(), t, replicaCount); } private void runLinkedListMRJob(int iteration) throws Exception { @@ -746,7 +746,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { // Scale this up on a real cluster if (util.isDistributedCluster()) { util.getConfiguration().setIfUnset(NUM_MAPS_KEY, - Integer.toString(util.getHBaseAdmin().getClusterStatus().getServersSize() * 10) + Integer.toString(util.getAdmin().getClusterStatus().getServersSize() * 10) ); util.getConfiguration().setIfUnset(NUM_IMPORT_ROUNDS_KEY, "5"); } else { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java index 437f200af15..f87cc86b4a9 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java @@ -223,11 +223,11 @@ public class IntegrationTestMTTR { loadTableName = TableName.valueOf(util.getConfiguration() .get("hbase.IntegrationTestMTTR.loadTableName", "IntegrationTestMTTRLoadTestTool")); - if (util.getHBaseAdmin().tableExists(tableName)) { + if (util.getAdmin().tableExists(tableName)) { util.deleteTable(tableName); } - if (util.getHBaseAdmin().tableExists(loadTableName)) { + if (util.getAdmin().tableExists(loadTableName)) { util.deleteTable(loadTableName); } @@ -240,7 +240,7 @@ public class IntegrationTestMTTR { HColumnDescriptor descriptor = new HColumnDescriptor(FAMILY); descriptor.setMaxVersions(1); tableDescriptor.addFamily(descriptor); - util.getHBaseAdmin().createTable(tableDescriptor); + util.getAdmin().createTable(tableDescriptor); // Setup the table for LoadTestTool int ret = loadTool.run(new String[]{"-tn", loadTableName.getNameAsString(), "-init_only"}); @@ -557,7 +557,7 @@ public class IntegrationTestMTTR { protected boolean doAction() throws Exception { Admin admin = null; try { - admin = util.getHBaseAdmin(); + admin = util.getAdmin(); ClusterStatus status = admin.getClusterStatus(); return status != null; } finally { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java index fe9c58c29ad..f72b5f79eb3 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/rsgroup/IntegrationTestRSGroup.java @@ -47,7 +47,7 @@ public class IntegrationTestRSGroup extends TestRSGroupsBase { TEST_UTIL = new IntegrationTestingUtility(); ((IntegrationTestingUtility)TEST_UTIL).initializeCluster(NUM_SLAVES_BASE); //set shared configs - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); cluster = TEST_UTIL.getHBaseClusterInterface(); rsGroupAdmin = new VerifyingRSGroupAdminClient(rsGroupAdmin.newClient(TEST_UTIL.getConnection()), TEST_UTIL.getConfiguration()); 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 5b437d45adf..dec565f340d 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 @@ -538,7 +538,7 @@ public void cleanUpCluster() throws Exception { HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_NAME)); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); - Admin admin = getTestingUtil(getConf()).getHBaseAdmin(); + Admin admin = getTestingUtil(getConf()).getAdmin(); admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), 40); doLoad(getConf(), htd); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java index d6bed7993fd..e92f863afb8 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java @@ -159,7 +159,7 @@ public class IntegrationTestTimeBoundedRequestsWithRegionReplicas extends Integr // flush the table LOG.info("Flushing the table"); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); admin.flush(getTablename()); // re-open the regions to make sure that the replicas are up to date diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java index f325aacda23..b7463bd57da 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/trace/IntegrationTestSendTraceRequests.java @@ -94,7 +94,7 @@ public class IntegrationTestSendTraceRequests extends AbstractHBaseTool { @Test public void internalDoWork() throws Exception { util = createUtil(); - admin = util.getHBaseAdmin(); + admin = util.getAdmin(); setupReceiver(); deleteTable(); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java index 61e650b1f4d..fc8290f90dc 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java @@ -107,7 +107,7 @@ public class RowResourceBase { @Before public void beforeMethod() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE_NAME)) { TEST_UTIL.deleteTable(TABLE_NAME); } @@ -119,7 +119,7 @@ public class RowResourceBase { @After public void afterMethod() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE_NAME)) { TEST_UTIL.deleteTable(TABLE_NAME); } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java index 50974546a81..1d245b3feec 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java @@ -68,7 +68,7 @@ public class TestGzipFilter { REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration()); client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort())); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { return; } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java index c1087b5d6e0..dfcc8afab93 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java @@ -107,7 +107,7 @@ public class TestMultiRowResource { marshaller = context.createMarshaller(); unmarshaller = context.createUnmarshaller(); client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort())); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { return; } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java index d7649b0b348..7f75a229844 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java @@ -152,7 +152,7 @@ public class TestNamespacesInstanceResource { Response response; // Check that doesn't exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertNotNull(findNamespace(admin, "default")); assertNotNull(findNamespace(admin, "hbase")); @@ -168,7 +168,7 @@ public class TestNamespacesInstanceResource { @Test public void testGetNamespaceTablesAndCannotDeleteNamespace() throws IOException, JAXBException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); String nsName = "TestNamespacesInstanceResource5"; Response response; @@ -251,7 +251,7 @@ public class TestNamespacesInstanceResource { Response response; // Check that namespaces don't exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertNull(findNamespace(admin, NAMESPACE1)); assertNull(findNamespace(admin, NAMESPACE2)); assertNull(findNamespace(admin, NAMESPACE3)); @@ -289,7 +289,7 @@ public class TestNamespacesInstanceResource { Response response; // Check that namespaces don't exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertNull(findNamespace(admin, NAMESPACE1)); assertNull(findNamespace(admin, NAMESPACE2)); @@ -365,7 +365,7 @@ public class TestNamespacesInstanceResource { Response response; // Check that namespaces don't exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertNull(findNamespace(admin, NAMESPACE3)); assertNull(findNamespace(admin, NAMESPACE4)); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java index bbd6f322586..e3d82a3985a 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java @@ -101,7 +101,7 @@ public class TestNamespacesResource { Response response; // Check that namespace does not yet exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertFalse(doesNamespaceExist(admin, NAMESPACE1)); model = testNamespacesModel.buildTestModel(); testNamespacesModel.checkModel(model); @@ -159,7 +159,7 @@ public class TestNamespacesResource { Response response; // Check that namespace does not yet exist via non-REST call. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertFalse(doesNamespaceExist(admin, NAMESPACE1)); model = testNamespacesModel.buildTestModel(); testNamespacesModel.checkModel(model); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java index be7ee9a8c36..3916386bb02 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java @@ -175,7 +175,7 @@ public class TestScannerResource { ScannerModel.class); marshaller = context.createMarshaller(); unmarshaller = context.createUnmarshaller(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { return; } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java index bedd08ea568..083ddbe9848 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java @@ -137,7 +137,7 @@ public class TestScannersWithFilters { unmarshaller = context.createUnmarshaller(); client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort())); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (!admin.tableExists(TABLE)) { HTableDescriptor htd = new HTableDescriptor(TABLE); htd.addFamily(new HColumnDescriptor(FAMILIES[0])); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java index 8b0b5b2e530..1a86ce9fce1 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java @@ -145,7 +145,7 @@ public class TestScannersWithLabels { ScannerModel.class); marshaller = context.createMarshaller(); unmarshaller = context.createUnmarshaller(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { return; } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java index 96106e9cecf..df920b1d582 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java @@ -122,7 +122,7 @@ public class TestSchemaResource { TableSchemaModel model; Response response; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertFalse(admin.tableExists(TableName.valueOf(TABLE1))); // create the table @@ -181,7 +181,7 @@ public class TestSchemaResource { TableSchemaModel model; Response response; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); assertFalse(admin.tableExists(TableName.valueOf(TABLE2))); // create the table diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java index 1666bc9adf8..826468070f2 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java @@ -91,7 +91,7 @@ public class TestTableResource { TableInfoModel.class, TableListModel.class, TableRegionModel.class); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { return; } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java index 7924aed392b..32f508a7b76 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java @@ -99,7 +99,7 @@ public class TestTableScan { REST_TEST_UTIL.startServletContainer(conf); client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort())); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (!admin.tableExists(TABLE)) { HTableDescriptor htd = new HTableDescriptor(TABLE); htd.addFamily(new HColumnDescriptor(CFA)); @@ -112,8 +112,8 @@ public class TestTableScan { @AfterClass public static void tearDownAfterClass() throws Exception { - TEST_UTIL.getHBaseAdmin().disableTable(TABLE); - TEST_UTIL.getHBaseAdmin().deleteTable(TABLE); + TEST_UTIL.getAdmin().disableTable(TABLE); + TEST_UTIL.getAdmin().deleteTable(TABLE); REST_TEST_UTIL.shutdownServletContainer(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 57f20fd5388..0310d9ff007 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -108,7 +108,7 @@ public class TestRemoteTable { @Before public void before() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(TABLE)) { if (admin.isTableEnabled(TABLE)) admin.disableTable(TABLE); admin.deleteTable(TABLE); diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java index 51a676f7356..957994f9fa4 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java @@ -80,7 +80,7 @@ public class TestRSGroups extends TestRSGroupsBase { ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, ""+NUM_SLAVES_BASE); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); cluster = TEST_UTIL.getHBaseCluster(); master = ((MiniHBaseCluster)cluster).getMaster(); diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java index 50302bcb5d9..15e50995cd4 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java @@ -35,8 +35,8 @@ import org.apache.hadoop.hbase.RegionLoad; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; +import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ClusterConnection; -import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos; @@ -68,7 +68,7 @@ public abstract class TestRSGroupsBase { //shared, cluster type specific protected static HBaseTestingUtility TEST_UTIL; - protected static HBaseAdmin admin; + protected static Admin admin; protected static HBaseCluster cluster; protected static RSGroupAdmin rsGroupAdmin; @@ -106,13 +106,13 @@ public abstract class TestRSGroupsBase { } protected void deleteTableIfNecessary() throws IOException { - for (HTableDescriptor desc : TEST_UTIL.getHBaseAdmin().listTables(tablePrefix+".*")) { + for (HTableDescriptor desc : TEST_UTIL.getAdmin().listTables(tablePrefix+".*")) { TEST_UTIL.deleteTable(desc.getTableName()); } } protected void deleteNamespaceIfNecessary() throws IOException { - for (NamespaceDescriptor desc : TEST_UTIL.getHBaseAdmin().listNamespaceDescriptors()) { + for (NamespaceDescriptor desc : TEST_UTIL.getAdmin().listNamespaceDescriptors()) { if(desc.getName().startsWith(tablePrefix)) { admin.deleteNamespace(desc.getName()); } @@ -496,7 +496,7 @@ public abstract class TestRSGroupsBase { }); // Lets move this region to the new group. - TEST_UTIL.getHBaseAdmin().move(Bytes.toBytes(HRegionInfo.encodeRegionName(Bytes.toBytes(targetRegion))), + TEST_UTIL.getAdmin().move(Bytes.toBytes(HRegionInfo.encodeRegionName(Bytes.toBytes(targetRegion))), Bytes.toBytes(targetServer.getServerName())); TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate() { @Override diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java index b89ea0eb514..ace959428da 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java @@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.ServerManager; @@ -54,7 +54,7 @@ public class TestRSGroupsOfflineMode { private static final org.apache.commons.logging.Log LOG = LogFactory.getLog(TestRSGroupsOfflineMode.class); private static HMaster master; - private static HBaseAdmin hbaseAdmin; + private static Admin hbaseAdmin; private static HBaseTestingUtility TEST_UTIL; private static HBaseCluster cluster; private static RSGroupAdminEndpoint RSGroupAdminEndpoint; @@ -75,7 +75,7 @@ public class TestRSGroupsOfflineMode { cluster = TEST_UTIL.getHBaseCluster(); master = ((MiniHBaseCluster)cluster).getMaster(); master.balanceSwitch(false); - hbaseAdmin = TEST_UTIL.getHBaseAdmin(); + hbaseAdmin = TEST_UTIL.getAdmin(); //wait till the balancer is in online mode TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate() { @Override diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java index 47c306b2397..59ca64c60dd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java @@ -84,12 +84,12 @@ public class TestAcidGuarantees implements Tool { } if (useMob) { - HTableDescriptor htd = util.getHBaseAdmin().getTableDescriptor(TABLE_NAME); + HTableDescriptor htd = util.getAdmin().getTableDescriptor(TABLE_NAME); HColumnDescriptor hcd = htd.getColumnFamilies()[0]; // force mob enabled such that all data is mob data hcd.setMobEnabled(true); hcd.setMobThreshold(4); - util.getHBaseAdmin().modifyColumnFamily(TABLE_NAME, hcd); + util.getAdmin().modifyColumnFamily(TABLE_NAME, hcd); } } @@ -337,7 +337,7 @@ public class TestAcidGuarantees implements Tool { } // Add a flusher ctx.addThread(new RepeatingTestThread(ctx) { - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); public void doAnAction() throws Exception { try { admin.flush(TABLE_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java index f129f9dd3b2..20cf8bb62a9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java @@ -74,7 +74,7 @@ public class TestHColumnDescriptorDefaultVersions { @Test public void testCreateTableWithDefault() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with one family HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); HColumnDescriptor hcd = new HColumnDescriptor(FAMILY); @@ -95,7 +95,7 @@ public class TestHColumnDescriptorDefaultVersions { TEST_UTIL.getConfiguration().setInt("hbase.column.max.version", 3); TEST_UTIL.startMiniCluster(1); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with one family HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); HColumnDescriptor hcd = new HColumnDescriptor(FAMILY); @@ -117,7 +117,7 @@ public class TestHColumnDescriptorDefaultVersions { TEST_UTIL.getConfiguration().setInt("hbase.column.max.version", 3); TEST_UTIL.startMiniCluster(1); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with one family HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); HColumnDescriptor hcd = new HColumnDescriptor(FAMILY); @@ -149,7 +149,7 @@ public class TestHColumnDescriptorDefaultVersions { private void verifyHColumnDescriptor(int expected, final TableName tableName, final byte[]... families) throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Verify descriptor from master HTableDescriptor htd = admin.getTableDescriptor(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java index e1c19e2a0e4..5d0f49406ce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java @@ -236,7 +236,7 @@ public class TestMetaTableAccessor { assertFalse(MetaTableAccessor.tableExists(connection, name)); UTIL.createTable(name, HConstants.CATALOG_FAMILY); assertTrue(MetaTableAccessor.tableExists(connection, name)); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.disableTable(name); admin.deleteTable(name); assertFalse(MetaTableAccessor.tableExists(connection, name)); 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 9bd2fe97a09..ac000db88b8 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 @@ -73,7 +73,7 @@ public class TestMultiVersions { @Before public void before() throws MasterNotRunningException, ZooKeeperConnectionException, IOException { - this.admin = UTIL.getHBaseAdmin(); + this.admin = UTIL.getAdmin(); } /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java index 2dca6b16f8f..877fbc5d634 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java @@ -64,7 +64,7 @@ public class TestNamespace { public static void setUp() throws Exception { TEST_UTIL = new HBaseTestingUtility(); TEST_UTIL.startMiniCluster(NUM_SLAVES_BASE); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); cluster = TEST_UTIL.getHBaseCluster(); master = ((MiniHBaseCluster)cluster).getMaster(); zkNamespaceManager = 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 4feebcc6bbf..056881be404 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 @@ -251,7 +251,7 @@ public class TestZooKeeper { HColumnDescriptor family = new HColumnDescriptor("fam"); desc.addFamily(family); LOG.info("Creating table " + tableName); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); try { admin.createTable(desc); } finally { @@ -463,7 +463,7 @@ public class TestZooKeeper { HMaster m = cluster.getMaster(); final ZooKeeperWatcher zkw = m.getZooKeeper(); // now the cluster is up. So assign some regions. - try (Admin admin = TEST_UTIL.getHBaseAdmin()) { + try (Admin admin = TEST_UTIL.getAdmin()) { byte[][] SPLIT_KEYS = new byte[][] { Bytes.toBytes("a"), Bytes.toBytes("b"), Bytes.toBytes("c"), Bytes.toBytes("d"), Bytes.toBytes("e"), Bytes.toBytes("f"), Bytes.toBytes("g"), Bytes.toBytes("h"), Bytes.toBytes("i"), Bytes.toBytes("j") }; @@ -527,7 +527,7 @@ public class TestZooKeeper { cluster.startRegionServer(); HMaster m = cluster.getMaster(); // now the cluster is up. So assign some regions. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); Table table = null; try { byte[][] SPLIT_KEYS = new byte[][] { Bytes.toBytes("1"), Bytes.toBytes("2"), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java index c43b319c98a..8b5abb3e95e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java @@ -119,7 +119,7 @@ public class TestHFileArchiving { TableName.valueOf("testRemovesRegionDirOnArchive"); UTIL.createTable(TABLE_NAME, TEST_FAM); - final Admin admin = UTIL.getHBaseAdmin(); + final Admin admin = UTIL.getAdmin(); // get the current store files for the region List servingRegions = UTIL.getHBaseCluster().getRegions(TABLE_NAME); @@ -250,7 +250,7 @@ public class TestHFileArchiving { region.waitForFlushesAndCompactions(); // disable table to prevent new updates - UTIL.getHBaseAdmin().disableTable(TABLE_NAME); + UTIL.getAdmin().disableTable(TABLE_NAME); LOG.debug("Disabled table"); // remove all the files from the archive to get a fair comparison @@ -330,7 +330,7 @@ public class TestHFileArchiving { region.waitForFlushesAndCompactions(); // disable table to prevent new updates - UTIL.getHBaseAdmin().disableTable(TABLE_NAME); + UTIL.getAdmin().disableTable(TABLE_NAME); LOG.debug("Disabled table"); // remove all the files from the archive to get a fair comparison @@ -341,7 +341,7 @@ public class TestHFileArchiving { List storeFiles = region.getStoreFileList(columns); // then delete the table so the hfiles get archived - UTIL.getHBaseAdmin().deleteColumnFamily(TABLE_NAME, TEST_FAM); + UTIL.getAdmin().deleteColumnFamily(TABLE_NAME, TEST_FAM); assertArchiveFiles(fs, storeFiles, 30000); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java index 3b19bcc72d9..f45b41d79f6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java @@ -155,11 +155,11 @@ public class TestBlockEvictionFromClient { exceptionLatch = null; CustomInnerRegionObserver.throwException.set(false); // Clean up the tables for every test case - TableName[] listTableNames = TEST_UTIL.getHBaseAdmin().listTableNames(); + TableName[] listTableNames = TEST_UTIL.getAdmin().listTableNames(); for (TableName tableName : listTableNames) { if (!tableName.isSystemTable()) { - TEST_UTIL.getHBaseAdmin().disableTable(tableName); - TEST_UTIL.getHBaseAdmin().deleteTable(tableName); + TEST_UTIL.getAdmin().disableTable(tableName); + TEST_UTIL.getAdmin().deleteTable(tableName); } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java index a4603b7da22..a4805630cd5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java @@ -75,7 +75,7 @@ public class TestClientOperationInterrupt { util = new HBaseTestingUtility(conf); util.startMiniCluster(); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); if (admin.tableExists(tableName)) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java index 65a67d04c0a..6499fa14f8b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCloneSnapshotFromClient.java @@ -87,7 +87,7 @@ public class TestCloneSnapshotFromClient { */ @Before public void setup() throws Exception { - this.admin = TEST_UTIL.getHBaseAdmin(); + this.admin = TEST_UTIL.getAdmin(); long tid = System.currentTimeMillis(); tableName = TableName.valueOf("testtb-" + tid); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java index 0de04f339b7..67ab2624da3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java @@ -82,7 +82,7 @@ public class TestEnableTable { final TableName tableName = TableName.valueOf("testEnableTableWithNoRegionServers"); final MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); final HMaster m = cluster.getMaster(); - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(new HColumnDescriptor(FAMILYNAME)); admin.createTable(desc); @@ -109,10 +109,10 @@ public class TestEnableTable { cluster.waitForRegionServerToStart(rs2.getRegionServer().getServerName().getHostname(), rs2.getRegionServer().getServerName().getPort(), 60000); - List regions = TEST_UTIL.getHBaseAdmin().getTableRegions(tableName); + List regions = TEST_UTIL.getAdmin().getTableRegions(tableName); assertEquals(1, regions.size()); for (HRegionInfo region : regions) { - TEST_UTIL.getHBaseAdmin().assign(region.getEncodedNameAsBytes()); + TEST_UTIL.getAdmin().assign(region.getEncodedNameAsBytes()); } LOG.debug("Waiting for table assigned " + tableName); TEST_UTIL.waitUntilAllRegionsAssigned(tableName); @@ -143,7 +143,7 @@ public class TestEnableTable { public void testDeleteForSureClearsAllTableRowsFromMeta() throws IOException, InterruptedException { final TableName tableName = TableName.valueOf("testDeleteForSureClearsAllTableRowsFromMeta"); - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(new HColumnDescriptor(FAMILYNAME)); try { @@ -223,7 +223,7 @@ public class TestEnableTable { MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster() .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName()); observer.tableCreationLatch = new CountDownLatch(1); - Admin admin = testUtil.getHBaseAdmin(); + Admin admin = testUtil.getAdmin(); if (splitKeys != null) { admin.createTable(htd, splitKeys); } else { @@ -241,7 +241,7 @@ public class TestEnableTable { MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster() .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName()); observer.tableDeletionLatch = new CountDownLatch(1); - Admin admin = testUtil.getHBaseAdmin(); + Admin admin = testUtil.getAdmin(); try { admin.disableTable(tableName); } catch (Exception e) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFastFail.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFastFail.java index 37325c8c09e..8f3216628b2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFastFail.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFastFail.java @@ -105,7 +105,7 @@ public class TestFastFail { @Ignore ("Can go zombie -- see HBASE-14421; FIX") @Test public void testFastFail() throws IOException, InterruptedException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); final String tableName = "testClientRelearningExperiment"; HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(Bytes @@ -295,7 +295,7 @@ public class TestFastFail { @Test public void testCallQueueTooBigExceptionDoesntTriggerPffe() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); final String tableName = "testCallQueueTooBigException"; HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(Bytes 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 ff7d2118d1f..74df9cb2847 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 @@ -237,7 +237,7 @@ public class TestFromClientSide { HTableDescriptor desc = new HTableDescriptor(TABLENAME); desc.addFamily(hcd); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); Table h = TEST_UTIL.getConnection().getTable(TABLENAME); long ts = System.currentTimeMillis(); @@ -319,14 +319,14 @@ public class TestFromClientSide { assertNull(result.getValue(FAMILY, COLUMN)); // major compaction, purged future deletes - TEST_UTIL.getHBaseAdmin().flush(TABLENAME); - TEST_UTIL.getHBaseAdmin().majorCompact(TABLENAME); + TEST_UTIL.getAdmin().flush(TABLENAME); + TEST_UTIL.getAdmin().majorCompact(TABLENAME); // waiting for the major compaction to complete TEST_UTIL.waitFor(6000, new Waiter.Predicate() { @Override public boolean evaluate() throws IOException { - return TEST_UTIL.getHBaseAdmin().getCompactionState(TABLENAME) == + return TEST_UTIL.getAdmin().getCompactionState(TABLENAME) == CompactionState.NONE; } }); @@ -646,7 +646,7 @@ public class TestFromClientSide { private List splitTable(final Table t) throws IOException, InterruptedException { // Split this table in two. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.split(t.getName()); admin.close(); List regions = waitOnSplit(t); @@ -1756,7 +1756,7 @@ public class TestFromClientSide { @Test public void testDeleteFamilyVersion() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); TableName TABLE = TableName.valueOf("testDeleteFamilyVersion"); byte [][] QUALIFIERS = makeNAscii(QUALIFIER, 1); @@ -1801,7 +1801,7 @@ public class TestFromClientSide { byte [][] VALUES = makeN(VALUE, 5); long [] ts = {1000, 2000, 3000, 4000, 5000}; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); Table ht = TEST_UTIL.createTable(TABLE, FAMILY, 5); Put put = null; Result result = null; @@ -3668,7 +3668,7 @@ public class TestFromClientSide { TableName TABLE = TableName.valueOf("testUpdatesWithMajorCompaction"); Table hTable = TEST_UTIL.createTable(TABLE, FAMILY, 10); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Write a column with values at timestamp 1, 2 and 3 byte[] row = Bytes.toBytes("row2"); @@ -3729,7 +3729,7 @@ public class TestFromClientSide { TableName tableName = TableName.valueOf("testMajorCompactionBetweenTwoUpdates"); Table hTable = TEST_UTIL.createTable(tableName, FAMILY, 10); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Write a column with values at timestamp 1, 2 and 3 byte[] row = Bytes.toBytes("row3"); @@ -4094,7 +4094,7 @@ public class TestFromClientSide { for (int i = 0; i < tables.length; i++) { TEST_UTIL.createTable(tables[i], FAMILY); } - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor[] ts = admin.listTables(); HashSet result = new HashSet(ts.length); Collections.addAll(result, ts); @@ -4209,7 +4209,7 @@ public class TestFromClientSide { // to be reloaded. // Test user metadata - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // make a modifiable descriptor HTableDescriptor desc = new HTableDescriptor(a.getTableDescriptor()); // offline the table @@ -5143,7 +5143,7 @@ public class TestFromClientSide { byte [] family1 = Bytes.toBytes("f1"); byte [] family2 = Bytes.toBytes("f2"); try (Table table = TEST_UTIL.createTable(TABLE, new byte[][] {family1, family2}, 10); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TABLE)) { List allRegionLocations = locator.getAllRegionLocations(); assertEquals(1, allRegionLocations.size()); @@ -6159,7 +6159,7 @@ public class TestFromClientSide { HColumnDescriptor fam = new HColumnDescriptor(FAMILY); htd.addFamily(fam); byte[][] KEYS = HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd, KEYS); List regions = admin.getTableRegions(htd.getTableName()); @@ -6210,7 +6210,7 @@ public class TestFromClientSide { HColumnDescriptor fam = new HColumnDescriptor(FAMILY); htd.addFamily(fam); byte[][] KEYS = HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE; - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd, KEYS); HRegionLocator locator = (HRegionLocator) admin.getConnection().getRegionLocator(htd.getTableName()); 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 6f9637f5c53..0e271f0b3ac 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 @@ -117,7 +117,7 @@ public class TestFromClientSide3 { */ @After public void tearDown() throws Exception { - for (HTableDescriptor htd: TEST_UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: TEST_UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); TEST_UTIL.deleteTable(htd.getTableName()); } @@ -171,7 +171,7 @@ public class TestFromClientSide3 { TableName tableName = TableName.valueOf("testAdvancedConfigOverride"); Table hTable = TEST_UTIL.createTable(tableName, FAMILY, 10); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); ClusterConnection connection = (ClusterConnection) TEST_UTIL.getConnection(); // Create 3 store files. @@ -471,7 +471,7 @@ public class TestFromClientSide3 { @Test public void testGetEmptyRow() throws Exception { //Create a table and put in 1 row - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(Bytes.toBytes("test"))); desc.addFamily(new HColumnDescriptor(FAMILY)); admin.createTable(desc); @@ -713,7 +713,7 @@ public class TestFromClientSide3 { HTableDescriptor htd = new HTableDescriptor(tableName); HColumnDescriptor fam = new HColumnDescriptor(FAMILY); htd.addFamily(fam); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd); Table table = admin.getConnection().getTable(TableName.valueOf("testMVCCUsingMVCCPreAssign")); //put two row first to init the scanner diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java index 3416e54676d..e16e5c03704 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java @@ -340,7 +340,7 @@ public class TestHCM { final ConnectionImplementation hci = (ConnectionImplementation)TEST_UTIL.getConnection(); try (RegionLocator l = TEST_UTIL.getConnection().getRegionLocator(tn)) { while (l.getRegionLocation(rk).getPort() != sn.getPort()) { - TEST_UTIL.getHBaseAdmin().move(l.getRegionLocation(rk).getRegionInfo(). + TEST_UTIL.getAdmin().move(l.getRegionLocation(rk).getRegionInfo(). getEncodedNameAsBytes(), Bytes.toBytes(sn.toString())); TEST_UTIL.waitUntilNoRegionsInTransition(); hci.clearRegionCache(tn); @@ -804,7 +804,7 @@ public class TestHCM { table.close(); connection.close(); Assert.assertTrue("Unexpected exception is " + failed.get(), failed.get() == null); - TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance, true); + TEST_UTIL.getAdmin().setBalancerRunning(previousBalance, true); } /** @@ -815,7 +815,7 @@ public class TestHCM { TableName tableName = TableName.valueOf("HCM-testConnectionIdle"); TEST_UTIL.createTable(tableName, FAM_NAM).close(); int idleTime = 20000; - boolean previousBalance = TEST_UTIL.getHBaseAdmin().setBalancerRunning(false, true); + boolean previousBalance = TEST_UTIL.getAdmin().setBalancerRunning(false, true); Configuration c2 = new Configuration(TEST_UTIL.getConfiguration()); // We want to work on a separate connection. @@ -863,7 +863,7 @@ public class TestHCM { connection.close(); EnvironmentEdgeManager.reset(); - TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance, true); + TEST_UTIL.getAdmin().setBalancerRunning(previousBalance, true); } /** @@ -877,7 +877,7 @@ public class TestHCM { TableName tableName = TableName.valueOf("HCM-testConnectionCut"); TEST_UTIL.createTable(tableName, FAM_NAM).close(); - boolean previousBalance = TEST_UTIL.getHBaseAdmin().setBalancerRunning(false, true); + boolean previousBalance = TEST_UTIL.getAdmin().setBalancerRunning(false, true); Configuration c2 = new Configuration(TEST_UTIL.getConfiguration()); // We want to work on a separate connection. @@ -932,7 +932,7 @@ public class TestHCM { } finally { syncBlockingFilter.set(true); t.join(); - TEST_UTIL.getHBaseAdmin().setBalancerRunning(previousBalance, true); + TEST_UTIL.getAdmin().setBalancerRunning(previousBalance, true); } table.close(); @@ -1008,7 +1008,7 @@ public class TestHCM { assertNotNull(conn.getCachedLocation(TABLE_NAME, ROW)); assertNotNull(conn.getCachedLocation(TableName.valueOf(TABLE_NAME.getName()), ROW.clone())); - TEST_UTIL.getHBaseAdmin().setBalancerRunning(false, false); + TEST_UTIL.getAdmin().setBalancerRunning(false, false); HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster(); // We can wait for all regions to be online, that makes log reading easier when debugging @@ -1040,7 +1040,7 @@ public class TestHCM { // Moving. It's possible that we don't have all the regions online at this point, so // the test must depends only on the region we're looking at. LOG.info("Move starting region="+toMove.getRegionInfo().getRegionNameAsString()); - TEST_UTIL.getHBaseAdmin().move( + TEST_UTIL.getAdmin().move( toMove.getRegionInfo().getEncodedNameAsBytes(), destServerName.getServerName().getBytes() ); @@ -1099,7 +1099,7 @@ public class TestHCM { // We move it back to do another test with a scan LOG.info("Move starting region=" + toMove.getRegionInfo().getRegionNameAsString()); - TEST_UTIL.getHBaseAdmin().move( + TEST_UTIL.getAdmin().move( toMove.getRegionInfo().getEncodedNameAsBytes(), curServer.getServerName().getServerName().getBytes() ); @@ -1304,7 +1304,7 @@ public class TestHCM { conn.clearRegionCache(TABLE_NAME3); Assert.assertEquals(0, conn.getNumberOfCachedRegionLocations(TABLE_NAME3)); - TEST_UTIL.getHBaseAdmin().setBalancerRunning(false, false); + TEST_UTIL.getAdmin().setBalancerRunning(false, false); HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster(); // We can wait for all regions to be online, that makes log reading easier when debugging @@ -1357,7 +1357,7 @@ public class TestHCM { // Moving. It's possible that we don't have all the regions online at this point, so // the test must depends only on the region we're looking at. LOG.info("Move starting region="+toMove.getRegionInfo().getRegionNameAsString()); - TEST_UTIL.getHBaseAdmin().move( + TEST_UTIL.getAdmin().move( toMove.getRegionInfo().getEncodedNameAsBytes(), destServerName.getServerName().getBytes() ); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHTableMultiplexerFlushCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHTableMultiplexerFlushCache.java index 8c5488027c1..1b423525058 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHTableMultiplexerFlushCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHTableMultiplexerFlushCache.java @@ -162,7 +162,7 @@ public class TestHTableMultiplexerFlushCache { // Move the region LOG.info("Moving " + loc.getRegionInfo().getEncodedName() + " from " + originalServer + " to " + newServer); - TEST_UTIL.getHBaseAdmin().move(loc.getRegionInfo().getEncodedNameAsBytes(), + TEST_UTIL.getAdmin().move(loc.getRegionInfo().getEncodedNameAsBytes(), Bytes.toBytes(newServer.getServerName())); TEST_UTIL.waitUntilAllRegionsAssigned(TABLE); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java index 470fc5ccd4f..a5615aede9a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java @@ -177,14 +177,14 @@ public class TestIllegalTableDescriptor { } private void checkTableIsLegal(HTableDescriptor htd) throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(htd); assertTrue(admin.tableExists(htd.getTableName())); TEST_UTIL.deleteTable(htd.getTableName()); } private void checkTableIsIllegal(HTableDescriptor htd) throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); try { admin.createTable(htd); fail(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java index d8bc59112d7..ef8f2345621 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java @@ -87,7 +87,7 @@ public class TestLeaseRenewal { */ @After public void tearDown() throws Exception { - for (HTableDescriptor htd : TEST_UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd : TEST_UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); TEST_UTIL.deleteTable(htd.getTableName()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java index 721391a2d59..197725c27ec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicas.java @@ -112,7 +112,7 @@ public class TestMetaWithReplicas { @Test public void testMetaHTDReplicaCount() throws Exception { - assertTrue(TEST_UTIL.getHBaseAdmin().getTableDescriptor(TableName.META_TABLE_NAME) + assertTrue(TEST_UTIL.getAdmin().getTableDescriptor(TableName.META_TABLE_NAME) .getRegionReplication() == 3); } @@ -166,14 +166,14 @@ public class TestMetaWithReplicas { TableName TABLE = TableName.valueOf("testShutdownHandling"); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; - if (util.getHBaseAdmin().tableExists(TABLE)) { - util.getHBaseAdmin().disableTable(TABLE); - util.getHBaseAdmin().deleteTable(TABLE); + if (util.getAdmin().tableExists(TABLE)) { + util.getAdmin().disableTable(TABLE); + util.getAdmin().deleteTable(TABLE); } ServerName master = null; try (Connection c = ConnectionFactory.createConnection(util.getConfiguration());) { try (Table htable = util.createTable(TABLE, FAMILIES);) { - util.getHBaseAdmin().flush(TableName.META_TABLE_NAME); + util.getAdmin().flush(TableName.META_TABLE_NAME); Thread.sleep(conf.getInt(StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, 30000) * 6); List regions = MetaTableAccessor.getTableRegions(c, TABLE); @@ -184,13 +184,13 @@ public class TestMetaWithReplicas { // If the servers are the same, then move the test table's region out of the server // to another random server if (hrl.getServerName().equals(primary)) { - util.getHBaseAdmin().move(hrl.getRegionInfo().getEncodedNameAsBytes(), null); + util.getAdmin().move(hrl.getRegionInfo().getEncodedNameAsBytes(), null); // wait for the move to complete do { Thread.sleep(10); hrl = MetaTableAccessor.getRegionLocation(c, regions.get(0)); } while (primary.equals(hrl.getServerName())); - util.getHBaseAdmin().flush(TableName.META_TABLE_NAME); + util.getAdmin().flush(TableName.META_TABLE_NAME); Thread.sleep(conf.getInt(StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, 30000) * 3); } @@ -237,9 +237,9 @@ public class TestMetaWithReplicas { public void testMetaLookupThreadPoolCreated() throws Exception { TableName TABLE = TableName.valueOf("testMetaLookupThreadPoolCreated"); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; - if (TEST_UTIL.getHBaseAdmin().tableExists(TABLE)) { - TEST_UTIL.getHBaseAdmin().disableTable(TABLE); - TEST_UTIL.getHBaseAdmin().deleteTable(TABLE); + if (TEST_UTIL.getAdmin().tableExists(TABLE)) { + TEST_UTIL.getAdmin().disableTable(TABLE); + TEST_UTIL.getAdmin().deleteTable(TABLE); } try (Table htable = TEST_UTIL.createTable(TABLE, FAMILIES);) { byte[] row = "test".getBytes(); @@ -392,7 +392,7 @@ public class TestMetaWithReplicas { // check that the data in the znode is parseable (this would also mean the znode exists) byte[] data = ZKUtil.getData(zkw, primaryMetaZnode); ServerName currentServer = ProtobufUtil.toServerName(data); - Collection liveServers = TEST_UTIL.getHBaseAdmin().getClusterStatus().getServers(); + Collection liveServers = TEST_UTIL.getAdmin().getClusterStatus().getServers(); ServerName moveToServer = null; for (ServerName s : liveServers) { if (!currentServer.equals(s)) { @@ -402,8 +402,8 @@ public class TestMetaWithReplicas { assert(moveToServer != null); TableName tableName = TableName.valueOf("randomTable5678"); TEST_UTIL.createTable(tableName, "f"); - assertTrue(TEST_UTIL.getHBaseAdmin().tableExists(tableName)); - TEST_UTIL.getHBaseAdmin().move(HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(), + assertTrue(TEST_UTIL.getAdmin().tableExists(tableName)); + TEST_UTIL.getAdmin().move(HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(), Bytes.toBytes(moveToServer.getServerName())); int i = 0; do { @@ -413,8 +413,8 @@ public class TestMetaWithReplicas { i++; } while (!moveToServer.equals(currentServer) && i < 1000); //wait for 10 seconds overall assert(i != 1000); - TEST_UTIL.getHBaseAdmin().disableTable(tableName); - assertTrue(TEST_UTIL.getHBaseAdmin().isTableDisabled(tableName)); + TEST_UTIL.getAdmin().disableTable(tableName); + assertTrue(TEST_UTIL.getAdmin().isTableDisabled(tableName)); } @Test @@ -449,7 +449,7 @@ public class TestMetaWithReplicas { TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager() .getRegionStates().createRegionState(h); TEST_UTIL.assignRegion(h); - HBaseFsckRepair.waitUntilAssigned(TEST_UTIL.getHBaseAdmin(), h); + HBaseFsckRepair.waitUntilAssigned(TEST_UTIL.getAdmin(), h); // check that problem exists HBaseFsck hbck = doFsck(TEST_UTIL.getConfiguration(), false); assertErrors(hbck, new ERROR_CODE[]{ERROR_CODE.UNKNOWN, ERROR_CODE.SHOULD_NOT_BE_DEPLOYED}); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClient.java index 7972daf0a95..a3a5a76d44b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClient.java @@ -161,9 +161,9 @@ public class TestMobCloneSnapshotFromClient extends TestCloneSnapshotFromClient hcd.setMobThreshold(0L); htd.addFamily(hcd); } - util.getHBaseAdmin().createTable(htd, splitKeys); + util.getAdmin().createTable(htd, splitKeys); SnapshotTestingUtils.waitForTableToBeOnline(util, tableName); assertEquals((splitKeys.length + 1) * regionReplication, - util.getHBaseAdmin().getTableRegions(tableName).size()); + util.getAdmin().getTableRegions(tableName).size()); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java index 04c592e84d5..9d107052b99 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java @@ -117,7 +117,7 @@ public class TestMultiRespectsLimits { HColumnDescriptor hcd = new HColumnDescriptor(FAMILY); hcd.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF); desc.addFamily(hcd); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); Table t = TEST_UTIL.getConnection().getTable(name); final HRegionServer regionServer = TEST_UTIL.getHBaseCluster().getRegionServer(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java index 9f9037f6bb7..3a08088ff2f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java @@ -217,7 +217,7 @@ public class TestReplicaWithCluster { SlowMeCopro.sleepTime.set(0); } - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName()); } @@ -238,13 +238,13 @@ public class TestReplicaWithCluster { Assert.assertFalse(r.isStale()); // Add a CF, it should work. - HTableDescriptor bHdt = HTU.getHBaseAdmin().getTableDescriptor(hdt.getTableName()); + HTableDescriptor bHdt = HTU.getAdmin().getTableDescriptor(hdt.getTableName()); HColumnDescriptor hcd = new HColumnDescriptor(row); hdt.addFamily(hcd); - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); - HTU.getHBaseAdmin().modifyTable(hdt.getTableName(), hdt); - HTU.getHBaseAdmin().enableTable(hdt.getTableName()); - HTableDescriptor nHdt = HTU.getHBaseAdmin().getTableDescriptor(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().modifyTable(hdt.getTableName(), hdt); + HTU.getAdmin().enableTable(hdt.getTableName()); + HTableDescriptor nHdt = HTU.getAdmin().getTableDescriptor(hdt.getTableName()); Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()), bHdt.getColumnFamilyCount() + 1, nHdt.getColumnFamilyCount()); @@ -267,7 +267,7 @@ public class TestReplicaWithCluster { SlowMeCopro.sleepTime.set(0); } - Admin admin = HTU.getHBaseAdmin(); + Admin admin = HTU.getAdmin(); nHdt =admin.getTableDescriptor(hdt.getTableName()); Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()), bHdt.getColumnFamilyCount() + 1, nHdt.getColumnFamilyCount()); @@ -288,7 +288,7 @@ public class TestReplicaWithCluster { hdt.addFamily(fam); hdt.addCoprocessor(SlowMeCopro.class.getName()); - HTU.getHBaseAdmin().createTable(hdt, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + HTU.getAdmin().createTable(hdt, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); Configuration conf2 = HBaseConfiguration.create(HTU.getConfiguration()); conf2.set(HConstants.HBASE_CLIENT_INSTANCE_ID, String.valueOf(-1)); @@ -299,7 +299,7 @@ public class TestReplicaWithCluster { HTU2.setZkCluster(miniZK); HTU2.startMiniCluster(NB_SERVERS); LOG.info("Setup second Zk"); - HTU2.getHBaseAdmin().createTable(hdt, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + HTU2.getAdmin().createTable(hdt, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); ReplicationAdmin admin = new ReplicationAdmin(HTU.getConfiguration()); @@ -313,7 +313,7 @@ public class TestReplicaWithCluster { final Table table = HTU.getConnection().getTable(hdt.getTableName()); table.put(p); - HTU.getHBaseAdmin().flush(table.getName()); + HTU.getAdmin().flush(table.getName()); LOG.info("Put & flush done on the first cluster. Now doing a get on the same cluster."); Waiter.waitFor(HTU.getConfiguration(), 1000, new Waiter.Predicate() { @@ -352,10 +352,10 @@ public class TestReplicaWithCluster { }); table2.close(); - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName()); - HTU2.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU2.getAdmin().disableTable(hdt.getTableName()); HTU2.deleteTable(hdt.getTableName()); // We shutdown HTU2 minicluster later, in afterClass(), as shutting down @@ -438,7 +438,7 @@ public class TestReplicaWithCluster { SlowMeCopro.sleepTime.set(0); } - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName()); } @@ -471,7 +471,7 @@ public class TestReplicaWithCluster { Result r = table.get(g); Assert.assertTrue(r.isStale()); } finally { - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName()); } } @@ -516,7 +516,7 @@ public class TestReplicaWithCluster { Assert.assertTrue(r.isStale()); } finally { - HTU.getHBaseAdmin().disableTable(hdt.getTableName()); + HTU.getAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName()); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java index 0f7f3d90e44..40e3bde631c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java @@ -303,7 +303,7 @@ public class TestReplicasClient { public void testLocations() throws Exception { byte[] b1 = "testLocations".getBytes(); openRegion(hriSecondary); - ClusterConnection hc = (ClusterConnection) HTU.getHBaseAdmin().getConnection(); + ClusterConnection hc = (ClusterConnection) HTU.getAdmin().getConnection(); try { hc.clearRegionCache(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java index a3fc640ddc5..4ae959d8709 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java @@ -103,7 +103,7 @@ public class TestRestoreSnapshotFromClient { */ @Before public void setup() throws Exception { - this.admin = TEST_UTIL.getHBaseAdmin(); + this.admin = TEST_UTIL.getAdmin(); long tid = System.currentTimeMillis(); tableName = @@ -146,7 +146,7 @@ public class TestRestoreSnapshotFromClient { @After public void tearDown() throws Exception { TEST_UTIL.deleteTable(tableName); - SnapshotTestingUtils.deleteAllSnapshots(TEST_UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(TEST_UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(TEST_UTIL); } 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 90956ac08c4..14214d5d2c4 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 @@ -137,7 +137,7 @@ public class TestScannerTimeout { Scan scan = new Scan(); scan.setCaching(SCANNER_CACHING); LOG.info("************ TEST3686A"); - MetaTableAccessor.fullScanMetaAndPrint(TEST_UTIL.getHBaseAdmin().getConnection()); + MetaTableAccessor.fullScanMetaAndPrint(TEST_UTIL.getAdmin().getConnection()); // Set a very high timeout, we want to test what happens when a RS // fails but the region is recovered before the lease times out. // Since the RS is already created, this conf is client-side only for diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java index eedb57cfaa9..1e6b0fa1e5b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java @@ -77,7 +77,7 @@ public class TestSizeFailures { splits[i - 1][0] = (byte) (split >>> 8); splits[i - 1][0] = (byte) (split); } - TEST_UTIL.getHBaseAdmin().createTable(desc, splits); + TEST_UTIL.getAdmin().createTable(desc, splits); Connection conn = TEST_UTIL.getConnection(); try (Table table = conn.getTable(TABLENAME)) { 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 4111a69390f..04bc6c740dc 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 @@ -121,7 +121,7 @@ public class TestSnapshotCloneIndependence { fs = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem(); rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir(); - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); originalTableName = TableName.valueOf("test" + testName.getMethodName()); cloneTableName = TableName.valueOf("test-clone-" + originalTableName); snapshotNameAsString = "snapshot_" + originalTableName; @@ -137,7 +137,7 @@ public class TestSnapshotCloneIndependence { public void tearDown() throws Exception { UTIL.deleteTable(originalTableName); UTIL.deleteTable(cloneTableName); - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java index c08de4b4a05..633c7087dab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java @@ -116,7 +116,7 @@ public class TestSnapshotFromClient { @After public void tearDown() throws Exception { UTIL.deleteTable(TABLE_NAME); - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); } @@ -135,7 +135,7 @@ public class TestSnapshotFromClient { */ @Test (timeout=300000) public void testMetaTablesSnapshot() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); byte[] snapshotName = Bytes.toBytes("metaSnapshot"); try { @@ -153,7 +153,7 @@ public class TestSnapshotFromClient { */ @Test (timeout=300000) public void testSnapshotDeletionWithRegex() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // make sure we don't fail on listing snapshots SnapshotTestingUtils.assertNoSnapshots(admin); @@ -189,7 +189,7 @@ public class TestSnapshotFromClient { */ @Test (timeout=300000) public void testOfflineTableSnapshot() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // make sure we don't fail on listing snapshots SnapshotTestingUtils.assertNoSnapshots(admin); @@ -237,7 +237,7 @@ public class TestSnapshotFromClient { @Test (timeout=300000) public void testSnapshotFailsOnNonExistantTable() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // make sure we don't fail on listing snapshots SnapshotTestingUtils.assertNoSnapshots(admin); String tableName = "_not_a_table"; @@ -268,7 +268,7 @@ public class TestSnapshotFromClient { public void testOfflineTableSnapshotWithEmptyRegions() throws Exception { // test with an empty table with one region - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // make sure we don't fail on listing snapshots SnapshotTestingUtils.assertNoSnapshots(admin); @@ -313,7 +313,7 @@ public class TestSnapshotFromClient { Admin admin = null; TableName tableName2 = TableName.valueOf("testListTableSnapshots"); try { - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(tableName2); UTIL.createTable(htd, new byte[][] { TEST_FAM }, UTIL.getConfiguration()); @@ -357,7 +357,7 @@ public class TestSnapshotFromClient { public void testListTableSnapshotsWithRegex() throws Exception { Admin admin = null; try { - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); String table1Snapshot1 = "Table1Snapshot1"; admin.snapshot(table1Snapshot1, TABLE_NAME); @@ -397,7 +397,7 @@ public class TestSnapshotFromClient { Admin admin = null; TableName tableName2 = TableName.valueOf("testListTableSnapshots"); try { - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(tableName2); UTIL.createTable(htd, new byte[][] { TEST_FAM }, UTIL.getConfiguration()); @@ -430,7 +430,7 @@ public class TestSnapshotFromClient { public void testDeleteTableSnapshotsWithRegex() throws Exception { Admin admin = null; try { - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); String table1Snapshot1 = "Table1Snapshot1"; admin.snapshot(table1Snapshot1, TABLE_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java index 1a774e5e7b7..55086b5c2a3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java @@ -133,7 +133,7 @@ public class TestSnapshotMetadata { @Before public void setup() throws Exception { - admin = UTIL.getHBaseAdmin(); + admin = UTIL.getAdmin(); createTableWithNonDefaultProperties(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java index 8b9428fe85a..85cb0fda751 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java @@ -89,7 +89,7 @@ public class TestTableSnapshotScanner { } else { util.createTable(tableName, FAMILIES); } - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // put some stuff in the table Table table = util.getConnection().getTable(tableName); @@ -146,7 +146,7 @@ public class TestTableSnapshotScanner { scanner.close(); } finally { if (!shutdownCluster) { - util.getHBaseAdmin().deleteSnapshot(snapshotName); + util.getAdmin().deleteSnapshot(snapshotName); util.deleteTable(tableName); tearDownCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java index 0e47d3971ab..c3f6eedf79a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java @@ -80,7 +80,7 @@ public class TestConstraint { // add a constraint Constraints.add(desc, CheckWasRunConstraint.class); - util.getHBaseAdmin().createTable(desc); + util.getAdmin().createTable(desc); Table table = util.getConnection().getTable(tableName); try { // test that we don't fail on a valid put @@ -113,7 +113,7 @@ public class TestConstraint { // add a constraint that is sure to fail Constraints.add(desc, AllFailConstraint.class); - util.getHBaseAdmin().createTable(desc); + util.getAdmin().createTable(desc); Table table = util.getConnection().getTable(tableName); // test that we do fail on violation @@ -157,7 +157,7 @@ public class TestConstraint { // and then disable the failing constraint Constraints.disableConstraint(desc, AllFailConstraint.class); - util.getHBaseAdmin().createTable(desc); + util.getAdmin().createTable(desc); Table table = util.getConnection().getTable(tableName); try { // test that we don't fail because its disabled @@ -190,7 +190,7 @@ public class TestConstraint { // then disable all the constraints Constraints.disable(desc); - util.getHBaseAdmin().createTable(desc); + util.getAdmin().createTable(desc); Table table = util.getConnection().getTable(tableName); try { // test that we do fail on violation @@ -223,7 +223,7 @@ public class TestConstraint { Constraints.add(desc, CheckWasRunConstraint.class); CheckWasRunConstraint.wasRun = false; - util.getHBaseAdmin().createTable(desc); + util.getAdmin().createTable(desc); Table table = util.getConnection().getTable(tableName); // test that we do fail on violation @@ -248,8 +248,8 @@ public class TestConstraint { public void cleanup() throws Exception { // cleanup CheckWasRunConstraint.wasRun = false; - util.getHBaseAdmin().disableTable(tableName); - util.getHBaseAdmin().deleteTable(tableName); + util.getAdmin().disableTable(tableName); + util.getAdmin().deleteTable(tableName); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java index 061068cbaa9..6eeb6d149c4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java @@ -86,7 +86,7 @@ public class TestMasterCoprocessorExceptionWithAbort { HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_TABLE)); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); try { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.createTable(htd); fail("BuggyMasterObserver failed to throw an exception."); } catch (IOException e) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java index bbb855c699f..ddc9cb86b8f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java @@ -192,7 +192,7 @@ public class TestMasterCoprocessorExceptionWithRemove { boolean threwDNRE = false; try { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.createTable(htd1); } catch (IOException e) { if (e.getClass().getName().equals("org.apache.hadoop.hbase.DoNotRetryIOException")) { @@ -219,7 +219,7 @@ public class TestMasterCoprocessorExceptionWithRemove { // by creating another table: should not have a problem this time. HTableDescriptor htd2 = new HTableDescriptor(TableName.valueOf(TEST_TABLE2)); htd2.addFamily(new HColumnDescriptor(TEST_FAMILY2)); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); try { admin.createTable(htd2); } catch (IOException e) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java index 66963fded9f..cbbc5a5fb3d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java @@ -1844,7 +1844,7 @@ public class TestMasterObserver { // create a table HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); tableCreationLatch = new CountDownLatch(1); admin.createTable(htd); @@ -1907,7 +1907,7 @@ public class TestMasterObserver { // create a table - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.createNamespace(NamespaceDescriptor.create(testNamespace).build()); assertTrue("Test namespace should be created", cp.wasCreateNamespaceCalled()); @@ -2082,7 +2082,7 @@ public class TestMasterObserver { assertTrue("Coprocessor should be called on region rebalancing", cp.wasBalanceCalled()); } finally { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.disableTable(tableName); deleteTable(admin, tableName); } 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 53b34b209f6..7a51252b239 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 @@ -122,11 +122,11 @@ public class TestOpenTableInCoprocessor { @After public void cleanupTestTable() throws Exception { - UTIL.getHBaseAdmin().disableTable(primaryTable); - UTIL.getHBaseAdmin().deleteTable(primaryTable); + UTIL.getAdmin().disableTable(primaryTable); + UTIL.getAdmin().deleteTable(primaryTable); - UTIL.getHBaseAdmin().disableTable(otherTable); - UTIL.getHBaseAdmin().deleteTable(otherTable); + UTIL.getAdmin().disableTable(otherTable); + UTIL.getAdmin().deleteTable(otherTable); } @@ -156,7 +156,7 @@ public class TestOpenTableInCoprocessor { other.addFamily(new HColumnDescriptor(family)); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.createTable(primary); admin.createTable(other); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java index 3cbbe9d9cf8..2e63856e5a8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java @@ -76,7 +76,7 @@ public class TestRegionObserverBypass { @Before public void setUp() throws Exception { - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); if (admin.tableExists(tableName)) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java index 02bb0d3b170..784eca79ae7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java @@ -270,7 +270,7 @@ public class TestRegionObserverScannerOpenHook { desc.addCoprocessor(NoDataFromCompaction.class.getName(), null, Coprocessor.PRIORITY_HIGHEST, null); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.createTable(desc); Table table = UTIL.getConnection().getTable(desc.getTableName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java index e587096610f..7041c92da8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java @@ -100,7 +100,7 @@ public class FilterTestingCluster { conf = HBaseConfiguration.create(conf); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); try { - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } catch (MasterNotRunningException e) { assertNull("Master is not running", e); } catch (ZooKeeperConnectionException e) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java index 4d7c8083024..59873bef58c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java @@ -176,7 +176,7 @@ public class TestFilterWrapper { TestFilterWrapper.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); try { connection = ConnectionFactory.createConnection(TestFilterWrapper.conf); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } catch (MasterNotRunningException e) { assertNull("Master is not running", e); } catch (ZooKeeperConnectionException e) { 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 3180c503585..0207c7fb2f4 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 @@ -298,7 +298,7 @@ public class TestBlockReorder { ((HRegion)region).getWAL().registerWALActionsListener(listener); } - htu.getHBaseAdmin().rollWALWriter(targetRs.getServerName()); + htu.getAdmin().rollWALWriter(targetRs.getServerName()); // wait try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java index 6cf4d6878e0..a2cd50cd09a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java @@ -218,7 +218,7 @@ public class TestChangingEncoding { private void compactAndWait() throws IOException, InterruptedException { LOG.debug("Compacting table " + tableName); HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.majorCompact(tableName); // Waiting for the compaction to start, at least .5s. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java index 42c66e6db8a..e62af9e2a18 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestLoadAndSwitchEncodeOnDisk.java @@ -67,7 +67,7 @@ public class TestLoadAndSwitchEncodeOnDisk extends @Test(timeout=TIMEOUT_MS) public void loadTest() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); compression = Compression.Algorithm.GZ; // used for table setup super.loadTest(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java index c4fdea41b0d..9db5587839e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java @@ -120,7 +120,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa "Snapshot job should not use BucketCache.", 0, job.getFloat("hbase.bucketcache.size", -1), 0.01); } finally { - UTIL.getHBaseAdmin().deleteSnapshot(snapshotName); + UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } @@ -177,7 +177,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa verifyWithMockedMapReduce(job, numRegions, expectedNumSplits, getStartRow(), getEndRow()); } finally { - util.getHBaseAdmin().deleteSnapshot(snapshotName); + util.getAdmin().deleteSnapshot(snapshotName); util.deleteTable(tableName); tearDownCluster(); } @@ -258,7 +258,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa Assert.assertTrue(job.isSuccessful()); } finally { if (!shutdownCluster) { - util.getHBaseAdmin().deleteSnapshot(snapshotName); + util.getAdmin().deleteSnapshot(snapshotName); util.deleteTable(tableName); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java index 66d290a43d2..ed4175b9ba3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java @@ -146,7 +146,7 @@ public abstract class TableSnapshotInputFormatTestBase { } } } finally { - UTIL.getHBaseAdmin().deleteSnapshot(snapshotName); + UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } @@ -201,7 +201,7 @@ public abstract class TableSnapshotInputFormatTestBase { } else { util.createTable(tableName, FAMILIES); } - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); // put some stuff in the table Table table = util.getConnection().getTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index bd3efa7f993..a77668547dc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -281,7 +281,7 @@ public class TestImportExport { desc.addFamily(new HColumnDescriptor(FAMILYA) .setMaxVersions(1) ); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); try (Table t = UTIL.getConnection().getTable(desc.getTableName());) { Put p = new Put(ROW1); @@ -312,7 +312,7 @@ public class TestImportExport { .setMaxVersions(5) .setKeepDeletedCells(KeepDeletedCells.TRUE) ); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); try (Table t = UTIL.getConnection().getTable(desc.getTableName());) { Put p = new Put(ROW1); @@ -344,7 +344,7 @@ public class TestImportExport { .setMaxVersions(5) .setKeepDeletedCells(KeepDeletedCells.TRUE) ); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); try (Table t = UTIL.getConnection().getTable(desc.getTableName());) { args = new String[] { IMPORT_TABLE, @@ -378,7 +378,7 @@ public class TestImportExport { .setMaxVersions(5) .setKeepDeletedCells(KeepDeletedCells.TRUE) ); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); Table exportT = UTIL.getConnection().getTable(EXPORT_TABLE); @@ -414,7 +414,7 @@ public class TestImportExport { .setMaxVersions(5) .setKeepDeletedCells(KeepDeletedCells.TRUE) ); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); Table importT = UTIL.getConnection().getTable(TableName.valueOf(IMPORT_TABLE)); args = new String[] { @@ -452,7 +452,7 @@ public class TestImportExport { String EXPORT_TABLE = "exportSimpleCase_ImportWithFilter"; HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(EXPORT_TABLE)); desc.addFamily(new HColumnDescriptor(FAMILYA).setMaxVersions(5)); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); Table exportTable = UTIL.getConnection().getTable(desc.getTableName()); Put p1 = new Put(ROW1); @@ -476,7 +476,7 @@ public class TestImportExport { String IMPORT_TABLE = "importWithFilter"; desc = new HTableDescriptor(TableName.valueOf(IMPORT_TABLE)); desc.addFamily(new HColumnDescriptor(FAMILYA).setMaxVersions(5)); - UTIL.getHBaseAdmin().createTable(desc); + UTIL.getAdmin().createTable(desc); Table importTable = UTIL.getConnection().getTable(desc.getTableName()); args = new String[] { "-D" + Import.FILTER_CLASS_CONF_KEY + "=" + PrefixFilter.class.getName(), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java index ebc7c978581..834f225c226 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java @@ -104,7 +104,7 @@ public class TestLoadIncrementalHFiles { } protected static void setupNamespace() throws Exception { - util.getHBaseAdmin().createNamespace(NamespaceDescriptor.create(NAMESPACE).build()); + util.getAdmin().createNamespace(NamespaceDescriptor.create(NAMESPACE).build()); } @AfterClass @@ -340,7 +340,7 @@ public class TestLoadIncrementalHFiles { int expectedRows = hfileIdx * 1000; if (preCreateTable || map != null) { - util.getHBaseAdmin().createTable(htd, tableSplitKeys); + util.getAdmin().createTable(htd, tableSplitKeys); } final TableName tableName = htd.getTableName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java index a0bac77a43e..c1d0329f54d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java @@ -246,7 +246,7 @@ public class TestLoadIncrementalHFilesSplitRecovery { * @throws IOException */ void assertExpectedTable(TableName table, int count, int value) throws IOException { - HTableDescriptor [] htds = util.getHBaseAdmin().listTables(table.getNameAsString()); + HTableDescriptor [] htds = util.getAdmin().listTables(table.getNameAsString()); assertEquals(htds.length, 1); Table t = null; try { @@ -637,7 +637,7 @@ public class TestLoadIncrementalHFilesSplitRecovery { */ void assertExpectedTable(final Connection connection, TableName table, int count, int value) throws IOException { - HTableDescriptor [] htds = util.getHBaseAdmin().listTables(table.getNameAsString()); + HTableDescriptor [] htds = util.getAdmin().listTables(table.getNameAsString()); assertEquals(htds.length, 1); Table t = null; try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java index 41e67808ce5..253e1183408 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableSnapshotInputFormat.java @@ -55,7 +55,7 @@ public class TestMultiTableSnapshotInputFormat extends MultiTableInputFormatTest // take a snapshot of every table we have. for (String tableName : TABLES) { SnapshotTestingUtils - .createSnapshotAndValidate(TEST_UTIL.getHBaseAdmin(), TableName.valueOf(tableName), + .createSnapshotAndValidate(TEST_UTIL.getAdmin(), TableName.valueOf(tableName), ImmutableList.of(MultiTableInputFormatTestBase.INPUT_FAMILY), null, snapshotNameForTable(tableName), FSUtils.getRootDir(TEST_UTIL.getConfiguration()), TEST_UTIL.getTestFileSystem(), true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java index 5e8c8cdcb0f..42010b40f8d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java @@ -177,7 +177,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa "Snapshot job should not use BucketCache.", 0, job.getConfiguration().getFloat("hbase.bucketcache.size", -1), 0.01); } finally { - UTIL.getHBaseAdmin().deleteSnapshot(snapshotName); + UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } @@ -212,7 +212,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa verifyWithMockedMapReduce(job, numRegions, expectedNumSplits, getStartRow(), getEndRow()); } finally { - util.getHBaseAdmin().deleteSnapshot(snapshotName); + util.getAdmin().deleteSnapshot(snapshotName); util.deleteTable(tableName); tearDownCluster(); } @@ -295,7 +295,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa Assert.assertTrue(job.waitForCompletion(true)); } finally { if (!shutdownCluster) { - util.getHBaseAdmin().deleteSnapshot(snapshotName); + util.getAdmin().deleteSnapshot(snapshotName); util.deleteTable(tableName); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java index 30ae944f5ba..8b7cdd72610 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java @@ -98,7 +98,7 @@ public class TestTimeRangeMapRed { @Before public void before() throws Exception { - this.admin = UTIL.getHBaseAdmin(); + this.admin = UTIL.getAdmin(); } private static class ProcessTimeRangeMapper diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java index f7f9abd4e5d..db728046a3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentListener.java @@ -208,7 +208,7 @@ public class TestAssignmentListener { @Test(timeout=60000) public void testAssignmentListener() throws IOException, InterruptedException { AssignmentManager am = TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); DummyAssignmentListener listener = new DummyAssignmentListener(); am.registerListener(listener); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java index 31e3af8d570..a458b44a8ed 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java @@ -128,7 +128,7 @@ public class TestAssignmentManagerMetrics { htd.addCoprocessorWithSpec(spec); try { - TEST_UTIL.getHBaseAdmin().modifyTable(TABLENAME, htd); + TEST_UTIL.getAdmin().modifyTable(TABLENAME, htd); fail("Expected region failed to open"); } catch (IOException e) { // expected, the RS will crash and the assignment will spin forever waiting for a RS diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java index e473b7525d4..ba88008b78a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java @@ -104,7 +104,7 @@ public class TestAssignmentManagerOnCluster { conf.setInt("hbase.master.ping.server.retry.sleep.interval", 1); TEST_UTIL.startMiniCluster(1, 4, null, MyMaster.class, MyRegionServer.class); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } @AfterClass @@ -200,7 +200,7 @@ public class TestAssignmentManagerOnCluster { // Region is assigned now. Let's assign it again. // Master should not abort, and region should be assigned. - TEST_UTIL.getHBaseAdmin().assign(hri.getRegionName()); + TEST_UTIL.getAdmin().assign(hri.getRegionName()); master.getAssignmentManager().waitForAssignment(hri); RegionState newState = regionStates.getRegionState(hri); assertTrue(newState.isOpened()); @@ -334,7 +334,7 @@ public class TestAssignmentManagerOnCluster { } assertTrue(destServerName != null && !destServerName.equals(serverName)); - TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(), + TEST_UTIL.getAdmin().move(hri.getEncodedNameAsBytes(), Bytes.toBytes(destServerName.getServerName())); long timeoutTime = System.currentTimeMillis() + 30000; @@ -366,7 +366,7 @@ public class TestAssignmentManagerOnCluster { public void testMoveRegionOfDeletedTable() throws Exception { TableName table = TableName.valueOf("testMoveRegionOfDeletedTable"); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); try { HRegionInfo hri = createTableAndGetOneRegion(table); @@ -736,7 +736,7 @@ public class TestAssignmentManagerOnCluster { am.regionOnline(hri, serverName); } am.getTableStateManager().setTableState(table, TableState.State.ENABLED); - TEST_UTIL.getHBaseAdmin().disableTable(table); + TEST_UTIL.getAdmin().disableTable(table); TEST_UTIL.deleteTable(table); } } @@ -1195,7 +1195,7 @@ public class TestAssignmentManagerOnCluster { // Closing region should just work fine admin.disableTable(table); assertTrue(regionStates.isRegionOffline(hri)); - List regions = TEST_UTIL.getHBaseAdmin().getOnlineRegions(serverName); + List regions = TEST_UTIL.getAdmin().getOnlineRegions(serverName); assertTrue(!regions.contains(hri)); } finally { MyRegionServer.simulateRetry = false; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java index 59ccbcf3cb5..ed29010fed3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java @@ -836,7 +836,7 @@ public class TestDistributedLogSplitting { makeWAL(hrs, regions, "table", "family", NUM_LOG_LINES, 100); LOG.info("Disabling table\n"); - TEST_UTIL.getHBaseAdmin().disableTable(TableName.valueOf("disableTable")); + TEST_UTIL.getAdmin().disableTable(TableName.valueOf("disableTable")); TEST_UTIL.waitTableDisabled(TableName.valueOf("disableTable").getName()); // abort RS @@ -955,7 +955,7 @@ public class TestDistributedLogSplitting { // move region in order for the region opened in recovering state final HRegionInfo hri = region; final HRegionServer tmpRS = dstRS; - TEST_UTIL.getHBaseAdmin().move(region.getEncodedNameAsBytes(), + TEST_UTIL.getAdmin().move(region.getEncodedNameAsBytes(), Bytes.toBytes(dstRS.getServerName().getServerName())); // wait for region move completes final RegionStates regionStates = @@ -1325,7 +1325,7 @@ public class TestDistributedLogSplitting { // after flush LOG.info("Verification after flush..."); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); r = ht.get(g); theStoredVal = Bytes.toLong(r.getValue(family, qualifier)); assertEquals(value, theStoredVal); @@ -1420,14 +1420,14 @@ public class TestDistributedLogSplitting { // after flush & compaction LOG.info("Verification after flush..."); - TEST_UTIL.getHBaseAdmin().flush(tableName); - TEST_UTIL.getHBaseAdmin().compact(tableName); + TEST_UTIL.getAdmin().flush(tableName); + TEST_UTIL.getAdmin().compact(tableName); // wait for compaction completes TEST_UTIL.waitFor(30000, 200, new Waiter.Predicate() { @Override public boolean evaluate() throws Exception { - return (TEST_UTIL.getHBaseAdmin() + return (TEST_UTIL.getAdmin() .getCompactionState(tableName) == CompactionState.NONE); } }); @@ -1497,7 +1497,7 @@ public class TestDistributedLogSplitting { // disable-enable cycle to get rid of table's dead regions left behind // by createMultiRegions LOG.debug("Disabling table\n"); - TEST_UTIL.getHBaseAdmin().disableTable(table); + TEST_UTIL.getAdmin().disableTable(table); LOG.debug("Waiting for no more RIT\n"); blockUntilNoRIT(zkw, master); NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); @@ -1508,7 +1508,7 @@ public class TestDistributedLogSplitting { } assertEquals(2 + existingRegions, regions.size()); LOG.debug("Enabling table\n"); - TEST_UTIL.getHBaseAdmin().enableTable(table); + TEST_UTIL.getAdmin().enableTable(table); LOG.debug("Waiting for no more RIT\n"); blockUntilNoRIT(zkw, master); LOG.debug("Verifying there are " + numRegions + " assigned on cluster\n"); @@ -1778,9 +1778,9 @@ public class TestDistributedLogSplitting { final HRegionServer destRS = hrs; // the RS doesn't have regions of the specified table so we need move one to this RS List tableRegions = - TEST_UTIL.getHBaseAdmin().getTableRegions(TableName.valueOf(tableName)); + TEST_UTIL.getAdmin().getTableRegions(TableName.valueOf(tableName)); final HRegionInfo hri = tableRegions.get(0); - TEST_UTIL.getHBaseAdmin().move(hri.getEncodedNameAsBytes(), + TEST_UTIL.getAdmin().move(hri.getEncodedNameAsBytes(), Bytes.toBytes(destRS.getServerName().getServerName())); // wait for region move completes final RegionStates regionStates = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java index 2c790878bff..5aa2176cbb4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java @@ -70,7 +70,7 @@ public class TestGetLastFlushedSequenceId { @Test public void test() throws IOException, InterruptedException { - testUtil.getHBaseAdmin().createNamespace( + testUtil.getAdmin().createNamespace( NamespaceDescriptor.create(tableName.getNamespaceAsString()).build()); Table table = testUtil.createTable(tableName, families); table.put(new Put(Bytes.toBytes("k")) @@ -94,7 +94,7 @@ public class TestGetLastFlushedSequenceId { // This will be the sequenceid just before that of the earliest edit in memstore. long storeSequenceId = ids.getStoreSequenceId(0).getSequenceId(); assertTrue(storeSequenceId > 0); - testUtil.getHBaseAdmin().flush(tableName); + testUtil.getAdmin().flush(tableName); Thread.sleep(2000); ids = testUtil.getHBaseCluster().getMaster() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java index 19a5d8a1540..36784de8cd0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java @@ -69,7 +69,7 @@ public class TestMaster { TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 3); // Start a cluster of two regionservers. TEST_UTIL.startMiniCluster(2); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } @AfterClass @@ -99,7 +99,7 @@ public class TestMaster { // Now trigger a split and stop when the split is in progress LOG.info("Splitting table"); - TEST_UTIL.getHBaseAdmin().split(TABLENAME); + TEST_UTIL.getAdmin().split(TABLENAME); LOG.info("Waiting for split result to be about to open"); RegionStates regionStates = m.getAssignmentManager().getRegionStates(); while (regionStates.getRegionsOfTable(TABLENAME).size() <= 1) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java index b62279e6e4b..d23c6f9cc91 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java @@ -76,7 +76,7 @@ public class TestMasterRestartAfterDisablingTable { log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); log("Disabling table\n"); - TEST_UTIL.getHBaseAdmin().disableTable(table); + TEST_UTIL.getAdmin().disableTable(table); NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); assertEquals( @@ -101,7 +101,7 @@ public class TestMasterRestartAfterDisablingTable { TableState.State.DISABLING)); log("Enabling table\n"); // Need a new Admin, the previous one is on the old master - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.enableTable(table); admin.close(); log("Waiting for no more RIT\n"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java index 9d79c6c1257..900d3d38ddd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java @@ -85,7 +85,7 @@ public class TestRollingRestart { log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); log("Disabling table\n"); - TEST_UTIL.getHBaseAdmin().disableTable(table); + TEST_UTIL.getAdmin().disableTable(table); log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); @@ -95,7 +95,7 @@ public class TestRollingRestart { } assertEquals(2, regions.size()); log("Enabling table\n"); - TEST_UTIL.getHBaseAdmin().enableTable(table); + TEST_UTIL.getAdmin().enableTable(table); log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); log("Verifying there are " + numRegions + " assigned on cluster\n"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java index cb7337edc6f..f33bc9815ae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java @@ -99,14 +99,14 @@ public class TestWarmupRegion { } // major compaction, purged future deletes - TEST_UTIL.getHBaseAdmin().flush(TABLENAME); - TEST_UTIL.getHBaseAdmin().majorCompact(TABLENAME); + TEST_UTIL.getAdmin().flush(TABLENAME); + TEST_UTIL.getAdmin().majorCompact(TABLENAME); // waiting for the major compaction to complete TEST_UTIL.waitFor(6000, new Waiter.Predicate() { @Override public boolean evaluate() throws IOException { - return TEST_UTIL.getHBaseAdmin().getCompactionState(TABLENAME) == + return TEST_UTIL.getAdmin().getCompactionState(TABLENAME) == CompactionState.NONE; } }); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java index 0aeec0ac89d..9c6b132ae87 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java @@ -137,7 +137,7 @@ public class TestSnapshotFromMaster { @After public void tearDown() throws Exception { UTIL.deleteTable(TABLE_NAME); - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); } @@ -273,7 +273,7 @@ public class TestSnapshotFromMaster { */ @Test(timeout = 300000) public void testSnapshotHFileArchiving() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // make sure we don't fail on listing snapshots SnapshotTestingUtils.assertNoSnapshots(admin); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java index f8bc6ab4452..ed28a0b9360 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java @@ -72,7 +72,7 @@ public class TestSimpleRegionNormalizerOnCluster { // Start a cluster of two regionservers. TEST_UTIL.startMiniCluster(1); TestNamespaceAuditor.waitForQuotaEnabled(TEST_UTIL); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java index efe63eaa881..fb2923a83a5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestAddColumnFamilyProcedure.java @@ -60,7 +60,7 @@ public class TestAddColumnFamilyProcedure extends TestTableDDLProcedureBase { tableName, cf1); // Test 2: Add a column family offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); long procId2 = procExec.submitProcedure( new AddColumnFamilyProcedure(procExec.getEnvironment(), tableName, columnDescriptor2)); // Wait the completion @@ -103,7 +103,7 @@ public class TestAddColumnFamilyProcedure extends TestTableDDLProcedureBase { ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); // Do the same add the existing column family - this time offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); long procId3 = procExec.submitProcedure( new AddColumnFamilyProcedure(procExec.getEnvironment(), tableName, columnDescriptor)); // Wait the completion @@ -125,7 +125,7 @@ public class TestAddColumnFamilyProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); // create the table MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f1", "f2", "f3"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java index 430443886a6..d8221bb17a2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCloneSnapshotProcedure.java @@ -56,7 +56,7 @@ public class TestCloneSnapshotProcedure extends TestTableDDLProcedureBase { @Override public void tearDown() throws Exception { super.tearDown(); - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); snapshot = null; } @@ -66,7 +66,7 @@ public class TestCloneSnapshotProcedure extends TestTableDDLProcedureBase { long tid = System.currentTimeMillis(); final byte[] snapshotName = Bytes.toBytes("snapshot-" + tid); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // create Table SnapshotTestingUtils.createTable(UTIL, snapshotTableName, getNumReplicas(), CF); // Load data diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java index b219bd00df2..995d98dacbc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java @@ -123,7 +123,7 @@ public class TestCreateNamespaceProcedure { @Test(timeout=60000) public void testCreateSystemNamespace() throws Exception { final NamespaceDescriptor nsd = - UTIL.getHBaseAdmin().getNamespaceDescriptor(NamespaceDescriptor.SYSTEM_NAMESPACE.getName()); + UTIL.getAdmin().getNamespaceDescriptor(NamespaceDescriptor.SYSTEM_NAMESPACE.getName()); final ProcedureExecutor procExec = getMasterProcedureExecutor(); long procId = procExec.submitProcedure( @@ -217,7 +217,7 @@ public class TestCreateNamespaceProcedure { // Validate the non-existence of namespace try { - NamespaceDescriptor nsDescriptor = UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + NamespaceDescriptor nsDescriptor = UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertNull(nsDescriptor); } catch (NamespaceNotFoundException nsnfe) { // Expected @@ -231,7 +231,7 @@ public class TestCreateNamespaceProcedure { private void validateNamespaceCreated(NamespaceDescriptor nsd) throws IOException { NamespaceDescriptor createdNsDescriptor = - UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertNotNull(createdNsDescriptor); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java index 89ffcb0c6e0..390eacd1127 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedure.java @@ -58,7 +58,7 @@ public class TestDeleteColumnFamilyProcedure extends TestTableDDLProcedureBase { tableName, cf1); // Test 2: delete the column family that exists offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); long procId2 = procExec.submitProcedure( new DeleteColumnFamilyProcedure(procExec.getEnvironment(), tableName, cf2.getBytes())); // Wait the completion @@ -101,7 +101,7 @@ public class TestDeleteColumnFamilyProcedure extends TestTableDDLProcedureBase { ProcedureTestingUtility.getExceptionCause(result) instanceof InvalidFamilyOperationException); // Try again, this time with table disabled. - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); long procId3 = procExec.submitProcedure( new DeleteColumnFamilyProcedure(procExec.getEnvironment(), tableName, cf2.getBytes())); // Wait the completion @@ -145,7 +145,7 @@ public class TestDeleteColumnFamilyProcedure extends TestTableDDLProcedureBase { // create the table MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f1", "f2", "f3", cf4); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java index fd17f3058d9..899d1142157 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java @@ -98,7 +98,7 @@ public class TestDeleteColumnFamilyProcedureFromClient { @Test public void deleteColumnFamilyWithMultipleRegions() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor beforehtd = admin.getTableDescriptor(TABLENAME); FileSystem fs = TEST_UTIL.getDFSCluster().getFileSystem(); @@ -176,7 +176,7 @@ public class TestDeleteColumnFamilyProcedureFromClient { @Test public void deleteColumnFamilyTwice() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor beforehtd = admin.getTableDescriptor(TABLENAME); String cfToDelete = "cf1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java index a34d6d774c0..72a437c19d3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java @@ -79,7 +79,7 @@ public class TestDeleteNamespaceProcedure { @After public void tearDown() throws Exception { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(getMasterProcedureExecutor(), false); - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } @@ -197,7 +197,7 @@ public class TestDeleteNamespaceProcedure { // Validate the namespace still exists NamespaceDescriptor createdNsDescriptor= - UTIL.getHBaseAdmin().getNamespaceDescriptor(namespaceName); + UTIL.getAdmin().getNamespaceDescriptor(namespaceName); assertNotNull(createdNsDescriptor); } @@ -218,7 +218,7 @@ public class TestDeleteNamespaceProcedure { public static void validateNamespaceNotExist(final String nsName) throws IOException { try { - NamespaceDescriptor nsDescriptor = UTIL.getHBaseAdmin().getNamespaceDescriptor(nsName); + NamespaceDescriptor nsDescriptor = UTIL.getAdmin().getNamespaceDescriptor(nsName); assertNull(nsDescriptor); } catch (NamespaceNotFoundException nsnfe) { // Expected diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java index c259bb643d0..61746a1156f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteTableProcedure.java @@ -70,7 +70,7 @@ public class TestDeleteTableProcedure extends TestTableDDLProcedureBase { HRegionInfo[] regions = MasterProcedureTestingUtility.createTable( procExec, tableName, null, "f"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); // delete the table (that exists) long procId1 = procExec.submitProcedure( @@ -114,7 +114,7 @@ public class TestDeleteTableProcedure extends TestTableDDLProcedureBase { private void testSimpleDelete(final TableName tableName, byte[][] splitKeys) throws Exception { HRegionInfo[] regions = MasterProcedureTestingUtility.createTable( getMasterProcedureExecutor(), tableName, splitKeys, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); // delete the table final ProcedureExecutor procExec = getMasterProcedureExecutor(); @@ -133,7 +133,7 @@ public class TestDeleteTableProcedure extends TestTableDDLProcedureBase { byte[][] splitKeys = null; HRegionInfo[] regions = MasterProcedureTestingUtility.createTable( getMasterProcedureExecutor(), tableName, splitKeys, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); final ProcedureExecutor procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.waitNoProcedureRunning(procExec); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java index b8b91b5ed62..c1b42a918ce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestEnableTableProcedure.java @@ -45,7 +45,7 @@ public class TestEnableTableProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); // Enable the table long procId = procExec.submitProcedure( @@ -99,7 +99,7 @@ public class TestEnableTableProcedure extends TestTableDDLProcedureBase { Bytes.toBytes("a"), Bytes.toBytes("b"), Bytes.toBytes("c") }; MasterProcedureTestingUtility.createTable(procExec, tableName, splitKeys, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); @@ -123,7 +123,7 @@ public class TestEnableTableProcedure extends TestTableDDLProcedureBase { Bytes.toBytes("a"), Bytes.toBytes("b"), Bytes.toBytes("c") }; MasterProcedureTestingUtility.createTable(procExec, tableName, splitKeys, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java index e4f42d64374..af48302be4e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java @@ -145,7 +145,7 @@ public class TestMasterFailoverWithProcedures { Path tableDir = FSUtils.getTableDir(getRootDir(), tableName); MasterProcedureTestingUtility.validateTableCreation( UTIL.getHBaseCluster().getMaster(), tableName, regions, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureExecutor procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, true); @@ -189,7 +189,7 @@ public class TestMasterFailoverWithProcedures { UTIL.getConnection(), tableName, 100, splitKeys, families); assertEquals(100, UTIL.countRows(tableName)); // disable the table - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureExecutor procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); @@ -203,7 +203,7 @@ public class TestMasterFailoverWithProcedures { UTIL.waitUntilAllRegionsAssigned(tableName); // validate the table regions and layout - regions = UTIL.getHBaseAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); + regions = UTIL.getAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); if (preserveSplits) { assertEquals(1 + splitKeys.length, regions.length); } else { @@ -280,7 +280,7 @@ public class TestMasterFailoverWithProcedures { }; MasterProcedureTestingUtility.createTable( getMasterProcedureExecutor(), tableName, splitKeys, "f1", "f2"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureExecutor procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java index 450714f0050..4eedc9a00c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java @@ -73,7 +73,7 @@ public class TestMasterProcedureEvents { @After public void tearDown() throws Exception { - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java index 77581854db9..74c4ad5ad4e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyColumnFamilyProcedure.java @@ -61,7 +61,7 @@ public class TestModifyColumnFamilyProcedure extends TestTableDDLProcedureBase { .getMaster(), tableName, cf1, columnDescriptor); // Test 2: modify the column family offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); columnDescriptor.setBlocksize(newBlockSize * 2); long procId2 = procExec.submitProcedure( new ModifyColumnFamilyProcedure(procExec.getEnvironment(), tableName, columnDescriptor)); @@ -110,7 +110,7 @@ public class TestModifyColumnFamilyProcedure extends TestTableDDLProcedureBase { // create the table MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f1", "f2", cf3); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java index 2c1708986df..1b53d23b8f7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java @@ -75,7 +75,7 @@ public class TestModifyNamespaceProcedure { @After public void tearDown() throws Exception { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(getMasterProcedureExecutor(), false); - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } @@ -97,7 +97,7 @@ public class TestModifyNamespaceProcedure { // Before modify NamespaceDescriptor currentNsDescriptor = - UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertEquals(currentNsDescriptor.getConfigurationValue(nsKey1), nsValue1before); assertNull(currentNsDescriptor.getConfigurationValue(nsKey2)); @@ -113,7 +113,7 @@ public class TestModifyNamespaceProcedure { // Verify the namespace is updated. currentNsDescriptor = - UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertEquals(nsd.getConfigurationValue(nsKey1), nsValue1after); assertEquals(currentNsDescriptor.getConfigurationValue(nsKey2), nsValue2); } @@ -124,7 +124,7 @@ public class TestModifyNamespaceProcedure { final ProcedureExecutor procExec = getMasterProcedureExecutor(); try { - NamespaceDescriptor nsDescriptor = UTIL.getHBaseAdmin().getNamespaceDescriptor(namespaceName); + NamespaceDescriptor nsDescriptor = UTIL.getAdmin().getNamespaceDescriptor(namespaceName); assertNull(nsDescriptor); } catch (NamespaceNotFoundException nsnfe) { // Expected @@ -218,7 +218,7 @@ public class TestModifyNamespaceProcedure { ProcedureTestingUtility.assertProcNotFailed(procExec, procId); // Validate NamespaceDescriptor currentNsDescriptor = - UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertEquals(currentNsDescriptor.getConfigurationValue(nsKey), nsValue); } @@ -246,7 +246,7 @@ public class TestModifyNamespaceProcedure { // Validate NamespaceDescriptor currentNsDescriptor = - UTIL.getHBaseAdmin().getNamespaceDescriptor(nsd.getName()); + UTIL.getAdmin().getNamespaceDescriptor(nsd.getName()); assertNull(currentNsDescriptor.getConfigurationValue(nsKey)); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java index 7ebb0757b6f..ea9bea28bc6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java @@ -45,10 +45,10 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); MasterProcedureTestingUtility.createTable(procExec, tableName, null, "cf"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); // Modify the table descriptor - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); // Test 1: Modify 1 property long newMaxFileSize = htd.getMaxFileSize() * 2; @@ -59,7 +59,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { procExec, new ModifyTableProcedure(procExec.getEnvironment(), htd)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId1)); - HTableDescriptor currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(newMaxFileSize, currentHtd.getMaxFileSize()); // Test 2: Modify multiple properties @@ -72,7 +72,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { procExec, new ModifyTableProcedure(procExec.getEnvironment(), htd)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId2)); - currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(newReadOnlyOption, currentHtd.isReadOnly()); assertEquals(newMemStoreFlushSize, currentHtd.getMemStoreFlushSize()); } @@ -83,28 +83,28 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); MasterProcedureTestingUtility.createTable(procExec, tableName, null, "cf1"); - HTableDescriptor currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(1, currentHtd.getFamiliesKeys().size()); // Test 1: Modify the table descriptor online String cf2 = "cf2"; - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); htd.addFamily(new HColumnDescriptor(cf2)); long procId = ProcedureTestingUtility.submitAndWait( procExec, new ModifyTableProcedure(procExec.getEnvironment(), htd)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId)); - currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(2, currentHtd.getFamiliesKeys().size()); assertTrue(currentHtd.hasFamily(cf2.getBytes())); // Test 2: Modify the table descriptor offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); String cf3 = "cf3"; HTableDescriptor htd2 = - new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); htd2.addFamily(new HColumnDescriptor(cf3)); long procId2 = @@ -112,7 +112,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { new ModifyTableProcedure(procExec.getEnvironment(), htd2)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId2)); - currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertTrue(currentHtd.hasFamily(cf3.getBytes())); assertEquals(3, currentHtd.getFamiliesKeys().size()); } @@ -126,27 +126,27 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); MasterProcedureTestingUtility.createTable(procExec, tableName, null, cf1, cf2, cf3); - HTableDescriptor currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(3, currentHtd.getFamiliesKeys().size()); // Test 1: Modify the table descriptor - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); htd.removeFamily(cf2.getBytes()); long procId = ProcedureTestingUtility.submitAndWait( procExec, new ModifyTableProcedure(procExec.getEnvironment(), htd)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId)); - currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(2, currentHtd.getFamiliesKeys().size()); assertFalse(currentHtd.hasFamily(cf2.getBytes())); // Test 2: Modify the table descriptor offline - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); HTableDescriptor htd2 = - new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); htd2.removeFamily(cf3.getBytes()); // Disable Sanity check htd2.setConfiguration("hbase.table.sanity.checks", Boolean.FALSE.toString()); @@ -156,13 +156,13 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { new ModifyTableProcedure(procExec.getEnvironment(), htd2)); ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId2)); - currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(1, currentHtd.getFamiliesKeys().size()); assertFalse(currentHtd.hasFamily(cf3.getBytes())); //Removing the last family will fail HTableDescriptor htd3 = - new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); htd3.removeFamily(cf1.getBytes()); long procId3 = ProcedureTestingUtility.submitAndWait(procExec, @@ -186,13 +186,13 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { // create the table HRegionInfo[] regions = MasterProcedureTestingUtility.createTable( procExec, tableName, null, "cf1", cf3); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); // Modify multiple properties of the table. - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true; htd.setCompactionEnabled(newCompactionEnableOption); htd.addFamily(new HColumnDescriptor(cf2)); @@ -208,7 +208,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { MasterProcedureTestingUtility.testRecoveryAndDoubleExecution(procExec, procId, numberOfSteps); // Validate descriptor - HTableDescriptor currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(newCompactionEnableOption, currentHtd.isCompactionEnabled()); assertEquals(2, currentHtd.getFamiliesKeys().size()); @@ -231,7 +231,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); // Modify multiple properties of the table. - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true; htd.setCompactionEnabled(newCompactionEnableOption); htd.addFamily(new HColumnDescriptor(cf2)); @@ -246,7 +246,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { MasterProcedureTestingUtility.testRecoveryAndDoubleExecution(procExec, procId, numberOfSteps); // Validate descriptor - HTableDescriptor currentHtd = UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName); assertEquals(newCompactionEnableOption, currentHtd.isCompactionEnabled()); assertEquals(2, currentHtd.getFamiliesKeys().size()); assertTrue(currentHtd.hasFamily(cf2.getBytes())); @@ -269,7 +269,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true; htd.setCompactionEnabled(newCompactionEnableOption); htd.addFamily(new HColumnDescriptor(familyName)); @@ -295,12 +295,12 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase { // create the table HRegionInfo[] regions = MasterProcedureTestingUtility.createTable( procExec, tableName, null, "cf1"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); - HTableDescriptor htd = new HTableDescriptor(UTIL.getHBaseAdmin().getTableDescriptor(tableName)); + HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName)); boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true; htd.setCompactionEnabled(newCompactionEnableOption); htd.addFamily(new HColumnDescriptor(familyName)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java index 62332543ef7..3652bdb26fe 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java @@ -80,7 +80,7 @@ public class TestProcedureAdmin { public void tearDown() throws Exception { assertTrue("expected executor to be running", getMasterProcedureExecutor().isRunning()); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(getMasterProcedureExecutor(), false); - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } @@ -118,7 +118,7 @@ public class TestProcedureAdmin { HRegionInfo[] regions = MasterProcedureTestingUtility.createTable(procExec, tableName, null, "f"); - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); ProcedureTestingUtility.waitNoProcedureRunning(procExec); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(procExec, true); // Submit an un-abortable procedure diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedure.java index 4b5ff89bcc8..8025ca6354c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestRestoreSnapshotProcedure.java @@ -79,7 +79,7 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { @Override public void tearDown() throws Exception { super.tearDown(); - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); } @@ -90,7 +90,7 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { private void setupSnapshotAndUpdateTable() throws Exception { long tid = System.currentTimeMillis(); final byte[] snapshotName = Bytes.toBytes("snapshot-" + tid); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); // create Table SnapshotTestingUtils.createTable(UTIL, snapshotTableName, getNumReplicas(), CF1, CF2); // Load data @@ -170,7 +170,7 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { final ProcedureExecutor procExec = getMasterProcedureExecutor(); try { - UTIL.getHBaseAdmin().enableTable(snapshotTableName); + UTIL.getAdmin().enableTable(snapshotTableName); long procId = ProcedureTestingUtility.submitAndWait( procExec, @@ -181,7 +181,7 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { assertTrue( ProcedureTestingUtility.getExceptionCause(result) instanceof TableNotDisabledException); } finally { - UTIL.getHBaseAdmin().disableTable(snapshotTableName); + UTIL.getAdmin().disableTable(snapshotTableName); } } @@ -205,9 +205,9 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { private void validateSnapshotRestore() throws IOException { try { - UTIL.getHBaseAdmin().enableTable(snapshotTableName); + UTIL.getAdmin().enableTable(snapshotTableName); - HTableDescriptor currentHTD = UTIL.getHBaseAdmin().getTableDescriptor(snapshotTableName); + HTableDescriptor currentHTD = UTIL.getAdmin().getTableDescriptor(snapshotTableName); assertTrue(currentHTD.hasFamily(CF1)); assertTrue(currentHTD.hasFamily(CF2)); assertFalse(currentHTD.hasFamily(CF3)); @@ -215,7 +215,7 @@ public class TestRestoreSnapshotProcedure extends TestTableDDLProcedureBase { assertEquals(currentHTD.getFamiliesKeys().size(), snapshotHTD.getFamiliesKeys().size()); SnapshotTestingUtils.verifyRowCount(UTIL, snapshotTableName, rowCountCF1 + rowCountCF2); } finally { - UTIL.getHBaseAdmin().disableTable(snapshotTableName); + UTIL.getAdmin().disableTable(snapshotTableName); } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitTableRegionProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitTableRegionProcedure.java index 9e75cb921fc..89774125608 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitTableRegionProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitTableRegionProcedure.java @@ -94,7 +94,7 @@ public class TestSplitTableRegionProcedure { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(getMasterProcedureExecutor(), false); // Turn off balancer so it doesn't cut in and mess up our placements. - UTIL.getHBaseAdmin().setBalancerRunning(false, true); + UTIL.getAdmin().setBalancerRunning(false, true); // Turn off the meta scanner so it don't remove parent on us. UTIL.getHBaseCluster().getMaster().setCatalogJanitorEnabled(false); } @@ -102,7 +102,7 @@ public class TestSplitTableRegionProcedure { @After public void tearDown() throws Exception { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(getMasterProcedureExecutor(), false); - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } @@ -233,12 +233,12 @@ public class TestSplitTableRegionProcedure { ProcedureTestingUtility.waitProcedure(procExec, procId); ProcedureTestingUtility.assertProcNotFailed(procExec, procId); - UTIL.getHBaseAdmin().majorCompact(tableName); + UTIL.getAdmin().majorCompact(tableName); // waiting for the major compaction to complete UTIL.waitFor(6000, new Waiter.Predicate() { @Override public boolean evaluate() throws IOException { - return UTIL.getHBaseAdmin().getCompactionState(tableName) == CompactionState.NONE; + return UTIL.getAdmin().getCompactionState(tableName) == CompactionState.NONE; } }); @@ -345,7 +345,7 @@ public class TestSplitTableRegionProcedure { p.addColumn(Bytes.toBytes(ColumnFamilyName2), Bytes.toBytes("q2"), Bytes.toBytes(i)); t.put(p); if (i % 5 == 0) { - UTIL.getHBaseAdmin().flush(tableName); + UTIL.getAdmin().flush(tableName); } } } @@ -360,7 +360,7 @@ public class TestSplitTableRegionProcedure { d = new Delete(Bytes.toBytes("" + i)); t.delete(d); if (i % 5 == 0) { - UTIL.getHBaseAdmin().flush(tableName); + UTIL.getAdmin().flush(tableName); } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java index a0b69b96902..f453a67fc7f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java @@ -62,7 +62,7 @@ public abstract class TestTableDDLProcedureBase { @After public void tearDown() throws Exception { resetProcExecutorTestingKillFlag(); - for (HTableDescriptor htd: UTIL.getHBaseAdmin().listTables()) { + for (HTableDescriptor htd: UTIL.getAdmin().listTables()) { LOG.info("Tear down, remove table=" + htd.getTableName()); UTIL.deleteTable(htd.getTableName()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java index 417987bf2b2..77e1fc9b1ae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java @@ -83,7 +83,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testModifyTable() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with one family HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); baseHtd.addFamily(new HColumnDescriptor(FAMILY_0)); @@ -106,7 +106,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testAddColumn() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with two families HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); baseHtd.addFamily(new HColumnDescriptor(FAMILY_0)); @@ -126,7 +126,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testAddSameColumnFamilyTwice() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with one families HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); baseHtd.addFamily(new HColumnDescriptor(FAMILY_0)); @@ -155,7 +155,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testModifyColumnFamily() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HColumnDescriptor cfDescriptor = new HColumnDescriptor(FAMILY_0); int blockSize = cfDescriptor.getBlocksize(); @@ -184,7 +184,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testModifyNonExistingColumnFamily() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HColumnDescriptor cfDescriptor = new HColumnDescriptor(FAMILY_1); int blockSize = cfDescriptor.getBlocksize(); @@ -215,7 +215,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testDeleteColumn() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with two families HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); baseHtd.addFamily(new HColumnDescriptor(FAMILY_0)); @@ -236,7 +236,7 @@ public class TestTableDescriptorModificationFromClient { @Test public void testDeleteSameColumnFamilyTwice() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Create a table with two families HTableDescriptor baseHtd = new HTableDescriptor(TABLE_NAME); baseHtd.addFamily(new HColumnDescriptor(FAMILY_0)); @@ -265,7 +265,7 @@ public class TestTableDescriptorModificationFromClient { private void verifyTableDescriptor(final TableName tableName, final byte[]... families) throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); // Verify descriptor from master HTableDescriptor htd = admin.getTableDescriptor(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java index 7d88a85f136..56b8175482e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTruncateTableProcedure.java @@ -99,7 +99,7 @@ public class TestTruncateTableProcedure extends TestTableDDLProcedureBase { UTIL.getConnection(), tableName, 100, splitKeys, families); assertEquals(100, UTIL.countRows(tableName)); // disable the table - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); // truncate the table final ProcedureExecutor procExec = getMasterProcedureExecutor(); @@ -110,7 +110,7 @@ public class TestTruncateTableProcedure extends TestTableDDLProcedureBase { UTIL.waitUntilAllRegionsAssigned(tableName); // validate the table regions and layout - regions = UTIL.getHBaseAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); + regions = UTIL.getAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); if (preserveSplits) { assertEquals(1 + splitKeys.length, regions.length); } else { @@ -155,7 +155,7 @@ public class TestTruncateTableProcedure extends TestTableDDLProcedureBase { UTIL.getConnection(), tableName, 100, splitKeys, families); assertEquals(100, UTIL.countRows(tableName)); // disable the table - UTIL.getHBaseAdmin().disableTable(tableName); + UTIL.getAdmin().disableTable(tableName); final ProcedureExecutor procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.waitNoProcedureRunning(procExec); @@ -174,7 +174,7 @@ public class TestTruncateTableProcedure extends TestTableDDLProcedureBase { UTIL.waitUntilAllRegionsAssigned(tableName); // validate the table regions and layout - regions = UTIL.getHBaseAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); + regions = UTIL.getAdmin().getTableRegions(tableName).toArray(new HRegionInfo[0]); if (preserveSplits) { assertEquals(1 + splitKeys.length, regions.length); } else { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java index e74b3de3ab6..5efb5091410 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java @@ -83,7 +83,7 @@ public class TestExpiredMobFileCleaner { hcd.setMaxVersions(4); desc.addFamily(hcd); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getBufferedMutator(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java index 1f8bcb27bc5..d9fc9f669a8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java @@ -72,7 +72,7 @@ public class TestMobDataBlockEncoding { hcd.setMaxVersions(4); hcd.setDataBlockEncoding(encoding); desc.addFamily(hcd); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getTable(TableName.valueOf(TN)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/compactions/TestMobCompactor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/compactions/TestMobCompactor.java index 1630e2d5fa7..0739271389c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/compactions/TestMobCompactor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/compactions/TestMobCompactor.java @@ -133,7 +133,7 @@ public class TestMobCompactor { conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration(), pool); fs = TEST_UTIL.getTestFileSystem(); conf = TEST_UTIL.getConfiguration(); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java index f8a1a932d7c..0190b8fcc95 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java @@ -114,7 +114,7 @@ public class TestNamespaceAuditor { RegionServerObserver.class); UTIL.startMiniCluster(1, 1); waitForQuotaEnabled(UTIL); - ADMIN = UTIL.getHBaseAdmin(); + ADMIN = UTIL.getAdmin(); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java index cbcc166da40..b52a8d6b1e2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java @@ -61,7 +61,7 @@ public class TestProcedureManager { @Test public void testSimpleProcedureManager() throws IOException { - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); byte[] result = admin.execProcedureWithRet(SimpleMasterProcedureManager.SIMPLE_SIGNATURE, "mytest", new HashMap()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java index d6e8952813a..ef26c252696 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java @@ -67,7 +67,7 @@ public class TestQuotaAdmin { @Test public void testThrottleType() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); String userName = User.getCurrent().getShortName(); admin.setQuota(QuotaSettingsFactory @@ -115,7 +115,7 @@ public class TestQuotaAdmin { @Test public void testSimpleScan() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); String userName = User.getCurrent().getShortName(); admin.setQuota(QuotaSettingsFactory @@ -156,7 +156,7 @@ public class TestQuotaAdmin { @Test public void testQuotaRetrieverFilter() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); TableName[] tables = new TableName[] { TableName.valueOf("T0"), TableName.valueOf("T01"), TableName.valueOf("NS0:T2"), }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java index 0c065887595..91c2d80f554 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java @@ -115,7 +115,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserGlobalThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); // Add 6req/min limit @@ -139,7 +139,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserGlobalReadAndWriteThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); // Add 6req/min limit for read request @@ -171,7 +171,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserTableThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); // Add 6req/min limit @@ -196,7 +196,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserTableReadAndWriteThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); // Add 6req/min limit for write request on tables[0] @@ -237,7 +237,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserNamespaceThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); final String NAMESPACE = "default"; @@ -262,7 +262,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserNamespaceReadAndWriteThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); final String NAMESPACE = "default"; @@ -295,7 +295,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testTableGlobalThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); // Add 6req/min limit admin.setQuota(QuotaSettingsFactory @@ -319,7 +319,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testTableGlobalReadAndWriteThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); // Add 6req/min limit for read request admin.setQuota(QuotaSettingsFactory @@ -356,7 +356,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testNamespaceGlobalThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String NAMESPACE = "default"; // Add 6req/min limit @@ -378,7 +378,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testNamespaceGlobalReadAndWriteThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String NAMESPACE = "default"; // Add 6req/min limit for write request @@ -409,7 +409,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserAndTableThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); // Add 6req/min limit for the user on tables[0] @@ -458,7 +458,7 @@ public class TestQuotaThrottle { @Test(timeout=60000) public void testUserGlobalBypassThrottle() throws Exception { - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); final String userName = User.getCurrent().getShortName(); final String NAMESPACE = "default"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java index 6c851de9ede..c7b6c7c4bbd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java @@ -105,7 +105,7 @@ public class TestCompactSplitThread { HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(family)); htd.setCompactionEnabled(false); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(tableName); HRegionServer regionServer = TEST_UTIL.getRSForFirstRegionInTable(tableName); @@ -155,8 +155,6 @@ public class TestCompactSplitThread { @Test(timeout = 60000) public void testFlushWithTableCompactionDisabled() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); - HTableDescriptor htd = new HTableDescriptor(tableName); htd.setCompactionEnabled(false); TEST_UTIL.createTable(htd, new byte[][] { family }, null); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java index d6302b3a5ac..9e83afbda9c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java @@ -89,7 +89,7 @@ public class TestCompactionState { Table ht = null; try { ht = TEST_UTIL.createTable(table, family); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); try { admin.compact(table, fakecf); } catch (IOException ioe) { @@ -137,7 +137,7 @@ public class TestCompactionState { int countBefore = countStoreFilesInFamilies(regions, families); int countBeforeSingleFamily = countStoreFilesInFamily(regions, family); assertTrue(countBefore > 0); // there should be some data files - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (expectedState == CompactionState.MINOR) { if (singleFamily) { admin.compact(table, family); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java index fe2cb44975e..b0f3468ac96 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java @@ -93,7 +93,7 @@ public class TestDeleteMobTable { table.put(put); // create an hfile - TEST_UTIL.getHBaseAdmin().flush(htd.getTableName()); + TEST_UTIL.getAdmin().flush(htd.getTableName()); } catch (IOException e) { table.close(); throw e; @@ -121,7 +121,7 @@ public class TestDeleteMobTable { TEST_UTIL.deleteTable(tn); } - Assert.assertFalse(TEST_UTIL.getHBaseAdmin().tableExists(tn)); + Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tn)); Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString())); Assert.assertEquals(1, countArchiveMobFiles(tn, hcd.getNameAsString())); Assert.assertTrue(mobArchiveExist(tn, hcd.getNameAsString(), fileName)); @@ -145,7 +145,7 @@ public class TestDeleteMobTable { TEST_UTIL.deleteTable(tn); } - Assert.assertFalse(TEST_UTIL.getHBaseAdmin().tableExists(tn)); + Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tn)); Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString())); Assert.assertEquals(0, countArchiveMobFiles(tn, hcd.getNameAsString())); Assert.assertFalse(mobTableDirExist(tn)); @@ -167,7 +167,7 @@ public class TestDeleteMobTable { Assert.assertFalse(mobArchiveExist(tn, hcd.getNameAsString(), fileName)); Assert.assertTrue(mobTableDirExist(tn)); - TEST_UTIL.getHBaseAdmin().deleteColumnFamily(tn, FAMILY); + TEST_UTIL.getAdmin().deleteColumnFamily(tn, FAMILY); Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString())); Assert.assertEquals(1, countArchiveMobFiles(tn, hcd.getNameAsString())); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java index cee64e07a39..a5134cef108 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java @@ -118,11 +118,11 @@ public class TestEncryptionKeyRotation { hcd.setEncryptionKey(EncryptionUtil.wrapKey(conf, conf.get(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY, User.getCurrent().getShortName()), secondCFKey)); - TEST_UTIL.getHBaseAdmin().modifyColumnFamily(htd.getTableName(), hcd); + TEST_UTIL.getAdmin().modifyColumnFamily(htd.getTableName(), hcd); Thread.sleep(5000); // Need a predicate for online schema change // And major compact - TEST_UTIL.getHBaseAdmin().majorCompact(htd.getTableName()); + TEST_UTIL.getAdmin().majorCompact(htd.getTableName()); final List updatePaths = findCompactedStorefilePaths(htd.getTableName()); TEST_UTIL.waitFor(30000, 1000, true, new Predicate() { @Override @@ -261,7 +261,7 @@ public class TestEncryptionKeyRotation { private void createTableAndFlush(HTableDescriptor htd) throws Exception { HColumnDescriptor hcd = htd.getFamilies().iterator().next(); // Create the test table - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(htd.getName(), 5000); // Create a store file Table table = TEST_UTIL.getConnection().getTable(htd.getTableName()); @@ -271,7 +271,7 @@ public class TestEncryptionKeyRotation { } finally { table.close(); } - TEST_UTIL.getHBaseAdmin().flush(htd.getTableName()); + TEST_UTIL.getAdmin().flush(htd.getTableName()); } private static byte[] extractHFileKey(Path path) throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java index ad7cf2fb2a5..760bdacc884 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java @@ -100,7 +100,7 @@ public class TestEncryptionRandomKeying { TEST_UTIL.startMiniCluster(1); // Create the test table - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(htd.getName(), 5000); // Create a store file @@ -111,7 +111,7 @@ public class TestEncryptionRandomKeying { } finally { table.close(); } - TEST_UTIL.getHBaseAdmin().flush(htd.getTableName()); + TEST_UTIL.getAdmin().flush(htd.getTableName()); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java index c7226211172..cb4f1c358e2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java @@ -140,7 +140,7 @@ public class TestEndToEndSplitTransaction { this.table = table; this.tableName = table.getName(); this.family = table.getTableDescriptor().getFamiliesKeys().iterator().next(); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0); connection = TEST_UTIL.getConnection(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java index 55f882a1f7c..920f1726b0f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java @@ -189,7 +189,7 @@ public class TestFSErrorsExposed { TableName tableName = TableName.valueOf("table"); byte[] fam = Bytes.toBytes("fam"); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(new HColumnDescriptor(fam) .setMaxVersions(1) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java index ce123f9704a..cc970b7704a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java @@ -338,7 +338,7 @@ public class TestHRegionServerBulkLoad { htd.addFamily(new HColumnDescriptor(family(i))); } - UTIL.getHBaseAdmin().createTable(htd); + UTIL.getAdmin().createTable(htd); } catch (TableExistsException tee) { LOG.info("Table " + table + " already exists"); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java index 67c5f513ebf..3f42276c144 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java @@ -95,7 +95,7 @@ public class TestJoinedScanners { hcd.setDataBlockEncoding(blockEncoding); desc.addFamily(hcd); } - htu.getHBaseAdmin().createTable(desc); + htu.getAdmin().createTable(desc); Table ht = htu.getConnection().getTable(tableName); long rows_to_insert = 1000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java index c93c9194f57..965bb9ee2b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java @@ -95,7 +95,7 @@ public class TestMobStoreScanner { hcd.setMobThreshold(threshold); hcd.setMaxVersions(4); desc.addFamily(hcd); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) .getTable(tn); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java index 839e5e514e0..dc87d2f6f70 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java @@ -339,7 +339,7 @@ public class TestPerColumnFamilyFlush { final int numRegionServers = 4; try { TEST_UTIL.startMiniCluster(numRegionServers); - TEST_UTIL.getHBaseAdmin().createNamespace( + TEST_UTIL.getAdmin().createNamespace( NamespaceDescriptor.create(TABLENAME.getNamespaceAsString()).build()); Table table = TEST_UTIL.createTable(TABLENAME, FAMILIES); HTableDescriptor htd = table.getTableDescriptor(); @@ -581,9 +581,9 @@ public class TestPerColumnFamilyFlush { int cf3StoreFileCount1 = -1; try { TEST_UTIL.startMiniCluster(1); - TEST_UTIL.getHBaseAdmin().createNamespace( + TEST_UTIL.getAdmin().createNamespace( NamespaceDescriptor.create(TABLENAME.getNamespaceAsString()).build()); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(TABLENAME); Connection conn = ConnectionFactory.createConnection(conf); Table table = conn.getTable(TABLENAME); @@ -605,9 +605,9 @@ public class TestPerColumnFamilyFlush { conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN, 0); try { TEST_UTIL.startMiniCluster(1); - TEST_UTIL.getHBaseAdmin().createNamespace( + TEST_UTIL.getAdmin().createNamespace( NamespaceDescriptor.create(TABLENAME.getNamespaceAsString()).build()); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); Connection conn = ConnectionFactory.createConnection(conf); Table table = conn.getTable(TABLENAME); doPut(table, memstoreFlushSize); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java index b5c7c40f595..dae223346c6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java @@ -26,6 +26,8 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang.math.RandomUtils; @@ -47,7 +49,6 @@ import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.client.Admin; -import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionReplicaUtil; import org.apache.hadoop.hbase.client.Result; @@ -321,7 +322,8 @@ public class TestRegionMergeTransactionOnCluster { public void testMerge() throws Exception { LOG.info("Starting testMerge"); final TableName tableName = TableName.valueOf("testMerge"); - final HBaseAdmin hbaseAdmin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); + final int syncWaitTimeout = 10 * 60000; // 10min try { // Create table and load data. @@ -334,18 +336,19 @@ public class TestRegionMergeTransactionOnCluster { regionStates.regionOffline(a); try { // Merge offline region. Region a is offline here - hbaseAdmin.mergeRegionsSync(a.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), false); + admin.mergeRegionsAsync(a.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), false) + .get(syncWaitTimeout, TimeUnit.MILLISECONDS); fail("Offline regions should not be able to merge"); - } catch (IOException ie) { + } catch (ExecutionException ie) { System.out.println(ie); assertTrue("Exception should mention regions not online", - StringUtils.stringifyException(ie).contains("regions not online") - && ie instanceof MergeRegionException); + StringUtils.stringifyException(ie.getCause()).contains("regions not online") + && ie.getCause() instanceof MergeRegionException); } try { // Merge the same region: b and b. - hbaseAdmin.mergeRegionsSync(b.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), true); + admin.mergeRegionsAsync(b.getEncodedNameAsBytes(), b.getEncodedNameAsBytes(), true); fail("A region should not be able to merge with itself, even forcifully"); } catch (IOException ie) { assertTrue("Exception should mention regions not online", @@ -355,7 +358,7 @@ public class TestRegionMergeTransactionOnCluster { try { // Merge unknown regions - hbaseAdmin.mergeRegionsSync(Bytes.toBytes("-f1"), Bytes.toBytes("-f2"), true); + admin.mergeRegionsAsync(Bytes.toBytes("-f1"), Bytes.toBytes("-f2"), true); fail("Unknown region could not be merged"); } catch (IOException ie) { assertTrue("UnknownRegionException should be thrown", diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java index 2496e2b8c65..abe6c6ce02e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java @@ -118,7 +118,7 @@ public class TestRegionReplicaFailover { htd = HTU.createTableDescriptor( name.getMethodName().substring(0, name.getMethodName().length()-3)); htd.setRegionReplication(3); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); } @After @@ -159,8 +159,8 @@ public class TestRegionReplicaFailover { HTU.loadNumericRows(table, fam, 0, 1000); - HTU.getHBaseAdmin().disableTable(htd.getTableName()); - HTU.getHBaseAdmin().enableTable(htd.getTableName()); + HTU.getAdmin().disableTable(htd.getTableName()); + HTU.getAdmin().enableTable(htd.getTableName()); HTU.verifyNumericRows(table, fam, 0, 1000, 1); } @@ -357,7 +357,7 @@ public class TestRegionReplicaFailover { byte[] startKey = Bytes.toBytes("aaa"); byte[] endKey = Bytes.toBytes("zzz"); byte[][] splits = HTU.getRegionSplitStartKeys(startKey, endKey, numRegions); - HTU.getHBaseAdmin().createTable(htd, startKey, endKey, numRegions); + HTU.getAdmin().createTable(htd, startKey, endKey, numRegions); try (Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Table table = connection.getTable(htd.getTableName())) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java index 15766f5889d..e6b1bc502f2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java @@ -94,7 +94,7 @@ public class TestRegionServerMetrics { TEST_UTIL.startMiniCluster(1, 1); cluster = TEST_UTIL.getHBaseCluster(); cluster.waitForActiveAndReadyMaster(); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); connection = TEST_UTIL.getConnection(); while (cluster.getLiveRegionServerThreads().isEmpty() && @@ -276,7 +276,7 @@ public class TestRegionServerMetrics { public void testStoreCount() throws Exception { //Force a hfile. doNPuts(1, false); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); metricsRegionServer.getRegionServerWrapper().forceRecompute(); assertGauge("storeCount", 1); @@ -287,7 +287,7 @@ public class TestRegionServerMetrics { public void testStoreFileAge() throws Exception { //Force a hfile. doNPuts(1, false); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); metricsRegionServer.getRegionServerWrapper().forceRecompute(); assertTrue(metricsHelper.getGaugeLong("maxStoreFileAge", serverSource) > 0); @@ -525,7 +525,7 @@ public class TestRegionServerMetrics { public void testAverageRegionSize() throws Exception { //Force a hfile. doNPuts(1, false); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); metricsRegionServer.getRegionServerWrapper().forceRecompute(); assertTrue(metricsHelper.getGaugeDouble("averageRegionSize", serverSource) > 0.0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java index 9e1a61e35a5..755e8e3f26d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java @@ -76,7 +76,7 @@ public class TestRemoveRegionMetrics { TableName tableName = TableName.valueOf(tableNameString); Table t = TEST_UTIL.createTable(tableName, Bytes.toBytes("D")); TEST_UTIL.waitUntilAllRegionsAssigned(t.getName()); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HRegionInfo regionInfo; byte[] row = Bytes.toBytes("r1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java index 909ae7143e4..8a31af8f6e9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java @@ -78,7 +78,7 @@ public class TestSCVFWithMiniCluster { util.startMiniCluster(1); - Admin admin = util.getHBaseAdmin(); + Admin admin = util.getAdmin(); destroy(admin, HBASE_TABLE_NAME); create(admin, HBASE_TABLE_NAME, FAMILY_A, FAMILY_B); admin.close(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java index 623d75b3db3..a15cbb37e76 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java @@ -72,7 +72,7 @@ public class TestScannerWithBulkload { public void testBulkLoad() throws Exception { TableName tableName = TableName.valueOf("testBulkLoad"); long l = System.currentTimeMillis(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); createTable(admin, tableName); Scan scan = createScan(); final Table table = init(admin, l, scan, tableName); @@ -210,7 +210,7 @@ public class TestScannerWithBulkload { public void testBulkLoadWithParallelScan() throws Exception { final TableName tableName = TableName.valueOf("testBulkLoadWithParallelScan"); final long l = System.currentTimeMillis(); - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); createTable(admin, tableName); Scan scan = createScan(); final Table table = init(admin, l, scan, tableName); @@ -252,7 +252,7 @@ public class TestScannerWithBulkload { public void testBulkLoadNativeHFile() throws Exception { TableName tableName = TableName.valueOf("testBulkLoadNativeHFile"); long l = System.currentTimeMillis(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); createTable(admin, tableName); Scan scan = createScan(); final Table table = init(admin, l, scan, tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java index 043473a44d4..0b0e68396cd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java @@ -128,7 +128,7 @@ public class TestSplitTransactionOnCluster { @Before public void setup() throws IOException { TESTING_UTIL.ensureSomeNonStoppedRegionServersAvailable(NB_SERVERS); - this.admin = TESTING_UTIL.getHBaseAdmin(); + this.admin = TESTING_UTIL.getAdmin(); this.cluster = TESTING_UTIL.getMiniHBaseCluster(); } @@ -517,7 +517,7 @@ public class TestSplitTransactionOnCluster { HMaster master = abortAndWaitForMaster(); - this.admin = TESTING_UTIL.getHBaseAdmin(); + this.admin = TESTING_UTIL.getAdmin(); // Update the region to be offline and split, so that HRegionInfo#equals // returns true in checking rebuilt region states map. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java index 1c1a98bf2db..db0803c4cba 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java @@ -81,7 +81,7 @@ public class TestSplitWalDataLoss { testUtil.getConfiguration().setInt("hbase.regionserver.msginterval", 30000); testUtil.getConfiguration().setBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false); testUtil.startMiniCluster(2); - Admin admin = testUtil.getHBaseAdmin(); + Admin admin = testUtil.getAdmin(); admin.createNamespace(namespace); admin.createTable(new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(family))); testUtil.waitTableAvailable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java index f8107d61929..32c7845bcee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java @@ -117,7 +117,7 @@ public class TestTags { // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE); colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE); desc.addFamily(colDesc); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(desc); byte[] value = Bytes.toBytes("value"); table = TEST_UTIL.getConnection().getTable(tableName); @@ -183,7 +183,7 @@ public class TestTags { // colDesc.setDataBlockEncoding(DataBlockEncoding.NONE); colDesc.setDataBlockEncoding(DataBlockEncoding.PREFIX_TREE); desc.addFamily(colDesc); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(desc); table = TEST_UTIL.getConnection().getTable(tableName); @@ -275,7 +275,7 @@ public class TestTags { colDesc.setBlockCacheEnabled(true); colDesc.setDataBlockEncoding(encoding); desc.addFamily(colDesc); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); admin.createTable(desc); try { table = TEST_UTIL.getConnection().getTable(tableName); @@ -387,7 +387,7 @@ public class TestTags { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor colDesc = new HColumnDescriptor(f); desc.addFamily(colDesc); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); Table table = null; try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java index f3cfc396624..74b915e2cd0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.regionserver.DefaultStoreEngine; @@ -78,7 +78,7 @@ public class TestFIFOCompactionPolicy { } private Store prepareData() throws IOException { - HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { admin.disableTable(tableName); admin.deleteTable(tableName); @@ -131,7 +131,7 @@ public class TestFIFOCompactionPolicy { try { Store store = prepareData(); assertEquals(10, store.getStorefilesCount()); - TEST_UTIL.getHBaseAdmin().majorCompact(tableName); + TEST_UTIL.getAdmin().majorCompact(tableName); while (store.getStorefilesCount() > 1) { Thread.sleep(100); } @@ -148,7 +148,7 @@ public class TestFIFOCompactionPolicy { conf.setInt(HStore.BLOCKING_STOREFILES_KEY, 10000); TEST_UTIL.startMiniCluster(1); - HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-TTL"); if (admin.tableExists(tableName)) { admin.disableTable(tableName); @@ -177,7 +177,7 @@ public class TestFIFOCompactionPolicy { conf.setInt(HStore.BLOCKING_STOREFILES_KEY, 10000); TEST_UTIL.startMiniCluster(1); - HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-MinVersion"); if (admin.tableExists(tableName)) { admin.disableTable(tableName); @@ -208,7 +208,7 @@ public class TestFIFOCompactionPolicy { conf.setInt(HStore.BLOCKING_STOREFILES_KEY, 10); TEST_UTIL.startMiniCluster(1); - HBaseAdmin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); TableName tableName = TableName.valueOf(getClass().getSimpleName() + "-BlockingStoreFiles"); if (admin.tableExists(tableName)) { admin.disableTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java index 41975eb578b..5a2ac6f2042 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java @@ -84,7 +84,7 @@ public class TestCompactionWithThroughputController { } private Store prepareData() throws IOException { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { admin.disableTable(tableName); admin.deleteTable(tableName); @@ -124,7 +124,7 @@ public class TestCompactionWithThroughputController { Store store = prepareData(); assertEquals(10, store.getStorefilesCount()); long startTime = System.currentTimeMillis(); - TEST_UTIL.getHBaseAdmin().majorCompact(tableName); + TEST_UTIL.getAdmin().majorCompact(tableName); while (store.getStorefilesCount() != 1) { Thread.sleep(20); } @@ -153,7 +153,7 @@ public class TestCompactionWithThroughputController { Store store = prepareData(); assertEquals(10, store.getStorefilesCount()); long startTime = System.currentTimeMillis(); - TEST_UTIL.getHBaseAdmin().majorCompact(tableName); + TEST_UTIL.getAdmin().majorCompact(tableName); while (store.getStorefilesCount() != 1) { Thread.sleep(20); } @@ -202,7 +202,7 @@ public class TestCompactionWithThroughputController { HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(family)); htd.setCompactionEnabled(false); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(tableName); HRegionServer regionServer = TEST_UTIL.getRSForFirstRegionInTable(tableName); PressureAwareCompactionThroughputController throughputController = @@ -259,7 +259,7 @@ public class TestCompactionWithThroughputController { HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(family)); htd.setCompactionEnabled(false); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(tableName); HStore store = (HStore) getStoreWithName(tableName); assertEquals(0, store.getStorefilesCount()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java index f328b1c7d93..fb11756de8c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java @@ -110,7 +110,7 @@ public class TestFlushWithThroughputController { table.put(new Put(Bytes.toBytes(i * 10 + j)).addColumn(family, qualifier, value)); } long startTime = System.nanoTime(); - hbtu.getHBaseAdmin().flush(tableName); + hbtu.getAdmin().flush(tableName); duration += System.nanoTime() - startTime; } Store store = getStoreWithName(tableName); @@ -159,7 +159,7 @@ public class TestFlushWithThroughputController { HTableDescriptor htd = new HTableDescriptor(tableName); htd.addFamily(new HColumnDescriptor(family)); htd.setCompactionEnabled(false); - hbtu.getHBaseAdmin().createTable(htd); + hbtu.getAdmin().createTable(htd); hbtu.waitTableAvailable(tableName); HRegionServer regionServer = hbtu.getRSForFirstRegionInTable(tableName); PressureAwareFlushThroughputController throughputController = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java index a4acc4f765a..c3fafb6a00e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java @@ -119,7 +119,7 @@ public abstract class AbstractTestLogRolling { cluster = TEST_UTIL.getHBaseCluster(); dfsCluster = TEST_UTIL.getDFSCluster(); fs = TEST_UTIL.getTestFileSystem(); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); // disable region rebalancing (interferes with log watching) cluster.getMaster().balanceSwitch(false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java index ceefc987274..40a7f5cf457 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java @@ -257,7 +257,7 @@ public abstract class AbstractTestWALReplay { throws InterruptedException, MasterNotRunningException, ZooKeeperConnectionException, IOException { HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster(); - TEST_UTIL.getHBaseAdmin().move( + TEST_UTIL.getAdmin().move( destRegion.getRegionInfo().getEncodedNameAsBytes(), Bytes.toBytes(destServer.getServerName().getServerName())); while (true) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java index 9851815ac33..aec0a4724d2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java @@ -104,7 +104,7 @@ public class TestLogRollAbort { cluster = TEST_UTIL.getHBaseCluster(); dfsCluster = TEST_UTIL.getDFSCluster(); - admin = TEST_UTIL.getHBaseAdmin(); + admin = TEST_UTIL.getAdmin(); conf = TEST_UTIL.getConfiguration(); fs = TEST_UTIL.getDFSCluster().getFileSystem(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java index c1a9e2527dd..c1b6f4a3c48 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java @@ -508,7 +508,7 @@ public class TestMasterReplication { private void createTableOnClusters(HTableDescriptor table) throws Exception { for (HBaseTestingUtility utility : utilities) { - utility.getHBaseAdmin().createTable(table); + utility.getAdmin().createTable(table); } } @@ -691,7 +691,7 @@ public class TestMasterReplication { private void rollWALAndWait(final HBaseTestingUtility utility, final TableName table, final byte[] row) throws IOException { - final Admin admin = utility.getHBaseAdmin(); + final Admin admin = utility.getAdmin(); final MiniHBaseCluster cluster = utility.getMiniHBaseCluster(); // find the region that corresponds to the given row. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java index 29e7d67c58d..6af5d8d295f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java @@ -136,9 +136,9 @@ public class TestMultiSlaveReplication { utility3.startMiniCluster(); ReplicationAdmin admin1 = new ReplicationAdmin(conf1); - utility1.getHBaseAdmin().createTable(table); - utility2.getHBaseAdmin().createTable(table); - utility3.getHBaseAdmin().createTable(table); + utility1.getAdmin().createTable(table); + utility2.getAdmin().createTable(table); + utility3.getAdmin().createTable(table); Table htable1 = utility1.getConnection().getTable(tableName); htable1.setWriteBufferSize(1024); Table htable2 = utility2.getConnection().getTable(tableName); @@ -208,7 +208,7 @@ public class TestMultiSlaveReplication { private void rollWALAndWait(final HBaseTestingUtility utility, final TableName table, final byte[] row) throws IOException { - final Admin admin = utility.getHBaseAdmin(); + final Admin admin = utility.getAdmin(); final MiniHBaseCluster cluster = utility.getMiniHBaseCluster(); // find the region that corresponds to the given row. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java index 8c218d08322..557ed99e402 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java @@ -57,7 +57,7 @@ public class TestReplicationChangingPeerRegionservers extends TestReplicationBas // rolling like this makes sure the most recent one gets added to the queue for (JVMClusterUtil.RegionServerThread r : utility1.getHBaseCluster().getRegionServerThreads()) { - utility1.getHBaseAdmin().rollWALWriter(r.getRegionServer().getServerName()); + utility1.getAdmin().rollWALWriter(r.getRegionServer().getServerName()); } utility1.deleteTableData(tableName); // truncating the table will send one Delete per row to the slave cluster diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java index f9c467e2609..f4f5f245fdb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEndpoint.java @@ -90,7 +90,7 @@ public class TestReplicationEndpoint extends TestReplicationBase { final List rsThreads = utility1.getMiniHBaseCluster().getRegionServerThreads(); for (RegionServerThread rs : rsThreads) { - utility1.getHBaseAdmin().rollWALWriter(rs.getRegionServer().getServerName()); + utility1.getAdmin().rollWALWriter(rs.getRegionServer().getServerName()); } // Wait for all log roll to finish utility1.waitFor(3000, new Waiter.ExplainingPredicate() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java index 58249f16d40..c892c5dd8e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java @@ -86,7 +86,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { // rolling like this makes sure the most recent one gets added to the queue for ( JVMClusterUtil.RegionServerThread r : utility1.getHBaseCluster().getRegionServerThreads()) { - utility1.getHBaseAdmin().rollWALWriter(r.getRegionServer().getServerName()); + utility1.getAdmin().rollWALWriter(r.getRegionServer().getServerName()); } int rowCount = utility1.countRows(tableName); utility1.deleteTableData(tableName); @@ -765,7 +765,7 @@ public class TestReplicationSmallTests extends TestReplicationBase { final String colFam = "cf1"; final int numOfTables = 3; - Admin hadmin = utility1.getHBaseAdmin(); + Admin hadmin = utility1.getAdmin(); // Create Tables for (int i = 0; i < numOfTables; i++) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java index bd07c9dfed9..e61ceb23491 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java @@ -183,12 +183,12 @@ public class TestReplicationSyncUpTool extends TestReplicationBase { ReplicationAdmin admin1 = new ReplicationAdmin(conf1); ReplicationAdmin admin2 = new ReplicationAdmin(conf2); - Admin ha = utility1.getHBaseAdmin(); + Admin ha = utility1.getAdmin(); ha.createTable(t1_syncupSource); ha.createTable(t2_syncupSource); ha.close(); - ha = utility2.getHBaseAdmin(); + ha = utility2.getAdmin(); ha.createTable(t1_syncupTarget); ha.createTable(t2_syncupTarget); ha.close(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSerialReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSerialReplication.java index 752afe8eef7..f848457c7cb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSerialReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSerialReplication.java @@ -114,7 +114,7 @@ public class TestSerialReplication { rpc.setClusterKey(utility2.getClusterKey()); admin1.addPeer("1", rpc, null); - utility1.getHBaseAdmin().setBalancerRunning(false, true); + utility1.getAdmin().setBalancerRunning(false, true); } @Test @@ -124,8 +124,8 @@ public class TestSerialReplication { HColumnDescriptor fam = new HColumnDescriptor(famName); fam.setScope(HConstants.REPLICATION_SCOPE_SERIAL); table.addFamily(fam); - utility1.getHBaseAdmin().createTable(table); - utility2.getHBaseAdmin().createTable(table); + utility1.getAdmin().createTable(table); + utility2.getAdmin().createTable(table); try(Table t1 = utility1.getConnection().getTable(tableName); Table t2 = utility2.getConnection().getTable(tableName)) { LOG.info("move to 1"); @@ -183,8 +183,8 @@ public class TestSerialReplication { HColumnDescriptor fam = new HColumnDescriptor(famName); fam.setScope(HConstants.REPLICATION_SCOPE_SERIAL); table.addFamily(fam); - utility1.getHBaseAdmin().createTable(table); - utility2.getHBaseAdmin().createTable(table); + utility1.getAdmin().createTable(table); + utility2.getAdmin().createTable(table); try(Table t1 = utility1.getConnection().getTable(tableName); Table t2 = utility2.getConnection().getTable(tableName)) { @@ -193,7 +193,7 @@ public class TestSerialReplication { put.addColumn(famName, VALUE, VALUE); t1.put(put); } - utility1.getHBaseAdmin().split(tableName, ROWS[50]); + utility1.getAdmin().split(tableName, ROWS[50]); waitTableHasRightNumberOfRegions(tableName, 2); for (int i = 11; i < 100; i += 10) { Put put = new Put(ROWS[i]); @@ -253,10 +253,10 @@ public class TestSerialReplication { HColumnDescriptor fam = new HColumnDescriptor(famName); fam.setScope(HConstants.REPLICATION_SCOPE_SERIAL); table.addFamily(fam); - utility1.getHBaseAdmin().createTable(table); - utility2.getHBaseAdmin().createTable(table); + utility1.getAdmin().createTable(table); + utility2.getAdmin().createTable(table); Threads.sleep(5000); - utility1.getHBaseAdmin().split(tableName, ROWS[50]); + utility1.getAdmin().split(tableName, ROWS[50]); waitTableHasRightNumberOfRegions(tableName, 2); try(Table t1 = utility1.getConnection().getTable(tableName); @@ -268,7 +268,7 @@ public class TestSerialReplication { } List> regions = MetaTableAccessor.getTableRegionsAndLocations(utility1.getConnection(), tableName); - utility1.getHBaseAdmin().mergeRegionsAsync(regions.get(0).getFirst().getRegionName(), + utility1.getAdmin().mergeRegionsAsync(regions.get(0).getFirst().getRegionName(), regions.get(1).getFirst().getRegionName(), true); waitTableHasRightNumberOfRegions(tableName, 1); for (int i = 11; i < 100; i += 10) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalThrottler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalThrottler.java index 43312390d6c..e65e7767d8b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalThrottler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalThrottler.java @@ -118,8 +118,8 @@ public class TestGlobalThrottler { HColumnDescriptor fam = new HColumnDescriptor(famName); fam.setScope(HConstants.REPLICATION_SCOPE_SERIAL); table.addFamily(fam); - utility1.getHBaseAdmin().createTable(table); - utility2.getHBaseAdmin().createTable(table); + utility1.getAdmin().createTable(table); + utility2.getAdmin().createTable(table); Thread watcher = new Thread(()->{ Replication replication = (Replication)utility1.getMiniHBaseCluster() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java index 11df7e08eae..d8386d7828d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java @@ -126,7 +126,7 @@ public class TestRegionReplicaReplicationEndpoint { HTableDescriptor htd = HTU.createTableDescriptor( "testReplicationPeerIsCreated_no_region_replicas"); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); try { peerConfig = admin.getPeerConfig(peerId); fail("Should throw ReplicationException, because replication peer id=" + peerId @@ -137,7 +137,7 @@ public class TestRegionReplicaReplicationEndpoint { htd = HTU.createTableDescriptor("testReplicationPeerIsCreated"); htd.setRegionReplication(2); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); // assert peer configuration is correct peerConfig = admin.getPeerConfig(peerId); @@ -170,7 +170,7 @@ public class TestRegionReplicaReplicationEndpoint { HTableDescriptor htd = HTU.createTableDescriptor("testRegionReplicaReplicationPeerIsCreatedForModifyTable"); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); // assert that replication peer is not created yet try { @@ -181,10 +181,10 @@ public class TestRegionReplicaReplicationEndpoint { } assertNull(peerConfig); - HTU.getHBaseAdmin().disableTable(htd.getTableName()); + HTU.getAdmin().disableTable(htd.getTableName()); htd.setRegionReplication(2); - HTU.getHBaseAdmin().modifyTable(htd.getTableName(), htd); - HTU.getHBaseAdmin().enableTable(htd.getTableName()); + HTU.getAdmin().modifyTable(htd.getTableName(), htd); + HTU.getAdmin().enableTable(htd.getTableName()); // assert peer configuration is correct peerConfig = admin.getPeerConfig(peerId); @@ -203,7 +203,7 @@ public class TestRegionReplicaReplicationEndpoint { + regionReplication); HTableDescriptor htd = HTU.createTableDescriptor(tableName.toString()); htd.setRegionReplication(regionReplication); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); TableName tableNameNoReplicas = TableName.valueOf("testRegionReplicaReplicationWithReplicas_NO_REPLICAS"); HTU.deleteTableIfAny(tableNameNoReplicas); @@ -294,7 +294,7 @@ public class TestRegionReplicaReplicationEndpoint { HTableDescriptor htd = HTU.createTableDescriptor(tableName.toString()); htd.setRegionReplication(regionReplication); htd.setRegionMemstoreReplication(false); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Table table = connection.getTable(tableName); @@ -329,7 +329,7 @@ public class TestRegionReplicaReplicationEndpoint { TableName tableName = TableName.valueOf("testRegionReplicaReplicationForFlushAndCompaction"); HTableDescriptor htd = HTU.createTableDescriptor(tableName.toString()); htd.setRegionReplication(regionReplication); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); @@ -375,12 +375,12 @@ public class TestRegionReplicaReplicationEndpoint { int regionReplication = 3; htd.setRegionReplication(regionReplication); HTU.deleteTableIfAny(tableName); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); TableName toBeDisabledTable = TableName.valueOf(dropTable ? "droppedTable" : "disabledTable"); HTU.deleteTableIfAny(toBeDisabledTable); htd = HTU.createTableDescriptor(toBeDisabledTable.toString()); htd.setRegionReplication(regionReplication); - HTU.getHBaseAdmin().createTable(htd); + HTU.getAdmin().createTable(htd); // both tables are created, now pause replication ReplicationAdmin admin = new ReplicationAdmin(HTU.getConfiguration()); @@ -410,9 +410,9 @@ public class TestRegionReplicaReplicationEndpoint { new WALKey(encodedRegionName, toBeDisabledTable, 1), new WALEdit()); - HTU.getHBaseAdmin().disableTable(toBeDisabledTable); // disable the table + HTU.getAdmin().disableTable(toBeDisabledTable); // disable the table if (dropTable) { - HTU.getHBaseAdmin().deleteTable(toBeDisabledTable); + HTU.getAdmin().deleteTable(toBeDisabledTable); } sinkWriter.append(toBeDisabledTable, encodedRegionName, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java index 340665f6eba..067e1f5ff21 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java @@ -656,18 +656,18 @@ public class SecureTestUtil { HColumnDescriptor hcd = new HColumnDescriptor(family); htd.addFamily(hcd); } - createTable(testUtil, testUtil.getHBaseAdmin(), htd); + createTable(testUtil, testUtil.getAdmin(), htd); return testUtil.getConnection().getTable(htd.getTableName()); } public static void createTable(HBaseTestingUtility testUtil, HTableDescriptor htd) throws Exception { - createTable(testUtil, testUtil.getHBaseAdmin(), htd); + createTable(testUtil, testUtil.getAdmin(), htd); } public static void createTable(HBaseTestingUtility testUtil, HTableDescriptor htd, byte[][] splitKeys) throws Exception { - createTable(testUtil, testUtil.getHBaseAdmin(), htd, splitKeys); + createTable(testUtil, testUtil.getAdmin(), htd, splitKeys); } public static void createTable(HBaseTestingUtility testUtil, Admin admin, HTableDescriptor htd) @@ -694,17 +694,17 @@ public class SecureTestUtil { public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName) throws Exception { - deleteTable(testUtil, testUtil.getHBaseAdmin(), tableName); + deleteTable(testUtil, testUtil.getAdmin(), tableName); } public static void createNamespace(HBaseTestingUtility testUtil, NamespaceDescriptor nsDesc) throws Exception { - testUtil.getHBaseAdmin().createNamespace(nsDesc); + testUtil.getAdmin().createNamespace(nsDesc); } public static void deleteNamespace(HBaseTestingUtility testUtil, String namespace) throws Exception { - testUtil.getHBaseAdmin().deleteNamespace(namespace); + testUtil.getAdmin().deleteNamespace(namespace); } public static void deleteTable(HBaseTestingUtility testUtil, Admin admin, TableName tableName) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java index cc6425fba34..2efc5ff9673 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java @@ -1066,8 +1066,8 @@ public class TestAccessController extends SecureTestUtil { USER_GROUP_ADMIN); } finally { // Reinit after the bulk upload - TEST_UTIL.getHBaseAdmin().disableTable(TEST_TABLE); - TEST_UTIL.getHBaseAdmin().enableTable(TEST_TABLE); + TEST_UTIL.getAdmin().disableTable(TEST_TABLE); + TEST_UTIL.getAdmin().enableTable(TEST_TABLE); } } @@ -1267,7 +1267,7 @@ public class TestAccessController extends SecureTestUtil { final byte[] qualifier = Bytes.toBytes("q"); // create table - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { deleteTable(TEST_UTIL, tableName); } @@ -1521,7 +1521,7 @@ public class TestAccessController extends SecureTestUtil { final byte[] qualifier = Bytes.toBytes("q"); // create table - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { deleteTable(TEST_UTIL, tableName); } @@ -1625,7 +1625,7 @@ public class TestAccessController extends SecureTestUtil { final byte[] qualifier = Bytes.toBytes("q"); // create table - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { deleteTable(TEST_UTIL, tableName); } @@ -2010,7 +2010,7 @@ public class TestAccessController extends SecureTestUtil { @Test (timeout=180000) public void testSnapshot() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE); SnapshotDescription.Builder builder = SnapshotDescription.newBuilder(); builder.setName(TEST_TABLE.getNameAsString() + "-snapshot"); @@ -2071,7 +2071,7 @@ public class TestAccessController extends SecureTestUtil { @Test (timeout=180000) public void testSnapshotWithOwner() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); final HTableDescriptor htd = admin.getTableDescriptor(TEST_TABLE); SnapshotDescription.Builder builder = SnapshotDescription.newBuilder(); builder.setName(TEST_TABLE.getNameAsString() + "-snapshot"); @@ -2132,7 +2132,7 @@ public class TestAccessController extends SecureTestUtil { LOG.debug("Test for global authorization for a new registered RegionServer."); MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster(); - final Admin admin = TEST_UTIL.getHBaseAdmin(); + final Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(TEST_TABLE2); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); createTable(TEST_UTIL, htd); @@ -2660,7 +2660,7 @@ public class TestAccessController extends SecureTestUtil { systemUserConnection, TEST_TABLE.getNameAsString()); assertTrue(existingPerms != null); assertTrue(existingPerms.size() > 1); - TEST_UTIL.getHBaseAdmin().disableTable(TEST_TABLE); + TEST_UTIL.getAdmin().disableTable(TEST_TABLE); TEST_UTIL.truncateTable(TEST_TABLE); TEST_UTIL.waitTableAvailable(TEST_TABLE); List perms = AccessControlClient.getUserPermissions( @@ -2715,7 +2715,7 @@ public class TestAccessController extends SecureTestUtil { final byte[] family = Bytes.toBytes("f1"); // create table in default ns - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(table1); htd.addFamily(new HColumnDescriptor(family)); createTable(TEST_UTIL, htd); 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 5ddfb9c83a7..29bbbbbae48 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 @@ -139,7 +139,7 @@ public class TestCellACLs extends SecureTestUtil { @Before public void setUp() throws Exception { // Create the test table (owner added to the _acl_ table) - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(TEST_TABLE.getTableName()); HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY); hcd.setMaxVersions(4); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java index 5a90d599360..87fd6ab9ec9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java @@ -60,7 +60,7 @@ public class TestCoprocessorWhitelistMasterObserver extends SecureTestUtil { @After public void tearDownTestCoprocessorWhitelistMasterObserver() throws Exception { - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); try { try { admin.disableTable(TEST_TABLE); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java index 17b143e39dc..de98092b11a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java @@ -153,8 +153,8 @@ public class TestNamespaceCommands extends SecureTestUtil { .getRegionServerCoprocessorHost() .findCoprocessor(AccessController.class.getName()); - UTIL.getHBaseAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE).build()); - UTIL.getHBaseAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE2).build()); + UTIL.getAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE).build()); + UTIL.getAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE2).build()); // grants on global grantGlobal(UTIL, USER_GLOBAL_ADMIN.getShortName(), Permission.Action.ADMIN); @@ -181,8 +181,8 @@ public class TestNamespaceCommands extends SecureTestUtil { @AfterClass public static void afterClass() throws Exception { - UTIL.getHBaseAdmin().deleteNamespace(TEST_NAMESPACE); - UTIL.getHBaseAdmin().deleteNamespace(TEST_NAMESPACE2); + UTIL.getAdmin().deleteNamespace(TEST_NAMESPACE); + UTIL.getAdmin().deleteNamespace(TEST_NAMESPACE2); UTIL.shutdownMiniCluster(); } 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 74105e1e2b2..c39a84b64ee 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 @@ -116,7 +116,7 @@ public class TestScanEarlyTermination extends SecureTestUtil { @Before public void setUp() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(TEST_TABLE.getTableName()); htd.setOwner(USER_OWNER); HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY1); 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 b23651f9256..602d18fd7b6 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 @@ -315,7 +315,7 @@ public class TestTablePermissions { .addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v1"))); table.put(new Put(Bytes.toBytes("row2")) .addColumn(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v2"))); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); admin.split(TEST_TABLE); // wait for split diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java index ad359753960..7c60f686ab4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java @@ -183,7 +183,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil { @Before public void setUp() throws Exception { // Create the test table (owner added to the _acl_ table) - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); HTableDescriptor htd = new HTableDescriptor(TEST_TABLE.getTableName()); HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY); hcd.setMaxVersions(100); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java index 56a7260a0bd..dd1fe2aaa6a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java @@ -142,10 +142,10 @@ public class TestVisibilityLabelReplicationWithExpAsString extends TestVisibilit HColumnDescriptor desc = new HColumnDescriptor(fam); desc.setScope(HConstants.REPLICATION_SCOPE_GLOBAL); table.addFamily(desc); - try (Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin()) { + try (Admin hBaseAdmin = TEST_UTIL.getAdmin()) { hBaseAdmin.createTable(table); } - try (Admin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin()){ + try (Admin hBaseAdmin1 = TEST_UTIL1.getAdmin()){ hBaseAdmin1.createTable(table); } addLabels(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java index 0cbe5547919..2111229024d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java @@ -651,7 +651,7 @@ public abstract class TestVisibilityLabels { @Test public void testUserShouldNotDoDDLOpOnLabelsTable() throws Exception { - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); try { admin.disableTable(LABELS_TABLE_NAME); fail("Lables table should not get disabled by user."); @@ -705,7 +705,7 @@ public abstract class TestVisibilityLabels { col = new HColumnDescriptor(fam2); col.setMaxVersions(5); desc.addFamily(col); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put put = new Put(r1); put.addColumn(fam, qual, 3l, v1); @@ -789,7 +789,7 @@ public abstract class TestVisibilityLabels { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor col = new HColumnDescriptor(fam); desc.addFamily(col); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)){ Put p1 = new Put(row1); p1.addColumn(fam, qual, value); @@ -825,7 +825,7 @@ public abstract class TestVisibilityLabels { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor col = new HColumnDescriptor(fam); desc.addFamily(col); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { Put p1 = new Put(row1); p1.addColumn(fam, qual, value); @@ -841,7 +841,7 @@ public abstract class TestVisibilityLabels { table.mutateRow(rm); } - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); List regions = TEST_UTIL.getHBaseCluster().getRegions(tableName); Store store = regions.get(0).getStore(fam); Collection storefiles = store.getStorefiles(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java index 48703b07068..5977c23a4a7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java @@ -187,7 +187,7 @@ public class TestVisibilityLabelsReplication { rpc.setClusterKey(TEST_UTIL1.getClusterKey()); replicationAdmin.addPeer("2", rpc, null); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HTableDescriptor table = new HTableDescriptor(TABLE_NAME); HColumnDescriptor desc = new HColumnDescriptor(fam); desc.setScope(HConstants.REPLICATION_SCOPE_GLOBAL); @@ -199,7 +199,7 @@ public class TestVisibilityLabelsReplication { hBaseAdmin.close(); } } - Admin hBaseAdmin1 = TEST_UTIL1.getHBaseAdmin(); + Admin hBaseAdmin1 = TEST_UTIL1.getAdmin(); try { hBaseAdmin1.createTable(table); } finally { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java index f6510f32075..9853fa2bd40 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithDeletes.java @@ -135,7 +135,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL)); ResultScanner scanner = table.getScanner(s); @@ -173,7 +173,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL)); ResultScanner scanner = table.getScanner(s); @@ -211,7 +211,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL)); ResultScanner scanner = table.getScanner(s); @@ -249,7 +249,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL)); ResultScanner scanner = table.getScanner(s); @@ -268,7 +268,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -287,7 +287,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -324,7 +324,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -374,7 +374,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -427,7 +427,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -472,7 +472,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteColumnsWithoutAndWithVisibilityLabels() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); @@ -529,7 +529,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteColumnsWithAndWithoutVisibilityLabels() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); @@ -586,7 +586,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteFamiliesWithoutAndWithVisibilityLabels() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); @@ -643,7 +643,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteFamiliesWithAndWithoutVisibilityLabels() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); @@ -700,7 +700,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeletesWithoutAndWithVisibilityLabels() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); @@ -759,7 +759,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testVisibilityLabelsWithDeleteFamilyWithPutsReAppearing() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -774,7 +774,7 @@ public class TestVisibilityLabelsWithDeletes { put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -835,7 +835,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testVisibilityLabelsWithDeleteColumnsWithPutsReAppearing() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -850,7 +850,7 @@ public class TestVisibilityLabelsWithDeletes { put.addColumn(fam, qual, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -911,7 +911,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testVisibilityCombinations() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -964,7 +964,7 @@ public class TestVisibilityLabelsWithDeletes { public void testVisibilityLabelsWithDeleteColumnWithSpecificVersionWithPutsReAppearing() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1029,7 +1029,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1081,7 +1081,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1139,7 +1139,7 @@ public class TestVisibilityLabelsWithDeletes { private Table doPuts(TableName tableName) throws IOException, InterruptedIOException, RetriesExhaustedWithDetailsException, InterruptedException { - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1175,7 +1175,7 @@ public class TestVisibilityLabelsWithDeletes { + TOPSECRET + "&" + SECRET+")")); puts.add(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); put = new Put(Bytes.toBytes("row2")); put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility("(" + CONFIDENTIAL + "&" + PRIVATE + ")|(" + TOPSECRET @@ -1189,7 +1189,7 @@ public class TestVisibilityLabelsWithDeletes { private Table doPutsWithDiffCols(TableName tableName) throws IOException, InterruptedIOException, RetriesExhaustedWithDetailsException, InterruptedException { - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1231,7 +1231,7 @@ public class TestVisibilityLabelsWithDeletes { private Table doPutsWithoutVisibility(TableName tableName) throws IOException, InterruptedIOException, RetriesExhaustedWithDetailsException, InterruptedException { - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1261,7 +1261,7 @@ public class TestVisibilityLabelsWithDeletes { Table table = TEST_UTIL.getConnection().getTable(tableName); table.put(puts); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); put = new Put(Bytes.toBytes("row2")); put.addColumn(fam, qual, 127l, value); @@ -1277,7 +1277,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1296,7 +1296,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1342,7 +1342,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1360,7 +1360,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1401,7 +1401,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row1")); put.addColumn(fam, qual, 128l, value); put.setCellVisibility(new CellVisibility(TOPSECRET)); @@ -1423,7 +1423,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1467,7 +1467,7 @@ public class TestVisibilityLabelsWithDeletes { put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1488,7 +1488,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1505,13 +1505,13 @@ public class TestVisibilityLabelsWithDeletes { } }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row3")); put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "&" + PRIVATE)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); - TEST_UTIL.getHBaseAdmin().majorCompact(tableName); + TEST_UTIL.getAdmin().flush(tableName); + TEST_UTIL.getAdmin().majorCompact(tableName); // Sleep to ensure compaction happens. Need to do it in a better way Thread.sleep(5000); Scan s = new Scan(); @@ -1554,7 +1554,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1572,7 +1572,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1603,7 +1603,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPutsWithDiffCols(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1621,7 +1621,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1659,7 +1659,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteColumnsWithDiffColsAndTags() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1674,7 +1674,7 @@ public class TestVisibilityLabelsWithDeletes { put.addColumn(fam, qual1, 126l, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1707,7 +1707,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteColumnsWithDiffColsAndTags1() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -1722,7 +1722,7 @@ public class TestVisibilityLabelsWithDeletes { put.addColumn(fam, qual1, 126l, value); put.setCellVisibility(new CellVisibility(SECRET)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1757,7 +1757,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPutsWithoutVisibility(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1774,7 +1774,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1812,7 +1812,7 @@ public class TestVisibilityLabelsWithDeletes { } }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1858,7 +1858,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1877,7 +1877,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -1913,7 +1913,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)) { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -1932,13 +1932,13 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Put put = new Put(Bytes.toBytes("row3")); put.addColumn(fam, qual, 127l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "&" + PRIVATE)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); - TEST_UTIL.getHBaseAdmin().compact(tableName); + TEST_UTIL.getAdmin().flush(tableName); + TEST_UTIL.getAdmin().compact(tableName); Thread.sleep(5000); // Sleep to ensure compaction happens. Need to do it in a better way Scan s = new Scan(); @@ -2100,7 +2100,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2153,7 +2153,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2254,7 +2254,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2871,7 +2871,7 @@ public class TestVisibilityLabelsWithDeletes { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); try (Table table = doPuts(tableName)){ - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -2888,7 +2888,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2912,7 +2912,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2937,7 +2937,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2962,7 +2962,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -2987,7 +2987,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -3012,7 +3012,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -3061,7 +3061,7 @@ public class TestVisibilityLabelsWithDeletes { public void testVisibilityExpressionWithNotEqualORCondition() throws Exception { setAuths(); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -3076,7 +3076,7 @@ public class TestVisibilityLabelsWithDeletes { put.addColumn(fam, qual, 124l, value); put.setCellVisibility(new CellVisibility(CONFIDENTIAL + "|" + PRIVATE)); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -3094,7 +3094,7 @@ public class TestVisibilityLabelsWithDeletes { }; SUPERUSER.runAs(actiona); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); Scan s = new Scan(); s.setMaxVersions(5); s.setAuthorizations(new Authorizations(SECRET, PRIVATE, CONFIDENTIAL, TOPSECRET)); @@ -3118,7 +3118,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteWithNoVisibilitiesForPutsAndDeletes() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -3155,7 +3155,7 @@ public class TestVisibilityLabelsWithDeletes { @Test public void testDeleteWithFamilyDeletesOfSameTsButDifferentVisibilities() throws Exception { final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); @@ -3250,7 +3250,7 @@ public class TestVisibilityLabelsWithDeletes { put.setCellVisibility(new CellVisibility(labelExp)); puts.add(put); table.put(put); - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); i++; } return table; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java index 96203b51080..b24deb30ae2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java @@ -122,14 +122,14 @@ public class TestVisibilityWithCheckAuths { }; SUPERUSER.runAs(action); final TableName tableName = TableName.valueOf(TEST_NAME.getMethodName()); - Admin hBaseAdmin = TEST_UTIL.getHBaseAdmin(); + Admin hBaseAdmin = TEST_UTIL.getAdmin(); HColumnDescriptor colDesc = new HColumnDescriptor(fam); colDesc.setMaxVersions(5); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(colDesc); hBaseAdmin.createTable(desc); try { - TEST_UTIL.getHBaseAdmin().flush(tableName); + TEST_UTIL.getAdmin().flush(tableName); PrivilegedExceptionAction actiona = new PrivilegedExceptionAction() { @Override public Void run() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java index 107f487f16f..9e332d6f129 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java @@ -60,10 +60,10 @@ public class MobSnapshotTestingUtils { hcd.setMobThreshold(0L); htd.addFamily(hcd); } - util.getHBaseAdmin().createTable(htd, splitKeys); + util.getAdmin().createTable(htd, splitKeys); SnapshotTestingUtils.waitForTableToBeOnline(util, tableName); assertEquals((splitKeys.length + 1) * regionReplication, util - .getHBaseAdmin().getTableRegions(tableName).size()); + .getAdmin().getTableRegions(tableName).size()); } /** @@ -90,7 +90,7 @@ public class MobSnapshotTestingUtils { hcd.setMobThreshold(0L); htd.addFamily(hcd); } - util.getHBaseAdmin().createTable(htd); + util.getAdmin().createTable(htd); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait // until they are assigned util.waitUntilAllRegionsAssigned(htd.getTableName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java index 57359b36d23..74f49747bc6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java @@ -163,7 +163,7 @@ public final class SnapshotTestingUtils { throws IOException { MasterFileSystem mfs = testUtil.getHBaseCluster().getMaster().getMasterFileSystem(); confirmSnapshotValid(snapshotDescriptor, tableName, family, - mfs.getRootDir(), testUtil.getHBaseAdmin(), mfs.getFileSystem()); + mfs.getRootDir(), testUtil.getAdmin(), mfs.getFileSystem()); } /** @@ -760,7 +760,7 @@ public final class SnapshotTestingUtils { byte[][] splitKeys = getSplitKeys(nRegions); util.createTable(htd, splitKeys); assertEquals((splitKeys.length + 1) * regionReplication, - util.getHBaseAdmin().getTableRegions(tableName).size()); + util.getAdmin().getTableRegions(tableName).size()); } public static byte[][] getSplitKeys() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java index b78785b9165..47601ca335f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java @@ -103,7 +103,7 @@ public class TestExportSnapshot { */ @Before public void setUp() throws Exception { - this.admin = TEST_UTIL.getHBaseAdmin(); + this.admin = TEST_UTIL.getAdmin(); long tid = System.currentTimeMillis(); tableName = TableName.valueOf("testtb-" + tid); @@ -139,7 +139,7 @@ public class TestExportSnapshot { @After public void tearDown() throws Exception { TEST_UTIL.deleteTable(tableName); - SnapshotTestingUtils.deleteAllSnapshots(TEST_UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(TEST_UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(TEST_UTIL); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java index 4d316beaad8..6bc33145bb2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java @@ -97,7 +97,7 @@ public class TestRestoreFlushSnapshotFromClient { */ @Before public void setup() throws Exception { - this.admin = UTIL.getHBaseAdmin(); + this.admin = UTIL.getAdmin(); long tid = System.currentTimeMillis(); tableName = TableName.valueOf("testtb-" + tid); @@ -134,7 +134,7 @@ public class TestRestoreFlushSnapshotFromClient { @After public void tearDown() throws Exception { - SnapshotTestingUtils.deleteAllSnapshots(UTIL.getHBaseAdmin()); + SnapshotTestingUtils.deleteAllSnapshots(UTIL.getAdmin()); SnapshotTestingUtils.deleteArchiveDirectory(UTIL); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java index 0e93bbb9398..fd0144c7396 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java @@ -64,7 +64,7 @@ public class TestSnapshotClientRetries { public void testSnapshotAlreadyExist() throws Exception { final String snapshotName = "testSnapshotAlreadyExist"; TEST_UTIL.createTable(TEST_TABLE.getTableName(), "f"); - TEST_UTIL.getHBaseAdmin().snapshot(snapshotName, TEST_TABLE.getTableName()); + TEST_UTIL.getAdmin().snapshot(snapshotName, TEST_TABLE.getTableName()); snapshotAndAssertOneRetry(snapshotName, TEST_TABLE.getTableName()); } @@ -101,7 +101,7 @@ public class TestSnapshotClientRetries { throws Exception { MasterSyncObserver observer = getMasterSyncObserver(); observer.snapshotCount = new AtomicInteger(0); - TEST_UTIL.getHBaseAdmin().snapshot(snapshotName, tableName); + TEST_UTIL.getAdmin().snapshot(snapshotName, tableName); assertEquals(1, observer.snapshotCount.get()); } @@ -109,7 +109,7 @@ public class TestSnapshotClientRetries { throws Exception { MasterSyncObserver observer = getMasterSyncObserver(); observer.cloneCount = new AtomicInteger(0); - TEST_UTIL.getHBaseAdmin().cloneSnapshot(snapshotName, tableName); + TEST_UTIL.getAdmin().cloneSnapshot(snapshotName, tableName); assertEquals(1, observer.cloneCount.get()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java index 58aa56aa225..a9297ded3f0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java @@ -103,7 +103,7 @@ public class TestCoprocessorScanPolicy { public void testBaseCases() throws Exception { TableName tableName = TableName.valueOf("baseCases"); - if (TEST_UTIL.getHBaseAdmin().tableExists(tableName)) { + if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.deleteTable(tableName); } Table t = TEST_UTIL.createTable(tableName, F, 1); @@ -153,7 +153,7 @@ public class TestCoprocessorScanPolicy { public void testTTL() throws Exception { TableName tableName = TableName.valueOf("testTTL"); - if (TEST_UTIL.getHBaseAdmin().tableExists(tableName)) { + if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.deleteTable(tableName); } HTableDescriptor desc = new HTableDescriptor(tableName); @@ -161,7 +161,7 @@ public class TestCoprocessorScanPolicy { .setMaxVersions(10) .setTimeToLive(1); desc.addFamily(hcd); - TEST_UTIL.getHBaseAdmin().createTable(desc); + TEST_UTIL.getAdmin().createTable(desc); Table t = TEST_UTIL.getConnection().getTable(tableName); long now = EnvironmentEdgeManager.currentTime(); ManualEnvironmentEdge me = new ManualEnvironmentEdge(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java index 0ed871191f0..501bfc43cf3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java @@ -91,7 +91,7 @@ public class TestHBaseFsckEncryption { conf.get(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY, User.getCurrent().getShortName()), cfKey)); htd.addFamily(hcd); - TEST_UTIL.getHBaseAdmin().createTable(htd); + TEST_UTIL.getAdmin().createTable(htd); TEST_UTIL.waitTableAvailable(htd.getName(), 5000); } @@ -118,7 +118,7 @@ public class TestHBaseFsckEncryption { table.close(); } // Flush it - TEST_UTIL.getHBaseAdmin().flush(htd.getTableName()); + TEST_UTIL.getAdmin().flush(htd.getTableName()); // Verify we have encrypted store files on disk final List paths = findStorefilePaths(htd.getTableName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java index 88c2fd95f11..47e233fc634 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java @@ -743,7 +743,7 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck { doFsck(conf, true); assertNoErrors(doFsck(conf, false)); - assertTrue(TEST_UTIL.getHBaseAdmin().isTableEnabled(table)); + assertTrue(TEST_UTIL.getAdmin().isTableEnabled(table)); } finally { cleanupTable(table); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java index 908a930bc1a..726a450d857 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java @@ -151,7 +151,7 @@ public class TestMiniClusterLoadSequential { LOG.info("Starting load test: dataBlockEncoding=" + dataBlockEncoding + ", isMultiPut=" + isMultiPut); numKeys = numKeys(); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); while (admin.getClusterStatus().getServers().size() < NUM_RS) { LOG.info("Sleeping until " + NUM_RS + " RSs are online"); Threads.sleepWithoutInterrupt(1000); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover.java index a75ff2ba252..7322de87a5e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover.java @@ -66,7 +66,7 @@ public class TestRegionMover { public void setUp() throws Exception { // Create a pre-split table just to populate some regions TableName tableName = TableName.valueOf("testRegionMover"); - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); if (admin.tableExists(tableName)) { TEST_UTIL.deleteTable(tableName); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java index 97b6ddb61ee..3701094fd65 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRebuildTestCore.java @@ -96,7 +96,7 @@ public class OfflineMetaRebuildTestCore { TEST_UTIL.startMiniCluster(3); conf = TEST_UTIL.getConfiguration(); this.connection = ConnectionFactory.createConnection(conf); - assertEquals(0, TEST_UTIL.getHBaseAdmin().listTables().length); + assertEquals(0, TEST_UTIL.getAdmin().listTables().length); // setup the table table = TableName.valueOf(TABLE_BASE + "-" + tableIdx); @@ -107,8 +107,8 @@ public class OfflineMetaRebuildTestCore { LOG.info("Table " + table + " has " + tableRowCount(conf, table) + " entries."); assertEquals(16, tableRowCount(conf, table)); - TEST_UTIL.getHBaseAdmin().disableTable(table); - assertEquals(1, TEST_UTIL.getHBaseAdmin().listTables().length); + TEST_UTIL.getAdmin().disableTable(table); + assertEquals(1, TEST_UTIL.getAdmin().listTables().length); } @After @@ -132,7 +132,7 @@ public class OfflineMetaRebuildTestCore { HTableDescriptor desc = new HTableDescriptor(tablename); HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM)); desc.addFamily(hcd); // If a table has no CF's it doesn't get checked - TEST_UTIL.getHBaseAdmin().createTable(desc, splits); + TEST_UTIL.getAdmin().createTable(desc, splits); return this.connection.getTable(tablename); } @@ -177,7 +177,7 @@ public class OfflineMetaRebuildTestCore { LOG.info("RegionName: " + hri.getRegionNameAsString()); byte[] deleteRow = hri.getRegionName(); - TEST_UTIL.getHBaseAdmin().unassign(deleteRow, true); + TEST_UTIL.getAdmin().unassign(deleteRow, true); LOG.info("deleting hdfs data: " + hri.toString() + hsa.toString()); Path rootDir = FSUtils.getRootDir(conf); @@ -224,7 +224,7 @@ public class OfflineMetaRebuildTestCore { protected void wipeOutMeta() throws IOException { // Mess it up by blowing up meta. - Admin admin = TEST_UTIL.getHBaseAdmin(); + Admin admin = TEST_UTIL.getAdmin(); Scan s = new Scan(); Table meta = TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME); ResultScanner scanner = meta.getScanner(s); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java index 15414156afe..3be77877ae6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java @@ -89,11 +89,11 @@ public class TestOfflineMetaRebuildBase extends OfflineMetaRebuildTestCore { // everything is good again. assertEquals(5, scanMeta()); // including table state rows - TableName[] tableNames = TEST_UTIL.getHBaseAdmin().listTableNames(); + TableName[] tableNames = TEST_UTIL.getAdmin().listTableNames(); for (TableName tableName : tableNames) { - HTableDescriptor tableDescriptor = TEST_UTIL.getHBaseAdmin().getTableDescriptor(tableName); + HTableDescriptor tableDescriptor = TEST_UTIL.getAdmin().getTableDescriptor(tableName); assertNotNull(tableDescriptor); - assertTrue(TEST_UTIL.getHBaseAdmin().isTableEnabled(tableName)); + assertTrue(TEST_UTIL.getAdmin().isTableEnabled(tableName)); } HTableDescriptor[] htbls = admin.listTables(); LOG.info("Tables present after restart: " + Arrays.toString(htbls)); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java index 6df435395f2..13d499716cd 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java @@ -140,7 +140,7 @@ public class TestThriftHBaseServiceHandler { @BeforeClass public static void beforeClass() throws Exception { UTIL.startMiniCluster(); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableAname)); for (HColumnDescriptor family : families) { tableDescriptor.addFamily(family); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java index 8c643db87e4..f7299088c8e 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java @@ -139,7 +139,7 @@ public static void beforeClass() throws Exception { // Wait for the labels table to become available UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000); createLabels(); - Admin admin = UTIL.getHBaseAdmin(); + Admin admin = UTIL.getAdmin(); HTableDescriptor tableDescriptor = new HTableDescriptor( TableName.valueOf(tableAname)); for (HColumnDescriptor family : families) {