[ 
https://issues.apache.org/jira/browse/HBASE-13357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385624#comment-14385624
 ] 

Srikanth Srungarapu commented on HBASE-13357:
---------------------------------------------

Patch looks ok to me. It is a good practice to clean up the resources we've 
created towards the end of the test. Though this is not critical, it is more 
related to code hygiene. What say ? 
{code}
+  @Test(expected = QuotaExceededException.class, timeout = 30000)
+  public void testExceedTableQuotaInNamespace() throws Exception {
+    String nsp = prefix + "_testExceedTableQuotaInNamespace";
+    NamespaceDescriptor nspDesc =
+        
NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_TABLES,
 "1")
+            .build();
+    ADMIN.createNamespace(nspDesc);
+    assertNotNull("Namespace descriptor found null.", 
ADMIN.getNamespaceDescriptor(nsp));
+    assertEquals(ADMIN.listNamespaceDescriptors().length, 3);
+    HTableDescriptor tableDescOne =
+        new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM 
+ "table1"));
+    HTableDescriptor tableDescTwo =
+        new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM 
+ "table2"));
+    ADMIN.createTable(tableDescOne);
+    ADMIN.createTable(tableDescTwo, Bytes.toBytes("AAA"), 
Bytes.toBytes("ZZZ"), 4);
+  }
{code}

> If maxTables/maxRegions exceeds quota in a namespace, throw 
> QuotaExceededException
> ----------------------------------------------------------------------------------
>
>                 Key: HBASE-13357
>                 URL: https://issues.apache.org/jira/browse/HBASE-13357
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Ashish Singhi
>            Assignee: Ashish Singhi
>            Priority: Minor
>              Labels: quota
>             Fix For: 2.0.0
>
>         Attachments: HBASE-13357.patch
>
>
> If maximum number of tables or regions count exceeds in a namespace we are 
> throwing DoNotRetryIOException instead we should throw QuotaExceededException.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to