public OperationQuota checkQuota(String userName, Statement s) throws RpcThrottlingException {
    if (!IoTDBDescriptor.getInstance().getConfig().isQuotaEnable()) {
      return NoopOperationQuota.get();
    }
    switch (s.getType()) {
      case INSERT:
      case BATCH_INSERT:
      case BATCH_INSERT_ONE_DEVICE:
      case BATCH_INSERT_ROWS:
      case MULTI_BATCH_INSERT:
      case PIPE_ENRICHED:
        return checkQuota(userName, 1, 0, s);
      case QUERY:
      case GROUP_BY_TIME:
      case QUERY_INDEX:
      case AGGREGATION:
      case UDAF:
      case UDTF:
      case LAST:
      case FILL:
      case GROUP_BY_FILL:
      case SELECT_INTO:
        return checkQuota(userName, 0, 1, s);
      default:
        return NoopOperationQuota.get();
    }
  }
Check the quota for the current (rpc-context) user. Returns the {@link OperationQuota} used to
get the available quota and to report the data/usage of the operation.

@param userName the region where the operation will be performed
@return the {@link OperationQuota}
@throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/quotas/DataNodeThrottleQuotaManager.java