public void setUserQuota(final String userName, final TableName table, final SetQuotaRequest req)
    throws IOException, InterruptedException {
    setQuota(req, new SetQuotaOperations() {
      @Override
      public GlobalQuotaSettingsImpl fetch() throws IOException {
        return new GlobalQuotaSettingsImpl(userName, table, null, null,
          QuotaUtil.getUserQuota(masterServices.getConnection(), userName, table));
      }

      @Override
      public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException {
        QuotaUtil.addUserQuota(masterServices.getConnection(), userName, table,
          quotaPojo.toQuotas());
      }

      @Override
      public void delete() throws IOException {
        QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName, table);
      }

      @Override
      public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException {
        masterServices.getMasterCoprocessorHost().preSetUserQuota(userName, table, quotaPojo);
      }

      @Override
      public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException {
        masterServices.getMasterCoprocessorHost().postSetUserQuota(userName, table, quotaPojo);
      }
    });
  }
Master Quota Manager. It is responsible for initialize the quota table on the first-run and
provide the admin operations to interact with the quota table. TODO: FUTURE: The master will be
responsible to notify each RS of quota changes and it will do the "quota aggregation" when the
QuotaScope is CLUSTER.
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java