@Override public void delete() throws IOException { QuotaUtil.deleteNamespaceQuota(masterServices.getConnection(), namespace); } @Override
if (namespace != null) { LOG.debug("Deleting quota for namespace: " + namespace); QuotaUtil.deleteNamespaceQuota(conn, namespace); } else if (tableName != null) { LOG.debug("Deleting quota for table: " + tableName);
@Test public void testNamespaceQuotaUtil() throws Exception { final String namespace = "testNamespaceQuotaUtilNS"; Quotas quota = Quotas.newBuilder() .setThrottle(Throttle.newBuilder() .setReqNum(ProtobufUtil.toTimedQuota(1000, TimeUnit.SECONDS, QuotaScope.MACHINE)) .setWriteNum(ProtobufUtil.toTimedQuota(600, TimeUnit.SECONDS, QuotaScope.MACHINE)) .setReadSize(ProtobufUtil.toTimedQuota(8192, TimeUnit.SECONDS, QuotaScope.MACHINE)) .build()) .build(); // Add user quota and verify it QuotaUtil.addNamespaceQuota(this.connection, namespace, quota); Quotas resQuota = QuotaUtil.getNamespaceQuota(this.connection, namespace); assertEquals(quota, resQuota); // Remove user quota and verify it QuotaUtil.deleteNamespaceQuota(this.connection, namespace); resQuota = QuotaUtil.getNamespaceQuota(this.connection, namespace); assertEquals(null, resQuota); }
@Override public void delete() throws IOException { QuotaUtil.deleteNamespaceQuota(masterServices.getConnection(), namespace); }
if (namespace != null) { LOG.debug("Deleting quota for namespace: " + namespace); QuotaUtil.deleteNamespaceQuota(conn, namespace); } else { assert tableName != null;
@Test public void testNamespaceQuotaUtil() throws Exception { final String namespace = "testNamespaceQuotaUtilNS"; Quotas quota = Quotas.newBuilder() .setThrottle(Throttle.newBuilder() .setReqNum(ProtobufUtil.toTimedQuota(1000, TimeUnit.SECONDS, QuotaScope.MACHINE)) .setWriteNum(ProtobufUtil.toTimedQuota(600, TimeUnit.SECONDS, QuotaScope.MACHINE)) .setReadSize(ProtobufUtil.toTimedQuota(8192, TimeUnit.SECONDS, QuotaScope.MACHINE)) .build()) .build(); // Add user quota and verify it QuotaUtil.addNamespaceQuota(this.connection, namespace, quota); Quotas resQuota = QuotaUtil.getNamespaceQuota(this.connection, namespace); assertEquals(quota, resQuota); // Remove user quota and verify it QuotaUtil.deleteNamespaceQuota(this.connection, namespace); resQuota = QuotaUtil.getNamespaceQuota(this.connection, namespace); assertEquals(null, resQuota); }