anoopsjohn commented on a change in pull request #2370:
URL: https://github.com/apache/hbase/pull/2370#discussion_r486238893



##########
File path: hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
##########
@@ -216,7 +239,12 @@ private static int write(JsonWriter writer, MBeanServer 
mBeanServer, ObjectName
       } else {
         MBeanAttributeInfo[] attrs = minfo.getAttributes();
         for (int i = 0; i < attrs.length; i++) {
-          writeAttribute(writer, mBeanServer, oname, description, attrs[i]);
+          if (matchingPattern != null) {

Review comment:
       Infact u can see we dont need such if else, end of the day we call same 
writeAttribute which is having Pattern[] arg and we have null check there 
anyways. 

##########
File path: hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
##########
@@ -125,11 +130,13 @@ public int write(MBeanServer mBeanServer, ObjectName qry, 
String attribute,
    */
   private static int write(JsonWriter writer, MBeanServer mBeanServer, 
ObjectName qry,
       String attribute, boolean description) throws IOException {
-    LOG.trace("Listing beans for " + qry);
+    LOG.debug("Listing beans for " + qry);

Review comment:
       Ok to change. Can u also change to use {} format log line. Anyways that 
will be nice to have

##########
File path: hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
##########
@@ -225,8 +253,14 @@ private static int write(JsonWriter writer, MBeanServer 
mBeanServer, ObjectName
     return 0;
   }
 
+  private static void writeAttribute(final JsonWriter jg, final MBeanServer 
mBeanServer,

Review comment:
       Ya even this also not needed.

##########
File path: hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
##########
@@ -237,6 +271,21 @@ private static void writeAttribute(JsonWriter writer, 
MBeanServer mBeanServer, O
     if (attName.indexOf("=") >= 0 || attName.indexOf(":") >= 0 || 
attName.indexOf(" ") >= 0) {
       return;
     }
+
+    if (pattern != null) {
+      boolean matchFound = false;
+      for (Pattern compile : pattern) {

Review comment:
       Call its  pattern : patterns?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to