diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java index ca08992615d..42da86acc9b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java @@ -459,49 +459,6 @@ public abstract class CoprocessorHost - *
  • {@link org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost} - *
  • {@link org.apache.hadoop.hbase.regionserver.wal.WALCoprocessorHost} - * - * - * @param clazz Coprocessor you wish to evaluate - * @param methodName the name of the non-deprecated method version - * @param parameterTypes the Class of the non-deprecated method's arguments in the order they are - * declared. - */ - @InterfaceAudience.Private - protected static boolean useLegacyMethod(final Class clazz, - final String methodName, final Class... parameterTypes) { - boolean useLegacy; - // Use reflection to see if they implement the non-deprecated version - try { - clazz.getDeclaredMethod(methodName, parameterTypes); - LOG.debug("Found an implementation of '" + methodName + "' that uses updated method " + - "signature. Skipping legacy support for invocations in '" + clazz +"'."); - useLegacy = false; - } catch (NoSuchMethodException exception) { - useLegacy = true; - } catch (SecurityException exception) { - LOG.warn("The Security Manager denied our attempt to detect if the coprocessor '" + clazz + - "' requires legacy support; assuming it does. If you get later errors about legacy " + - "coprocessor use, consider updating your security policy to allow access to the package" + - " and declared members of your implementation."); - LOG.debug("Details of Security Manager rejection.", exception); - useLegacy = true; - } - return useLegacy; - } - /** * Used to limit legacy handling to once per Coprocessor class per classloader. */ @@ -517,21 +474,6 @@ public abstract class CoprocessorHost clazz, final String message) { - if(legacyWarning.add(clazz)) { - LOG.error("You have a legacy coprocessor loaded and there are events we can't map to the " + - " deprecated API. Your coprocessor will not see these events. Please update '" + clazz + - "'. Details of the problem: " + message); - } - } - /** * Implementations defined function to get an observer of type {@code O} from a coprocessor of * type {@code C}. Concrete implementations of CoprocessorHost define one getter for each 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 ee7bcd6e6a3..9eb2ec8d859 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 @@ -47,7 +47,6 @@ import org.apache.hadoop.hbase.coprocessor.MasterCoprocessor; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.MetricsCoprocessor; -import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.master.locking.LockProcedure; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.metrics.MetricRegistry; @@ -80,7 +79,6 @@ public class MasterCoprocessorHost */ private static class MasterEnvironment extends BaseEnvironment implements MasterCoprocessorEnvironment { - private final boolean supportGroupCPs; private final MetricRegistry metricRegistry; private final MasterServices services; @@ -88,8 +86,6 @@ public class MasterCoprocessorHost final Configuration conf, final MasterServices services) { super(impl, priority, seq, conf); this.services = services; - supportGroupCPs = !useLegacyMethod(impl.getClass(), - "preBalanceRSGroup", ObserverContext.class, String.class); this.metricRegistry = MetricsCoprocessor.createRegistryForMasterCoprocessor(impl.getClass().getName()); } @@ -1264,9 +1260,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preMoveServersAndTables(this, servers, tables, targetGroup); - } + observer.preMoveServersAndTables(this, servers, tables, targetGroup); } }); } @@ -1276,9 +1270,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postMoveServersAndTables(this, servers, tables, targetGroup); - } + observer.postMoveServersAndTables(this, servers, tables, targetGroup); } }); } @@ -1288,9 +1280,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preMoveServers(this, servers, targetGroup); - } + observer.preMoveServers(this, servers, targetGroup); } }); } @@ -1300,9 +1290,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postMoveServers(this, servers, targetGroup); - } + observer.postMoveServers(this, servers, targetGroup); } }); } @@ -1312,9 +1300,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preMoveTables(this, tables, targetGroup); - } + observer.preMoveTables(this, tables, targetGroup); } }); } @@ -1324,9 +1310,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postMoveTables(this, tables, targetGroup); - } + observer.postMoveTables(this, tables, targetGroup); } }); } @@ -1336,9 +1320,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preAddRSGroup(this, name); - } + observer.preAddRSGroup(this, name); } }); } @@ -1348,9 +1330,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if (((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postAddRSGroup(this, name); - } + observer.postAddRSGroup(this, name); } }); } @@ -1360,9 +1340,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preRemoveRSGroup(this, name); - } + observer.preRemoveRSGroup(this, name); } }); } @@ -1372,9 +1350,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postRemoveRSGroup(this, name); - } + observer.postRemoveRSGroup(this, name); } }); } @@ -1384,9 +1360,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preBalanceRSGroup(this, name); - } + observer.preBalanceRSGroup(this, name); } }); } @@ -1396,9 +1370,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postBalanceRSGroup(this, name, balanceRan); - } + observer.postBalanceRSGroup(this, name, balanceRan); } }); } @@ -1408,9 +1380,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.preRemoveServers(this, servers); - } + observer.preRemoveServers(this, servers); } }); } @@ -1420,9 +1390,7 @@ public class MasterCoprocessorHost execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() { @Override public void call(MasterObserver observer) throws IOException { - if(((MasterEnvironment)getEnvironment()).supportGroupCPs) { - observer.postRemoveServers(this, servers); - } + observer.postRemoveServers(this, servers); } }); }