Skip to content

Commit

Permalink
HBASE-26745: Include balancer cost metrics in jmx endpoint (apache#4140)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Purtell <apurtell@apache.org>
  • Loading branch information
briaugenreich authored and apurtell committed Mar 3, 2022
1 parent 36e1a1d commit 067c28e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private static void writeAttribute(JsonWriter writer, MBeanServer mBeanServer, O
if ("modelerType".equals(attName)) {
return;
}
if (attName.indexOf("=") >= 0 || attName.indexOf(":") >= 0 || attName.indexOf(" ") >= 0) {
if (attName.indexOf("=") >= 0 || attName.indexOf(" ") >= 0) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private MBeanServer getMockMBeanServer() throws Exception {
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],
Expand All @@ -77,6 +77,7 @@ private MBeanServer getMockMBeanServer() throws Exception {
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;
}

Expand All @@ -92,7 +93,8 @@ private String getExpectedJSON() {
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("}");
Expand Down

0 comments on commit 067c28e

Please sign in to comment.