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

Ted Yu commented on HBASE-8410:
-------------------------------

{code}
+public class ZKNamespaceStateManager extends ZooKeeperListener {
{code}
Please add class javadoc.
{code}
+  * Starts the ZKNamespaceStateManager and created the associated ZNode.
{code}
'created' -> 'creates'
{code}
+  * @return the state
+  * @throws IOException Signals that an I/O exception has occurred.
+  */
+ public NamespaceTableAndRegionInfo getState(String name) throws IOException {
+   NamespaceTableAndRegionInfo info = nsStateCache.get(name);
{code}
Would IOException come from ConcurrentSkipListMap.get() ?
Please clarify the return value javadoc.
{code}
+     if (nodeData.length != 0) {
+     NamespaceTableAndRegionInfo ns = ProtobufUtil
+         .toNamespaceState(NamespaceStateProtos.NamespaceTableAndRegionInfo
+             .parseFrom(nodeData));
+     nsStateCache.put(ns.getName(), ns);
+     } else {
{code}
Please fix indentation in the if block.
{code}
[email protected]
+public class NamespaceAuditor extends BaseRegionObserver implements 
MasterObserver {
{code}
Can NamespaceAuditor be marked @InterfaceAudience.Private ?
{code}
+    } else if (e instanceof RegionCoprocessorEnvironment) {
+      // if running at region
+      RegionCoprocessorEnvironment regionEnv = (RegionCoprocessorEnvironment) 
e;
+      rsServices = regionEnv.getRegionServerServices();
+      stateManager = new ZKNamespaceStateManager(rsServices.getZooKeeper());
+    }
{code}
Is the above needed ? I thought auditor runs at region server level.


> Basic quota support for namespaces
> ----------------------------------
>
>                 Key: HBASE-8410
>                 URL: https://issues.apache.org/jira/browse/HBASE-8410
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Francis Liu
>            Assignee: Vandana Ayyalasomayajula
>         Attachments: HBASE-8410_trunk_10.patch, HBASE-8410_trunk_2.patch, 
> HBASE-8410_trunk_3.patch, HBASE-8410_trunk_4.patch, HBASE-8410_trunk_4.patch, 
> HBASE-8410_trunk_5.patch, HBASE-8410_trunk_6.patch, HBASE-8410_trunk_7.patch, 
> HBASE-8410_trunk_8.patch, HBASE-8410_trunk_9.patch, HBASE_8410.patch, 
> HBASE_8410_1_trunk.patch
>
>
> This task involves creating an observer which provides basic quota support to 
> namespaces in terms of (1) number of tables and (2) number of regions. The 
> quota support can be enabled by setting:
> <property>
>     <name>hbase.coprocessor.region.classes</name>
>     <value>org.apache.hadoop.hbase.namespace.NamespaceController</value>
> </property>
> <property>
>     <name>hbase.coprocessor.master.classes</name>
>     <value>org.apache.hadoop.hbase.namespace.NamespaceController</value>
> </property>
> in the hbase-site.xml.
> To add quotas to namespace, while creating namespace properties need to be 
> added.
> Examples:
> 1. namespace_create 'ns1', {'hbase.namespace.quota.maxregion'=>'10'}
> 2. 1. namespace_create 'ns2', {'hbase.namespace.quota.maxtables'=>'2'}, 
> {'hbase.namespace.quota.maxregion'=>'5'}
> The quotas can be modified/added to namespace at any point of time. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to