From e2b797be390f05c55a490a64bc72e2d8c19fcbb7 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Mon, 14 Aug 2017 14:02:30 +0800 Subject: [PATCH] HBASE-18528 DON'T allow user to modify the passed table/column descriptor --- .../client/ImmutableHColumnDescriptor.java | 5 +- .../client/ImmutableHTableDescriptor.java | 11 ++- .../hbase/coprocessor/MasterObserver.java | 48 +++++------ .../hbase/master/MasterCoprocessorHost.java | 80 +++++++++++-------- 4 files changed, 79 insertions(+), 65 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHColumnDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHColumnDescriptor.java index c8d34ff957d..89ef851fe1f 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHColumnDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHColumnDescriptor.java @@ -35,8 +35,9 @@ public class ImmutableHColumnDescriptor extends HColumnDescriptor { super(desc, false); } - ImmutableHColumnDescriptor(final ModifyableColumnFamilyDescriptor desc) { - super(desc); + public ImmutableHColumnDescriptor(final ColumnFamilyDescriptor desc) { + super(desc instanceof ModifyableColumnFamilyDescriptor ? + (ModifyableColumnFamilyDescriptor) desc : new ModifyableColumnFamilyDescriptor(desc)); } @Override diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHTableDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHTableDescriptor.java index 4e9e9afc3cf..169f143c1ee 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHTableDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ImmutableHTableDescriptor.java @@ -28,19 +28,17 @@ import org.apache.hadoop.hbase.HTableDescriptor; * Read-only table descriptor. */ @Deprecated // deprecated for hbase 2.0, remove for hbase 3.0. see HTableDescriptor. -@InterfaceAudience.Public +@InterfaceAudience.Private public class ImmutableHTableDescriptor extends HTableDescriptor { @Override protected HColumnDescriptor toHColumnDescriptor(ColumnFamilyDescriptor desc) { if (desc == null) { return null; - } else if (desc instanceof ModifyableColumnFamilyDescriptor) { - return new ImmutableHColumnDescriptor((ModifyableColumnFamilyDescriptor) desc); } else if (desc instanceof HColumnDescriptor) { return new ImmutableHColumnDescriptor((HColumnDescriptor) desc); } else { - return new ImmutableHColumnDescriptor(new ModifyableColumnFamilyDescriptor(desc)); + return new ImmutableHColumnDescriptor(desc); } } /* @@ -51,6 +49,11 @@ public class ImmutableHTableDescriptor extends HTableDescriptor { super(desc, false); } + public ImmutableHTableDescriptor(final TableDescriptor desc) { + super(desc instanceof ModifyableTableDescriptor ? + (ModifyableTableDescriptor) desc : new ModifyableTableDescriptor(desc.getTableName(), desc)); + } + @Override protected ModifyableTableDescriptor getDelegateeForModification() { throw new UnsupportedOperationException("HTableDescriptor is read-only"); 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 f4f5db3150b..8e368ba8e9c 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 @@ -107,7 +107,7 @@ public interface MasterObserver extends Coprocessor { * table handler and it is async to the create 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 read-only HTableDescriptor for the table * @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). @@ -122,7 +122,7 @@ public interface MasterObserver extends Coprocessor { * of create table RPC call. Called as part of create table handler and * it is async to the create RPC call. * @param ctx the environment to interact with the framework and master - * @param desc the HTableDescriptor for the table + * @param desc the read-only HTableDescriptor for the table * @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). @@ -368,7 +368,7 @@ 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 read-only HTableDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-15575). * Use {@link #preModifyTableAction(ObserverContext, TableName, TableDescriptor)}. @@ -384,7 +384,7 @@ 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 read-only HTableDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #postCompletedModifyTableAction(ObserverContext, TableName, TableDescriptor)}. @@ -435,7 +435,7 @@ public interface MasterObserver extends Coprocessor { * add column RPC call. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #preAddColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -464,7 +464,7 @@ public interface MasterObserver extends Coprocessor { * add column RPC call. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #postAddColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -493,7 +493,7 @@ public interface MasterObserver extends Coprocessor { * add column handler. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use * {@link #preAddColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -525,7 +525,7 @@ public interface MasterObserver extends Coprocessor { * add column handler. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use * {@link #postCompletedAddColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -557,7 +557,7 @@ public interface MasterObserver extends Coprocessor { * modify column RPC call. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #preModifyColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -586,7 +586,7 @@ public interface MasterObserver extends Coprocessor { * column RPC call. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #postModifyColumnFamily(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -615,7 +615,7 @@ public interface MasterObserver extends Coprocessor { * modify column handler. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). * Use {@link #preModifyColumnFamilyAction(ObserverContext, TableName, ColumnFamilyDescriptor)}. @@ -647,7 +647,7 @@ public interface MasterObserver extends Coprocessor { * column handler. * @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 read-only HColumnDescriptor * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (HBASE-13645). Use * {@link #postCompletedModifyColumnFamilyAction(ObserverContext,TableName,ColumnFamilyDescriptor)}. @@ -1284,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 TableDescriptor of the table to snapshot + * @param tableDescriptor the TableDescriptor of the table to snapshot */ default void preSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** @@ -1295,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 TableDescriptor of the table to snapshot + * @param tableDescriptor the TableDescriptor of the table to snapshot */ default void postSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** @@ -1325,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 TableDescriptor of the table to create + * @param tableDescriptor the TableDescriptor of the table to create */ default void preCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** @@ -1336,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 v of the table to create + * @param tableDescriptor the v of the table to create */ default void postCloneSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** @@ -1348,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 TableDescriptor of the table to restore + * @param tableDescriptor the TableDescriptor of the table to restore */ default void preRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** @@ -1359,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 TableDescriptor of the table to restore + * @param tableDescriptor the TableDescriptor of the table to restore */ default void postRestoreSnapshot(final ObserverContext ctx, - final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor) + final SnapshotDescription snapshot, final TableDescriptor tableDescriptor) throws IOException {} /** 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 04bdacf60b0..004f91d5e6b 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,7 +22,6 @@ 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; @@ -38,6 +37,9 @@ import org.apache.hadoop.hbase.ProcedureInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; +import org.apache.hadoop.hbase.client.ImmutableHColumnDescriptor; +import org.apache.hadoop.hbase.client.ImmutableHTableDescriptor; import org.apache.hadoop.hbase.client.MasterSwitchType; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -243,7 +245,7 @@ public class MasterCoprocessorHost /* Implementation of hooks for invoking MasterObservers */ - public void preCreateTable(final HTableDescriptor htd, final HRegionInfo[] regions) + public void preCreateTable(final TableDescriptor htd, final HRegionInfo[] regions) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override @@ -254,7 +256,7 @@ public class MasterCoprocessorHost }); } - public void postCreateTable(final HTableDescriptor htd, final HRegionInfo[] regions) + public void postCreateTable(final TableDescriptor htd, final HRegionInfo[] regions) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override @@ -265,26 +267,26 @@ public class MasterCoprocessorHost }); } - public void preCreateTableAction(final HTableDescriptor htd, final HRegionInfo[] regions, + public void preCreateTableAction(final TableDescriptor htd, final HRegionInfo[] regions, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preCreateTableHandler(ctx, htd, regions); + oserver.preCreateTableHandler(ctx, toImmutableHTableDescriptor(htd), regions); oserver.preCreateTableAction(ctx, htd, regions); } }); } public void postCompletedCreateTableAction( - final HTableDescriptor htd, final HRegionInfo[] regions, final User user) throws IOException { + final TableDescriptor htd, final HRegionInfo[] regions, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postCreateTableHandler(ctx, htd, regions); + oserver.postCreateTableHandler(ctx, toImmutableHTableDescriptor(htd), regions); oserver.postCompletedCreateTableAction(ctx, htd, regions); } }); @@ -376,7 +378,7 @@ public class MasterCoprocessorHost }); } - public void preModifyTable(final TableName tableName, final HTableDescriptor htd) + public void preModifyTable(final TableName tableName, final TableDescriptor htd) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override @@ -387,7 +389,7 @@ public class MasterCoprocessorHost }); } - public void postModifyTable(final TableName tableName, final HTableDescriptor htd) + public void postModifyTable(final TableName tableName, final TableDescriptor htd) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override @@ -398,51 +400,51 @@ public class MasterCoprocessorHost }); } - public void preModifyTableAction(final TableName tableName, final HTableDescriptor htd, + public void preModifyTableAction(final TableName tableName, final TableDescriptor htd, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preModifyTableHandler(ctx, tableName, htd); + oserver.preModifyTableHandler(ctx, tableName, toImmutableHTableDescriptor(htd)); oserver.preModifyTableAction(ctx, tableName, htd); } }); } - public void postCompletedModifyTableAction(final TableName tableName, final HTableDescriptor htd, + public void postCompletedModifyTableAction(final TableName tableName, final TableDescriptor htd, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postModifyTableHandler(ctx, tableName, htd); + oserver.postModifyTableHandler(ctx, tableName, toImmutableHTableDescriptor(htd)); oserver.postCompletedModifyTableAction(ctx, tableName, htd); } }); } - public boolean preAddColumn(final TableName tableName, final HColumnDescriptor columnFamily) + public boolean preAddColumn(final TableName tableName, final ColumnFamilyDescriptor columnFamily) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preAddColumn(ctx, tableName, columnFamily); + oserver.preAddColumn(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.preAddColumnFamily(ctx, tableName, columnFamily); } }); } - public void postAddColumn(final TableName tableName, final HColumnDescriptor columnFamily) + public void postAddColumn(final TableName tableName, final ColumnFamilyDescriptor columnFamily) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postAddColumn(ctx, tableName, columnFamily); + oserver.postAddColumn(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.postAddColumnFamily(ctx, tableName, columnFamily); } }); @@ -450,14 +452,14 @@ public class MasterCoprocessorHost public boolean preAddColumnFamilyAction( final TableName tableName, - final HColumnDescriptor columnFamily, + final ColumnFamilyDescriptor columnFamily, final User user) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preAddColumnHandler(ctx, tableName, columnFamily); + oserver.preAddColumnHandler(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.preAddColumnFamilyAction(ctx, tableName, columnFamily); } }); @@ -465,38 +467,38 @@ public class MasterCoprocessorHost public void postCompletedAddColumnFamilyAction( final TableName tableName, - final HColumnDescriptor columnFamily, + final ColumnFamilyDescriptor columnFamily, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postAddColumnHandler(ctx, tableName, columnFamily); + oserver.postAddColumnHandler(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.postCompletedAddColumnFamilyAction(ctx, tableName, columnFamily); } }); } - public boolean preModifyColumn(final TableName tableName, final HColumnDescriptor columnFamily) + public boolean preModifyColumn(final TableName tableName, final ColumnFamilyDescriptor columnFamily) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preModifyColumn(ctx, tableName, columnFamily); + oserver.preModifyColumn(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.preModifyColumnFamily(ctx, tableName, columnFamily); } }); } - public void postModifyColumn(final TableName tableName, final HColumnDescriptor columnFamily) + public void postModifyColumn(final TableName tableName, final ColumnFamilyDescriptor columnFamily) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postModifyColumn(ctx, tableName, columnFamily); + oserver.postModifyColumn(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.postModifyColumnFamily(ctx, tableName, columnFamily); } }); @@ -504,13 +506,13 @@ public class MasterCoprocessorHost public boolean preModifyColumnFamilyAction( final TableName tableName, - final HColumnDescriptor columnFamily, + final ColumnFamilyDescriptor columnFamily, final User user) throws IOException { return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.preModifyColumnHandler(ctx, tableName, columnFamily); + oserver.preModifyColumnHandler(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.preModifyColumnFamilyAction(ctx, tableName, columnFamily); } }); @@ -518,13 +520,13 @@ public class MasterCoprocessorHost public void postCompletedModifyColumnFamilyAction( final TableName tableName, - final HColumnDescriptor columnFamily, + final ColumnFamilyDescriptor columnFamily, final User user) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation(user) { @Override public void call(MasterObserver oserver, ObserverContext ctx) throws IOException { - oserver.postModifyColumnHandler(ctx, tableName, columnFamily); + oserver.postModifyColumnHandler(ctx, tableName, toImmutableHColumnDescriptor(columnFamily)); oserver.postCompletedModifyColumnFamilyAction(ctx, tableName, columnFamily); } }); @@ -1155,7 +1157,7 @@ public class MasterCoprocessorHost } public void preSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1166,7 +1168,7 @@ public class MasterCoprocessorHost } public void postSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1197,7 +1199,7 @@ public class MasterCoprocessorHost } public void preCloneSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1208,7 +1210,7 @@ public class MasterCoprocessorHost } public void postCloneSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1219,7 +1221,7 @@ public class MasterCoprocessorHost } public void preRestoreSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1230,7 +1232,7 @@ public class MasterCoprocessorHost } public void postRestoreSnapshot(final SnapshotDescription snapshot, - final HTableDescriptor hTableDescriptor) throws IOException { + final TableDescriptor hTableDescriptor) throws IOException { execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() { @Override public void call(MasterObserver oserver, ObserverContext ctx) @@ -1875,4 +1877,12 @@ public class MasterCoprocessorHost } }); } + + private static ImmutableHTableDescriptor toImmutableHTableDescriptor(TableDescriptor desc) { + return new ImmutableHTableDescriptor(desc); + } + + private static ImmutableHColumnDescriptor toImmutableHColumnDescriptor(ColumnFamilyDescriptor desc) { + return new ImmutableHColumnDescriptor(desc); + } }