hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [1/3] hbase git commit: HBASE-14998 Unify synchronous and asynchronous methods in Admin and cleanup
Date Thu, 14 Sep 2017 00:20:04 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 62db6bf1a -> 274bbb64c


http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
index 40b42fa..4e17335 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
@@ -342,7 +342,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public TableDescriptor listTableDescriptor(TableName tableName) throws TableNotFoundException,
IOException {
+  public TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundException,
IOException {
     return getTableDescriptor(tableName, getConnection(), rpcCallerFactory, rpcControllerFactory,
        operationTimeout, rpcTimeout);
   }
@@ -1410,7 +1410,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean setBalancerRunning(final boolean on, final boolean synchronous)
+  public boolean balancerSwitch(final boolean on, final boolean synchronous)
   throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
@@ -1423,7 +1423,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean balancer() throws IOException {
+  public boolean balance() throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Boolean rpcCall() throws Exception {
@@ -1434,7 +1434,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean balancer(final boolean force) throws IOException {
+  public boolean balance(final boolean force) throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Boolean rpcCall() throws Exception {
@@ -1478,7 +1478,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean setNormalizerRunning(final boolean on) throws IOException {
+  public boolean normalizerSwitch(final boolean on) throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Boolean rpcCall() throws Exception {
@@ -1490,7 +1490,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean enableCatalogJanitor(final boolean enable) throws IOException {
+  public boolean catalogJanitorSwitch(final boolean enable) throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Boolean rpcCall() throws Exception {
@@ -1501,7 +1501,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public int runCatalogScan() throws IOException {
+  public int runCatalogJanitor() throws IOException {
     return executeCallable(new MasterCallable<Integer>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Integer rpcCall() throws Exception {
@@ -1523,7 +1523,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean setCleanerChoreRunning(final boolean on) throws IOException {
+  public boolean cleanerChoreSwitch(final boolean on) throws IOException {
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override public Boolean rpcCall() throws Exception {
         return master.setCleanerChoreRunning(getRpcController(), RequestConverter
@@ -2556,7 +2556,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public void takeSnapshotAsync(SnapshotDescription snapshotDesc) throws IOException,
+  public void snapshotAsync(SnapshotDescription snapshotDesc) throws IOException,
       SnapshotCreationException {
     asyncSnapshot(ProtobufUtil.createHBaseProtosSnapshotDesc(snapshotDesc));
   }
@@ -2763,7 +2763,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public byte[] execProcedureWithRet(String signature, String instance, Map<String, String>
props)
+  public byte[] execProcedureWithReturn(String signature, String instance, Map<String,
String> props)
       throws IOException {
     ProcedureDescription desc = ProtobufUtil.buildProcedureDescription(signature, instance,
props);
     final ExecProcedureRequest request =
@@ -3645,7 +3645,7 @@ public class HBaseAdmin implements Admin {
      * @return the table descriptor
      */
     protected TableDescriptor getTableDescriptor() throws IOException {
-      return getAdmin().listTableDescriptor(getTableName());
+      return getAdmin().getDescriptor(getTableName());
     }
 
     /**
@@ -3843,7 +3843,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean[] setSplitOrMergeEnabled(final boolean enabled, final boolean synchronous,
+  public boolean[] splitOrMergeEnabledSwitch(final boolean enabled, final boolean synchronous,
                                           final MasterSwitchType... switchTypes)
     throws IOException {
     return executeCallable(new MasterCallable<boolean[]>(getConnection(),
@@ -3865,7 +3865,7 @@ public class HBaseAdmin implements Admin {
   }
 
   @Override
-  public boolean isSplitOrMergeEnabled(final MasterSwitchType switchType) throws IOException
{
+  public boolean splitOrMergeEnabledSwitch(final MasterSwitchType switchType) throws IOException
{
     return executeCallable(new MasterCallable<Boolean>(getConnection(), getRpcControllerFactory())
{
       @Override
       protected Boolean rpcCall() throws Exception {

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
index d1a760b..5879532 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
@@ -422,7 +422,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         LOG.info("Creating table:" + td);
         admin.createTable(td, startKey, endKey, numRegions);
         Assert.assertTrue("Table: " + td + " was not created", admin.tableExists(tableName));
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertTrue(
           "After create, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
         enabledTables.put(tableName, freshTableDesc);
@@ -461,7 +461,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         admin.disableTable(tableName);
         Assert.assertTrue("Table: " + selected + " was not disabled",
             admin.isTableDisabled(tableName));
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertTrue(
           "After disable, Table: " + tableName + " is not disabled",
           admin.isTableDisabled(tableName));
@@ -510,7 +510,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         admin.enableTable(tableName);
         Assert.assertTrue("Table: " + selected + " was not enabled",
             admin.isTableEnabled(tableName));
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertTrue(
           "After enable, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
         enabledTables.put(tableName, freshTableDesc);
@@ -607,7 +607,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         LOG.info("Adding column family: " + cfd + " to table: " + tableName);
         admin.addColumnFamily(tableName, cfd);
         // assertion
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertTrue("Column family: " + cfd + " was not added",
             freshTableDesc.hasColumnFamily(cfd.getName()));
         Assert.assertTrue(
@@ -659,7 +659,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         admin.modifyTable(td);
 
         // assertion
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         ColumnFamilyDescriptor freshColumnDesc = freshTableDesc.getColumnFamily(columnDesc.getName());
         Assert.assertEquals("Column family: " + columnDesc + " was not altered",
             freshColumnDesc.getMaxVersions(), versions);
@@ -750,7 +750,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
         LOG.info("Deleting column family: " + cfd + " from table: " + tableName);
         admin.deleteColumnFamily(tableName, cfd.getName());
         // assertion
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertFalse("Column family: " + cfd + " was not added",
             freshTableDesc.hasColumnFamily(cfd.getName()));
         Assert.assertTrue(
@@ -801,7 +801,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase
{
           put.addColumn(family, qualifier, value);
           table.put(put);
         }
-        TableDescriptor freshTableDesc = admin.listTableDescriptor(tableName);
+        TableDescriptor freshTableDesc = admin.getDescriptor(tableName);
         Assert.assertTrue(
           "After insert, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
         enabledTables.put(tableName, freshTableDesc);

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
index 2f01afe..3994aae 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
@@ -254,7 +254,7 @@ public class Action {
     HBaseTestingUtility util = this.context.getHBaseIntegrationTestingUtility();
     Admin admin = util.getAdmin();
 
-    TableDescriptor tableDescriptor = admin.listTableDescriptor(tableName);
+    TableDescriptor tableDescriptor = admin.getDescriptor(tableName);
     ColumnFamilyDescriptor[] columnDescriptors = tableDescriptor.getColumnFamilies();
 
     if (columnDescriptors == null || columnDescriptors.length == 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java
index 509f7b6..1098ff9 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
@@ -52,7 +52,7 @@ public class RemoveColumnAction extends Action {
 
   @Override
   public void perform() throws Exception {
-    TableDescriptor tableDescriptor = admin.listTableDescriptor(tableName);
+    TableDescriptor tableDescriptor = admin.getDescriptor(tableName);
     ColumnFamilyDescriptor[] columnDescriptors = tableDescriptor.getColumnFamilies();
 
     if (columnDescriptors.length <= (protectedColumns == null ? 1 : protectedColumns.size()))
{

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
index 3a47f1b..679d991 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
@@ -161,7 +161,7 @@ public class CopyTable extends Configured implements Tool {
       try (Connection conn = ConnectionFactory.createConnection(getConf());
           Admin admin = conn.getAdmin()) {
         HFileOutputFormat2.configureIncrementalLoadMap(job,
-            admin.listTableDescriptor((TableName.valueOf(dstTableName))));
+            admin.getDescriptor((TableName.valueOf(dstTableName))));
       }
     } else {
       TableMapReduceUtil.initTableMapperJob(tableName, scan,

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
index 3827fd1..3924ee6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java
@@ -98,7 +98,7 @@ public class ExpiredMobFileCleaner extends Configured implements Tool {
     Connection connection = ConnectionFactory.createConnection(getConf());
     Admin admin = connection.getAdmin();
     try {
-      TableDescriptor htd = admin.listTableDescriptor(tn);
+      TableDescriptor htd = admin.getDescriptor(tn);
       ColumnFamilyDescriptor family = htd.getColumnFamily(Bytes.toBytes(familyName));
       if (family == null || !family.isMobEnabled()) {
         throw new IOException("Column family " + familyName + " is not a MOB column family");

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptorDefaultVersions.java
index d85326f..47f0add 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
@@ -154,7 +154,7 @@ public class TestHColumnDescriptorDefaultVersions {
     Admin admin = TEST_UTIL.getAdmin();
 
     // Verify descriptor from master
-    TableDescriptor htd = admin.listTableDescriptor(tableName);
+    TableDescriptor htd = admin.getDescriptor(tableName);
     ColumnFamilyDescriptor[] hcds = htd.getColumnFamilies();
     verifyHColumnDescriptor(expected, hcds, tableName, families);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/274bbb64/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java
----------------------------------------------------------------------
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 c2c6d28..7661ed4 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
@@ -319,14 +319,14 @@ public class TestReplicaWithCluster {
     Assert.assertFalse(r.isStale());
 
     // Add a CF, it should work.
-    TableDescriptor bHdt = HTU.getAdmin().listTableDescriptor(td.getTableName());
+    TableDescriptor bHdt = HTU.getAdmin().getDescriptor(td.getTableName());
     td = TableDescriptorBuilder.newBuilder(td)
             .addColumnFamily(ColumnFamilyDescriptorBuilder.of(row))
             .build();
     HTU.getAdmin().disableTable(td.getTableName());
     HTU.getAdmin().modifyTable(td);
     HTU.getAdmin().enableTable(td.getTableName());
-    TableDescriptor nHdt = HTU.getAdmin().listTableDescriptor(td.getTableName());
+    TableDescriptor nHdt = HTU.getAdmin().getDescriptor(td.getTableName());
     Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()),
         bHdt.getColumnFamilyCount() + 1, nHdt.getColumnFamilyCount());
 
@@ -350,7 +350,7 @@ public class TestReplicaWithCluster {
     }
 
     Admin admin = HTU.getAdmin();
-    nHdt =admin.listTableDescriptor(td.getTableName());
+    nHdt =admin.getDescriptor(td.getTableName());
     Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()),
         bHdt.getColumnFamilyCount() + 1, nHdt.getColumnFamilyCount());
 


Mime
View raw message