diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ExampleMasterObserverWithMetrics.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ExampleMasterObserverWithMetrics.java index 6649162e932..8535d05fca4 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ExampleMasterObserverWithMetrics.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ExampleMasterObserverWithMetrics.java @@ -24,8 +24,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -68,7 +68,7 @@ public class ExampleMasterObserverWithMetrics implements MasterObserver { @Override public void preCreateTable(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { // we rely on the fact that there is only 1 instance of our MasterObserver. We keep track of // when the operation starts before the operation is executing. this.createTableStartTime = System.currentTimeMillis(); @@ -76,7 +76,7 @@ public class ExampleMasterObserverWithMetrics implements MasterObserver { @Override public void postCreateTable(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { if (this.createTableStartTime > 0) { long time = System.currentTimeMillis() - this.createTableStartTime; LOG.info("Create table took: " + time); diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java index 91d31d0530c..9fda3f0d9ef 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java @@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; @@ -268,7 +269,7 @@ public class RSGroupAdminEndpoint implements MasterObserver, CoprocessorService } } - void assignTableToGroup(HTableDescriptor desc) throws IOException { + void assignTableToGroup(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); @@ -293,7 +294,7 @@ public class RSGroupAdminEndpoint implements MasterObserver, CoprocessorService // Assign table to default RSGroup. @Override public void preCreateTable(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { assignTableToGroup(desc); } @@ -330,7 +331,7 @@ public class RSGroupAdminEndpoint implements MasterObserver, CoprocessorService @Override public void preCloneSnapshot(ObserverContext ctx, - SnapshotDescription snapshot, HTableDescriptor desc) throws IOException { + SnapshotDescription snapshot, TableDescriptor desc) throws IOException { assignTableToGroup(desc); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java index cf75c721883..f4f5db3150b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java @@ -35,8 +35,10 @@ import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.MasterSwitchType; import org.apache.hadoop.hbase.client.Mutation; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.master.RegionPlan; import org.apache.hadoop.hbase.master.locking.LockProcedure; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; @@ -83,21 +85,21 @@ public interface MasterObserver extends Coprocessor { * table RPC call. * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master - * @param desc the HTableDescriptor for the table + * @param desc the TableDescriptor for the table * @param regions the initial regions created for the table */ default void preCreateTable(final ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException {} + TableDescriptor desc, HRegionInfo[] regions) throws IOException {} /** * Called after the createTable operation has been requested. Called as part * of create table RPC call. * @param ctx the environment to interact with the framework and master - * @param desc the HTableDescriptor for the table + * @param desc the TableDescriptor for the table * @param regions the initial regions created for the table */ default void postCreateTable(final ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException {} + TableDescriptor desc, HRegionInfo[] regions) throws IOException {} /** * Called before a new table is created by @@ -109,7 +111,7 @@ public interface MasterObserver extends Coprocessor { * @param regions the initial regions created for the table * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-15575). - * Use {@link #preCreateTableAction(ObserverContext, HTableDescriptor, HRegionInfo[])}. + * Use {@link #preCreateTableAction(ObserverContext, TableDescriptor, HRegionInfo[])}. */ @Deprecated default void preCreateTableHandler(final ObserverContext @@ -124,7 +126,7 @@ public interface MasterObserver extends Coprocessor { * @param regions the initial regions created for the table * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-15575). - * Use {@link #postCompletedCreateTableAction(ObserverContext, HTableDescriptor, HRegionInfo[])} + * Use {@link #postCompletedCreateTableAction(ObserverContext, TableDescriptor, HRegionInfo[])} */ @Deprecated default void postCreateTableHandler(final ObserverContext @@ -141,12 +143,12 @@ public interface MasterObserver extends Coprocessor { * Make sure to implement only one of the two as both are called. * * @param ctx the environment to interact with the framework and master - * @param desc the HTableDescriptor for the table + * @param desc the TableDescriptor for the table * @param regions the initial regions created for the table */ default void preCreateTableAction( final ObserverContext ctx, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException {} /** @@ -159,12 +161,12 @@ public interface MasterObserver extends Coprocessor { * Make sure to implement only one of the two as both are called. * * @param ctx the environment to interact with the framework and master - * @param desc the HTableDescriptor for the table + * @param desc the TableDescriptor for the table * @param regions the initial regions created for the table */ default void postCompletedCreateTableAction( final ObserverContext ctx, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException {} /** @@ -345,20 +347,20 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param htd the HTableDescriptor + * @param htd the TableDescriptor */ default void preModifyTable(final ObserverContext ctx, - final TableName tableName, HTableDescriptor htd) throws IOException {} + final TableName tableName, TableDescriptor htd) throws IOException {} /** * Called after the modifyTable operation has been requested. Called as part * of modify table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param htd the HTableDescriptor + * @param htd the TableDescriptor */ default void postModifyTable(final ObserverContext ctx, - final TableName tableName, HTableDescriptor htd) throws IOException {} + final TableName tableName, TableDescriptor htd) throws IOException {} /** * Called prior to modifying a table's properties. Called as part of modify @@ -369,7 +371,7 @@ public interface MasterObserver extends Coprocessor { * @param htd the HTableDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-15575). - * Use {@link #preModifyTableAction(ObserverContext, TableName, HTableDescriptor)}. + * Use {@link #preModifyTableAction(ObserverContext, TableName, TableDescriptor)}. */ @Deprecated default void preModifyTableHandler( @@ -385,7 +387,7 @@ public interface MasterObserver extends Coprocessor { * @param htd the HTableDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #postCompletedModifyTableAction(ObserverContext, TableName, HTableDescriptor)}. + * Use {@link #postCompletedModifyTableAction(ObserverContext, TableName, TableDescriptor)}. */ @Deprecated default void postModifyTableHandler( @@ -403,12 +405,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param htd the HTableDescriptor + * @param htd the TableDescriptor */ default void preModifyTableAction( final ObserverContext ctx, final TableName tableName, - final HTableDescriptor htd) throws IOException {} + final TableDescriptor htd) throws IOException {} /** * Called after to modifying a table's properties. Called as part of modify @@ -421,12 +423,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param htd the HTableDescriptor + * @param htd the TableDescriptor */ default void postCompletedModifyTableAction( final ObserverContext ctx, final TableName tableName, - final HTableDescriptor htd) throws IOException {} + final TableDescriptor htd) throws IOException {} /** * Called prior to adding a new column family to the table. Called as part of @@ -436,7 +438,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #preAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}. + * Use {@link #preAddColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void preAddColumn(final ObserverContext ctx, @@ -452,10 +454,10 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void preAddColumnFamily(final ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException {} + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called after the new column family has been created. Called as part of @@ -465,7 +467,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #postAddColumnFamily(ObserverContext, TableName, HColumnDescriptor)}. + * Use {@link #postAddColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void postAddColumn(final ObserverContext ctx, @@ -481,10 +483,10 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void postAddColumnFamily(final ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException {} + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called prior to adding a new column family to the table. Called as part of @@ -494,7 +496,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use - * {@link #preAddColumnFamilyAction(ObserverContext, TableName, HColumnDescriptor)}. + * {@link #preAddColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void preAddColumnHandler( @@ -511,12 +513,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void preAddColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException {} + final ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called after the new column family has been created. Called as part of @@ -526,7 +528,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use - * {@link #postCompletedAddColumnFamilyAction(ObserverContext, TableName, HColumnDescriptor)}. + * {@link #postCompletedAddColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void postAddColumnHandler( @@ -543,12 +545,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void postCompletedAddColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException {} + final ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called prior to modifying a column family's attributes. Called as part of @@ -558,7 +560,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #preModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}. + * Use {@link #preModifyColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void preModifyColumn(final ObserverContext ctx, @@ -574,10 +576,10 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void preModifyColumnFamily(final ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException {} + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called after the column family has been updated. Called as part of modify @@ -587,7 +589,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #postModifyColumnFamily(ObserverContext, TableName, HColumnDescriptor)}. + * Use {@link #postModifyColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void postModifyColumn(final ObserverContext ctx, @@ -603,10 +605,10 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void postModifyColumnFamily(final ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException {} + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called prior to modifying a column family's attributes. Called as part of @@ -616,7 +618,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). - * Use {@link #preModifyColumnFamilyAction(ObserverContext, TableName, HColumnDescriptor)}. + * Use {@link #preModifyColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. */ @Deprecated default void preModifyColumnHandler( @@ -633,12 +635,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void preModifyColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException {} + final ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called after the column family has been updated. Called as part of modify @@ -648,7 +650,7 @@ public interface MasterObserver extends Coprocessor { * @param columnFamily the HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use - * {@link #postCompletedModifyColumnFamilyAction(ObserverContext,TableName,HColumnDescriptor)}. + * {@link #postCompletedModifyColumnFamilyAction(ObserverContext,TableName,ColumnFamilyDescriptor)}. */ @Deprecated default void postModifyColumnHandler( @@ -665,12 +667,12 @@ public interface MasterObserver extends Coprocessor { * * @param ctx the environment to interact with the framework and master * @param tableName the name of the table - * @param columnFamily the HColumnDescriptor + * @param columnFamily the ColumnFamilyDescriptor */ default void postCompletedModifyColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException {} + final ColumnFamilyDescriptor columnFamily) throws IOException {} /** * Called prior to deleting the entire column family. Called as part of @@ -1282,10 +1284,10 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to snapshot + * @param hTableDescriptor the TableDescriptor of the table to snapshot */ default void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1293,10 +1295,10 @@ public interface MasterObserver extends Coprocessor { * Called as part of snapshot RPC call. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to snapshot + * @param hTableDescriptor the TableDescriptor of the table to snapshot */ default void postSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1323,10 +1325,10 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to create + * @param hTableDescriptor the TableDescriptor of the table to create */ default void preCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1334,10 +1336,10 @@ public interface MasterObserver extends Coprocessor { * Called as part of restoreSnapshot RPC call. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to create + * @param hTableDescriptor the v of the table to create */ default void postCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1346,10 +1348,10 @@ public interface MasterObserver extends Coprocessor { * It can't bypass the default action, e.g., ctx.bypass() won't have effect. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to restore + * @param hTableDescriptor the TableDescriptor of the table to restore */ default void preRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1357,10 +1359,10 @@ public interface MasterObserver extends Coprocessor { * Called as part of restoreSnapshot RPC call. * @param ctx the environment to interact with the framework and master * @param snapshot the SnapshotDescriptor for the snapshot - * @param hTableDescriptor the hTableDescriptor of the table to restore + * @param hTableDescriptor the TableDescriptor of the table to restore */ default void postRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException {} /** @@ -1390,7 +1392,7 @@ public interface MasterObserver extends Coprocessor { * @param regex regular expression used for filtering the table names */ default void preGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, + List tableNamesList, List descriptors, String regex) throws IOException {} /** @@ -1401,7 +1403,7 @@ public interface MasterObserver extends Coprocessor { * @param regex regular expression used for filtering the table names */ default void postGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, + List tableNamesList, List descriptors, String regex) throws IOException {} /** @@ -1411,7 +1413,7 @@ public interface MasterObserver extends Coprocessor { * @param regex regular expression used for filtering the table names */ default void preGetTableNames(ObserverContext ctx, - List descriptors, String regex) throws IOException {} + List descriptors, String regex) throws IOException {} /** * Called after a getTableNames request has been processed. @@ -1420,7 +1422,7 @@ public interface MasterObserver extends Coprocessor { * @param regex regular expression used for filtering the table names */ default void postGetTableNames(ObserverContext ctx, - List descriptors, String regex) throws IOException {} + List descriptors, String regex) throws IOException {} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/package-info.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/package-info.java index e2113c066fe..8a677eef868 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/package-info.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/package-info.java @@ -192,7 +192,7 @@ code, see the {@link org.apache.hadoop.hbase.client.coprocessor} package documen

Coprocessor loading

A customized coprocessor can be loaded by two different ways, by configuration, -or by HTableDescriptor for a newly created table. +or by TableDescriptor for a newly created table.

(Currently we don't really have an on demand coprocessor loading mechanism for opened regions.) @@ -255,13 +255,14 @@ policy implementations, perhaps) ahead of observers. "TestClassloading.jar"); // create a table that references the jar - HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(getClass().getTableName())); - htd.addFamily(new HColumnDescriptor("test")); - htd.setValue("Coprocessor$1", - path.toString() + - ":" + classFullName + - ":" + Coprocessor.Priority.USER); - HBaseAdmin admin = new HBaseAdmin(this.conf); + TableDescriptor htd = TableDescriptorBuilder + .newBuilder(TableName.valueOf(getClass().getTableName())) + .addColumnFamily(ColumnFamilyDescriptorBuilder.of("test")) + .setValue(Bytes.toBytes("Coprocessor$1", path.toString()+ + ":" + classFullName + + ":" + Coprocessor.Priority.USER)) + .build(); + Admin admin = connection.getAdmin(); admin.createTable(htd);

Chain of RegionObservers

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index d6b149a4740..96bf85959fd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -53,6 +53,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.CoordinatedStateException; import org.apache.hadoop.hbase.CoordinatedStateManager; @@ -2975,7 +2976,7 @@ public class HMaster extends HRegionServer implements MasterServices { } @Override - public List listTableDescriptorsByNamespace(String name) throws IOException { + public List listTableDescriptorsByNamespace(String name) throws IOException { checkInitialized(); return listTableDescriptors(name, null, null, true); } @@ -3042,10 +3043,10 @@ public class HMaster extends HRegionServer implements MasterServices { * @param includeSysTables False to match only against userspace tables * @return the list of table descriptors */ - public List listTableDescriptors(final String namespace, final String regex, + public List listTableDescriptors(final String namespace, final String regex, final List tableNameList, final boolean includeSysTables) throws IOException { - List htds = new ArrayList<>(); + List htds = new ArrayList<>(); boolean bypass = cpHost != null? cpHost.preGetTableDescriptors(tableNameList, htds, regex): false; if (!bypass) { @@ -3066,14 +3067,14 @@ public class HMaster extends HRegionServer implements MasterServices { */ public List listTableNames(final String namespace, final String regex, final boolean includeSysTables) throws IOException { - List htds = new ArrayList<>(); + List htds = new ArrayList<>(); boolean bypass = cpHost != null? cpHost.preGetTableNames(htds, regex): false; if (!bypass) { htds = getTableDescriptors(htds, namespace, regex, null, includeSysTables); if (cpHost != null) cpHost.postGetTableNames(htds, regex); } List result = new ArrayList<>(htds.size()); - for (HTableDescriptor htd: htds) result.add(htd.getTableName()); + for (TableDescriptor htd: htds) result.add(htd.getTableName()); return result; } @@ -3082,7 +3083,7 @@ public class HMaster extends HRegionServer implements MasterServices { * tables, etc. * @throws IOException */ - private List getTableDescriptors(final List htds, + private List getTableDescriptors(final List htds, final String namespace, final String regex, final List tableNameList, final boolean includeSysTables) throws IOException { @@ -3123,12 +3124,12 @@ public class HMaster extends HRegionServer implements MasterServices { * @param descriptors list of table descriptors to filter * @param pattern the regex to use */ - private static void filterTablesByRegex(final Collection descriptors, + private static void filterTablesByRegex(final Collection descriptors, final Pattern pattern) { final String defaultNS = NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR; - Iterator itr = descriptors.iterator(); + Iterator itr = descriptors.iterator(); while (itr.hasNext()) { - HTableDescriptor htd = itr.next(); + TableDescriptor htd = itr.next(); String tableName = htd.getTableName().getNameAsString(); boolean matched = pattern.matcher(tableName).matches(); if (!matched && htd.getTableName().getNamespaceAsString().equals(defaultNS)) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java index 6064f9bbcd8..04bdacf60b0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java @@ -22,6 +22,7 @@ package org.apache.hadoop.hbase.master; import java.io.IOException; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import org.apache.commons.lang.ClassUtils; import org.apache.commons.logging.Log; @@ -39,6 +40,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.MasterSwitchType; import org.apache.hadoop.hbase.client.Mutation; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; @@ -1259,7 +1261,7 @@ public class MasterCoprocessorHost } public boolean preGetTableDescriptors(final List tableNamesList, - final List descriptors, final String regex) throws IOException { + final List descriptors, final String regex) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1270,7 +1272,7 @@ public class MasterCoprocessorHost } public void postGetTableDescriptors(final List tableNamesList, - final List descriptors, final String regex) throws IOException { + final List descriptors, final String regex) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1280,7 +1282,7 @@ public class MasterCoprocessorHost }); } - public boolean preGetTableNames(final List descriptors, + public boolean preGetTableNames(final List descriptors, final String regex) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override @@ -1291,7 +1293,7 @@ public class MasterCoprocessorHost }); } - public void postGetTableNames(final List descriptors, + public void postGetTableNames(final List descriptors, final String regex) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index aa64caa5047..5a2cd173b45 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.MasterSwitchType; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableState; import org.apache.hadoop.hbase.client.VersionInfoUtil; import org.apache.hadoop.hbase.client.replication.ReplicationSerDeHelper; @@ -856,13 +857,13 @@ public class MasterRpcServices extends RSRpcServices } } - List descriptors = master.listTableDescriptors(namespace, regex, + List descriptors = master.listTableDescriptors(namespace, regex, tableNameList, req.getIncludeSysTables()); GetTableDescriptorsResponse.Builder builder = GetTableDescriptorsResponse.newBuilder(); if (descriptors != null && descriptors.size() > 0) { // Add the table descriptors to the response - for (HTableDescriptor htd: descriptors) { + for (TableDescriptor htd: descriptors) { builder.addTableSchema(ProtobufUtil.convertToTableSchema(htd)); } } @@ -1114,7 +1115,7 @@ public class MasterRpcServices extends RSRpcServices try { ListTableDescriptorsByNamespaceResponse.Builder b = ListTableDescriptorsByNamespaceResponse.newBuilder(); - for (HTableDescriptor htd : master + for (TableDescriptor htd : master .listTableDescriptorsByNamespace(request.getNamespaceName())) { b.addTableSchema(ProtobufUtil.convertToTableSchema(htd)); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java index 3046b8a16ce..f7f5d069c1d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.TableNotDisabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.MasterSwitchType; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.executor.ExecutorService; import org.apache.hadoop.hbase.master.assignment.AssignmentManager; import org.apache.hadoop.hbase.master.locking.LockManager; @@ -381,7 +382,7 @@ public interface MasterServices extends Server { * @return descriptors * @throws IOException */ - public List listTableDescriptorsByNamespace(String name) throws IOException; + public List listTableDescriptorsByNamespace(String name) throws IOException; /** * Get list of table names by namespace diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java index 97ac1de38fd..dfadbb94272 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java @@ -59,6 +59,7 @@ import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.QualifierFilter; @@ -365,7 +366,7 @@ public class AccessControlLists { /** * Returns {@code true} if the given table is {@code _acl_} metadata table. */ - static boolean isAclTable(HTableDescriptor desc) { + static boolean isAclTable(TableDescriptor desc) { return ACL_TABLE_NAME.equals(desc.getTableName()); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java index 42de48d0ce4..c40d4817088 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java @@ -43,10 +43,8 @@ import org.apache.hadoop.hbase.CompoundConfiguration; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseInterfaceAudience; -import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.MetaTableAccessor; @@ -57,6 +55,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Tag; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Append; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Get; @@ -68,6 +67,7 @@ import org.apache.hadoop.hbase.client.Query; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.BulkLoadObserver; import org.apache.hadoop.hbase.coprocessor.CoprocessorException; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; @@ -134,7 +134,6 @@ import com.google.protobuf.Message; import com.google.protobuf.RpcCallback; import com.google.protobuf.RpcController; import com.google.protobuf.Service; -import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; /** * Provides basic authorization checks for data access and administrative @@ -988,8 +987,8 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preCreateTable(ObserverContext c, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { - Set families = desc.getFamiliesKeys(); + TableDescriptor desc, HRegionInfo[] regions) throws IOException { + Set families = desc.getColumnFamilyNames(); Map> familyMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); for (byte[] family: families) { familyMap.put(family, null); @@ -1001,7 +1000,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void postCompletedCreateTableAction( final ObserverContext c, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException { // When AC is used, it should be configured as the 1st CP. // In Master, the table operations like create, are handled by a Thread pool but the max size @@ -1108,14 +1107,14 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preModifyTable(ObserverContext c, TableName tableName, - HTableDescriptor htd) throws IOException { + TableDescriptor htd) throws IOException { requirePermission(getActiveUser(c), "modifyTable", tableName, null, null, Action.ADMIN, Action.CREATE); } @Override public void postModifyTable(ObserverContext c, - TableName tableName, final HTableDescriptor htd) throws IOException { + TableName tableName, final TableDescriptor htd) throws IOException { final Configuration conf = c.getEnvironment().getConfiguration(); // default the table owner to current user, if not specified. final String owner = (htd.getOwnerString() != null) ? htd.getOwnerString() : @@ -1134,7 +1133,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preAddColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { requireTablePermission(getActiveUser(ctx), "addColumn", tableName, columnFamily.getName(), null, Action.ADMIN, Action.CREATE); @@ -1142,7 +1141,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preModifyColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { requirePermission(getActiveUser(ctx), "modifyColumn", tableName, columnFamily.getName(), null, Action.ADMIN, Action.CREATE); @@ -1318,7 +1317,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { requirePermission(getActiveUser(ctx), "snapshot " + snapshot.getName(), hTableDescriptor.getTableName(), null, null, Permission.Action.ADMIN); @@ -1340,11 +1339,11 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { User user = getActiveUser(ctx); if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user) - && hTableDescriptor.getNameAsString().equals(snapshot.getTable())) { + && hTableDescriptor.getTableName().getNameAsString().equals(snapshot.getTable())) { // Snapshot owner is allowed to create a table with the same name as the snapshot he took AuthResult result = AuthResult.allow("cloneSnapshot " + snapshot.getName(), "Snapshot owner check allowed", user, null, hTableDescriptor.getTableName(), null); @@ -1356,7 +1355,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { User user = getActiveUser(ctx); if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user)) { @@ -2521,7 +2520,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void preGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, + List tableNamesList, List descriptors, String regex) throws IOException { // We are delegating the authorization check to postGetTableDescriptors as we don't have // any concrete set of table names when a regex is present or the full list is requested. @@ -2541,7 +2540,7 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void postGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, + List tableNamesList, List descriptors, String regex) throws IOException { // Skipping as checks in this case are already done by preGetTableDescriptors. if (regex == null && tableNamesList != null && !tableNamesList.isEmpty()) { @@ -2550,9 +2549,9 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS // Retains only those which passes authorization checks, as the checks weren't done as part // of preGetTableDescriptors. - Iterator itr = descriptors.iterator(); + Iterator itr = descriptors.iterator(); while (itr.hasNext()) { - HTableDescriptor htd = itr.next(); + TableDescriptor htd = itr.next(); try { requirePermission(getActiveUser(ctx), "getTableDescriptors", htd.getTableName(), null, null, Action.ADMIN, Action.CREATE); @@ -2564,11 +2563,11 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS @Override public void postGetTableNames(ObserverContext ctx, - List descriptors, String regex) throws IOException { + List descriptors, String regex) throws IOException { // Retains only those which passes authorization checks. - Iterator itr = descriptors.iterator(); + Iterator itr = descriptors.iterator(); while (itr.hasNext()) { - HTableDescriptor htd = itr.next(); + TableDescriptor htd = itr.next(); try { requireAccess(getActiveUser(ctx), "getTableNames", htd.getTableName(), Action.values()); } catch (AccessDeniedException e) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java index 57715934ab3..9a94e89a549 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java @@ -19,10 +19,7 @@ package org.apache.hadoop.hbase.security.access; import java.io.IOException; -import java.net.URI; -import java.nio.file.PathMatcher; import java.util.Collection; -import java.util.List; import java.util.regex.Matcher; import org.apache.commons.io.FilenameUtils; @@ -39,9 +36,9 @@ import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.master.MasterServices; import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.util.Bytes; /** @@ -58,13 +55,13 @@ public class CoprocessorWhitelistMasterObserver implements MasterObserver { @Override public void preModifyTable(ObserverContext ctx, - TableName tableName, HTableDescriptor htd) throws IOException { + TableName tableName, TableDescriptor htd) throws IOException { verifyCoprocessors(ctx, htd); } @Override public void preCreateTable(ObserverContext ctx, - HTableDescriptor htd, HRegionInfo[] regions) throws IOException { + TableDescriptor htd, HRegionInfo[] regions) throws IOException { verifyCoprocessors(ctx, htd); } @@ -143,7 +140,7 @@ public class CoprocessorWhitelistMasterObserver implements MasterObserver { * @param htd as passed in from the coprocessor */ private void verifyCoprocessors(ObserverContext ctx, - HTableDescriptor htd) throws IOException { + TableDescriptor htd) throws IOException { MasterServices services = ctx.getEnvironment().getMasterServices(); Configuration conf = services.getConfiguration(); @@ -152,9 +149,8 @@ public class CoprocessorWhitelistMasterObserver implements MasterObserver { conf.getStringCollection( CP_COPROCESSOR_WHITELIST_PATHS_KEY); - List coprocs = htd.getCoprocessors(); + Collection coprocs = htd.getCoprocessors(); for (int i = 0; i < coprocs.size(); i++) { - String coproc = coprocs.get(i); String coprocSpec = Bytes.toString(htd.getValue( Bytes.toBytes("coprocessor$" + (i + 1)))); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java index c6091c394b8..23f058373da 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java @@ -51,6 +51,7 @@ import org.apache.hadoop.hbase.TagType; import org.apache.hadoop.hbase.TagUtil; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Append; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Increment; @@ -59,6 +60,7 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.constraint.ConstraintException; import org.apache.hadoop.hbase.coprocessor.CoprocessorException; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -215,7 +217,7 @@ public class VisibilityController implements MasterObserver, RegionObserver, @Override public void preModifyTable(ObserverContext ctx, - TableName tableName, HTableDescriptor htd) throws IOException { + TableName tableName, TableDescriptor htd) throws IOException { if (!authorizationEnabled) { return; } @@ -226,7 +228,7 @@ public class VisibilityController implements MasterObserver, RegionObserver, @Override public void preAddColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { if (!authorizationEnabled) { return; @@ -238,7 +240,7 @@ public class VisibilityController implements MasterObserver, RegionObserver, @Override public void preModifyColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException { + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { if (!authorizationEnabled) { return; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java index 59309ee1dfe..966f5198eb6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java @@ -30,11 +30,11 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.impl.BackupSystemTable; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.MasterObserver; @@ -81,7 +81,7 @@ public class TestBackupDeleteWithFailures extends TestBackupBase{ @Override public void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { if (failures.contains(Failure.PRE_SNAPSHOT_FAILURE)) { 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 a0cf4d2e6fa..133b1112193 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 @@ -197,7 +197,7 @@ public class TestEnableTable { @Override public void postCompletedCreateTableAction( final ObserverContext ctx, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException { // the AccessController test, some times calls only and directly the // postCompletedCreateTableAction() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java index f9977513f82..878d445f357 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java @@ -47,6 +47,7 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; import org.apache.hadoop.hbase.metrics.Counter; import org.apache.hadoop.hbase.metrics.Metric; @@ -101,14 +102,14 @@ public class TestCoprocessorMetrics { @Override public void preCreateTable(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { // we rely on the fact that there is only 1 instance of our MasterObserver this.start = System.currentTimeMillis(); } @Override public void postCreateTable(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { if (this.start > 0) { long time = System.currentTimeMillis() - start; LOG.info("Create table took: " + time); 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 5130a411b22..c0a5801d2c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java @@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterCoprocessorHost; import org.apache.hadoop.hbase.testclassification.CoprocessorTests; @@ -104,7 +105,7 @@ public class TestMasterCoprocessorExceptionWithAbort { @Override public void postCreateTable(ObserverContext env, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { // cause a NullPointerException and don't catch it: this will cause the // master to abort(). Integer i; 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 7c5d8a19e96..92d12eeac7f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java @@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterCoprocessorHost; import org.apache.hadoop.hbase.testclassification.CoprocessorTests; @@ -81,7 +82,7 @@ public class TestMasterCoprocessorExceptionWithRemove { @SuppressWarnings("null") @Override public void postCreateTable(ObserverContext env, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { // Cause a NullPointerException and don't catch it: this should cause the // master to throw an o.apache.hadoop.hbase.DoNotRetryIOException to the // client. 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 1e6d717bedd..1b8b27b0614 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 @@ -46,12 +46,14 @@ import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.MasterSwitchType; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterCoprocessorHost; import org.apache.hadoop.hbase.master.RegionPlan; @@ -316,7 +318,7 @@ public class TestMasterObserver { @Override public void preCreateTable(ObserverContext env, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { if (bypass) { env.bypass(); } @@ -325,7 +327,7 @@ public class TestMasterObserver { @Override public void postCreateTable(ObserverContext env, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { postCreateTableCalled = true; } @@ -396,7 +398,7 @@ public class TestMasterObserver { @Override public void preModifyTable(ObserverContext env, - TableName tableName, HTableDescriptor htd) throws IOException { + TableName tableName, TableDescriptor htd) throws IOException { if (bypass) { env.bypass(); }else{ @@ -407,7 +409,7 @@ public class TestMasterObserver { @Override public void postModifyTable(ObserverContext env, - TableName tableName, HTableDescriptor htd) throws IOException { + TableName tableName, TableDescriptor htd) throws IOException { postModifyTableCalled = true; } @@ -537,7 +539,7 @@ public class TestMasterObserver { @Override public void preAddColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily + TableName tableName, ColumnFamilyDescriptor columnFamily ) throws IOException { if (bypass) { ctx.bypass(); @@ -556,7 +558,7 @@ public class TestMasterObserver { @Override public void postAddColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException { + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { postAddColumnCalled = true; } @@ -576,7 +578,7 @@ public class TestMasterObserver { @Override public void preModifyColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException { + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { if (bypass) { ctx.bypass(); } @@ -591,7 +593,7 @@ public class TestMasterObserver { @Override public void postModifyColumnFamily(ObserverContext ctx, - TableName tableName, HColumnDescriptor columnFamily) throws IOException { + TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { postModifyColumnCalled = true; } @@ -941,14 +943,14 @@ public class TestMasterObserver { @Override public void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { preSnapshotCalled = true; } @Override public void postSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { postSnapshotCalled = true; } @@ -975,14 +977,14 @@ public class TestMasterObserver { @Override public void preCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { preCloneSnapshotCalled = true; } @Override public void postCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { postCloneSnapshotCalled = true; } @@ -993,14 +995,14 @@ public class TestMasterObserver { @Override public void preRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { preRestoreSnapshotCalled = true; } @Override public void postRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { postRestoreSnapshotCalled = true; } @@ -1035,7 +1037,7 @@ public class TestMasterObserver { @Override public void preCreateTableAction( final ObserverContext env, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException { if (bypass) { env.bypass(); @@ -1053,7 +1055,7 @@ public class TestMasterObserver { @Override public void postCompletedCreateTableAction( final ObserverContext ctx, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException { postCompletedCreateTableActionCalled = true; tableCreationLatch.countDown(); @@ -1167,7 +1169,7 @@ public class TestMasterObserver { public void preModifyTableAction( final ObserverContext env, final TableName tableName, - final HTableDescriptor htd) throws IOException { + final TableDescriptor htd) throws IOException { if (bypass) { env.bypass(); } @@ -1178,7 +1180,7 @@ public class TestMasterObserver { public void postCompletedModifyTableAction( final ObserverContext env, final TableName tableName, - final HTableDescriptor htd) throws IOException { + final TableDescriptor htd) throws IOException { postCompletedModifyTableActionCalled = true; } @@ -1201,7 +1203,7 @@ public class TestMasterObserver { public void preAddColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException { + final ColumnFamilyDescriptor columnFamily) throws IOException { if (bypass) { ctx.bypass(); } @@ -1219,7 +1221,7 @@ public class TestMasterObserver { public void postCompletedAddColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException { + final ColumnFamilyDescriptor columnFamily) throws IOException { postCompletedAddColumnFamilyActionCalled = true; } @@ -1242,7 +1244,7 @@ public class TestMasterObserver { public void preModifyColumnFamilyAction( final ObserverContext ctx, final TableName tableName, - final HColumnDescriptor columnFamily) throws IOException { + final ColumnFamilyDescriptor columnFamily) throws IOException { if (bypass) { ctx.bypass(); } @@ -1259,7 +1261,7 @@ public class TestMasterObserver { @Override public void postCompletedModifyColumnFamilyAction( ObserverContext ctx, TableName tableName, - HColumnDescriptor columnFamily) throws IOException { + ColumnFamilyDescriptor columnFamily) throws IOException { postCompletedModifyColumnFamilyActionCalled = true; } @@ -1390,14 +1392,14 @@ public class TestMasterObserver { @Override public void preGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, String regex) + List tableNamesList, List descriptors, String regex) throws IOException { preGetTableDescriptorsCalled = true; } @Override public void postGetTableDescriptors(ObserverContext ctx, - List tableNamesList, List descriptors, + List tableNamesList, List descriptors, String regex) throws IOException { postGetTableDescriptorsCalled = true; } @@ -1408,13 +1410,13 @@ public class TestMasterObserver { @Override public void preGetTableNames(ObserverContext ctx, - List descriptors, String regex) throws IOException { + List descriptors, String regex) throws IOException { preGetTableNamesCalled = true; } @Override public void postGetTableNames(ObserverContext ctx, - List descriptors, String regex) throws IOException { + List descriptors, String regex) throws IOException { postGetTableNamesCalled = true; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockNoopMasterServices.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockNoopMasterServices.java index 3c4dc945c5a..1636ba51209 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockNoopMasterServices.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockNoopMasterServices.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.TableDescriptors; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ClusterConnection; import org.apache.hadoop.hbase.client.MasterSwitchType; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.executor.ExecutorService; import org.apache.hadoop.hbase.favored.FavoredNodesManager; import org.apache.hadoop.hbase.master.assignment.AssignmentManager; @@ -236,7 +237,7 @@ public class MockNoopMasterServices implements MasterServices, Server { } @Override - public List listTableDescriptorsByNamespace(String name) throws IOException { + public List listTableDescriptorsByNamespace(String name) throws IOException { return null; //To change body of implemented methods use File | Settings | File Templates. } 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 37537e5432e..f64188790b2 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 @@ -25,8 +25,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import org.apache.hadoop.hbase.shaded.com.google.common.collect.Sets; - import java.io.IOException; import java.util.Collections; import java.util.List; @@ -58,6 +56,7 @@ import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.MasterObserver; @@ -554,7 +553,7 @@ public class TestNamespaceAuditor { @Override public void preCreateTableAction(ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { if (throwExceptionInPreCreateTableAction) { throw new IOException("Throw exception as it is demanded."); } 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 e47cfd5da3c..5627016b67d 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 @@ -49,6 +49,7 @@ import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -629,7 +630,7 @@ public class SecureTestUtil { @Override public void postCompletedCreateTableAction( final ObserverContext ctx, - HTableDescriptor desc, HRegionInfo[] regions) throws IOException { + TableDescriptor desc, HRegionInfo[] regions) throws IOException { // the AccessController test, some times calls only and directly the // postCompletedCreateTableAction() if (tableCreationLatch != null) { 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 afc5844146c..bfd9c1a5df3 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 @@ -44,12 +44,12 @@ import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Increment; -import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; @@ -704,7 +704,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil { public Object run() throws Exception { List tableNamesList = Lists.newArrayList(); tableNamesList.add(TEST_TABLE.getTableName()); - List descriptors = Lists.newArrayList(); + List descriptors = Lists.newArrayList(); ACCESS_CONTROLLER.preGetTableDescriptors(ObserverContext.createAndPrepare(CP_ENV, null), tableNamesList, descriptors, ".+"); return null; @@ -715,7 +715,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil { verifyAllowed(new AccessTestAction() { @Override public Object run() throws Exception { - List descriptors = Lists.newArrayList(); + List descriptors = Lists.newArrayList(); ACCESS_CONTROLLER.preGetTableNames(ObserverContext.createAndPrepare(CP_ENV, null), descriptors, ".+"); return null; 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 bd9d5dc3cf9..5da0d942561 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 @@ -26,8 +26,8 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; @@ -80,7 +80,7 @@ public class TestSnapshotClientRetries { @Override public void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { if (snapshotCount != null) { snapshotCount.incrementAndGet(); @@ -89,7 +89,7 @@ public class TestSnapshotClientRetries { @Override public void preCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) throws IOException { if (cloneCount != null) { cloneCount.incrementAndGet(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java index f6e328e58b0..c18d6d03268 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java @@ -55,9 +55,9 @@ import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionLocator; -import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -598,7 +598,7 @@ public class BaseTestHBaseFsck { @Override public void postCompletedCreateTableAction( final ObserverContext ctx, - final HTableDescriptor desc, + final TableDescriptor desc, final HRegionInfo[] regions) throws IOException { // the AccessController test, some times calls only and directly the // postCompletedCreateTableAction()