diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java index 923a719264b2..df94bc01ccbe 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java @@ -135,13 +135,23 @@ public interface RegionCoprocessorEnvironment extends CoprocessorEnvironment + * Introduced in 2.6.1. Any custom implementations of this class should implement this method in + * order to take advantage of the new behavior. + *

* @return the RpcQuotaManager */ - RpcQuotaManager getRpcQuotaManager(); + default RpcQuotaManager getRpcQuotaManager() { + throw new UnsupportedOperationException("Not implemented"); + } /** * Check the quota for the current (rpc-context) user. Returns the OperationQuota used to get the * available quota and to report the data/usage of the operation. + *

+ * Introduced in 2.6.1. Any custom implementations of this class should implement this method in + * order to take advantage of the new behavior. + *

* @param scan the scan to be estimated against the quota * @param maxBlockBytesScanned the maximum bytes scanned in a single RPC call by the * scanner @@ -150,33 +160,47 @@ public interface RegionCoprocessorEnvironment extends CoprocessorEnvironment + * Introduced in 2.6.1. Any custom implementations of this class should implement this method in + * order to take advantage of the new behavior. + *

* @param region the region where the operation will be performed * @param type the operation type * @return the OperationQuota * @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded. */ - OperationQuota checkBatchQuota(final Region region, final OperationQuota.OperationType type) - throws IOException, RpcThrottlingException; + default OperationQuota checkBatchQuota(final Region region, + final OperationQuota.OperationType type) throws IOException, RpcThrottlingException { + throw new UnsupportedOperationException("Not implemented"); + } /** * Check the quota for the current (rpc-context) user. Returns the OperationQuota used to get the * available quota and to report the data/usage of the operation. This method does not support * scans because estimating a scan's workload is more complicated than estimating the workload of * a get/put. + *

+ * Introduced in 2.6.1. Any custom implementations of this class should implement this method in + * order to take advantage of the new behavior. + *

* @param region the region where the operation will be performed * @param numWrites number of writes to count against quota * @param numReads number of reads to count against quota * @return the OperationQuota * @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded. */ - OperationQuota checkBatchQuota(final Region region, int numWrites, int numReads) - throws IOException, RpcThrottlingException; + default OperationQuota checkBatchQuota(final Region region, int numWrites, int numReads) + throws IOException, RpcThrottlingException { + throw new UnsupportedOperationException("Not implemented"); + } }