This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new 067c28e HBASE-26745: Include balancer cost metrics in jmx endpoint
(#4140)
067c28e is described below
commit 067c28e9aee26c3f7d8f24e5861997ecfbc691af
Author: Bri Augenreich <[email protected]>
AuthorDate: Wed Mar 2 20:38:05 2022 -0500
HBASE-26745: Include balancer cost metrics in jmx endpoint (#4140)
Signed-off-by: Andrew Purtell <[email protected]>
---
hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java | 2 +-
.../src/test/java/org/apache/hadoop/hbase/util/TestJSONBean.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git
a/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
b/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
index 0dbe0fd..def2611 100644
--- a/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
+++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
@@ -255,7 +255,7 @@ public class JSONBean {
if ("modelerType".equals(attName)) {
return;
}
- if (attName.indexOf("=") >= 0 || attName.indexOf(":") >= 0 ||
attName.indexOf(" ") >= 0) {
+ if (attName.indexOf("=") >= 0 || attName.indexOf(" ") >= 0) {
return;
}
diff --git
a/hbase-http/src/test/java/org/apache/hadoop/hbase/util/TestJSONBean.java
b/hbase-http/src/test/java/org/apache/hadoop/hbase/util/TestJSONBean.java
index 0db6d12..c277cd0 100644
--- a/hbase-http/src/test/java/org/apache/hadoop/hbase/util/TestJSONBean.java
+++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/util/TestJSONBean.java
@@ -59,7 +59,7 @@ public class TestJSONBean {
MBeanInfo mbeanInfo = mock(MBeanInfo.class);
when(mbeanInfo.getClassName()).thenReturn("testClassName");
String[] attributeNames = new String[] {"intAttr", "nanAttr",
"infinityAttr",
- "strAttr", "boolAttr"};
+ "strAttr", "boolAttr", "test:Attr"};
MBeanAttributeInfo[] attributeInfos = new
MBeanAttributeInfo[attributeNames.length];
for (int i = 0; i < attributeInfos.length; i++) {
attributeInfos[i] = new MBeanAttributeInfo(attributeNames[i],
@@ -77,6 +77,7 @@ public class TestJSONBean {
thenReturn(Double.POSITIVE_INFINITY);
when(mbeanServer.getAttribute(any(), eq("strAttr"))).thenReturn("aString");
when(mbeanServer.getAttribute(any(), eq("boolAttr"))).thenReturn(true);
+ when(mbeanServer.getAttribute(any(),
eq("test:Attr"))).thenReturn("aString");
return mbeanServer;
}
@@ -92,7 +93,8 @@ public class TestJSONBean {
pw.println(" \"nanAttr\": \"NaN\",");
pw.println(" \"infinityAttr\": \"Infinity\",");
pw.println(" \"strAttr\": \"aString\",");
- pw.println(" \"boolAttr\": true");
+ pw.println(" \"boolAttr\": true,");
+ pw.println(" \"test:Attr\": aString");
pw.println(" }");
pw.println(" ]");
pw.print("}");