@Override
  public OperationQuota checkBatchQuota(final Region region, final int numWrites,
    final int numReads, boolean isAtomic) throws IOException, RpcThrottlingException {
    Optional<User> user = RpcServer.getRequestUser();
    UserGroupInformation ugi;
    if (user.isPresent()) {
      ugi = user.get().getUGI();
    } else {
      ugi = User.getCurrent().getUGI();
    }
    TableDescriptor tableDescriptor = region.getTableDescriptor();
    TableName table = tableDescriptor.getTableName();

    OperationQuota quota = getQuota(ugi, table, region.getMinBlockSizeBytes());
    try {
      quota.checkBatchQuota(numWrites, numReads, isAtomic);
    } catch (RpcThrottlingException e) {
      LOG.debug("Throttling exception for user=" + ugi.getUserName() + " table=" + table
        + " numWrites=" + numWrites + " numReads=" + numReads + ": " + e.getMessage());
      throw e;
    }
    return quota;
  }
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.
@param region    the region where the operation will be performed
@param numWrites number of writes to perform
@param numReads  number of short-reads to perform
@return the OperationQuota
@throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java