public void setTableQuota(final TableName table, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, table, null, null, QuotaUtil.getTableQuota(masterServices.getConnection(), table)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addTableQuota(masterServices.getConnection(), table, quotaPojo.toQuotas()); } @Override public void delete() throws IOException { QuotaUtil.deleteTableQuota(masterServices.getConnection(), table); } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetTableQuota(table, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetTableQuota(table, quotaPojo); } }); }
public void setNamespaceQuota(final String namespace, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, null, namespace, null, QuotaUtil.getNamespaceQuota(masterServices.getConnection(), namespace)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addNamespaceQuota(masterServices.getConnection(), namespace, ((GlobalQuotaSettingsImpl) quotaPojo).toQuotas()); } @Override public void delete() throws IOException { QuotaUtil.deleteNamespaceQuota(masterServices.getConnection(), namespace); } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetNamespaceQuota(namespace, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetNamespaceQuota(namespace, quotaPojo); } }); }
public void setUserQuota(final String userName, final String namespace, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(userName, null, namespace, null, QuotaUtil.getUserQuota(masterServices.getConnection(), userName, namespace)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, namespace, quotaPojo.toQuotas()); } @Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName, namespace); } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetUserQuota( userName, namespace, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetUserQuota( userName, namespace, quotaPojo); } }); }
public void setUserQuota(final String userName, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(req.getUserName(), null, null, null, QuotaUtil.getUserQuota(masterServices.getConnection(), userName)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, quotaPojo.toQuotas()); } @Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName); } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetUserQuota(userName, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetUserQuota(userName, quotaPojo); } }); }
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); } }); }
public void setRegionServerQuota(final String regionServer, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, null, null, regionServer, QuotaUtil.getRegionServerQuota(masterServices.getConnection(), regionServer)); } @Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addRegionServerQuota(masterServices.getConnection(), regionServer, ((GlobalQuotaSettingsImpl) quotaPojo).toQuotas()); } @Override public void delete() throws IOException { QuotaUtil.deleteRegionServerQuota(masterServices.getConnection(), regionServer); } @Override public void preApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().preSetRegionServerQuota(regionServer, quotaPojo); } @Override public void postApply(GlobalQuotaSettingsImpl quotaPojo) throws IOException { masterServices.getMasterCoprocessorHost().postSetRegionServerQuota(regionServer, quotaPojo); } }); }
@Override public SetQuotaResponse setQuota(RpcController c, SetQuotaRequest req) throws ServiceException { try { master.checkInitialized(); return master.getMasterQuotaManager().setQuota(req); } catch (Exception e) { throw new ServiceException(e); } }
public void setNamespaceQuota(final String namespace, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public Quotas fetch() throws IOException { return QuotaUtil.getNamespaceQuota(masterServices.getConnection(), namespace); } @Override public void update(final Quotas quotas) throws IOException { QuotaUtil.addNamespaceQuota(masterServices.getConnection(), namespace, quotas); } @Override public void delete() throws IOException { QuotaUtil.deleteNamespaceQuota(masterServices.getConnection(), namespace); } @Override public void preApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().preSetNamespaceQuota(namespace, quotas); } @Override public void postApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().postSetNamespaceQuota(namespace, quotas); } }); }
public void setUserQuota(final String userName, final TableName table, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public Quotas fetch() throws IOException { return QuotaUtil.getUserQuota(masterServices.getConnection(), userName, table); } @Override public void update(final Quotas quotas) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, table, quotas); } @Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName, table); } @Override public void preApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().preSetUserQuota(userName, table, quotas); } @Override public void postApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().postSetUserQuota(userName, table, quotas); } }); }
public void setUserQuota(final String userName, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public Quotas fetch() throws IOException { return QuotaUtil.getUserQuota(masterServices.getConnection(), userName); } @Override public void update(final Quotas quotas) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, quotas); } @Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName); } @Override public void preApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().preSetUserQuota(userName, quotas); } @Override public void postApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().postSetUserQuota(userName, quotas); } }); }
public void setTableQuota(final TableName table, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public Quotas fetch() throws IOException { return QuotaUtil.getTableQuota(masterServices.getConnection(), table); } @Override public void update(final Quotas quotas) throws IOException { QuotaUtil.addTableQuota(masterServices.getConnection(), table, quotas); } @Override public void delete() throws IOException { QuotaUtil.deleteTableQuota(masterServices.getConnection(), table); } @Override public void preApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().preSetTableQuota(table, quotas); } @Override public void postApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().postSetTableQuota(table, quotas); } }); }
public void setUserQuota(final String userName, final String namespace, final SetQuotaRequest req) throws IOException, InterruptedException { setQuota(req, new SetQuotaOperations() { @Override public Quotas fetch() throws IOException { return QuotaUtil.getUserQuota(masterServices.getConnection(), userName, namespace); } @Override public void update(final Quotas quotas) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, namespace, quotas); } @Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName, namespace); } @Override public void preApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().preSetUserQuota(userName, namespace, quotas); } @Override public void postApply(final Quotas quotas) throws IOException { masterServices.getMasterCoprocessorHost().postSetUserQuota(userName, namespace, quotas); } }); }
@Override public SetQuotaResponse setQuota(RpcController c, SetQuotaRequest req) throws ServiceException { try { master.checkInitialized(); return master.getMasterQuotaManager().setQuota(req); } catch (Exception e) { throw new ServiceException(e); } }