@Override
  public void postDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx,
    String namespace) throws IOException {
    // Do nothing if quotas aren't enabled
    if (!quotasEnabled) {
      return;
    }
    final Connection conn = ctx.getEnvironment().getConnection();
    Quotas quotas = QuotaUtil.getNamespaceQuota(conn, namespace);
    if (quotas != null) {
      if (quotas.hasSpace()) {
        QuotaSettings settings = QuotaSettingsFactory.removeNamespaceSpaceLimit(namespace);
        try (Admin admin = conn.getAdmin()) {
          admin.setQuota(settings);
        }
      }
      if (quotas.hasThrottle()) {
        QuotaSettings settings = QuotaSettingsFactory.unthrottleNamespace(namespace);
        try (Admin admin = conn.getAdmin()) {
          admin.setQuota(settings);
        }
      }
    }
  }
An observer to automatically delete quotas when a table/namespace is deleted.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotasObserver.java