Skip to content

Commit 923be19

Browse files
authored
Merge pull request #16 from tinawenqiao/dev
1.Modify KafkaBrokerFilter.yml 2.Modify beanname get method. Canonica…
2 parents bad57f8 + 879082f commit 923be19

File tree

10 files changed

+904
-173
lines changed

10 files changed

+904
-173
lines changed

JMXFilterTemplate/KafkaBrokerFilter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ filters:
55
#
66
- include:
77
domain: kafka.server
8-
bean_regex: kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec.*
8+
bean: kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec
99
attribute:
1010
Count:
1111
metric_type: KAFKA_BROKER_VOLUMN
@@ -15,7 +15,7 @@ filters:
1515
alias: BytesInPerSec
1616
- include:
1717
domain: kafka.server
18-
bean_regex: kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec.*
18+
bean: kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec
1919
attribute:
2020
Count:
2121
metric_type: KAFKA_BROKER_VOLUMN
@@ -25,7 +25,7 @@ filters:
2525
alias: BytesOutPerSec
2626
- include:
2727
domain: kafka.server
28-
bean_regex: kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec.*
28+
bean: kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec
2929
attribute:
3030
Count:
3131
metric_type: KAFKA_BROKER_VOLUMN

docs/definitions.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,21 @@ __optional__|enum (success, failure)
9191
__Type__ : < string, object > map
9292

9393

94+
[[_healthcheckresult]]
95+
=== HealthCheckResult
96+
97+
[options="header", cols=".^3,.^11,.^4"]
98+
|===
99+
|Name|Description|Schema
100+
|**msg** +
101+
__optional__||string
102+
|**status** +
103+
__optional__||string
104+
|**timestamp** +
105+
__optional__|**Example** : `"yyyy-MM-dd HH:mm:ss"`|string
106+
|===
107+
108+
94109
[[_hostandport]]
95110
=== HostAndPort
96111

@@ -299,6 +314,21 @@ __optional__|integer(int64)
299314
|===
300315

301316

317+
[[_user]]
318+
=== User
319+
320+
[options="header", cols=".^3,.^4"]
321+
|===
322+
|Name|Schema
323+
|**password** +
324+
__optional__|string
325+
|**role** +
326+
__optional__|string
327+
|**username** +
328+
__optional__|string
329+
|===
330+
331+
302332
[[_zkserverclient]]
303333
=== ZkServerClient
304334

docs/index.html

Lines changed: 684 additions & 166 deletions
Large diffs are not rendered by default.

docs/index.pdf

94.4 KB
Binary file not shown.

docs/overview.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ __BasePath__ : /
2727

2828
* collector-controller : Rest API for Collecting JMX Metric Data
2929
* kafka-controller : Kafka Controller
30+
* user-controller : Security User Management Controller.
3031
* zookeeper-controller : Zookeeper Controller
3132

3233

docs/paths.adoc

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,35 @@ __required__|type|enum (NEW, OLD)
502502
* `*/*`
503503

504504

505+
[[_healthcheckusingget]]
506+
==== Check the cluster health.
507+
....
508+
GET /kafka/health
509+
....
510+
511+
512+
===== Responses
513+
514+
[options="header", cols=".^2,.^14,.^4"]
515+
|===
516+
|HTTP Code|Description|Schema
517+
|**200**|OK|<<_healthcheckresult,HealthCheckResult>>
518+
|**401**|Unauthorized|No Content
519+
|**403**|Forbidden|No Content
520+
|**404**|Not Found|No Content
521+
|===
522+
523+
524+
===== Consumes
525+
526+
* `application/json`
527+
528+
529+
===== Produces
530+
531+
* `*/*`
532+
533+
505534
[[_addpartitionusingpost]]
506535
==== Add a partition to the topic
507536
....
@@ -1256,6 +1285,159 @@ GET /kafka/topicsbrief
12561285
* `*/*`
12571286

12581287

1288+
[[_user-controller_resource]]
1289+
=== User-controller
1290+
Security User Management Controller.
1291+
1292+
1293+
[[_adduserusingpost]]
1294+
==== Add user.
1295+
....
1296+
POST /users
1297+
....
1298+
1299+
1300+
===== Parameters
1301+
1302+
[options="header", cols=".^2,.^3,.^9,.^4"]
1303+
|===
1304+
|Type|Name|Description|Schema
1305+
|**Body**|**user** +
1306+
__required__|user|<<_user,User>>
1307+
|===
1308+
1309+
1310+
===== Responses
1311+
1312+
[options="header", cols=".^2,.^14,.^4"]
1313+
|===
1314+
|HTTP Code|Description|Schema
1315+
|**200**|OK|<<_generalresponse,GeneralResponse>>
1316+
|**201**|Created|No Content
1317+
|**401**|Unauthorized|No Content
1318+
|**403**|Forbidden|No Content
1319+
|**404**|Not Found|No Content
1320+
|===
1321+
1322+
1323+
===== Consumes
1324+
1325+
* `application/json`
1326+
1327+
1328+
===== Produces
1329+
1330+
* `*/*`
1331+
1332+
1333+
[[_listuserusingget]]
1334+
==== Get user list.
1335+
....
1336+
GET /users
1337+
....
1338+
1339+
1340+
===== Responses
1341+
1342+
[options="header", cols=".^2,.^14,.^4"]
1343+
|===
1344+
|HTTP Code|Description|Schema
1345+
|**200**|OK|< string > array
1346+
|**401**|Unauthorized|No Content
1347+
|**403**|Forbidden|No Content
1348+
|**404**|Not Found|No Content
1349+
|===
1350+
1351+
1352+
===== Consumes
1353+
1354+
* `application/json`
1355+
1356+
1357+
===== Produces
1358+
1359+
* `*/*`
1360+
1361+
1362+
[[_modifyuserusingput]]
1363+
==== Modify user information.
1364+
....
1365+
PUT /users
1366+
....
1367+
1368+
1369+
===== Parameters
1370+
1371+
[options="header", cols=".^2,.^3,.^9,.^4"]
1372+
|===
1373+
|Type|Name|Description|Schema
1374+
|**Body**|**user** +
1375+
__required__|user|<<_user,User>>
1376+
|===
1377+
1378+
1379+
===== Responses
1380+
1381+
[options="header", cols=".^2,.^14,.^4"]
1382+
|===
1383+
|HTTP Code|Description|Schema
1384+
|**200**|OK|<<_generalresponse,GeneralResponse>>
1385+
|**201**|Created|No Content
1386+
|**401**|Unauthorized|No Content
1387+
|**403**|Forbidden|No Content
1388+
|**404**|Not Found|No Content
1389+
|===
1390+
1391+
1392+
===== Consumes
1393+
1394+
* `application/json`
1395+
1396+
1397+
===== Produces
1398+
1399+
* `*/*`
1400+
1401+
1402+
[[_deluserusingdelete]]
1403+
==== Delete user.
1404+
....
1405+
DELETE /users/{username}
1406+
....
1407+
1408+
1409+
===== Parameters
1410+
1411+
[options="header", cols=".^2,.^3,.^9,.^4"]
1412+
|===
1413+
|Type|Name|Description|Schema
1414+
|**Path**|**username** +
1415+
__required__|username|string
1416+
|===
1417+
1418+
1419+
===== Responses
1420+
1421+
[options="header", cols=".^2,.^14,.^4"]
1422+
|===
1423+
|HTTP Code|Description|Schema
1424+
|**200**|OK|<<_generalresponse,GeneralResponse>>
1425+
|**204**|No Content|No Content
1426+
|**401**|Unauthorized|No Content
1427+
|**403**|Forbidden|No Content
1428+
|===
1429+
1430+
1431+
===== Consumes
1432+
1433+
* `application/json`
1434+
1435+
1436+
===== Produces
1437+
1438+
* `*/*`
1439+
1440+
12591441
[[_zookeeper-controller_resource]]
12601442
=== Zookeeper-controller
12611443
Zookeeper Controller

src/docs/swagger/swagger.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/main/java/org/gnuhpc/bigdata/model/JMXComplexAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public LinkedList<HashMap<String, Object>> getMetrics()
2828
}
2929
if (metric.get(METRIC_TYPE) == null) {
3030
metric.put("domain", getBeanName().getDomain());
31-
metric.put("beanName", getBeanName().getCanonicalName());
31+
metric.put("beanName", getBeanName().toString());
3232
metric.put("attributeName", subAttribute);
3333
metric.put(METRIC_TYPE, getMetricType(subAttribute));
3434
}

src/main/java/org/gnuhpc/bigdata/model/JMXSimpleAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public LinkedList<HashMap<String, Object>> getMetrics() throws AttributeNotFound
2525
HashMap<String, Object> metric = new HashMap<String, Object>();
2626

2727
metric.put("domain", getBeanName().getDomain());
28-
metric.put("beanName", getBeanName().getCanonicalName());
28+
metric.put("beanName", getBeanName().toString());
2929
metric.put("attributeName", getAttributeName());
3030
metric.put("alias", getAlias());
3131
metric.put("value", castToDouble(getValue(), null));

src/main/java/org/gnuhpc/bigdata/model/JMXTabularAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public LinkedList<HashMap<String, Object>> getMetrics() throws AttributeNotFound
3737

3838
HashMap<String, Object> metric = subSub.get(metricKey);
3939
metric.put("domain", getBeanName().getDomain());
40-
metric.put("beanName", getBeanName().getCanonicalName());
40+
metric.put("beanName", getBeanName().toString());
4141
metric.put("attributeName", fullMetricKey);
4242
if (metric.get(ALIAS) == null) {
4343
metric.put(ALIAS, convertMetricName(getAlias(metricKey)));

0 commit comments

Comments
 (0)