Compare commits

...

140 Commits

Author SHA1 Message Date
EricZeng
b74612fa41 Merge pull request #134 from didi/dev_2.2.0
merge dev 2.2.0
2021-01-25 17:30:26 +08:00
EricZeng
22e0c20dcd Merge pull request #133 from lucasun/dev_2.2.0_fe
fix txt
2021-01-25 17:21:42 +08:00
孙超
08f92e1100 fix txt 2021-01-25 17:02:07 +08:00
zengqiao
bb12ece46e modify zk example 2021-01-25 17:01:54 +08:00
EricZeng
0065438305 Merge pull request #132 from lucasun/dev_2.2.0_fe
add fe page
2021-01-25 16:47:02 +08:00
孙超
7f115c1b3e add fe page 2021-01-25 15:34:07 +08:00
EricZeng
0ef64fa4bd Merge pull request #126 from ZHAOYINRUI/patch-8
Create alarm_rules.md
2021-01-25 11:09:21 +08:00
ZHAOYINRUI
84dbc17c22 Update alarm_rules.md 2021-01-25 11:04:30 +08:00
EricZeng
16e16e356d Merge pull request #130 from xuehaipeng/patch-1
Update faq.md
2021-01-25 10:35:12 +08:00
xuehaipeng
978ee885c4 Update faq.md 2021-01-24 20:06:29 +08:00
zengqiao
850d43df63 add v2.2.0 feature & fix 2021-01-23 13:19:29 +08:00
zengqiao
fc109fd1b1 bump version to 2.2.0 2021-01-23 12:41:38 +08:00
EricZeng
2829947b93 Merge pull request #129 from didi/master
merge master
2021-01-23 11:09:52 +08:00
EricZeng
0c2af89a1c Merge pull request #125 from ZHAOYINRUI/patch-7
create kafka_metrics_desc.md
2021-01-23 11:03:14 +08:00
EricZeng
14c2dc9624 update kafka_metrics.md 2021-01-23 11:01:44 +08:00
EricZeng
4f35d710a6 Update and rename metric.md to kafka_metrics_desc.md 2021-01-23 10:58:11 +08:00
EricZeng
fdb5e018e5 Merge pull request #122 from ZHAOYINRUI/patch-4
Update README.md
2021-01-23 10:51:26 +08:00
EricZeng
6001fde25c Update dynamic_config_manager.md 2021-01-23 10:21:47 +08:00
EricZeng
ae63c0adaf Merge pull request #128 from didi/dev
add sync topic to db doc
2021-01-23 10:20:27 +08:00
zengqiao
ad1539c8f6 add sync topic to db doc 2021-01-23 10:17:59 +08:00
EricZeng
634a0c8cd0 Update faq.md 2021-01-22 20:42:13 +08:00
ZHAOYINRUI
773f9a0c63 Create alarm_rules.md 2021-01-22 18:16:51 +08:00
ZHAOYINRUI
e4e320e9e3 Create metric.md 2021-01-22 18:06:35 +08:00
ZHAOYINRUI
3b4b400e6b Update README.md 2021-01-22 15:56:53 +08:00
mike.zhangliang
f3a5e3f5ed Update README.md 2021-01-18 19:06:43 +08:00
mike.zhangliang
e685e621f3 Update README.md 2021-01-18 19:05:44 +08:00
EricZeng
2cd2be9b67 Merge pull request #112 from didi/dev
监控告警系统对接说明文档
2021-01-17 18:21:16 +08:00
zengqiao
e73d9e8a03 add monitor_system_integrate_with_self file 2021-01-17 18:18:07 +08:00
zengqiao
476f74a604 rename file 2021-01-17 16:49:02 +08:00
EricZeng
ab0d1d99e6 Merge pull request #111 from didi/dev
Dev
2021-01-17 16:11:08 +08:00
zengqiao
d5680ffd5d 增加Topic同步任务&Bug修复 2021-01-16 16:26:38 +08:00
EricZeng
3c091a88d4 Merge pull request #110 from didi/master
合并master分支上的改动
2021-01-16 13:37:31 +08:00
EricZeng
49b70b33de Merge pull request #108 from didi/dev
增加application.yml文件说明 & 修改版本
2021-01-16 13:34:07 +08:00
zengqiao
c5ff2716fb 优化build.sh & yaml 2021-01-16 12:39:56 +08:00
ZQKC
400fdf0896 修复图片地址错误问题
修复图片地址错误问题
2021-01-16 12:04:20 +08:00
ZQKC
cbb8c7323c Merge pull request #109 from ZHAOYINRUI/master
架构图更新、钉钉群ID更新
2021-01-16 09:33:19 +08:00
ZHAOYINRUI
60e79f8f77 Update README.md 2021-01-16 00:25:06 +08:00
ZHAOYINRUI
0e829d739a Add files via upload 2021-01-16 00:22:31 +08:00
ZQKC
62abb274e0 增加application.yml文件说明
增加application.yml文件说明
2021-01-15 19:14:48 +08:00
ZQKC
e4028785de Update README.md
change km address
2021-01-09 15:30:30 +08:00
mrazkong
2bb44bcb76 Update Intergration_n9e_monitor.md 2021-01-07 17:09:15 +08:00
mike.zhangliang
684599f81b Update README.md 2021-01-07 15:44:17 +08:00
mike.zhangliang
b56d28f5df Update README.md 2021-01-07 15:43:07 +08:00
ZHAOYINRUI
02b9ac04c8 Update user_guide_cn.md 2020-12-30 22:44:23 +08:00
zengqiao
2fc283990a bump version to 2.1.0 2020-12-19 01:53:46 +08:00
ZQKC
abb652ebd5 Merge pull request #104 from didi/dev
v2.1版本合并
2020-12-19 01:14:26 +08:00
zengqiao
55786cb7f7 修改node版本要求 2020-12-19 00:45:58 +08:00
zengqiao
447a575f4f v2.1 fe 2020-12-19 00:40:52 +08:00
zengqiao
49280a8617 v2.1版本更新 2020-12-19 00:27:16 +08:00
ZQKC
ff78a9cc35 Merge pull request #101 from didi/dev
use mysql 8
2020-12-11 11:49:06 +08:00
zengqiao
3fea5c9c8c use mysql 8 2020-12-11 10:48:03 +08:00
ZQKC
aea63cad52 Merge pull request #94 from didi/dev
增加FAQ
2020-11-22 21:49:48 +08:00
zengqiao
800abe9920 增加FAQ 2020-11-22 21:43:52 +08:00
ZQKC
dd6069e41a Merge pull request #93 from didi/dev
夜莺Mon集成配置说明
2020-11-22 20:09:34 +08:00
zengqiao
90d31aeff0 夜莺Mon集成配置说明 2020-11-22 20:07:14 +08:00
ZQKC
4d9a327b1f Merge pull request #92 from didi/dev
FIX N9e Mon
2020-11-22 18:15:49 +08:00
zengqiao
06a97ef076 FIX N9e Mon 2020-11-22 18:13:36 +08:00
ZQKC
76c2477387 Merge pull request #91 from didi/dev
修复上报夜莺功能
2020-11-22 17:00:39 +08:00
zengqiao
bc4dac9cad 删除无效代码 2020-11-22 16:58:43 +08:00
zengqiao
36e3d6c18a 修复上报夜莺功能 2020-11-22 16:56:22 +08:00
ZQKC
edfd84a8e3 Merge pull request #88 from didi/dev
增加build.sh
2020-11-15 17:02:26 +08:00
zengqiao
fb20cf6069 增加build.sh 2020-11-15 16:58:28 +08:00
ZQKC
abbe47f6b9 Merge pull request #87 from didi/dev
初始化SQL优化&KCM修复&连接信息修复
2020-11-15 16:55:42 +08:00
zengqiao
f84d250134 kcm修复&连接信息接口修复 2020-11-15 16:50:59 +08:00
zengqiao
3ffb4b8990 初始化SQL优化 2020-11-15 16:31:10 +08:00
ZQKC
f70cfabede Merge pull request #84 from didi/dev
fix 前端资源加载问题
2020-11-14 16:56:16 +08:00
potaaato
3a81783d77 Merge pull request #83 from Candieslove/master
fix: remove track.js && add font.css
2020-11-13 14:04:41 +08:00
eilenexuzhe
237a4a90ff fix: remove track.js && add font.css 2020-11-13 11:58:46 +08:00
ZQKC
99c7dfc98d Merge pull request #81 from didi/dev
修复Topic详情中服务地址不展示问题
2020-11-08 20:13:03 +08:00
zengqiao
48aba34370 修复Topic详情中服务地址不展示问题 2020-11-08 20:07:45 +08:00
ZQKC
29cca36f2c Merge pull request #80 from didi/dev
增加上报监控指标开关
2020-11-08 17:14:50 +08:00
zengqiao
0f5819f5c2 增加上报监控指标开关 2020-11-08 17:13:04 +08:00
ZQKC
373772de2d Merge pull request #79 from didi/dev
文案优化|服务发现接口修复
2020-11-08 16:11:10 +08:00
zengqiao
7f5bbe8b5f 优化 2020-11-08 16:00:15 +08:00
zengqiao
daee57167b 服务发现接口修复 2020-11-08 15:59:50 +08:00
zengqiao
03467196b9 POM文件优化 2020-11-08 15:59:27 +08:00
zengqiao
d3f3531cdb 文案优化 2020-11-08 15:43:42 +08:00
ZQKC
883b694592 Merge pull request #78 from didi/dev
文档更新
2020-11-07 22:21:52 +08:00
zengqiao
6c89d66af9 文档更新 2020-11-07 22:09:22 +08:00
ZQKC
fb0a76b418 Merge pull request #77 from didi/master
master合并到dev
2020-11-07 22:02:24 +08:00
ZQKC
64f77fca5b Merge pull request #71 from didi/dev_2.x
开放接口
2020-10-26 22:53:53 +08:00
zengqiao
b1fca2c5be 删除无效代码 2020-10-26 11:23:28 +08:00
zengqiao
108d705f09 删除无效代码 2020-10-26 11:20:34 +08:00
zengqiao
a77242e66c 开放接口&近期BUG修复 2020-10-26 11:17:45 +08:00
ZQKC
8b153113ff Merge pull request #70 from didi/master
merge master
2020-10-26 10:45:56 +08:00
zengqiao
6d0ec37135 增加格式PDF文档防止图裂 2020-10-22 09:32:58 +08:00
ZQKC
603dadff35 Merge pull request #62 from didi/dev
统一依赖包版本
2020-09-29 17:32:32 +08:00
zengqiao
1a4ef3d9c1 统一pom包版本 2020-09-29 17:25:04 +08:00
ZQKC
788468054a Merge pull request #61 from didi/master
合并master分支
2020-09-29 17:16:52 +08:00
ZQKC
bdb44c6dce Merge pull request #59 from didi/dev_2.x
Dev 2.x
2020-09-29 10:47:16 +08:00
zengqiao
251086f9e9 问题修复: 修复账号搜索仅返回一个的问题 2020-09-28 21:52:50 +08:00
zengqiao
b22aa62046 修改console包版本 2020-09-28 17:31:08 +08:00
zengqiao
c6e4b60424 kafka-manager 2.0 2020-09-28 15:46:34 +08:00
ZQKC
28d985aaf1 Merge pull request #58 from didi/dev
版本调整为1.1.0
2020-09-25 12:00:38 +08:00
zengqiao
2397cbf80b 调整版本为1.1 2020-09-25 11:56:31 +08:00
zengqiao
a13d9daae3 Merge branch 'master' into dev 2020-09-25 11:44:23 +08:00
zengqiao
c23870e020 bugfix, fix topic overview page 2020-09-17 19:04:33 +08:00
zengqiao
dd2e29dd40 bugfix, fix collect consumer metrics task 2020-09-16 21:04:47 +08:00
ZQKC
74b5700573 Merge pull request #48 from ZQKC/master
扩分区工单详情优化
2020-07-30 21:00:37 +08:00
zengqiao
ba6abea6d8 扩分区工单优化 2020-07-30 20:56:45 +08:00
ZQKC
33b231d512 Merge pull request #3 from didi/master
MR
2020-07-30 20:45:58 +08:00
ZQKC
61f0b67a92 Merge pull request #47 from ZQKC/master
修复扩分区工单
2020-07-30 19:34:56 +08:00
zengqiao
4b679be310 fix execute order partition 2020-07-30 19:30:31 +08:00
ZQKC
a969795677 Merge pull request #40 from hyper-xx/master
增加docker及docker-compose部署方式
2020-07-06 14:00:24 +08:00
xuzhengxi
4f4e7e80fc 增加docker及docker-compose部署方式 2020-07-06 13:19:58 +08:00
ZQKC
2f72cbb627 Merge pull request #38 from yangbajing/feature/postgresql
管理端存储添加 PostgreSQL 数据库支持。
2020-07-05 16:10:16 +08:00
Yang Jing
a460e169ab 修改 Spring 默认配置为使用 MySQL 数据库。 2020-07-05 16:07:33 +08:00
Yang Jing
27ce4d6a0d 为 AccountDao.insert 也提供 PostgreSQL 的 AccountDao.insertOnPG 版。 2020-07-05 00:55:55 +08:00
Yang Jing
ac86f8aded 当使用 PostgreSQL 数据库时,使用 insert on conflict 替代 MySQL 的 replace SQL语句。 2020-07-05 00:42:55 +08:00
Yang Jing
93eca239cb 通过 spring.profiles.active 指定配置来选择后端不同数据库的配置。 2020-07-02 21:39:02 +08:00
Yang Jing
dc5949d497 管理端存储添加 PostgreSQL 数据库支持。 2020-07-02 16:21:34 +08:00
ZQKC
5e24f6b044 Merge pull request #37 from ZQKC/master
fix retention.ms when execute topic order
2020-07-01 11:01:38 +08:00
zengqiao
0cd31e0545 fix retentionTime when create topic 2020-07-01 10:56:55 +08:00
ZQKC
d4dc4b9d0a Merge pull request #1 from didi/dependabot/maven/org.apache.zookeeper-zookeeper-3.4.14
Bump zookeeper from 3.4.6 to 3.4.14
2020-06-08 16:46:33 +08:00
ZQKC
8c6fe40de1 Merge pull request #17 from pierre94/pierre94-add-assembly
Add assembly and operation scripts to simplify deployment
2020-06-05 18:45:41 +08:00
ZQKC
e4dc4bae30 Merge pull request #2 from didi/master
pull
2020-06-05 18:28:28 +08:00
potaaato
d99c21f4d7 Merge pull request #31 from Candieslove/bugfix
fix  重置用户密码&&broker状态修改&&leader rebalance弹框修复
2020-06-05 18:10:31 +08:00
eilenexuzhe
8ef549de80 feat bugfix 2020-06-05 18:03:16 +08:00
ZQKC
1b57758102 Merge pull request #30 from didi/dev
fix underReplicatedPartition and add cluster
2020-06-05 17:08:49 +08:00
ZQKC
553fe30662 Merge pull request #29 from ZQKC/master
fix underReplicatedPartitionCount and add cluster
2020-06-05 17:01:06 +08:00
zengqiao
b6138afe8b fix add cluster 2020-06-05 16:56:00 +08:00
zengqiao
64d64fe6fe bugfix, fix underReplicatedPartitionCount 2020-06-05 15:23:56 +08:00
ZQKC
f29b356b74 Merge pull request #1 from didi/master
pull code
2020-06-05 14:04:11 +08:00
pierrexiong
b5621d1ffd add assembly and operation scripts to simplify deployment
xiongyongxin@hotmail
2020-05-22 20:17:38 +08:00
pierre xiong
66f0da934d Merge pull request #1 from didi/master
pull from didi/kafka-manager
2020-05-22 19:48:35 +08:00
zengqiao
13a90fdd57 add dingding notes 2020-05-19 21:37:15 +08:00
zengqiao
63966887ab shorten mysql's key length 2020-05-03 12:26:56 +08:00
zengqiao
2865b913af supply dingding group number 2020-04-21 18:13:20 +08:00
ZQKC
893ebdcc9b Merge pull request #10 from Candieslove/fix_unit
fix unit error
2020-04-20 20:17:20 +08:00
eilenexuzhe
e82437a2db fix unit error 2020-04-20 19:30:06 +08:00
ZQKC
c44f08a7ac Merge pull request #8 from Candieslove/fix_node_type
fix: setTimeout problem
2020-04-02 17:06:47 +08:00
eilenexuzhe
922545096a fix: setTimout problem 2020-04-02 16:59:38 +08:00
zengqiao
71f00576e0 del pom relativePath 2020-04-02 16:47:50 +08:00
ZQKC
cd11735e72 Merge pull request #4 from Candieslove/fix_webpack
fix  script problem under windows
2020-03-31 15:27:09 +08:00
eilenexuzhe
e1a8081f4b fix script problem under windows 2020-03-31 14:48:29 +08:00
dependabot[bot]
47265bb8d3 Bump zookeeper from 3.4.6 to 3.4.14
Bumps zookeeper from 3.4.6 to 3.4.14.

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-24 06:19:53 +00:00
zengqiao
15d2fe7cfc bugfix, fix user guide link 2020-03-24 14:19:19 +08:00
zengqiao
a7850c4fd7 optimize readme 2020-03-23 12:11:23 +08:00
zengqiao
d87e64534d optimize license link 2020-03-23 12:06:42 +08:00
zengqiao
fc87aaf0db modify readme&contributing 2020-03-23 12:01:18 +08:00
1412 changed files with 91249 additions and 37416 deletions

16
.gitignore vendored
View File

@@ -56,6 +56,7 @@ fabric.properties
*.jar *.jar
*.war *.war
*.ear *.ear
*.tar.gz
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
@@ -99,13 +100,14 @@ target/
*/velocity.log* */velocity.log*
*/*.log */*.log
*/*.log.* */*.log.*
web/node_modules/ node_modules/
web/node_modules/* node_modules/*
workspace.xml workspace.xml
/output/* /output/*
.gitversion .gitversion
*/node_modules/* node_modules/*
*/templates/* out/*
*/out/* dist/
*/dist/* dist/*
.DS_Store kafka-manager-web/src/main/resources/templates/
.DS_Store

View File

@@ -1,835 +1,28 @@
<!DOCTYPE html> # Contribution Guideline
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://assets-cdn.github.com">
<link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
Thanks for considering to contribute this project. All issues and pull requests are highly appreciated.
## Pull Requests
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-77c3b874f32e71b14cded5a120f42f5c7288fa52e0a37f2d5919fbd8bcfca63c.css" integrity="sha256-d8O4dPMucbFM3tWhIPQvXHKI+lLgo38tWRn72Lz8pjw=" media="all" rel="stylesheet" /> Before sending pull request to this project, please read and follow guidelines below.
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-7e91a10736ac37b832677484a258d697fe931ba402ccccab1f893155686ad976.css" integrity="sha256-fpGhBzasN7gyZ3SEoljWl/6TG6QCzMyrH4kxVWhq2XY=" media="all" rel="stylesheet" />
<meta name="viewport" content="width=device-width"> 1. Branch: We only accept pull request on `dev` branch.
2. Coding style: Follow the coding style used in kafka-manager.
<title>VirtualAPK/CONTRIBUTING.md at master · didi/VirtualAPK</title> 3. Commit message: Use English and be aware of your spell.
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> 4. Test: Make sure to test your code.
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
Add device mode, API version, related log, screenshots and other related information in your pull request if possible.
<meta content="https://avatars2.githubusercontent.com/u/27521938?v=4&amp;s=400" property="og:image" /><meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="didi/VirtualAPK" property="og:title" /><meta content="https://github.com/didi/VirtualAPK" property="og:url" /><meta content="VirtualAPK - A powerful and lightweight plugin framework for Android" property="og:description" />
<link rel="assets" href="https://assets-cdn.github.com/"> NOTE: We assume all your contribution can be licensed under the [Apache License 2.0](LICENSE).
<link rel="web-socket" href="wss://live.github.com/_sockets/VjI6MTgwNzY5MzEwOmE5N2I2Yjk2MGRmYmU0ZjZhMTFiOTA5M2Y5MzU5OGEzMmExNjZkYzAzNjYzNTQwMzMzMzQzMGJkMDRmZjNmNmU=--c366cc4384d45c90027d65f977134da25c41a884">
<meta name="pjax-timeout" content="1000">
<link rel="sudo-modal" href="/sessions/sudo_modal">
<meta name="request-id" content="4E29:2AD46:6CCCCFC:BBFD27E:5984674E" data-pjax-transient>
<meta name="selected-link" value="repo_source" data-pjax-transient> ## Issues
<meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> We love clearly described issues. :)
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
<meta name="google-analytics" content="UA-3769691-2">
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="https://collector.githubapp.com/github-external/browser_event" name="octolytics-event-url" /><meta content="4E29:2AD46:6CCCCFC:BBFD27E:5984674E" name="octolytics-dimension-request_id" /><meta content="iad" name="octolytics-dimension-region_edge" /><meta content="iad" name="octolytics-dimension-region_render" /><meta content="4598761" name="octolytics-actor-id" /><meta content="wbtiger" name="octolytics-actor-login" /><meta content="275cc19fd75d0968078b4b33bd2ac5fac4ab12873218083aeaa8dbc2df60c39f" name="octolytics-actor-hash" /> Following information can help us to resolve the issue faster.
<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-pjax-transient="true" name="analytics-location" />
<meta class="js-ga-set" name="dimension1" content="Logged In">
<meta name="hostname" content="github.com">
<meta name="user-login" content="wbtiger">
<meta name="expected-hostname" content="github.com">
<meta name="js-proxy-site-detection-payload" content="YTJlMTZlMWNkMzY4M2E1ZTVhMWNhODEyNDZmODkwODM5NzQwYjhhMGY5ODRlM2E1OTQyODA0YmZjNDdjZDQwMHx7InJlbW90ZV9hZGRyZXNzIjoiMjEwLjEzLjI0Mi4xIiwicmVxdWVzdF9pZCI6IjRFMjk6MkFENDY6NkNDQ0NGQzpCQkZEMjdFOjU5ODQ2NzRFIiwidGltZXN0YW1wIjoxNTAxODQ5NDI2LCJob3N0IjoiZ2l0aHViLmNvbSJ9">
<meta name="enabled-features" content="UNIVERSE_BANNER">
<meta name="html-safe-nonce" content="b2f561be57f18272195251bb7029b59e07e187fe">
<meta http-equiv="x-pjax-version" content="2a581bbaf84cb76d91db41147f2e3400">
<link href="https://github.com/didi/VirtualAPK/commits/master.atom" rel="alternate" title="Recent Commits to VirtualAPK:master" type="application/atom+xml">
<meta name="description" content="VirtualAPK - A powerful and lightweight plugin framework for Android">
<meta name="go-import" content="github.com/didi/VirtualAPK git https://github.com/didi/VirtualAPK.git">
<meta content="27521938" name="octolytics-dimension-user_id" /><meta content="didi" name="octolytics-dimension-user_login" /><meta content="95750391" name="octolytics-dimension-repository_id" /><meta content="didi/VirtualAPK" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="95750391" name="octolytics-dimension-repository_network_root_id" /><meta content="didi/VirtualAPK" name="octolytics-dimension-repository_network_root_nwo" /><meta content="true" name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" />
<link rel="canonical" href="https://github.com/didi/VirtualAPK/blob/master/CONTRIBUTING.md" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<meta name="theme-color" content="#1e2327">
<meta name="u2f-support" content="true">
</head>
<body class="logged-in env-production page-blob">
<div class="position-relative js-header-wrapper ">
<a href="#start-of-content" tabindex="1" class="bg-black text-white p-3 show-on-focus js-skip-to-content">Skip to content</a>
<div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div>
<div class="header" role="banner">
<div class="container-lg px-3 clearfix">
<div class="d-flex flex-justify-between">
<div class="d-flex">
<a class="header-logo-invertocat" href="https://github.com/" data-hotkey="g d" aria-label="Homepage" data-ga-click="Header, go to dashboard, icon:logo">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="32" version="1.1" viewBox="0 0 16 16" width="32"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
<div class="mr-2">
<div class="header-search scoped-search site-scoped-search js-site-search" role="search">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/search" class="js-site-search-form" data-scoped-search-url="/didi/VirtualAPK/search" data-unscoped-search-url="/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<label class="form-control header-search-wrapper js-chromeless-input-container">
<a href="/didi/VirtualAPK/blob/master/CONTRIBUTING.md" class="header-search-scope no-underline">This repository</a>
<input type="text"
class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable"
data-hotkey="s"
name="q"
value=""
placeholder="Search"
aria-label="Search this repository"
data-unscoped-placeholder="Search GitHub"
data-scoped-placeholder="Search"
autocapitalize="off">
<input type="hidden" class="js-site-search-type-field" name="type" >
</label>
</form></div>
</div>
<ul class="d-flex list-style-none" role="navigation">
<li>
<a href="/pulls" aria-label="Pull requests you created" class="js-selected-navigation-item header-navlink" data-ga-click="Header, click, Nav menu - item:pulls context:user" data-hotkey="g p" data-selected-links="/pulls /pulls/assigned /pulls/mentioned /pulls">
Pull requests
</a> </li>
<li>
<a href="/issues" aria-label="Issues you created" class="js-selected-navigation-item header-navlink" data-ga-click="Header, click, Nav menu - item:issues context:user" data-hotkey="g i" data-selected-links="/issues /issues/assigned /issues/mentioned /issues">
Issues
</a> </li>
<li>
<a href="/marketplace" class="js-selected-navigation-item header-navlink" data-ga-click="Header, click, Nav menu - item:marketplace context:user" data-selected-links=" /marketplace">
Marketplace
</a> </li>
<li>
<a class="header-navlink" href="https://gist.github.com/" data-ga-click="Header, go to gist, text:gist">Gist</a>
</li>
</ul>
</div>
<div class="d-flex">
<ul class="d-flex user-nav list-style-none" id="user-links">
<li class="dropdown js-menu-container">
<a href="/notifications" aria-label="You have unread notifications" class="header-navlink notification-indicator tooltipped tooltipped-s js-socket-channel js-notification-indicator" data-channel="notification-changed:4598761" data-ga-click="Header, go to notifications, icon:unread" data-hotkey="g n">
<span class="mail-status unread"></span>
<svg aria-hidden="true" class="octicon octicon-bell" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 12v1H0v-1l.73-.58c.77-.77.81-2.55 1.19-4.42C2.69 3.23 6 2 6 2c0-.55.45-1 1-1s1 .45 1 1c0 0 3.39 1.23 4.16 5 .38 1.88.42 3.66 1.19 4.42l.66.58H14zm-7 4c1.11 0 2-.89 2-2H5c0 1.11.89 2 2 2z"/></svg>
</a>
</li>
<li class="dropdown js-menu-container">
<a class="header-navlink tooltipped tooltipped-s js-menu-target" href="/new"
aria-label="Create new…"
aria-expanded="false"
aria-haspopup="true"
data-ga-click="Header, create new, icon:add">
<svg aria-hidden="true" class="octicon octicon-plus float-left" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 9H7v5H5V9H0V7h5V2h2v5h5z"/></svg>
<span class="dropdown-caret"></span>
</a>
<div class="dropdown-menu-content js-menu-content">
<ul class="dropdown-menu dropdown-menu-sw">
<a class="dropdown-item" href="/new" data-ga-click="Header, create new repository">
New repository
</a>
<a class="dropdown-item" href="/new/import" data-ga-click="Header, import a repository">
Import repository
</a>
<a class="dropdown-item" href="https://gist.github.com/" data-ga-click="Header, create new gist">
New gist
</a>
<a class="dropdown-item" href="/organizations/new" data-ga-click="Header, create new organization">
New organization
</a>
<div class="dropdown-divider"></div>
<div class="dropdown-header">
<span title="didi/VirtualAPK">This repository</span>
</div>
<a class="dropdown-item" href="/didi/VirtualAPK/issues/new" data-ga-click="Header, create new issue">
New issue
</a>
</ul>
</div>
</li>
<li class="dropdown js-menu-container">
<a class="header-navlink name tooltipped tooltipped-sw js-menu-target" href="/wbtiger"
aria-label="View profile and more"
aria-expanded="false"
aria-haspopup="true"
data-ga-click="Header, show menu, icon:avatar">
<img alt="@wbtiger" class="avatar" src="https://avatars0.githubusercontent.com/u/4598761?v=4&amp;s=40" height="20" width="20">
<span class="dropdown-caret"></span>
</a>
<div class="dropdown-menu-content js-menu-content">
<div class="dropdown-menu dropdown-menu-sw">
<div class="dropdown-header header-nav-current-user css-truncate">
Signed in as <strong class="css-truncate-target">wbtiger</strong>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/wbtiger" data-ga-click="Header, go to profile, text:your profile">
Your profile
</a>
<a class="dropdown-item" href="/wbtiger?tab=stars" data-ga-click="Header, go to starred repos, text:your stars">
Your stars
</a>
<a class="dropdown-item" href="/explore" data-ga-click="Header, go to explore, text:explore">
Explore
</a>
<a class="dropdown-item" href="https://help.github.com" data-ga-click="Header, go to help, text:help">
Help
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/settings/profile" data-ga-click="Header, go to settings, icon:settings">
Settings
</a>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/logout" class="logout-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="iCUyFq9DsN8+PSAXXSFLLHUCaZibvNeiW95cHdbtTULm4wBjigzSEJhDeC8sdAk7tBKHgYY+dXaFjQr1jYhQqg==" /></div>
<button type="submit" class="dropdown-item dropdown-signout" data-ga-click="Header, sign out, icon:logout">
Sign out
</button>
</form> </div>
</div>
</li>
</ul>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/logout" class="sr-only right-0" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="Flzhb/7RV6uQ+AzooTOZbPkQfbFDgFjQu64VxBLZMuh4mtMa2541ZDaGVNDQZtt7OACTqF4C+gRl/UMsSbwvAA==" /></div>
<button type="submit" class="dropdown-item dropdown-signout" data-ga-click="Header, sign out, icon:logout">
Sign out
</button>
</form> </div>
</div>
</div>
</div>
<div class="flash flash-full js-notice flash-warn">
<div class="container">
<h4>
We are having a problem billing the didichuxing organization.
Please <a href="https://github.com/organizations/didichuxing/settings/billing/payment">update your payment method</a>
or call your payment provider for details on why the transaction failed.
If you dont need access to your private repositories, you can <a href="http://github.com/organizations/didichuxing/settings/billing">downgrade to the Free plan</a>.
</h4>
You can always <a href="/contact">contact support</a> with any questions.
</div>
</div>
</div>
<div id="start-of-content" class="show-on-focus"></div>
<div id="js-flash-container">
</div>
<div role="main">
<div itemscope itemtype="http://schema.org/SoftwareSourceCode">
<div id="js-repo-pjax-container" data-pjax-container>
<div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav">
<div class="container repohead-details-container">
<ul class="pagehead-actions">
<li>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/notifications/subscribe" class="js-social-container" data-autosubmit="true" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="ilxSXS07ThXVEaOic735Ui/Z1PnKcDW+esvwfuYtshLhLnKxtLDr9v8bIilW+EP5XZQWYBwRfNG6uSd62UFOJQ==" /></div> <input class="form-control" id="repository_id" name="repository_id" type="hidden" value="95750391" />
<div class="select-menu js-menu-container js-select-menu">
<a href="/didi/VirtualAPK/subscription"
class="btn btn-sm btn-with-count select-menu-button js-menu-target"
role="button"
aria-haspopup="true"
aria-expanded="false"
aria-label="Toggle repository notifications menu"
data-ga-click="Repository, click Watch settings, action:blob#show">
<span class="js-select-button">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
Unwatch
</span>
</a>
<a class="social-count js-social-count"
href="/didi/VirtualAPK/watchers"
aria-label="201 users are watching this repository">
201
</a>
<div class="select-menu-modal-holder">
<div class="select-menu-modal subscription-menu-modal js-menu-content">
<div class="select-menu-header js-navigation-enable" tabindex="-1">
<svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
<span class="select-menu-title">Notifications</span>
</div>
<div class="select-menu-list js-navigation-container" role="menu">
<div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
<div class="select-menu-item-text">
<input id="do_included" name="do" type="radio" value="included" />
<span class="select-menu-item-heading">Not watching</span>
<span class="description">Be notified when participating or @mentioned.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
Watch
</span>
</div>
</div>
<div class="select-menu-item js-navigation-item selected" role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
<div class="select-menu-item-text">
<input checked="checked" id="do_subscribed" name="do" type="radio" value="subscribed" />
<span class="select-menu-item-heading">Watching</span>
<span class="description">Be notified of all conversations.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
Unwatch
</span>
</div>
</div>
<div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
<div class="select-menu-item-text">
<input id="do_ignore" name="do" type="radio" value="ignore" />
<span class="select-menu-item-heading">Ignoring</span>
<span class="description">Never be notified.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-mute" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8 2.81v10.38c0 .67-.81 1-1.28.53L3 10H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h2l3.72-3.72C7.19 1.81 8 2.14 8 2.81zm7.53 3.22l-1.06-1.06-1.97 1.97-1.97-1.97-1.06 1.06L11.44 8 9.47 9.97l1.06 1.06 1.97-1.97 1.97 1.97 1.06-1.06L13.56 8l1.97-1.97z"/></svg>
Stop ignoring
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</li>
<li>
<div class="js-toggler-container js-social-container starring-container ">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/unstar" class="starred" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="Q+D8KWgxgtZRRzjMMMc9XHi7VS6G1YcZ06JQ7RcxZO8LHmloFHnOw2MryKAWIM4nirolh2QGKRJ1w9d2OhazBg==" /></div>
<button
type="submit"
class="btn btn-sm btn-with-count js-toggler-target"
aria-label="Unstar this repository" title="Unstar didi/VirtualAPK"
data-ga-click="Repository, click unstar button, action:blob#show; text:Unstar">
<svg aria-hidden="true" class="octicon octicon-star" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg>
Unstar
</button>
<a class="social-count js-social-count" href="/didi/VirtualAPK/stargazers"
aria-label="4154 users starred this repository">
4,154
</a>
</form>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/star" class="unstarred" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="5rEqD8GHiUII3nNr3fl0ZQis36UU6E62k7uQKTq8bRZr9grFDV61v7EICrRDkxCFz9ECivUVZfvPndKNUpOehA==" /></div>
<button
type="submit"
class="btn btn-sm btn-with-count js-toggler-target"
aria-label="Star this repository" title="Star didi/VirtualAPK"
data-ga-click="Repository, click star button, action:blob#show; text:Star">
<svg aria-hidden="true" class="octicon octicon-star" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"/></svg>
Star
</button>
<a class="social-count js-social-count" href="/didi/VirtualAPK/stargazers"
aria-label="4154 users starred this repository">
4,154
</a>
</form> </div>
</li>
<li>
<a href="#fork-destination-box" class="btn btn-sm btn-with-count"
title="Fork your own copy of didi/VirtualAPK to your account"
aria-label="Fork your own copy of didi/VirtualAPK to your account"
rel="facebox"
data-ga-click="Repository, show fork modal, action:blob#show; text:Fork">
<svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
Fork
</a>
<div id="fork-destination-box" style="display: none;">
<h2 class="facebox-header" data-facebox-id="facebox-header">Where should we fork this repository?</h2>
<include-fragment src=""
class="js-fork-select-fragment fork-select-fragment"
data-url="/didi/VirtualAPK/fork?fragment=1">
<img alt="Loading" height="64" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-128.gif" width="64" />
</include-fragment>
</div>
<a href="/didi/VirtualAPK/network" class="social-count"
aria-label="562 users forked this repository">
562
</a>
</li>
</ul>
<h1 class="public ">
<svg aria-hidden="true" class="octicon octicon-repo" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg>
<span class="author" itemprop="author"><a href="/didi" class="url fn" rel="author">didi</a></span><!--
--><span class="path-divider">/</span><!--
--><strong itemprop="name"><a href="/didi/VirtualAPK" data-pjax="#js-repo-pjax-container">VirtualAPK</a></strong>
</h1>
</div>
<div class="container">
<nav class="reponav js-repo-nav js-sidenav-container-pjax"
itemscope
itemtype="http://schema.org/BreadcrumbList"
role="navigation"
data-pjax="#js-repo-pjax-container">
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a href="/didi/VirtualAPK" class="js-selected-navigation-item selected reponav-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /didi/VirtualAPK" itemprop="url">
<svg aria-hidden="true" class="octicon octicon-code" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg>
<span itemprop="name">Code</span>
<meta itemprop="position" content="1">
</a> </span>
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a href="/didi/VirtualAPK/issues" class="js-selected-navigation-item reponav-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /didi/VirtualAPK/issues" itemprop="url">
<svg aria-hidden="true" class="octicon octicon-issue-opened" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg>
<span itemprop="name">Issues</span>
<span class="Counter">44</span>
<meta itemprop="position" content="2">
</a> </span>
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
<a href="/didi/VirtualAPK/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /didi/VirtualAPK/pulls" itemprop="url">
<svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
<span itemprop="name">Pull requests</span>
<span class="Counter">3</span>
<meta itemprop="position" content="3">
</a> </span>
<a href="/didi/VirtualAPK/projects" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /didi/VirtualAPK/projects">
<svg aria-hidden="true" class="octicon octicon-project" height="16" version="1.1" viewBox="0 0 15 16" width="15"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg>
Projects
<span class="Counter" >0</span>
</a>
<a href="/didi/VirtualAPK/wiki" class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /didi/VirtualAPK/wiki">
<svg aria-hidden="true" class="octicon octicon-book" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg>
Wiki
</a>
<a href="/didi/VirtualAPK/settings" class="js-selected-navigation-item reponav-item" data-selected-links="repo_settings repo_branch_settings hooks integration_installations /didi/VirtualAPK/settings">
<svg aria-hidden="true" class="octicon octicon-gear" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M14 8.77v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09L0 7.23v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09L14 8.75v.02zM7 11c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"/></svg>
Settings
</a>
<div class="reponav-dropdown js-menu-container">
<button type="button" class="btn-link reponav-item reponav-dropdown js-menu-target " data-no-toggle aria-expanded="false" aria-haspopup="true">
Insights
<svg aria-hidden="true" class="octicon octicon-triangle-down v-align-middle text-gray" height="11" version="1.1" viewBox="0 0 12 16" width="8"><path fill-rule="evenodd" d="M0 5l6 6 6-6z"/></svg>
</button>
<div class="dropdown-menu-content js-menu-content">
<div class="dropdown-menu dropdown-menu-sw">
<a class="dropdown-item" href="/didi/VirtualAPK/community" data-skip-pjax>
<svg aria-hidden="true" class="octicon octicon-heart" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11.2 3c-.52-.63-1.25-.95-2.2-1-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-.95.05-1.69.38-2.2 1-.52.61-.78 1.28-.8 2 0 .52.09 1.52.67 2.67C1.25 8.82 3.01 10.61 6 13c2.98-2.39 4.77-4.17 5.34-5.33C11.91 6.51 12 5.5 12 5c-.02-.72-.28-1.39-.8-2.02V3z"/></svg>
<span itemprop="name">Community</span>
</a>
<a class="dropdown-item" href="/didi/VirtualAPK/pulse" data-skip-pjax>
<svg aria-hidden="true" class="octicon octicon-pulse" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8z"/></svg>
Pulse
</a>
<a class="dropdown-item" href="/didi/VirtualAPK/graphs" data-skip-pjax>
<svg aria-hidden="true" class="octicon octicon-graph" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg>
Graphs
</a>
</div>
</div>
</div>
</nav>
</div>
</div>
<div class="container new-discussion-timeline experiment-repo-nav">
<div class="repository-content">
<a href="/didi/VirtualAPK/blob/0b0745edcd2b4adc411cb77de7c4099b898c23d8/CONTRIBUTING.md" class="d-none js-permalink-shortcut" data-hotkey="y">Permalink</a>
<!-- blob contrib key: blob_contributors:v21:25812bc73237cfe3552924ee8fa0aacd -->
<div class="file-navigation js-zeroclipboard-container">
<div class="select-menu branch-select-menu js-menu-container js-select-menu float-left">
<button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w"
type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true">
<i>Branch:</i>
<span class="js-select-button css-truncate-target">master</span>
</button>
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax>
<div class="select-menu-modal">
<div class="select-menu-header">
<svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
<span class="select-menu-title">Switch branches/tags</span>
</div>
<div class="select-menu-filters">
<div class="select-menu-text-filter">
<input type="text" aria-label="Find or create a branch…" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Find or create a branch…">
</div>
<div class="select-menu-tabs">
<ul>
<li class="select-menu-tab">
<a href="#" data-tab-filter="branches" data-filter-placeholder="Find or create a branch…" class="js-select-menu-tab" role="tab">Branches</a>
</li>
<li class="select-menu-tab">
<a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a>
</li>
</ul>
</div>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
<a class="select-menu-item js-navigation-item js-navigation-open "
href="/didi/VirtualAPK/blob/dev/CONTRIBUTING.md"
data-name="dev"
data-skip-pjax="true"
rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
<span class="select-menu-item-text css-truncate-target js-select-menu-filter-text">
dev
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open selected"
href="/didi/VirtualAPK/blob/master/CONTRIBUTING.md"
data-name="master"
data-skip-pjax="true"
rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"/></svg>
<span class="select-menu-item-text css-truncate-target js-select-menu-filter-text">
master
</span>
</a>
</div>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/branches" class="js-create-branch select-menu-item select-menu-new-item-form js-navigation-item js-new-item-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="Biopo2g/9XzE6zpe5jezjUisIeUSshY7es+KSqhR3toFPxwGTd8OXBdAvA6uShHQw4OpTPEpg0GDfZY+S0b0Sg==" /></div>
<svg aria-hidden="true" class="octicon octicon-git-branch select-menu-item-icon" height="16" version="1.1" viewBox="0 0 10 16" width="10"><path fill-rule="evenodd" d="M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 0 0-1-3.72C.88 1 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg>
<div class="select-menu-item-text">
<span class="select-menu-item-heading">Create branch: <span class="js-new-item-name"></span></span>
<span class="description">from master</span>
</div>
<input type="hidden" name="name" id="name" class="js-new-item-value">
<input type="hidden" name="branch" id="branch" value="master">
<input type="hidden" name="path" id="path" value="CONTRIBUTING.md">
</form>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div>
</div>
</div>
</div>
<div class="BtnGroup float-right">
<a href="/didi/VirtualAPK/find/master"
class="js-pjax-capture-input btn btn-sm BtnGroup-item"
data-pjax
data-hotkey="t">
Find file
</a>
<button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm BtnGroup-item tooltipped tooltipped-s" data-copied-hint="Copied!" type="button">Copy path</button>
</div>
<div class="breadcrumb js-zeroclipboard-target">
<span class="repo-root js-repo-root"><span class="js-path-segment"><a href="/didi/VirtualAPK"><span>VirtualAPK</span></a></span></span><span class="separator">/</span><strong class="final-path">CONTRIBUTING.md</strong>
</div>
</div>
<div class="commit-tease">
<span class="float-right">
<a class="commit-tease-sha" href="/didi/VirtualAPK/commit/2740ca13cbba694cf3f435f5a8d6716fa1aa1abc" data-pjax>
2740ca1
</a>
<relative-time datetime="2017-06-29T14:54:01Z">Jun 29, 2017</relative-time>
</span>
<div>
<img alt="@huandu" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/239739?v=4&amp;s=40" width="20" />
<a href="/huandu" class="user-mention" rel="contributor">huandu</a>
<a href="/didi/VirtualAPK/commit/2740ca13cbba694cf3f435f5a8d6716fa1aa1abc" class="message" data-pjax="true" title="polish documents">polish documents</a>
</div>
<div class="commit-tease-contributors">
<button type="button" class="btn-link muted-link contributors-toggle" data-facebox="#blob_contributors_box">
<strong>2</strong>
contributors
</button>
<a class="avatar-link tooltipped tooltipped-s" aria-label="singwhatiwanna" href="/didi/VirtualAPK/commits/master/CONTRIBUTING.md?author=singwhatiwanna"><img alt="@singwhatiwanna" class="avatar" height="20" src="https://avatars3.githubusercontent.com/u/3346272?v=4&amp;s=40" width="20" /> </a>
<a class="avatar-link tooltipped tooltipped-s" aria-label="huandu" href="/didi/VirtualAPK/commits/master/CONTRIBUTING.md?author=huandu"><img alt="@huandu" class="avatar" height="20" src="https://avatars2.githubusercontent.com/u/239739?v=4&amp;s=40" width="20" /> </a>
</div>
<div id="blob_contributors_box" style="display:none">
<h2 class="facebox-header" data-facebox-id="facebox-header">Users who have contributed to this file</h2>
<ul class="facebox-user-list" data-facebox-id="facebox-description">
<li class="facebox-user-list-item">
<img alt="@singwhatiwanna" height="24" src="https://avatars1.githubusercontent.com/u/3346272?v=4&amp;s=48" width="24" />
<a href="/singwhatiwanna">singwhatiwanna</a>
</li>
<li class="facebox-user-list-item">
<img alt="@huandu" height="24" src="https://avatars0.githubusercontent.com/u/239739?v=4&amp;s=48" width="24" />
<a href="/huandu">huandu</a>
</li>
</ul>
</div>
</div>
<div class="file">
<div class="file-header">
<div class="file-actions">
<div class="BtnGroup">
<a href="/didi/VirtualAPK/raw/master/CONTRIBUTING.md" class="btn btn-sm BtnGroup-item" id="raw-url">Raw</a>
<a href="/didi/VirtualAPK/blame/master/CONTRIBUTING.md" class="btn btn-sm js-update-url-with-hash BtnGroup-item" data-hotkey="b">Blame</a>
<a href="/didi/VirtualAPK/commits/master/CONTRIBUTING.md" class="btn btn-sm BtnGroup-item" rel="nofollow">History</a>
</div>
<a class="btn-octicon tooltipped tooltipped-nw"
href="https://desktop.github.com"
aria-label="Open this file in GitHub Desktop"
data-ga-click="Repository, open with desktop, type:windows">
<svg aria-hidden="true" class="octicon octicon-device-desktop" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"/></svg>
</a>
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/edit/master/CONTRIBUTING.md" class="inline-form js-update-url-with-hash" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="QhTGbaFmDHoBMq25j4xu14cHKLdUX6jxgf2RJaWgKTBKa+wMA6PqLifa6IgZUUe41ZmGJxYr6eM37m0/vzfs6w==" /></div>
<button class="btn-octicon tooltipped tooltipped-nw" type="submit"
aria-label="Edit this file" data-hotkey="e" data-disable-with>
<svg aria-hidden="true" class="octicon octicon-pencil" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"/></svg>
</button>
</form> <!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/didi/VirtualAPK/delete/master/CONTRIBUTING.md" class="inline-form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="ccXfryEyc1vQiyQxM36LxZBqUdDDFFxec9O+ylp0/H6Y2nFyHH1okgGAPkc47jJBd62nKEr0mFmdUIU+xSISFw==" /></div>
<button class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw" type="submit"
aria-label="Delete this file" data-disable-with>
<svg aria-hidden="true" class="octicon octicon-trashcan" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg>
</button>
</form> </div>
<div class="file-info">
29 lines (18 sloc)
<span class="file-info-divider"></span>
938 Bytes
</div>
</div>
<div id="readme" class="readme blob instapaper_body">
<article class="markdown-body entry-content" itemprop="text"><h1><a id="user-content-contribution-guideline" class="anchor" href="#contribution-guideline" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Contribution Guideline</h1>
<p>Thanks for considering to contribute this project. All issues and pull requests are highly appreciated.</p>
<h2><a id="user-content-pull-requests" class="anchor" href="#pull-requests" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Pull Requests</h2>
<p>Before sending pull request to this project, please read and follow guidelines below.</p>
<ol>
<li>Branch: We only accept pull request on <code>dev</code> branch.</li>
<li>Coding style: Follow the coding style used in VirtualAPK.</li>
<li>Commit message: Use English and be aware of your spell.</li>
<li>Test: Make sure to test your code.</li>
</ol>
<p>Add device mode, API version, related log, screenshots and other related information in your pull request if possible.</p>
<p>NOTE: We assume all your contribution can be licensed under the <a href="https://github.com/didi/VirtualAPK/blob/master/LICENSE">Apache License 2.0</a>.</p>
<h2><a id="user-content-issues" class="anchor" href="#issues" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Issues</h2>
<p>We love clearly described issues. :)</p>
<p>Following information can help us to resolve the issue faster.</p>
<ul>
<li>Device mode and hardware information.</li>
<li>API version.</li>
<li>Logs.</li>
<li>Screenshots.</li>
<li>Steps to reproduce the issue.</li>
</ul>
</article>
</div>
</div>
<button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button>
<div id="jump-to-line" style="display:none">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" aria-label="Jump to line" autofocus>
<button type="submit" class="btn">Go</button>
</form> </div>
</div>
<div class="modal-backdrop js-touch-events"></div>
</div>
</div>
</div>
</div>
<div class="container-lg site-footer-container">
<div class="site-footer " role="contentinfo">
<ul class="site-footer-links float-right">
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact GitHub</a></li>
<li><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
<li><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
<li><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
<li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
<li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
</ul>
<a href="https://github.com" aria-label="Homepage" class="site-footer-mark" title="GitHub">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="24" version="1.1" viewBox="0 0 16 16" width="24"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
<ul class="site-footer-links">
<li>&copy; 2017 <span title="0.18126s from unicorn-2592397628-tnzmf">GitHub</span>, Inc.</li>
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
<li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
<li><a href="https://help.github.com" data-ga-click="Footer, go to help, text:help">Help</a></li>
</ul>
</div>
</div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
You can't perform that action at this time.
</div>
<script crossorigin="anonymous" integrity="sha256-OiTVyGEpRWTLRqro9+PHTHqtjluGGBa/2WknMA8gP1E=" src="https://assets-cdn.github.com/assets/frameworks-3a24d5c861294564cb46aae8f7e3c74c7aad8e5b861816bfd96927300f203f51.js"></script>
<script async="async" crossorigin="anonymous" integrity="sha256-0u/yC9TgTIqxZRfYQjZg/tLvDPt0wXD1XA2s6QOFTaY=" src="https://assets-cdn.github.com/assets/github-d2eff20bd4e04c8ab16517d8423660fed2ef0cfb74c170f55c0dace903854da6.js"></script>
<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
<div class="facebox" id="facebox" style="display:none;">
<div class="facebox-popup">
<div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
</div>
<button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
</div>
</div>
</body>
</html>
* Device mode and hardware information.
* API version.
* Logs.
* Screenshots.
* Steps to reproduce the issue.

View File

@@ -9,10 +9,12 @@
## 主要功能特性 ## 主要功能特性
### 快速体验
- 体验地址 http://117.51.146.109:8080 账号密码 admin/admin
### 集群监控维度 ### 集群监控维度
- 多版本集群管控,支持从`0.10.2``2.4`版本; - 多版本集群管控,支持从`0.10.2``2.x`版本;
- 集群Topic、Broker等多维度历史与实时关键指标查看 - 集群Topic、Broker等多维度历史与实时关键指标查看
@@ -26,31 +28,36 @@
### 用户使用维度 ### 用户使用维度
- 管理员用户与普通用户视角区分 - Kafka用户、Kafka研发、Kafka运维 视角区分
- 管理员用户与普通用户权限区分 - Kafka用户、Kafka研发、Kafka运维 权限区分
## kafka-manager架构图 ## kafka-manager架构图
![kafka-manager-arch](./docs/assets/images/common/arch.png) ![kafka-manager-arch](https://img-ys011.didistatic.com/static/dicloudpub/do1_xgDHNDLj2ChKxctSuf72)
## 相关文档 ## 相关文档
- [kafka-manager安装手册](./docs/install_cn_guide.md) - [kafka-manager 安装手册](docs/install_guide/install_guide_cn.md)
- [kafka-manager使用手册](./docs/user_cn_guide.md) - [kafka-manager 接入集群](docs/user_guide/add_cluster/add_cluster.md)
- [kafka-manager 用户使用手册](docs/user_guide/user_guide_cn.md)
- [kafka-manager FAQ](docs/user_guide/faq.md)
## 钉钉交流群 ## 钉钉交流群
![dingding_group](./docs/assets/images/common/dingding_group.jpg) ![dingding_group](./docs/assets/images/common/dingding_group.jpg)
钉钉群ID32821440
## OCE认证
OCE是一个认证机制和交流平台为Logi-KafkaManager生产用户量身打造我们会为OCE企业提供更好的技术支持比如专属的技术沙龙、企业一对一的交流机会、专属的答疑群等如果贵司Logi-KafkaManager上了生产[快来加入吧](http://obsuite.didiyun.com/open/openAuth)
## 项目成员 ## 项目成员
### 内部核心人员 ### 内部核心人员
`iceyuhui``liuyaguang``limengmonty``zhangliangmike``nullhuangyiming``zengqiao``eilenexuzhe``huangjiaweihjw` `iceyuhui``liuyaguang``limengmonty``zhangliangmike``nullhuangyiming``zengqiao``eilenexuzhe``huangjiaweihjw``zhaoyinrui``marzkonglingxu``joysunchao`
### 外部贡献者 ### 外部贡献者

72
build.sh Normal file
View File

@@ -0,0 +1,72 @@
#!/bin/bash
workspace=$(cd $(dirname $0) && pwd -P)
cd $workspace
## constant
OUTPUT_DIR=./output
KM_VERSION=2.2.0
APP_NAME=kafka-manager
APP_DIR=${APP_NAME}-${KM_VERSION}
MYSQL_TABLE_SQL_FILE=./docs/install_guide/create_mysql_table.sql
CONFIG_FILE=./kafka-manager-web/src/main/resources/application.yml
## function
function build() {
# 编译命令
mvn -U clean package -Dmaven.test.skip=true
local sc=$?
if [ $sc -ne 0 ];then
## 编译失败, 退出码为 非0
echo "$APP_NAME build error"
exit $sc
else
echo "$APP_NAME build ok"
fi
}
function make_output() {
# 新建output目录
rm -rf ${OUTPUT_DIR} &>/dev/null
mkdir -p ${OUTPUT_DIR}/${APP_DIR} &>/dev/null
# 填充output目录, output内的内容
(
cp -rf ${MYSQL_TABLE_SQL_FILE} ${OUTPUT_DIR}/${APP_DIR} && # 拷贝 sql 初始化脚本 至output目录
cp -rf ${CONFIG_FILE} ${OUTPUT_DIR}/${APP_DIR} && # 拷贝 application.yml 至output目录
# 拷贝程序包到output路径
cp kafka-manager-web/target/kafka-manager-web-${KM_VERSION}-SNAPSHOT.jar ${OUTPUT_DIR}/${APP_DIR}/${APP_NAME}.jar
echo -e "make output ok."
) || { echo -e "make output error"; exit 2; } # 填充output目录失败后, 退出码为 非0
}
function make_package() {
# 压缩output目录
(
cd ${OUTPUT_DIR} && tar cvzf ${APP_DIR}.tar.gz ${APP_DIR}
echo -e "make package ok."
) || { echo -e "make package error"; exit 2; } # 压缩output目录失败后, 退出码为 非0
}
##########################################
## main
## 其中,
## 1.进行编译
## 2.生成部署包output
## 3.生成tar.gz压缩包
##########################################
# 1.进行编译
build
# 2.生成部署包output
make_output
# 3.生成tar.gz压缩包
make_package
# 编译成功
echo -e "build done"
exit 0

View File

@@ -1,21 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author zengqiao
* @date 20/2/28
*/
public class Constant {
public static final String KAFKA_MANAGER_INNER_ERROR = "kafka-manager inner error";
public final static Map<Integer, List<String>> BROKER_METRICS_TYPE_MBEAN_NAME_MAP = new ConcurrentHashMap<>();
public final static Map<Integer, List<String>> TOPIC_METRICS_TYPE_MBEAN_NAME_MAP = new ConcurrentHashMap<>();
public static final String COLLECTOR_METRICS_LOGGER = "COLLECTOR_METRICS_LOGGER";
public static final String API_METRICS_LOGGER = "API_METRICS_LOGGER";
}

View File

@@ -1,23 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant;
public class MetricsType {
/**
* Broker流量详情
*/
public static final int BROKER_FLOW_DETAIL = 0;
public static final int BROKER_TO_DB_METRICS = 1; // Broker入DB的Metrics指标
public static final int BROKER_REAL_TIME_METRICS = 2; // Broker入DB的Metrics指标
public static final int BROKER_OVER_VIEW_METRICS = 3; // Broker状态概览的指标
public static final int BROKER_OVER_ALL_METRICS = 4; // Broker状态总揽的指标
public static final int BROKER_ANALYSIS_METRICS = 5; // Broker分析的指标
public static final int BROKER_TOPIC_ANALYSIS_METRICS = 6; // Broker分析的指标
/**
* Topic流量详情
*/
public static final int TOPIC_FLOW_DETAIL = 100;
public static final int TOPIC_FLOW_OVERVIEW = 101;
public static final int TOPIC_METRICS_TO_DB = 102;
}

View File

@@ -1,35 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant;
/**
* @author limeng
* @date 2017/11/21
*/
public enum OffsetStoreLocation {
ZOOKEEPER("zookeeper"),
BROKER("broker");
private final String location;
OffsetStoreLocation(String location) {
this.location = location;
}
public String getLocation() {
return location;
}
public static OffsetStoreLocation getOffsetStoreLocation(String location) {
if (location == null) {
return null;
}
for (OffsetStoreLocation offsetStoreLocation: OffsetStoreLocation.values()) {
if (offsetStoreLocation.location.equals(location)) {
return offsetStoreLocation;
}
}
return null;
}
}

View File

@@ -1,35 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant;
public class StatusCode {
/*
* kafka-manager status code: 17000 ~ 17999
*
* 正常 - 0
* 参数错误 - 10000
* 资源未就绪 - 10001
*/
/*
* 已约定的状态码
*/
public static final Integer SUCCESS = 0;
public static final Integer PARAM_ERROR = 10000; //参数错误
public static final Integer RES_UNREADY = 10001; //资源未就绪
public static final Integer MY_SQL_SELECT_ERROR = 17210; // MySQL 查询数据异常
public static final Integer MY_SQL_INSERT_ERROR = 17211; // MySQL 插入数据异常
public static final Integer MY_SQL_DELETE_ERROR = 17212; // MySQL 删除数据异常
public static final Integer MY_SQL_UPDATE_ERROR = 17213; // MySQL 更新数据异常
public static final Integer MY_SQL_REPLACE_ERROR = 17214; // MySQL 替换数据异常
public static final Integer OPERATION_ERROR = 17300; // 请求操作异常
/**
* Topic相关的异常
*/
public static final Integer TOPIC_EXISTED = 17400; //Topic已经存在了
public static final Integer PARTIAL_SUCESS = 17700; //操作部分成功
}

View File

@@ -1,71 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant.monitor;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
/**
* 条件类型
* @author zengqiao
* @date 19/5/12
*/
public enum MonitorConditionType {
BIGGER(">", "大于"),
EQUAL("=", "等于"),
LESS("<", "小于"),
NOT_EQUAL("!=", "不等于");
private String name;
private String message;
MonitorConditionType(String name, String message) {
this.name = name;
this.message = message;
}
public static boolean legal(String name) {
for (MonitorConditionType elem: MonitorConditionType.values()) {
if (elem.name.equals(name)) {
return true;
}
}
return false;
}
@Override
public String toString() {
return "ConditionType{" +
"name='" + name + '\'' +
", message='" + message + '\'' +
'}';
}
public static List<AbstractMap.SimpleEntry<String, String>> toList() {
List<AbstractMap.SimpleEntry<String, String>> conditionTypeList = new ArrayList<>();
for (MonitorConditionType elem: MonitorConditionType.values()) {
conditionTypeList.add(new AbstractMap.SimpleEntry<>(elem.name, elem.message));
}
return conditionTypeList;
}
/**
* 计算 operation(data1, data2) 是否为true
* @param data1
* @param data2
* @param operation
* @author zengqiao
* @date 19/5/12
* @return boolean
*/
public static boolean matchCondition(Double data1, Double data2, String operation) {
switch (operation) {
case ">": return data1 > data2;
case "<": return data1 < data2;
case "=": return data1.equals(data2);
case "!=": return !data1.equals(data2);
default:
}
return false;
}
}

View File

@@ -1,19 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant.monitor;
/**
* @author zengqiao
* @date 20/3/18
*/
public enum MonitorMatchStatus {
UNKNOWN(0),
YES(1),
NO(2);
public Integer status;
MonitorMatchStatus(Integer status) {
this.status = status;
}
}

View File

@@ -1,59 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant.monitor;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
/**
* 指标类型
* @author zengqiao
* @date 19/5/12
*/
public enum MonitorMetricsType {
BYTES_IN("BytesIn", "流入流量"),
BYTES_OUT("BytesOut", "流出流量"),
LAG("Lag", "消费组Lag");
private String name;
private String message;
MonitorMetricsType(String name, String message) {
this.name = name;
this.message = message;
}
public static boolean legal(String name) {
for (MonitorMetricsType elem: MonitorMetricsType.values()) {
if (elem.name.equals(name)) {
return true;
}
}
return false;
}
@Override
public String toString() {
return "MetricType{" +
"name='" + name + '\'' +
", message='" + message + '\'' +
'}';
}
public static List<AbstractMap.SimpleEntry<String, String>> toList() {
List<AbstractMap.SimpleEntry<String, String>> metricTypeList = new ArrayList<>();
for (MonitorMetricsType elem: MonitorMetricsType.values()) {
metricTypeList.add(new AbstractMap.SimpleEntry<>(elem.name, elem.message));
}
return metricTypeList;
}
public String getName() {
return name;
}
public String getMessage() {
return message;
}
}

View File

@@ -1,56 +0,0 @@
package com.xiaojukeji.kafka.manager.common.constant.monitor;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
/**
* 通知类型
* @author huangyiminghappy@163.com
* @date 2019-05-06
*/
public enum MonitorNotifyType {
KAFKA_MESSAGE("KAFKA", "告警发送到KAFKA");
String name;
String message;
MonitorNotifyType(String name, String message){
this.name = name;
this.message = message;
}
public String getName() {
return name;
}
public String getMessage() {
return message;
}
public static boolean legal(String name) {
for (MonitorNotifyType elem: MonitorNotifyType.values()) {
if (elem.name.equals(name)) {
return true;
}
}
return false;
}
@Override
public String toString() {
return "NotifyType{" +
"name='" + name + '\'' +
", message='" + message + '\'' +
'}';
}
public static List<AbstractMap.SimpleEntry<String, String>> toList() {
List<AbstractMap.SimpleEntry<String, String>> notifyTypeList = new ArrayList<>();
for (MonitorNotifyType elem: MonitorNotifyType.values()) {
notifyTypeList.add(new AbstractMap.SimpleEntry<>(elem.name, elem.message));
}
return notifyTypeList;
}
}

View File

@@ -1,76 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity;
import com.alibaba.fastjson.JSON;
import com.xiaojukeji.kafka.manager.common.constant.StatusCode;
import java.io.Serializable;
/**
* @author huangyiminghappy@163.com
* @date 2019-07-08
*/
public class Result<T> implements Serializable {
private static final long serialVersionUID = -2772975319944108658L;
private T data;
private String message;
private Integer code;
public Result(T data) {
this.data = data;
this.code = StatusCode.SUCCESS;
this.message = "成功";
}
public Result() {
this(null);
}
public Result(Integer code, String message) {
this.message = message;
this.code = code;
}
public Result(Integer code, T data, String message) {
this.data = data;
this.message = message;
this.code = code;
}
public T getData()
{
return (T)this.data;
}
public void setData(T data)
{
this.data = data;
}
public String getMessage()
{
return this.message;
}
public void setMessage(String message)
{
this.message = message;
}
public Integer getCode()
{
return this.code;
}
public void setCode(Integer code)
{
this.code = code;
}
@Override
public String toString()
{
return JSON.toJSONString(this);
}
}

View File

@@ -1,24 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* FieldSelector
* @author huangyiminghappy@163.com
* @date 2019-06-19
*/
@Target(ElementType.FIELD)
@Retention(RUNTIME)
@Documented
public @interface FieldSelector {
//注解的属性
String name() default "";
int[] types() default {};
}

View File

@@ -1,35 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 用户角色
* @author zengqiao_cn@163.com
* @date 19/4/15
*/
public enum AccountRoleEnum {
UNKNOWN(-1),
NORMAL(0),
SRE(1),
ADMIN(2);
private Integer role;
AccountRoleEnum(Integer role) {
this.role = role;
}
public Integer getRole() {
return role;
}
public static AccountRoleEnum getUserRoleEnum(Integer role) {
for (AccountRoleEnum elem: AccountRoleEnum.values()) {
if (elem.getRole().equals(role)) {
return elem;
}
}
return null;
}
}

View File

@@ -1,38 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 操作Topic的状态
* @author zengqiao
* @date 19/11/26
*/
public enum AdminTopicStatusEnum {
SUCCESS(0, "成功"),
REPLACE_DB_FAILED(1, "更新DB失败"),
PARAM_NULL_POINTER(2, "参数错误"),
PARTITION_NUM_ILLEGAL(3, "分区数错误"),
BROKER_NUM_NOT_ENOUGH(4, "Broker数不足错误"),
TOPIC_NAME_ILLEGAL(5, "Topic名称非法"),
TOPIC_EXISTED(6, "Topic已存在"),
UNKNOWN_TOPIC_PARTITION(7, "Topic未知"),
TOPIC_CONFIG_ILLEGAL(8, "Topic配置错误"),
TOPIC_IN_DELETING(9, "Topic正在删除"),
UNKNOWN_ERROR(10, "未知错误");
private Integer code;
private String message;
AdminTopicStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -1,42 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* DBStatus状态含义
* @author zengqiao_cn@163.com
* @date 19/4/15
*/
public enum DBStatusEnum {
/**
* 逻辑删除
*/
DELETED(-1),
/**
* 普通
*/
NORMAL(0),
/**
* 已完成并通过
*/
PASSED(1);
private Integer status;
DBStatusEnum(Integer status) {
this.status = status;
}
public Integer getStatus() {
return status;
}
public static DBStatusEnum getDBStatusEnum(Integer status) {
for (DBStatusEnum elem: DBStatusEnum.values()) {
if (elem.getStatus().equals(status)) {
return elem;
}
}
return null;
}
}

View File

@@ -1,19 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 操作类型
* @author zengqiao
* @date 19/11/21
*/
public enum OperationEnum {
CREATE_TOPIC("create_topic"),
DELETE_TOPIC("delete_topic"),
MODIFY_TOPIC_CONFIG("modify_topic_config"),
EXPAND_TOPIC_PARTITION("expand_topic_partition");
public String message;
OperationEnum(String message) {
this.message = message;
}
}

View File

@@ -1,33 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 工单类型
* @author zengqiao
* @date 19/6/23
*/
public enum OrderTypeEnum {
UNKNOWN(-1),
APPLY_TOPIC(0),
APPLY_PARTITION(1);
private Integer code;
OrderTypeEnum(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
public static OrderTypeEnum getOrderTypeEnum(Integer code) {
for (OrderTypeEnum elem: OrderTypeEnum.values()) {
if (elem.getCode().equals(code)) {
return elem;
}
}
return OrderTypeEnum.UNKNOWN;
}
}

View File

@@ -1,31 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 优先副本选举状态
* @author zengqiao
* @date 2017/6/29.
*/
public enum PreferredReplicaElectEnum {
SUCCESS(0, "成功[创建成功|执行成功]"),
RUNNING(1, "正在执行"),
ALREADY_EXIST(2, "任务已存在"),
PARAM_ILLEGAL(3, "参数错误"),
UNKNOWN(4, "进度未知");
private Integer code;
private String message;
PreferredReplicaElectEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -1,45 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.bizenum;
/**
* 迁移状态
* @author zengqiao
* @date 19/12/29
*/
public enum ReassignmentStatusEnum {
WAITING(0, "等待执行"),
RUNNING(1, "正在执行"),
SUCCESS(2, "迁移成功"),
FAILED(3, "迁移失败"),
CANCELED(4, "取消任务");
private Integer code;
private String message;
ReassignmentStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
public static boolean triggerTask(Integer status) {
if (WAITING.code.equals(status) || RUNNING.code.equals(status)) {
return true;
}
return false;
}
public static boolean cancelTask(Integer status) {
if (WAITING.code.equals(status)) {
return true;
}
return false;
}
}

View File

@@ -1,132 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
import com.xiaojukeji.kafka.manager.common.entity.metrics.BrokerMetrics;
import com.xiaojukeji.kafka.manager.common.entity.zookeeper.BrokerMetadata;
/**
* @author zengqiao
* @date 19/4/21
*/
public class BrokerOverallDTO {
private Integer brokerId;
private String host;
private Integer port;
private Integer jmxPort;
private Long startTime;
private Integer partitionCount;
private Integer underReplicatedPartitions;
private Integer leaderCount;
private Double bytesInPerSec;
public Integer getBrokerId() {
return brokerId;
}
public void setBrokerId(Integer brokerId) {
this.brokerId = brokerId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public Integer getJmxPort() {
return jmxPort;
}
public void setJmxPort(Integer jmxPort) {
this.jmxPort = jmxPort;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Integer getPartitionCount() {
return partitionCount;
}
public void setPartitionCount(Integer partitionCount) {
this.partitionCount = partitionCount;
}
public Integer getUnderReplicatedPartitions() {
return underReplicatedPartitions;
}
public void setUnderReplicatedPartitions(Integer underReplicatedPartitions) {
this.underReplicatedPartitions = underReplicatedPartitions;
}
public Integer getLeaderCount() {
return leaderCount;
}
public void setLeaderCount(Integer leaderCount) {
this.leaderCount = leaderCount;
}
public Double getBytesInPerSec() {
return bytesInPerSec;
}
public void setBytesInPerSec(Double bytesInPerSec) {
this.bytesInPerSec = bytesInPerSec;
}
@Override
public String toString() {
return "BrokerOverallDTO{" +
"brokerId=" + brokerId +
", host='" + host + '\'' +
", port=" + port +
", jmxPort=" + jmxPort +
", startTime=" + startTime +
", partitionCount=" + partitionCount +
", underReplicatedPartitions=" + underReplicatedPartitions +
", leaderCount=" + leaderCount +
", bytesInPerSec=" + bytesInPerSec +
'}';
}
public static BrokerOverallDTO newInstance(BrokerMetadata brokerMetadata, BrokerMetrics brokerMetrics) {
BrokerOverallDTO brokerOverallDTO = new BrokerOverallDTO();
brokerOverallDTO.setBrokerId(brokerMetadata.getBrokerId());
brokerOverallDTO.setHost(brokerMetadata.getHost());
brokerOverallDTO.setPort(brokerMetadata.getPort());
brokerOverallDTO.setJmxPort(brokerMetadata.getJmxPort());
brokerOverallDTO.setStartTime(brokerMetadata.getTimestamp());
if (brokerMetrics == null) {
return brokerOverallDTO;
}
brokerOverallDTO.setPartitionCount(brokerMetrics.getPartitionCount());
brokerOverallDTO.setLeaderCount(brokerMetrics.getLeaderCount());
brokerOverallDTO.setBytesInPerSec(brokerMetrics.getBytesInPerSec());
brokerOverallDTO.setUnderReplicatedPartitions(brokerMetrics.getUnderReplicatedPartitions());
return brokerOverallDTO;
}
}

View File

@@ -1,121 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
import com.xiaojukeji.kafka.manager.common.entity.metrics.BrokerMetrics;
import com.xiaojukeji.kafka.manager.common.entity.zookeeper.BrokerMetadata;
import com.xiaojukeji.kafka.manager.common.entity.bizenum.DBStatusEnum;
/**
* @author zengqiao_cn@163.com
* @date 19/4/21
*/
public class BrokerOverviewDTO {
private Integer brokerId;
private String host;
private Integer port;
private Integer jmxPort;
private Long startTime;
private Double byteIn;
private Double byteOut;
private Integer status;
public Integer getBrokerId() {
return brokerId;
}
public void setBrokerId(Integer brokerId) {
this.brokerId = brokerId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public Integer getJmxPort() {
return jmxPort;
}
public void setJmxPort(Integer jmxPort) {
this.jmxPort = jmxPort;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Double getByteIn() {
return byteIn;
}
public void setByteIn(Double byteIn) {
this.byteIn = byteIn;
}
public Double getByteOut() {
return byteOut;
}
public void setByteOut(Double byteOut) {
this.byteOut = byteOut;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
@Override
public String toString() {
return "BrokerInfoDTO{" +
"brokerId=" + brokerId +
", host='" + host + '\'' +
", port=" + port +
", jmxPort=" + jmxPort +
", startTime=" + startTime +
", byteIn=" + byteIn +
", byteOut=" + byteOut +
", status=" + status +
'}';
}
public static BrokerOverviewDTO newInstance(BrokerMetadata brokerMetadata, BrokerMetrics brokerMetrics) {
BrokerOverviewDTO brokerOverviewDTO = new BrokerOverviewDTO();
brokerOverviewDTO.setBrokerId(brokerMetadata.getBrokerId());
brokerOverviewDTO.setHost(brokerMetadata.getHost());
brokerOverviewDTO.setPort(brokerMetadata.getPort());
brokerOverviewDTO.setJmxPort(brokerMetadata.getJmxPort());
brokerOverviewDTO.setStartTime(brokerMetadata.getTimestamp());
brokerOverviewDTO.setStatus(DBStatusEnum.NORMAL.getStatus());
if (brokerMetrics == null) {
return brokerOverviewDTO;
}
brokerOverviewDTO.setByteIn(brokerMetrics.getBytesInPerSec());
brokerOverviewDTO.setByteOut(brokerMetrics.getBytesOutPerSec());
return brokerOverviewDTO;
}
}

View File

@@ -1,70 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
import java.util.Date;
/**
* @author zengqiao
* @date 19/4/22
*/
public class ControllerDTO {
private String clusterName;
private Integer brokerId;
private String host;
private Integer controllerVersion;
private Date controllerTimestamp;
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
public Integer getBrokerId() {
return brokerId;
}
public void setBrokerId(Integer brokerId) {
this.brokerId = brokerId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public Integer getControllerVersion() {
return controllerVersion;
}
public void setControllerVersion(Integer controllerVersion) {
this.controllerVersion = controllerVersion;
}
public Date getControllerTimestamp() {
return controllerTimestamp;
}
public void setControllerTimestamp(Date controllerTimestamp) {
this.controllerTimestamp = controllerTimestamp;
}
@Override
public String toString() {
return "ControllerInfoDTO{" +
"clusterName='" + clusterName + '\'' +
", brokerId=" + brokerId +
", host='" + host + '\'' +
", controllerVersion=" + controllerVersion +
", controllerTimestamp=" + controllerTimestamp +
'}';
}
}

View File

@@ -1,123 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
/**
* @author arthur
* @date 2018/09/03
*/
public class TopicBasicDTO {
private String topicName;
private Integer partitionNum;
private Integer replicaNum;
private Integer brokerNum;
private String remark;
private Long modifyTime;
private Long createTime;
private String region;
private Long retentionTime;
private String principal;
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public Integer getPartitionNum() {
return partitionNum;
}
public void setPartitionNum(Integer partitionNum) {
this.partitionNum = partitionNum;
}
public Integer getReplicaNum() {
return replicaNum;
}
public void setReplicaNum(Integer replicaNum) {
this.replicaNum = replicaNum;
}
public Integer getBrokerNum() {
return brokerNum;
}
public void setBrokerNum(Integer brokerNum) {
this.brokerNum = brokerNum;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public Long getRetentionTime() {
return retentionTime;
}
public void setRetentionTime(Long retentionTime) {
this.retentionTime = retentionTime;
}
public Long getModifyTime() {
return modifyTime;
}
public void setModifyTime(Long modifyTime) {
this.modifyTime = modifyTime;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public String getPrincipal() {
return principal;
}
public void setPrincipal(String principal) {
this.principal = principal;
}
@Override
public String toString() {
return "TopicBasicInfoDTO{" +
"topicName='" + topicName + '\'' +
", partitionNum=" + partitionNum +
", replicaNum=" + replicaNum +
", brokerNum=" + brokerNum +
", remark='" + remark + '\'' +
", modifyTime=" + modifyTime +
", createTime=" + createTime +
", region='" + region + '\'' +
", retentionTime=" + retentionTime +
", principal='" + principal + '\'' +
'}';
}
}

View File

@@ -1,86 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
public class TopicOverviewDTO {
private Long clusterId;
private String topicName;
private Integer replicaNum;
private Integer partitionNum;
private Double bytesInPerSec;
private Double produceRequestPerSec;
private Long updateTime;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public Integer getReplicaNum() {
return replicaNum;
}
public void setReplicaNum(Integer replicaNum) {
this.replicaNum = replicaNum;
}
public Integer getPartitionNum() {
return partitionNum;
}
public void setPartitionNum(Integer partitionNum) {
this.partitionNum = partitionNum;
}
public Double getBytesInPerSec() {
return bytesInPerSec;
}
public void setBytesInPerSec(Double bytesInPerSec) {
this.bytesInPerSec = bytesInPerSec;
}
public Double getProduceRequestPerSec() {
return produceRequestPerSec;
}
public void setProduceRequestPerSec(Double produceRequestPerSec) {
this.produceRequestPerSec = produceRequestPerSec;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return "TopicOverviewDTO{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", replicaNum=" + replicaNum +
", partitionNum=" + partitionNum +
", bytesInPerSec=" + bytesInPerSec +
", produceRequestPerSec=" + produceRequestPerSec +
", updateTime=" + updateTime +
'}';
}
}

View File

@@ -1,105 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto;
import java.io.Serializable;
import java.util.List;
/**
* @author arthur
* @date 2017/6/6.
*/
public class TopicPartitionDTO implements Serializable {
private Integer partitionId;
private Long offset;
private Integer leaderBrokerId;
private Integer preferredBrokerId;
private Integer leaderEpoch;
private List<Integer> replicasBroker;
private List<Integer> isr;
private Boolean underReplicated;
public Integer getPartitionId() {
return partitionId;
}
public void setPartitionId(Integer partitionId) {
this.partitionId = partitionId;
}
public Long getOffset() {
return offset;
}
public void setOffset(Long offset) {
this.offset = offset;
}
public Integer getLeaderBrokerId() {
return leaderBrokerId;
}
public void setLeaderBrokerId(Integer leaderBrokerId) {
this.leaderBrokerId = leaderBrokerId;
}
public Integer getPreferredBrokerId() {
return preferredBrokerId;
}
public void setPreferredBrokerId(Integer preferredBrokerId) {
this.preferredBrokerId = preferredBrokerId;
}
public Integer getLeaderEpoch() {
return leaderEpoch;
}
public void setLeaderEpoch(Integer leaderEpoch) {
this.leaderEpoch = leaderEpoch;
}
public List<Integer> getReplicasBroker() {
return replicasBroker;
}
public void setReplicasBroker(List<Integer> replicasBroker) {
this.replicasBroker = replicasBroker;
}
public List<Integer> getIsr() {
return isr;
}
public void setIsr(List<Integer> isr) {
this.isr = isr;
}
public boolean isUnderReplicated() {
return underReplicated;
}
public void setUnderReplicated(boolean underReplicated) {
this.underReplicated = underReplicated;
}
@Override
public String toString() {
return "TopicPartitionDTO{" +
"partitionId=" + partitionId +
", offset=" + offset +
", leaderBrokerId=" + leaderBrokerId +
", preferredBrokerId=" + preferredBrokerId +
", leaderEpoch=" + leaderEpoch +
", replicasBroker=" + replicasBroker +
", isr=" + isr +
", underReplicated=" + underReplicated +
'}';
}
}

View File

@@ -1,47 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.alarm;
/**
* 告警通知
* @author zengqiao
* @date 2020-02-14
*/
public class AlarmNotifyDTO {
private Long alarmRuleId;
private String actionTag;
private String message;
public Long getAlarmRuleId() {
return alarmRuleId;
}
public void setAlarmRuleId(Long alarmRuleId) {
this.alarmRuleId = alarmRuleId;
}
public String getActionTag() {
return actionTag;
}
public void setActionTag(String actionTag) {
this.actionTag = actionTag;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "AlarmNotifyDTO{" +
"alarmRuleId=" + alarmRuleId +
", actionTag='" + actionTag + '\'' +
", message='" + message + '\'' +
'}';
}
}

View File

@@ -1,127 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.alarm;
import java.util.Map;
/**
* @author zengqiao
* @date 19/12/16
*/
public class AlarmRuleDTO {
/**
* 告警ID
*/
private Long id;
/**
* 告警名称
*/
private String name;
/**
* 已持续次数
*/
private Integer duration;
/**
* 集群ID, 过滤条件中必有的, 单独拿出来
*/
private Long clusterId;
/**
* 告警策略表达式
*/
private AlarmStrategyExpressionDTO strategyExpression;
/**
* 告警策略过滤条件
*/
private Map<String, String> strategyFilterMap;
/**
* 告警策略Action方式
*/
private Map<String, AlarmStrategyActionDTO> strategyActionMap;
/**
* 修改时间
*/
private Long gmtModify;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public AlarmStrategyExpressionDTO getStrategyExpression() {
return strategyExpression;
}
public void setStrategyExpression(AlarmStrategyExpressionDTO strategyExpression) {
this.strategyExpression = strategyExpression;
}
public Map<String, String> getStrategyFilterMap() {
return strategyFilterMap;
}
public void setStrategyFilterMap(Map<String, String> strategyFilterMap) {
this.strategyFilterMap = strategyFilterMap;
}
public Map<String, AlarmStrategyActionDTO> getStrategyActionMap() {
return strategyActionMap;
}
public void setStrategyActionMap(Map<String, AlarmStrategyActionDTO> strategyActionMap) {
this.strategyActionMap = strategyActionMap;
}
public Long getGmtModify() {
return gmtModify;
}
public void setGmtModify(Long gmtModify) {
this.gmtModify = gmtModify;
}
@Override
public String toString() {
return "AlarmRuleDTO{" +
"id=" + id +
", name='" + name + '\'' +
", duration=" + duration +
", clusterId=" + clusterId +
", strategyExpression=" + strategyExpression +
", strategyFilterMap=" + strategyFilterMap +
", strategyActionMap=" + strategyActionMap +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,43 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.alarm;
/**
* @author zengqiao
* @date 19/12/16
*/
public class AlarmStrategyActionDTO {
private String actionWay; // 告知方式: kafka
private String actionTag;
public String getActionWay() {
return actionWay;
}
public void setActionWay(String actionWay) {
this.actionWay = actionWay;
}
public String getActionTag() {
return actionTag;
}
public void setActionTag(String actionTag) {
this.actionTag = actionTag;
}
@Override
public String toString() {
return "AlarmStrategyActionDTO{" +
"actionWay='" + actionWay + '\'' +
", actionTag='" + actionTag + '\'' +
'}';
}
public boolean legal() {
if (actionWay == null
|| actionTag == null) {
return false;
}
return true;
}
}

View File

@@ -1,68 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.alarm;
/**
* 策略表达式
* @author zengqiao
* @date 19/12/16
*/
public class AlarmStrategyExpressionDTO {
private String metric;
private String opt;
private Long threshold;
private Integer duration;
public String getMetric() {
return metric;
}
public void setMetric(String metric) {
this.metric = metric;
}
public String getOpt() {
return opt;
}
public void setOpt(String opt) {
this.opt = opt;
}
public Long getThreshold() {
return threshold;
}
public void setThreshold(Long threshold) {
this.threshold = threshold;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
@Override
public String toString() {
return "AlarmStrategyExpressionModel{" +
"metric='" + metric + '\'' +
", opt='" + opt + '\'' +
", threshold=" + threshold +
", duration=" + duration +
'}';
}
public boolean legal() {
if (metric == null
|| opt == null
|| threshold == null
|| duration == null || duration <= 0) {
return false;
}
return true;
}
}

View File

@@ -1,44 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.alarm;
/**
* 告警过滤条件
* @author zengqiao
* @date 19/12/16
*/
public class AlarmStrategyFilterDTO {
private String key;
private String value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
return "AlarmStrategyFilterModel{" +
"key='" + key + '\'' +
", value='" + value + '\'' +
'}';
}
public boolean legal() {
if (key == null
|| value == null) {
return false;
}
return true;
}
}

View File

@@ -1,61 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.dto.consumer;
import com.xiaojukeji.kafka.manager.common.entity.zookeeper.PartitionState;
import java.util.List;
import java.util.Map;
/**
* Consumer实体类
* @author tukun
* @date 2015/11/12
*/
public class ConsumerDTO {
/**
* 消费group名
*/
private String consumerGroup;
/**
* 消费类型一般为static
*/
private String location;
/**
* 订阅的每个topic的partition状态列表
*/
private Map<String, List<PartitionState>> topicPartitionMap;
public String getConsumerGroup() {
return consumerGroup;
}
public void setConsumerGroup(String consumerGroup) {
this.consumerGroup = consumerGroup;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Map<String, List<PartitionState>> getTopicPartitionMap() {
return topicPartitionMap;
}
public void setTopicPartitionMap(Map<String, List<PartitionState>> topicPartitionMap) {
this.topicPartitionMap = topicPartitionMap;
}
@Override
public String toString() {
return "Consumer{" +
"consumerGroup='" + consumerGroup + '\'' +
", location='" + location + '\'' +
", topicPartitionMap=" + topicPartitionMap +
'}';
}
}

View File

@@ -1,394 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.metrics;
import com.xiaojukeji.kafka.manager.common.constant.MetricsType;
import com.xiaojukeji.kafka.manager.common.entity.annotations.FieldSelector;
import com.xiaojukeji.kafka.manager.common.entity.po.BaseEntryDO;
/**
* @author zengqiao
* @date 19/11/25
*/
public class BaseMetrics extends BaseEntryDO {
/**
* 每秒流入的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.BROKER_OVER_VIEW_METRICS,
MetricsType.BROKER_ANALYSIS_METRICS,
MetricsType.BROKER_TOPIC_ANALYSIS_METRICS,
MetricsType.TOPIC_FLOW_DETAIL,
MetricsType.TOPIC_FLOW_OVERVIEW,
MetricsType.TOPIC_METRICS_TO_DB
})
protected Double bytesInPerSec = 0.0;
protected Double bytesInPerSecMeanRate = 0.0;
protected Double bytesInPerSecFiveMinuteRate = 0.0;
protected Double bytesInPerSecFifteenMinuteRate = 0.0;
/**
* 每秒流出的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.BROKER_OVER_VIEW_METRICS,
MetricsType.BROKER_ANALYSIS_METRICS,
MetricsType.BROKER_TOPIC_ANALYSIS_METRICS,
MetricsType.TOPIC_FLOW_DETAIL,
MetricsType.TOPIC_METRICS_TO_DB
})
protected Double bytesOutPerSec = 0.0;
protected Double bytesOutPerSecMeanRate = 0.0;
protected Double bytesOutPerSecFiveMinuteRate = 0.0;
protected Double bytesOutPerSecFifteenMinuteRate = 0.0;
/**
* 每秒流入的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.BROKER_ANALYSIS_METRICS,
MetricsType.BROKER_TOPIC_ANALYSIS_METRICS,
MetricsType.TOPIC_FLOW_DETAIL,
MetricsType.TOPIC_METRICS_TO_DB
})
protected Double messagesInPerSec = 0.0;
protected Double messagesInPerSecMeanRate = 0.0;
protected Double messagesInPerSecFiveMinuteRate = 0.0;
protected Double messagesInPerSecFifteenMinuteRate = 0.0;
/**
* 每秒拒绝的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.TOPIC_FLOW_DETAIL,
MetricsType.TOPIC_METRICS_TO_DB
})
protected Double bytesRejectedPerSec = 0.0;
protected Double bytesRejectedPerSecMeanRate = 0.0;
protected Double bytesRejectedPerSecFiveMinuteRate = 0.0;
protected Double bytesRejectedPerSecFifteenMinuteRate = 0.0;
/**
* 每秒失败的Produce请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.TOPIC_FLOW_DETAIL
})
protected Double failProduceRequestPerSec = 0.0;
protected Double failProduceRequestPerSecMeanRate = 0.0;
protected Double failProduceRequestPerSecFiveMinuteRate = 0.0;
protected Double failProduceRequestPerSecFifteenMinuteRate = 0.0;
/**
* 每秒失败的Fetch请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS,
MetricsType.TOPIC_FLOW_DETAIL
})
protected Double failFetchRequestPerSec = 0.0;
protected Double failFetchRequestPerSecMeanRate = 0.0;
protected Double failFetchRequestPerSecFiveMinuteRate = 0.0;
protected Double failFetchRequestPerSecFifteenMinuteRate = 0.0;
/**
* 每秒总Produce请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_ANALYSIS_METRICS,
MetricsType.BROKER_TOPIC_ANALYSIS_METRICS,
MetricsType.TOPIC_FLOW_DETAIL,
MetricsType.TOPIC_METRICS_TO_DB,
MetricsType.TOPIC_FLOW_OVERVIEW
})
protected Double totalProduceRequestsPerSec = 0.0;
protected Double totalProduceRequestsPerSecMeanRate = 0.0;
protected Double totalProduceRequestsPerSecFiveMinuteRate = 0.0;
protected Double totalProduceRequestsPerSecFifteenMinuteRate = 0.0;
/**
* 每秒总Fetch请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_ANALYSIS_METRICS,
MetricsType.BROKER_TOPIC_ANALYSIS_METRICS,
MetricsType.TOPIC_FLOW_DETAIL
})
protected Double totalFetchRequestsPerSec = 0.0;
protected Double totalFetchRequestsPerSecMeanRate = 0.0;
protected Double totalFetchRequestsPerSecFiveMinuteRate = 0.0;
protected Double totalFetchRequestsPerSecFifteenMinuteRate = 0.0;
public Double getBytesInPerSec() {
return bytesInPerSec;
}
public void setBytesInPerSec(Double bytesInPerSec) {
this.bytesInPerSec = bytesInPerSec;
}
public Double getBytesInPerSecMeanRate() {
return bytesInPerSecMeanRate;
}
public void setBytesInPerSecMeanRate(Double bytesInPerSecMeanRate) {
this.bytesInPerSecMeanRate = bytesInPerSecMeanRate;
}
public Double getBytesInPerSecFiveMinuteRate() {
return bytesInPerSecFiveMinuteRate;
}
public void setBytesInPerSecFiveMinuteRate(Double bytesInPerSecFiveMinuteRate) {
this.bytesInPerSecFiveMinuteRate = bytesInPerSecFiveMinuteRate;
}
public Double getBytesInPerSecFifteenMinuteRate() {
return bytesInPerSecFifteenMinuteRate;
}
public void setBytesInPerSecFifteenMinuteRate(Double bytesInPerSecFifteenMinuteRate) {
this.bytesInPerSecFifteenMinuteRate = bytesInPerSecFifteenMinuteRate;
}
public Double getBytesOutPerSec() {
return bytesOutPerSec;
}
public void setBytesOutPerSec(Double bytesOutPerSec) {
this.bytesOutPerSec = bytesOutPerSec;
}
public Double getBytesOutPerSecMeanRate() {
return bytesOutPerSecMeanRate;
}
public void setBytesOutPerSecMeanRate(Double bytesOutPerSecMeanRate) {
this.bytesOutPerSecMeanRate = bytesOutPerSecMeanRate;
}
public Double getBytesOutPerSecFiveMinuteRate() {
return bytesOutPerSecFiveMinuteRate;
}
public void setBytesOutPerSecFiveMinuteRate(Double bytesOutPerSecFiveMinuteRate) {
this.bytesOutPerSecFiveMinuteRate = bytesOutPerSecFiveMinuteRate;
}
public Double getBytesOutPerSecFifteenMinuteRate() {
return bytesOutPerSecFifteenMinuteRate;
}
public void setBytesOutPerSecFifteenMinuteRate(Double bytesOutPerSecFifteenMinuteRate) {
this.bytesOutPerSecFifteenMinuteRate = bytesOutPerSecFifteenMinuteRate;
}
public Double getMessagesInPerSec() {
return messagesInPerSec;
}
public void setMessagesInPerSec(Double messagesInPerSec) {
this.messagesInPerSec = messagesInPerSec;
}
public Double getMessagesInPerSecMeanRate() {
return messagesInPerSecMeanRate;
}
public void setMessagesInPerSecMeanRate(Double messagesInPerSecMeanRate) {
this.messagesInPerSecMeanRate = messagesInPerSecMeanRate;
}
public Double getMessagesInPerSecFiveMinuteRate() {
return messagesInPerSecFiveMinuteRate;
}
public void setMessagesInPerSecFiveMinuteRate(Double messagesInPerSecFiveMinuteRate) {
this.messagesInPerSecFiveMinuteRate = messagesInPerSecFiveMinuteRate;
}
public Double getMessagesInPerSecFifteenMinuteRate() {
return messagesInPerSecFifteenMinuteRate;
}
public void setMessagesInPerSecFifteenMinuteRate(Double messagesInPerSecFifteenMinuteRate) {
this.messagesInPerSecFifteenMinuteRate = messagesInPerSecFifteenMinuteRate;
}
public Double getBytesRejectedPerSec() {
return bytesRejectedPerSec;
}
public void setBytesRejectedPerSec(Double bytesRejectedPerSec) {
this.bytesRejectedPerSec = bytesRejectedPerSec;
}
public Double getBytesRejectedPerSecMeanRate() {
return bytesRejectedPerSecMeanRate;
}
public void setBytesRejectedPerSecMeanRate(Double bytesRejectedPerSecMeanRate) {
this.bytesRejectedPerSecMeanRate = bytesRejectedPerSecMeanRate;
}
public Double getBytesRejectedPerSecFiveMinuteRate() {
return bytesRejectedPerSecFiveMinuteRate;
}
public void setBytesRejectedPerSecFiveMinuteRate(Double bytesRejectedPerSecFiveMinuteRate) {
this.bytesRejectedPerSecFiveMinuteRate = bytesRejectedPerSecFiveMinuteRate;
}
public Double getBytesRejectedPerSecFifteenMinuteRate() {
return bytesRejectedPerSecFifteenMinuteRate;
}
public void setBytesRejectedPerSecFifteenMinuteRate(Double bytesRejectedPerSecFifteenMinuteRate) {
this.bytesRejectedPerSecFifteenMinuteRate = bytesRejectedPerSecFifteenMinuteRate;
}
public Double getFailProduceRequestPerSec() {
return failProduceRequestPerSec;
}
public void setFailProduceRequestPerSec(Double failProduceRequestPerSec) {
this.failProduceRequestPerSec = failProduceRequestPerSec;
}
public Double getFailProduceRequestPerSecMeanRate() {
return failProduceRequestPerSecMeanRate;
}
public void setFailProduceRequestPerSecMeanRate(Double failProduceRequestPerSecMeanRate) {
this.failProduceRequestPerSecMeanRate = failProduceRequestPerSecMeanRate;
}
public Double getFailProduceRequestPerSecFiveMinuteRate() {
return failProduceRequestPerSecFiveMinuteRate;
}
public void setFailProduceRequestPerSecFiveMinuteRate(Double failProduceRequestPerSecFiveMinuteRate) {
this.failProduceRequestPerSecFiveMinuteRate = failProduceRequestPerSecFiveMinuteRate;
}
public Double getFailProduceRequestPerSecFifteenMinuteRate() {
return failProduceRequestPerSecFifteenMinuteRate;
}
public void setFailProduceRequestPerSecFifteenMinuteRate(Double failProduceRequestPerSecFifteenMinuteRate) {
this.failProduceRequestPerSecFifteenMinuteRate = failProduceRequestPerSecFifteenMinuteRate;
}
public Double getFailFetchRequestPerSec() {
return failFetchRequestPerSec;
}
public void setFailFetchRequestPerSec(Double failFetchRequestPerSec) {
this.failFetchRequestPerSec = failFetchRequestPerSec;
}
public Double getFailFetchRequestPerSecMeanRate() {
return failFetchRequestPerSecMeanRate;
}
public void setFailFetchRequestPerSecMeanRate(Double failFetchRequestPerSecMeanRate) {
this.failFetchRequestPerSecMeanRate = failFetchRequestPerSecMeanRate;
}
public Double getFailFetchRequestPerSecFiveMinuteRate() {
return failFetchRequestPerSecFiveMinuteRate;
}
public void setFailFetchRequestPerSecFiveMinuteRate(Double failFetchRequestPerSecFiveMinuteRate) {
this.failFetchRequestPerSecFiveMinuteRate = failFetchRequestPerSecFiveMinuteRate;
}
public Double getFailFetchRequestPerSecFifteenMinuteRate() {
return failFetchRequestPerSecFifteenMinuteRate;
}
public void setFailFetchRequestPerSecFifteenMinuteRate(Double failFetchRequestPerSecFifteenMinuteRate) {
this.failFetchRequestPerSecFifteenMinuteRate = failFetchRequestPerSecFifteenMinuteRate;
}
public Double getTotalProduceRequestsPerSec() {
return totalProduceRequestsPerSec;
}
public void setTotalProduceRequestsPerSec(Double totalProduceRequestsPerSec) {
this.totalProduceRequestsPerSec = totalProduceRequestsPerSec;
}
public Double getTotalProduceRequestsPerSecMeanRate() {
return totalProduceRequestsPerSecMeanRate;
}
public void setTotalProduceRequestsPerSecMeanRate(Double totalProduceRequestsPerSecMeanRate) {
this.totalProduceRequestsPerSecMeanRate = totalProduceRequestsPerSecMeanRate;
}
public Double getTotalProduceRequestsPerSecFiveMinuteRate() {
return totalProduceRequestsPerSecFiveMinuteRate;
}
public void setTotalProduceRequestsPerSecFiveMinuteRate(Double totalProduceRequestsPerSecFiveMinuteRate) {
this.totalProduceRequestsPerSecFiveMinuteRate = totalProduceRequestsPerSecFiveMinuteRate;
}
public Double getTotalProduceRequestsPerSecFifteenMinuteRate() {
return totalProduceRequestsPerSecFifteenMinuteRate;
}
public void setTotalProduceRequestsPerSecFifteenMinuteRate(Double totalProduceRequestsPerSecFifteenMinuteRate) {
this.totalProduceRequestsPerSecFifteenMinuteRate = totalProduceRequestsPerSecFifteenMinuteRate;
}
public Double getTotalFetchRequestsPerSec() {
return totalFetchRequestsPerSec;
}
public void setTotalFetchRequestsPerSec(Double totalFetchRequestsPerSec) {
this.totalFetchRequestsPerSec = totalFetchRequestsPerSec;
}
public Double getTotalFetchRequestsPerSecMeanRate() {
return totalFetchRequestsPerSecMeanRate;
}
public void setTotalFetchRequestsPerSecMeanRate(Double totalFetchRequestsPerSecMeanRate) {
this.totalFetchRequestsPerSecMeanRate = totalFetchRequestsPerSecMeanRate;
}
public Double getTotalFetchRequestsPerSecFiveMinuteRate() {
return totalFetchRequestsPerSecFiveMinuteRate;
}
public void setTotalFetchRequestsPerSecFiveMinuteRate(Double totalFetchRequestsPerSecFiveMinuteRate) {
this.totalFetchRequestsPerSecFiveMinuteRate = totalFetchRequestsPerSecFiveMinuteRate;
}
public Double getTotalFetchRequestsPerSecFifteenMinuteRate() {
return totalFetchRequestsPerSecFifteenMinuteRate;
}
public void setTotalFetchRequestsPerSecFifteenMinuteRate(Double totalFetchRequestsPerSecFifteenMinuteRate) {
this.totalFetchRequestsPerSecFifteenMinuteRate = totalFetchRequestsPerSecFifteenMinuteRate;
}
}

View File

@@ -1,331 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.metrics;
import com.xiaojukeji.kafka.manager.common.constant.Constant;
import com.xiaojukeji.kafka.manager.common.constant.MetricsType;
import com.xiaojukeji.kafka.manager.common.entity.annotations.FieldSelector;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
* 需要定时拉取的broker数据
* @author tukun
* @date 2015/11/6.
*/
public class BrokerMetrics extends BaseMetrics {
/**
* 集群ID
*/
private Long clusterId;
/**
* Topic名称
*/
private Integer brokerId;
/**
* 每秒Produce请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS
})
private Double produceRequestPerSec = 0.0;
private Double produceRequestPerSecMeanRate = 0.0;
private Double produceRequestPerSecFiveMinuteRate = 0.0;
private Double produceRequestPerSecFifteenMinuteRate = 0.0;
/**
* 每秒Fetch请求数的近一分钟的均值、平均字节数、近五分钟均值、近十五分钟均值
*/
@FieldSelector(types = {
MetricsType.BROKER_FLOW_DETAIL,
MetricsType.BROKER_TO_DB_METRICS,
MetricsType.BROKER_REAL_TIME_METRICS
})
private Double fetchConsumerRequestPerSec = 0.0;
private Double fetchConsumerRequestPerSecMeanRate = 0.0;
private Double fetchConsumerRequestPerSecFiveMinuteRate = 0.0;
private Double fetchConsumerRequestPerSecFifteenMinuteRate = 0.0;
/**
* Broker分区数量
*/
@FieldSelector(types = {MetricsType.BROKER_OVER_ALL_METRICS, 5})
private int partitionCount;
/**
* Broker已同步分区数量
*/
@FieldSelector(types = {MetricsType.BROKER_OVER_ALL_METRICS})
private int underReplicatedPartitions;
/**
* Broker Leader的数量
*/
@FieldSelector(types = {MetricsType.BROKER_OVER_ALL_METRICS, 5})
private int leaderCount;
/**
* Broker请求处理器空闲百分比
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double requestHandlerAvgIdlePercent = 0.0;
/**
* 网络处理器空闲百分比
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double networkProcessorAvgIdlePercent = 0.0;
/**
* 请求列表大小
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Integer requestQueueSize = 0;
/**
* 响应列表大小
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Integer responseQueueSize = 0;
/**
* 刷日志时间
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double logFlushRateAndTimeMs = 0.0;
/**
* produce请求总时间-平均值
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double totalTimeProduceMean = 0.0;
/**
* produce请求总时间-99th
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double totalTimeProduce99Th = 0.0;
/**
* fetch consumer请求总时间-平均值
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double totalTimeFetchConsumerMean = 0.0;
/**
* fetch consumer请求总时间-99th
*/
@FieldSelector(types = {MetricsType.BROKER_TO_DB_METRICS})
private Double totalTimeFetchConsumer99Th = 0.0;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public Integer getBrokerId() {
return brokerId;
}
public void setBrokerId(Integer brokerId) {
this.brokerId = brokerId;
}
public Double getProduceRequestPerSec() {
return produceRequestPerSec;
}
public void setProduceRequestPerSec(Double produceRequestPerSec) {
this.produceRequestPerSec = produceRequestPerSec;
}
public Double getProduceRequestPerSecMeanRate() {
return produceRequestPerSecMeanRate;
}
public void setProduceRequestPerSecMeanRate(Double produceRequestPerSecMeanRate) {
this.produceRequestPerSecMeanRate = produceRequestPerSecMeanRate;
}
public Double getProduceRequestPerSecFiveMinuteRate() {
return produceRequestPerSecFiveMinuteRate;
}
public void setProduceRequestPerSecFiveMinuteRate(Double produceRequestPerSecFiveMinuteRate) {
this.produceRequestPerSecFiveMinuteRate = produceRequestPerSecFiveMinuteRate;
}
public Double getProduceRequestPerSecFifteenMinuteRate() {
return produceRequestPerSecFifteenMinuteRate;
}
public void setProduceRequestPerSecFifteenMinuteRate(Double produceRequestPerSecFifteenMinuteRate) {
this.produceRequestPerSecFifteenMinuteRate = produceRequestPerSecFifteenMinuteRate;
}
public Double getFetchConsumerRequestPerSec() {
return fetchConsumerRequestPerSec;
}
public void setFetchConsumerRequestPerSec(Double fetchConsumerRequestPerSec) {
this.fetchConsumerRequestPerSec = fetchConsumerRequestPerSec;
}
public Double getFetchConsumerRequestPerSecMeanRate() {
return fetchConsumerRequestPerSecMeanRate;
}
public void setFetchConsumerRequestPerSecMeanRate(Double fetchConsumerRequestPerSecMeanRate) {
this.fetchConsumerRequestPerSecMeanRate = fetchConsumerRequestPerSecMeanRate;
}
public Double getFetchConsumerRequestPerSecFiveMinuteRate() {
return fetchConsumerRequestPerSecFiveMinuteRate;
}
public void setFetchConsumerRequestPerSecFiveMinuteRate(Double fetchConsumerRequestPerSecFiveMinuteRate) {
this.fetchConsumerRequestPerSecFiveMinuteRate = fetchConsumerRequestPerSecFiveMinuteRate;
}
public Double getFetchConsumerRequestPerSecFifteenMinuteRate() {
return fetchConsumerRequestPerSecFifteenMinuteRate;
}
public void setFetchConsumerRequestPerSecFifteenMinuteRate(Double fetchConsumerRequestPerSecFifteenMinuteRate) {
this.fetchConsumerRequestPerSecFifteenMinuteRate = fetchConsumerRequestPerSecFifteenMinuteRate;
}
public int getPartitionCount() {
return partitionCount;
}
public void setPartitionCount(int partitionCount) {
this.partitionCount = partitionCount;
}
public int getUnderReplicatedPartitions() {
return underReplicatedPartitions;
}
public void setUnderReplicatedPartitions(int underReplicatedPartitions) {
this.underReplicatedPartitions = underReplicatedPartitions;
}
public int getLeaderCount() {
return leaderCount;
}
public void setLeaderCount(int leaderCount) {
this.leaderCount = leaderCount;
}
public Double getRequestHandlerAvgIdlePercent() {
return requestHandlerAvgIdlePercent;
}
public void setRequestHandlerAvgIdlePercent(Double requestHandlerAvgIdlePercent) {
this.requestHandlerAvgIdlePercent = requestHandlerAvgIdlePercent;
}
public Double getNetworkProcessorAvgIdlePercent() {
return networkProcessorAvgIdlePercent;
}
public void setNetworkProcessorAvgIdlePercent(Double networkProcessorAvgIdlePercent) {
this.networkProcessorAvgIdlePercent = networkProcessorAvgIdlePercent;
}
public Integer getRequestQueueSize() {
return requestQueueSize;
}
public void setRequestQueueSize(Integer requestQueueSize) {
this.requestQueueSize = requestQueueSize;
}
public Integer getResponseQueueSize() {
return responseQueueSize;
}
public void setResponseQueueSize(Integer responseQueueSize) {
this.responseQueueSize = responseQueueSize;
}
public Double getLogFlushRateAndTimeMs() {
return logFlushRateAndTimeMs;
}
public void setLogFlushRateAndTimeMs(Double logFlushRateAndTimeMs) {
this.logFlushRateAndTimeMs = logFlushRateAndTimeMs;
}
public Double getTotalTimeProduceMean() {
return totalTimeProduceMean;
}
public void setTotalTimeProduceMean(Double totalTimeProduceMean) {
this.totalTimeProduceMean = totalTimeProduceMean;
}
public Double getTotalTimeProduce99Th() {
return totalTimeProduce99Th;
}
public void setTotalTimeProduce99Th(Double totalTimeProduce99Th) {
this.totalTimeProduce99Th = totalTimeProduce99Th;
}
public Double getTotalTimeFetchConsumerMean() {
return totalTimeFetchConsumerMean;
}
public void setTotalTimeFetchConsumerMean(Double totalTimeFetchConsumerMean) {
this.totalTimeFetchConsumerMean = totalTimeFetchConsumerMean;
}
public Double getTotalTimeFetchConsumer99Th() {
return totalTimeFetchConsumer99Th;
}
public void setTotalTimeFetchConsumer99Th(Double totalTimeFetchConsumer99Th) {
this.totalTimeFetchConsumer99Th = totalTimeFetchConsumer99Th;
}
private static void initialization(Field[] fields){
for(Field field : fields){
FieldSelector annotation = field.getAnnotation(FieldSelector.class);
if(annotation ==null){
continue;
}
String fieldName;
if("".equals(annotation.name())) {
fieldName = field.getName().substring(0,1).toUpperCase() + field.getName().substring(1);
} else{
fieldName = annotation.name();
}
for(int type: annotation.types()){
List<String> list = Constant.BROKER_METRICS_TYPE_MBEAN_NAME_MAP.getOrDefault(type, new ArrayList<>());
list.add(fieldName);
Constant.BROKER_METRICS_TYPE_MBEAN_NAME_MAP.put(type, list);
}
}
}
public static List<String> getFieldNameList(int metricsType){
synchronized (BrokerMetrics.class) {
if (Constant.BROKER_METRICS_TYPE_MBEAN_NAME_MAP.isEmpty()) {
initialization(BrokerMetrics.class.getDeclaredFields());
initialization(BaseMetrics.class.getDeclaredFields());
}
}
return Constant.BROKER_METRICS_TYPE_MBEAN_NAME_MAP.getOrDefault(metricsType, new ArrayList<>());
}
}

View File

@@ -1,68 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.metrics;
import com.xiaojukeji.kafka.manager.common.constant.Constant;
import com.xiaojukeji.kafka.manager.common.entity.annotations.FieldSelector;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
public class TopicMetrics extends BaseMetrics {
/**
* 集群ID
*/
private Long clusterId;
/**
* Topic名称
*/
private String topicName;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
private static void initialization(Field[] fields){
for(Field field : fields){
FieldSelector annotation = field.getAnnotation(FieldSelector.class);
if(annotation ==null){
continue;
}
String fieldName;
if("".equals(annotation.name())){
String name = field.getName();
fieldName = name.substring(0,1).toUpperCase()+name.substring(1);
}else{
fieldName = annotation.name();
}
for(int type: annotation.types()){
List<String> list = Constant.TOPIC_METRICS_TYPE_MBEAN_NAME_MAP.getOrDefault(type, new ArrayList<>());
list.add(fieldName);
Constant.TOPIC_METRICS_TYPE_MBEAN_NAME_MAP.put(type, list);
}
}
}
public static List<String> getFieldNameList(int type){
synchronized (TopicMetrics.class) {
if (Constant.TOPIC_METRICS_TYPE_MBEAN_NAME_MAP.isEmpty()) {
initialization(TopicMetrics.class.getDeclaredFields());
initialization(BaseMetrics.class.getDeclaredFields());
}
}
return Constant.TOPIC_METRICS_TYPE_MBEAN_NAME_MAP.get(type);
}
}

View File

@@ -1,68 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class AlarmRuleDO extends BaseDO {
private String alarmName;
private String strategyExpressions;
private String strategyFilters;
private String strategyActions;
private String principals;
public String getAlarmName() {
return alarmName;
}
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
public String getStrategyExpressions() {
return strategyExpressions;
}
public void setStrategyExpressions(String strategyExpressions) {
this.strategyExpressions = strategyExpressions;
}
public String getStrategyFilters() {
return strategyFilters;
}
public void setStrategyFilters(String strategyFilters) {
this.strategyFilters = strategyFilters;
}
public String getStrategyActions() {
return strategyActions;
}
public void setStrategyActions(String strategyActions) {
this.strategyActions = strategyActions;
}
public String getPrincipals() {
return principals;
}
public void setPrincipals(String principals) {
this.principals = principals;
}
@Override
public String toString() {
return "AlarmRuleDO{" +
"alarmName='" + alarmName + '\'' +
", strategyExpressions='" + strategyExpressions + '\'' +
", strategyFilters='" + strategyFilters + '\'' +
", strategyActions='" + strategyActions + '\'' +
", principals='" + principals + '\'' +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,59 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
import java.util.Date;
/**
* @author arthur
* @date 2017/7/25.
*/
public class BaseDO {
protected Long id;
protected Integer status;
protected Date gmtCreate;
protected Date gmtModify;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtModify() {
return gmtModify;
}
public void setGmtModify(Date gmtModify) {
this.gmtModify = gmtModify;
}
@Override
public String toString() {
return "BaseDO{" +
"id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,37 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
import java.util.Date;
/**
* @author zengqiao
* @date 19/11/25
*/
public abstract class BaseEntryDO {
protected Long id;
protected Date gmtCreate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
@Override
public String toString() {
return "BaseEntryDO{" +
"id=" + id +
", gmtCreate=" + gmtCreate +
'}';
}
}

View File

@@ -1,110 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
import com.xiaojukeji.kafka.manager.common.entity.metrics.BrokerMetrics;
public class ClusterMetricsDO extends BaseEntryDO {
private Long clusterId;
private Integer topicNum = 0;
private Integer partitionNum = 0;
private Integer brokerNum = 0;
private Double bytesInPerSec = 0.0;
private Double bytesOutPerSec = 0.0;
private Double bytesRejectedPerSec = 0.0;
private Double messagesInPerSec = 0.0;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public Integer getTopicNum() {
return topicNum;
}
public void setTopicNum(Integer topicNum) {
this.topicNum = topicNum;
}
public Integer getPartitionNum() {
return partitionNum;
}
public void setPartitionNum(Integer partitionNum) {
this.partitionNum = partitionNum;
}
public Integer getBrokerNum() {
return brokerNum;
}
public void setBrokerNum(Integer brokerNum) {
this.brokerNum = brokerNum;
}
public Double getBytesInPerSec() {
return bytesInPerSec;
}
public void setBytesInPerSec(Double bytesInPerSec) {
this.bytesInPerSec = bytesInPerSec;
}
public Double getBytesOutPerSec() {
return bytesOutPerSec;
}
public void setBytesOutPerSec(Double bytesOutPerSec) {
this.bytesOutPerSec = bytesOutPerSec;
}
public Double getBytesRejectedPerSec() {
return bytesRejectedPerSec;
}
public void setBytesRejectedPerSec(Double bytesRejectedPerSec) {
this.bytesRejectedPerSec = bytesRejectedPerSec;
}
public Double getMessagesInPerSec() {
return messagesInPerSec;
}
public void setMessagesInPerSec(Double messagesInPerSec) {
this.messagesInPerSec = messagesInPerSec;
}
public void addBrokerMetrics(BrokerMetrics brokerMetrics) {
this.clusterId = brokerMetrics.getClusterId();
this.brokerNum += 1;
this.bytesInPerSec += brokerMetrics.getBytesInPerSec();
this.bytesOutPerSec += brokerMetrics.getBytesOutPerSec();
this.bytesRejectedPerSec += brokerMetrics.getBytesRejectedPerSec();
this.messagesInPerSec += brokerMetrics.getMessagesInPerSec();
}
@Override
public String toString() {
return "ClusterMetricsDO{" +
"clusterId=" + clusterId +
", topicNum=" + topicNum +
", partitionNum=" + partitionNum +
", brokerNum=" + brokerNum +
", bytesInPerSec=" + bytesInPerSec +
", bytesOutPerSec=" + bytesOutPerSec +
", bytesRejectedPerSec=" + bytesRejectedPerSec +
", messagesInPerSec=" + messagesInPerSec +
", id=" + id +
", gmtCreate=" + gmtCreate +
'}';
}
}

View File

@@ -1,96 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
/**
* migrate topic task do
* @author zengqiao
* @date 19/4/16
*/
public class MigrationTaskDO extends BaseDO {
private Long clusterId;
private String topicName;
private String reassignmentJson;
private Long throttle;
private String operator;
private String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public String getReassignmentJson() {
return reassignmentJson;
}
public void setReassignmentJson(String reassignmentJson) {
this.reassignmentJson = reassignmentJson;
}
public Long getThrottle() {
return throttle;
}
public void setThrottle(Long throttle) {
this.throttle = throttle;
}
@Override
public String toString() {
return "MigrationTaskDO{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", reassignmentJson='" + reassignmentJson + '\'' +
", throttle=" + throttle +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
public static MigrationTaskDO createInstance(Long clusterId,
String topicName,
String reassignmentJson,
Long throttle,
String description) {
MigrationTaskDO migrationTaskDO = new MigrationTaskDO();
migrationTaskDO.setClusterId(clusterId);
migrationTaskDO.setTopicName(topicName);
migrationTaskDO.setReassignmentJson(reassignmentJson);
migrationTaskDO.setThrottle(throttle);
migrationTaskDO.setDescription(description);
return migrationTaskDO;
}
}

View File

@@ -1,64 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class OperationHistoryDO extends BaseEntryDO {
private Long clusterId;
private String topicName;
private String operator;
private String operation;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
@Override
public String toString() {
return "OperationHistoryDO{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", operator='" + operator + '\'' +
", operation='" + operation + '\'' +
", id=" + id +
", gmtCreate=" + gmtCreate +
'}';
}
public static OperationHistoryDO newInstance(Long clusterId, String topicName, String operator, String operation) {
OperationHistoryDO operationHistoryDO = new OperationHistoryDO();
operationHistoryDO.setClusterId(clusterId);
operationHistoryDO.setTopicName(topicName);
operationHistoryDO.setOperator(operator);
operationHistoryDO.setOperation(operation);
return operationHistoryDO;
}
}

View File

@@ -1,112 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class OrderPartitionDO extends BaseDO{
private Long clusterId;
private String clusterName;
private String topicName;
private String applicant;
private Long peakBytesIn;
private String description;
private Integer orderStatus;
private String approver;
private String opinion;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public String getApplicant() {
return applicant;
}
public void setApplicant(String applicant) {
this.applicant = applicant;
}
public Long getPeakBytesIn() {
return peakBytesIn;
}
public void setPeakBytesIn(Long peakBytesIn) {
this.peakBytesIn = peakBytesIn;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public String getApprover() {
return approver;
}
public void setApprover(String approver) {
this.approver = approver;
}
public String getOpinion() {
return opinion;
}
public void setOpinion(String opinion) {
this.opinion = opinion;
}
@Override
public String toString() {
return "OrderPartitionDO{" +
"clusterId=" + clusterId +
", clusterName='" + clusterName + '\'' +
", topicName='" + topicName + '\'' +
", applicant='" + applicant + '\'' +
", peakBytesIn=" + peakBytesIn +
", description='" + description + '\'' +
", orderStatus=" + orderStatus +
", approver='" + approver + '\'' +
", opinion='" + opinion + '\'' +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,178 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class OrderTopicDO extends BaseDO {
private Long clusterId;
private String clusterName;
private String topicName;
private Long retentionTime;
private Integer partitionNum;
private Integer replicaNum;
private String regions;
private String brokers;
private Long peakBytesIn;
private String applicant;
private String principals;
private String description;
private Integer orderStatus;
private String approver;
private String opinion;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public Long getRetentionTime() {
return retentionTime;
}
public void setRetentionTime(Long retentionTime) {
this.retentionTime = retentionTime;
}
public Integer getPartitionNum() {
return partitionNum;
}
public void setPartitionNum(Integer partitionNum) {
this.partitionNum = partitionNum;
}
public Integer getReplicaNum() {
return replicaNum;
}
public void setReplicaNum(Integer replicaNum) {
this.replicaNum = replicaNum;
}
public String getRegions() {
return regions;
}
public void setRegions(String regions) {
this.regions = regions;
}
public String getBrokers() {
return brokers;
}
public void setBrokers(String brokers) {
this.brokers = brokers;
}
public Long getPeakBytesIn() {
return peakBytesIn;
}
public void setPeakBytesIn(Long peakBytesIn) {
this.peakBytesIn = peakBytesIn;
}
public String getApplicant() {
return applicant;
}
public void setApplicant(String applicant) {
this.applicant = applicant;
}
public String getPrincipals() {
return principals;
}
public void setPrincipals(String principals) {
this.principals = principals;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public String getApprover() {
return approver;
}
public void setApprover(String approver) {
this.approver = approver;
}
public String getOpinion() {
return opinion;
}
public void setOpinion(String opinion) {
this.opinion = opinion;
}
@Override
public String toString() {
return "OrderTopicDO{" +
"clusterId=" + clusterId +
", clusterName='" + clusterName + '\'' +
", topicName='" + topicName + '\'' +
", retentionTime=" + retentionTime +
", partitionNum=" + partitionNum +
", replicaNum=" + replicaNum +
", regions='" + regions + '\'' +
", brokers='" + brokers + '\'' +
", peakBytesIn=" + peakBytesIn +
", applicant='" + applicant + '\'' +
", principals='" + principals + '\'' +
", description='" + description + '\'' +
", orderStatus=" + orderStatus +
", approver='" + approver + '\'' +
", opinion='" + opinion + '\'' +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,63 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class RegionDO extends BaseDO{
private String regionName;
private Long clusterId;
private String brokerList;
private Integer level;
private String description;
private String operator;
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getBrokerList() {
return brokerList;
}
public void setBrokerList(String brokerList) {
this.brokerList = brokerList;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
}

View File

@@ -1,68 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class TopicDO extends BaseDO{
private Long clusterId;
private String topicName;
private String applicant;
private String principals;
private String description;
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public String getApplicant() {
return applicant;
}
public void setApplicant(String applicant) {
this.applicant = applicant;
}
public String getPrincipals() {
return principals;
}
public void setPrincipals(String principals) {
this.principals = principals;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return "TopicDO{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", applicant='" + applicant + '\'' +
", principals='" + principals + '\'' +
", description='" + description + '\'' +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,46 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po;
public class TopicFavoriteDO extends BaseDO{
private String username;
private Long clusterId;
private String topicName;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getClusterId() {
return clusterId;
}
public void setClusterId(Long clusterId) {
this.clusterId = clusterId;
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
@Override
public String toString() {
return "TopicFavoriteDO{" +
"username='" + username + '\'' +
", clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", id=" + id +
", status=" + status +
", gmtCreate=" + gmtCreate +
", gmtModify=" + gmtModify +
'}';
}
}

View File

@@ -1,17 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po.query;
/**
* @author zengqiao
* @date 19/12/2
*/
public class AlarmRuleQueryOption extends BaseQueryOption {
private String alarmName;
public String getAlarmName() {
return alarmName;
}
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
}

View File

@@ -1,24 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po.query;
/**
* @author zengqiao
* @date 19/12/2
*/
public class BaseQueryOption {
protected Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public String toString() {
return "BaseQueryOption{" +
"id=" + id +
'}';
}
}

View File

@@ -1,17 +0,0 @@
package com.xiaojukeji.kafka.manager.common.entity.po.query;
/**
* @author zengqiao
* @date 19/12/4
*/
public class ClusterQueryOption extends BaseQueryOption {
private String clusterName;
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
}

View File

@@ -1,15 +0,0 @@
package com.xiaojukeji.kafka.manager.common.utils;
import java.util.Calendar;
import java.util.Date;
/**
* 日期工具
* @author huangyiminghappy@163.com
* @date 2019-03-20
*/
public class DateUtils {
public static Date long2Date(Long time){
return new Date(time);
}
}

View File

@@ -1,72 +0,0 @@
package com.xiaojukeji.kafka.manager.common.utils.jmx;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.io.IOException;
import java.net.MalformedURLException;
/**
* JMXConnector包装类
* @author tukun
* @date 2015/11/9.
*/
public class JmxConnectorWrap {
private final static Logger logger = LoggerFactory.getLogger(JmxConnectorWrap.class);
private JMXConnector jmxConnector;
/**
* JMX连接的主机名
*/
private String host;
/**
* JMX连接端口
*/
private int port;
public JmxConnectorWrap(String host, int port) {
this.host = host;
this.port = port;
}
public JMXConnector getJmxConnector() {
// 如果JMX连接断开则进行重新连接
if (jmxConnector == null && port != -1) {
createJMXConnector();
}
return jmxConnector;
}
private synchronized void createJMXConnector() {
if (jmxConnector != null) {
return;
}
String jmxUrl = String.format("service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi", host, port);
try {
JMXServiceURL url = new JMXServiceURL(jmxUrl);
jmxConnector = JMXConnectorFactory.connect(url, null);
} catch (MalformedURLException e) {
logger.error("JMX url exception, host:{} port:{} jmxUrl:{}", host, port, jmxUrl, e);
} catch (IOException e) {
logger.error("JMX connect exception, host:{} port:{}.", host, port, e);
}
logger.info("JMX connect success, host:{} port:{}.", host, port);
}
public void close() {
if (jmxConnector == null) {
return;
}
try {
jmxConnector.close();
} catch (IOException e) {
logger.warn("close JmxConnector exception, host:{} port:{}.", host, port, e);
}
}
}

View File

@@ -1,93 +0,0 @@
package com.xiaojukeji.kafka.manager.common.utils.jmx;
import java.util.HashMap;
import java.util.Map;
/**
* kafka集群的mbean的object name集合
* @author tukun, zengqiao
* @date 2015/11/5.
*/
public class MbeanNameUtil {
//broker监控参数
private static final String MESSAGE_IN_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec";
private static final String BYTES_IN_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec";
private static final String BYTES_OUT_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec";
private static final String BYTES_REJECTED_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=BytesRejectedPerSec";
private static final String FAILED_FETCH_REQUEST_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=FailedFetchRequestsPerSec";
private static final String FAILED_PRODUCE_REQUEST_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=FailedProduceRequestsPerSec";
private static final String PRODUCE_REQUEST_PER_SEC = "kafka.network:type=RequestMetrics,name=RequestsPerSec,request=Produce";
private static final String CONSUMER_REQUEST_PER_SEC = "kafka.network:type=RequestMetrics,name=RequestsPerSec,request=FetchConsumer";
private static final String TOTAL_PRODUCE_REQUEST_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=TotalProduceRequestsPerSec";
private static final String TOTAL_FETCH_REQUEST_PER_SEC = "kafka.server:type=BrokerTopicMetrics,name=TotalFetchRequestsPerSec";
private static final String REQUEST_HANDLER_AVG_IDLE_PERCENT = "kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent";
private static final String NETWORK_PROCESSOR_AVG_IDLE_PERCENT = "kafka.network:type=SocketServer,name=NetworkProcessorAvgIdlePercent";
private static final String REQUEST_QUEUE_SIZE = "kafka.network:type=RequestChannel,name=RequestQueueSize";
private static final String RESPONSE_QUEUE_SIZE = "kafka.network:type=RequestChannel,name=ResponseQueueSize";
private static final String LOG_FLUSH_RATE_AND_TIME_MS = "kafka.log:type=LogFlushStats,name=LogFlushRateAndTimeMs";
private static final String TOTAL_TIME_PRODUCE = "kafka.network:type=RequestMetrics,name=TotalTimeMs,request=Produce";
private static final String TOTAL_TIME_FETCH_CONSUMER = "kafka.network:type=RequestMetrics,name=TotalTimeMs,request=FetchConsumer";
private static final String PART_COUNT = "kafka.server:type=ReplicaManager,name=PartitionCount";
private static final String PARTITION_OFFSET_PULL = "kafka.log:type=Log,name=LogEndOffset,topic=${topic},partition=${partition}";
private static final String UNDER_REPLICATED_PARTITIONS = "kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions";
private static final String LEADER_COUNT = "kafka.server:type=ReplicaManager,name=LeaderCount";
// private static final String PRODUCE_REQUEST_TIME = "kafka.network:type=TopicRequestMetrics,name=TotalTimeMs,request=Produce";
// private static final String FETCH_REQUEST_TIME = "kafka.network:type=TopicRequestMetrics,name=TotalTimeMs,request=FetchConsumer";
//存储监控的参数name到获取的object_name的映射关系图
private static Map<String, Mbean> mbeanNameMap = new HashMap<String, Mbean>();
static {
//监控参数配置object_name和监控的属性名
mbeanNameMap.put("MessagesInPerSec", new Mbean(MESSAGE_IN_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("BytesInPerSec", new Mbean(BYTES_IN_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("BytesOutPerSec", new Mbean(BYTES_OUT_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("BytesRejectedPerSec", new Mbean(BYTES_REJECTED_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("FailFetchRequestPerSec", new Mbean(FAILED_FETCH_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("FailProduceRequestPerSec", new Mbean(FAILED_PRODUCE_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("ProduceRequestPerSec", new Mbean(PRODUCE_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("FetchConsumerRequestPerSec", new Mbean(CONSUMER_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("TotalProduceRequestsPerSec", new Mbean(TOTAL_PRODUCE_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("TotalFetchRequestsPerSec", new Mbean(TOTAL_FETCH_REQUEST_PER_SEC,"OneMinuteRate", Double.class));
mbeanNameMap.put("PartitionOffset", new Mbean(PARTITION_OFFSET_PULL,"Value", int.class));
mbeanNameMap.put("PartitionCount", new Mbean(PART_COUNT,"Value", int.class));
mbeanNameMap.put("UnderReplicatedPartitions", new Mbean(UNDER_REPLICATED_PARTITIONS,"Value", int.class));
mbeanNameMap.put("LeaderCount", new Mbean(LEADER_COUNT,"Value", int.class));
mbeanNameMap.put("RequestHandlerAvgIdlePercent", new Mbean(REQUEST_HANDLER_AVG_IDLE_PERCENT,"OneMinuteRate", Double.class));
mbeanNameMap.put("NetworkProcessorAvgIdlePercent", new Mbean(NETWORK_PROCESSOR_AVG_IDLE_PERCENT,"Value", Double.class));
mbeanNameMap.put("RequestQueueSize", new Mbean(REQUEST_QUEUE_SIZE,"Value", int.class));
mbeanNameMap.put("ResponseQueueSize", new Mbean(RESPONSE_QUEUE_SIZE, "Value", int.class));
mbeanNameMap.put("LogFlushRateAndTimeMs", new Mbean(LOG_FLUSH_RATE_AND_TIME_MS,"OneMinuteRate", Double.class));
mbeanNameMap.put("TotalTimeProduceMean", new Mbean(TOTAL_TIME_PRODUCE,"Mean", Double.class));
mbeanNameMap.put("TotalTimeProduce99Th", new Mbean(TOTAL_TIME_PRODUCE,"99thPercentile", Double.class));
mbeanNameMap.put("TotalTimeFetchConsumerMean", new Mbean(TOTAL_TIME_FETCH_CONSUMER,"Mean", Double.class));
mbeanNameMap.put("TotalTimeFetchConsumer99Th", new Mbean(TOTAL_TIME_FETCH_CONSUMER,"99thPercentile", Double.class));
// mbeanNameMap.put("ProduceRequestTime", new Mbean(PRODUCE_REQUEST_TIME,"Value"));
// mbeanNameMap.put("FetchRequestTime", new Mbean(FETCH_REQUEST_TIME,"Value"));
}
/**
* 根据属性名kafka版本topic获取相应的Mbean
*/
public static Mbean getMbean(String name, String topic) {
Mbean mbean = mbeanNameMap.get(name);
if (mbean == null) {
return null;
}
if (topic != null && !topic.isEmpty()) {
return new Mbean(mbean.getObjectName() + ",topic=" + topic, mbean.getProperty(), mbean.getPropertyClass());
}
return mbean;
}
}

View File

@@ -1,17 +0,0 @@
package com.xiaojukeji.kafka.manager.common.utils.zk;
/**
* Created by limeng on 2017/12/22
*/
public interface StateChangeListener {
enum State {
CONNECTION_RECONNECT, //
CONNECTION_DISCONNECT, NODE_DATA_CHANGED, CHILD_UPDATED, CHILD_ADDED, CHILD_DELETED,
//
;
}
void onChange(State state, String path);
}

View File

@@ -1,165 +0,0 @@
package com.xiaojukeji.kafka.manager.common.utils.zk;
import java.util.HashMap;
import java.util.Map;
/**
* 存储结构:
*
* <pre>
* /consumers
* consumer-group
* ids
* consumerId
* offsets
* topic-0
* 0(partition编号节点内容表示)
* 1
* 2
* topic-1
* owners
* /brokers
* topics
* topic-0 (节点内容是 ("0",[0,1,2]))
* partitions
* 0
* state节点内容是leader的brokerId同步副本信息等
* 1
* 2
* topic-x
* ids
* 1(临时节点broker编号节点信息为broker相关信息如JMX端口host和port等)
* 2
* n
* </pre>
*
* @author tukun @ 2015-11-5
* @version 1.0.0
*/
public class ZkPathUtil {
public static final String ZOOKEEPER_SEPARATOR = "/";
public static final String BROKER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "brokers";
public static final String CONTROLLER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "controller";
public static final String BROKER_IDS_ROOT = BROKER_ROOT_NODE
+ ZOOKEEPER_SEPARATOR + "ids";
public static final String BROKER_TOPICS_ROOT = BROKER_ROOT_NODE
+ ZOOKEEPER_SEPARATOR + "topics";
public static final String CONSUMER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "consumers";
public static final String CONFIG_ROOT_NODE = ZOOKEEPER_SEPARATOR + "config";
public static final String CONFIG_TOPICS_ROOT_NODE = CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + "topics";
//存储监控的参数name到获取的object_name的映射关系图
private static Map<String, String> zkPathMap = new HashMap<String, String>();
static {
zkPathMap.put("ConusmerPartitionOffset", CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR
+ "${consumerGroup}" + ZOOKEEPER_SEPARATOR
+ "offsets" + ZOOKEEPER_SEPARATOR + "${topic}"
+ ZOOKEEPER_SEPARATOR + "${partition}");
}
//for broker目录
public static String getBrokerIdNodePath(long brokerId) {
return String.format(BROKER_IDS_ROOT + ZOOKEEPER_SEPARATOR + "%d", brokerId);
}
public static String getBrokerTopicRoot(String topic) {
return BROKER_TOPICS_ROOT + ZOOKEEPER_SEPARATOR + topic;
}
public static String getBrokerTopicPartitionRoot(String topic) {
return BROKER_TOPICS_ROOT + ZOOKEEPER_SEPARATOR + topic + ZOOKEEPER_SEPARATOR
+ "partitions";
}
public static String getBrokerTopicPartitionStatePath(String topic, int partitionId) {
return String.format(getBrokerTopicPartitionRoot(topic) + ZOOKEEPER_SEPARATOR + "%d"
+ ZOOKEEPER_SEPARATOR + "state", partitionId);
}
//for consumer
public static String getConsumerTopicPartitionOffsetNodePath(String consumerGroup,
String topic, int partitionId) {
return String.format(CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR + "%s" + ZOOKEEPER_SEPARATOR
+ "offset" + "%s" + "%d", consumerGroup, topic, partitionId);
}
public static String getConsumerGroupRoot(String consumerGroup) {
return CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR + consumerGroup;
}
public static String getConsumerGroupIdsRoot(String consumerGroup) {
return CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR + consumerGroup + ZOOKEEPER_SEPARATOR
+ "ids";
}
public static String getConsumerGroupOffsetRoot(String consumerGroup) {
return CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR + consumerGroup + ZOOKEEPER_SEPARATOR
+ "offsets";
}
public static String getConsumerGroupOwnersRoot(String consumerGroup) {
return CONSUMER_ROOT_NODE + ZOOKEEPER_SEPARATOR + consumerGroup + ZOOKEEPER_SEPARATOR
+ "owners";
}
public static String getConsumerGroupConsumerIdsNodePath(String consumerGroup, String consumerId) {
return getConsumerGroupIdsRoot(consumerGroup) + ZOOKEEPER_SEPARATOR + consumerId;
}
public static String getConsumerGroupOffsetTopicNode(String consumerGroup, String topic) {
return getConsumerGroupOffsetRoot(consumerGroup) + ZOOKEEPER_SEPARATOR + topic;
}
public static String getConsumerGroupOffsetTopicPartitionNode(String consumerGroup,
String topic, int partitionId) {
return getConsumerGroupOffsetTopicNode(consumerGroup, topic) + ZOOKEEPER_SEPARATOR
+ partitionId;
}
public static String getConsumerGroupOwnersTopicNode(String consumerGroup, String topic) {
return getConsumerGroupOwnersRoot(consumerGroup) + ZOOKEEPER_SEPARATOR + topic;
}
public static String getConsumerGroupOwnersTopicPartitionNode(String consumerGroup,
String topic, int partitionId) {
return getConsumerGroupOwnersTopicNode(consumerGroup, topic) + ZOOKEEPER_SEPARATOR
+ partitionId;
}
public static String getConfigTopicNode(String topicName) {
return CONFIG_TOPICS_ROOT_NODE + ZOOKEEPER_SEPARATOR + topicName;
}
public static String parseLastPartFromZkPath(String zkPath) {
return zkPath.substring(zkPath.lastIndexOf("/") + 1);
}
public static Map<String, String> getZkPathMap() {
return zkPathMap;
}
public static void setZkPathMap(Map<String, String> zkPathMap) {
ZkPathUtil.zkPathMap = zkPathMap;
}
public static String getControllerRootNode() {
return CONTROLLER_ROOT_NODE;
}
public static String getEntityConfigPath(String entityType, String entity) {
return getEntityConfigRootPath(entityType) + "/" + entity;
}
public static String getEntityConfigRootPath(String entityType) {
return CONFIG_ROOT_NODE + "/" + entityType;
}
}

9326
console/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +0,0 @@
import * as React from 'react';
import { PaginationConfig, Table } from 'component/antd';
import { observer } from 'mobx-react';
import urlQuery from 'store/url-query';
import { IConsumeInfo } from 'store/topic';
import { consume } from 'store/consume';
import { SearchAndFilter } from 'container/cluster-topic';
import { modal } from 'store';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminConsume extends SearchAndFilter {
public state = {
searchKey: '',
};
public columns = [{
title: '消费组名称',
dataIndex: 'consumerGroup',
key: 'consumerGroup',
width: '70%',
sorter: (a: IConsumeInfo, b: IConsumeInfo) => a.consumerGroup.charCodeAt(0) - b.consumerGroup.charCodeAt(0),
}, {
title: 'location',
dataIndex: 'location',
key: 'location',
width: '20%',
render: (t: string) => t.toLowerCase(),
}, {
title: '操作',
key: 'operation',
width: '10%',
render: (t: string, r: IConsumeInfo) => {
return (
<a onClick={modal.showConsumerTopic.bind(null, Object.assign({ clusterId: urlQuery.clusterId }, r))}></a>);
},
},
];
public componentDidMount() {
consume.getConsumeInfo(urlQuery.clusterId);
}
public render() {
const data = consume.data.filter((d) => d.consumerGroup.includes(this.state.searchKey));
return (
<>
<ul className="table-operation-bar">
{this.renderSearch('请输入消费组名称')}
</ul>
<div style={{ marginTop: '48px' }}>
<Table
columns={this.columns}
dataSource={data}
pagination={pagination}
rowKey="consumerGroup"
/>
</div>
</>
);
}
}

View File

@@ -1,8 +0,0 @@
.content-container .table-operation-bar.in-panel {
position: static;
text-align: right;
.new-topic {
margin-right: 0;
margin-left: 30px;
}
}

View File

@@ -1,69 +0,0 @@
import * as React from 'react';
import { PaginationConfig, Table } from 'component/antd';
import { observer } from 'mobx-react';
import urlQuery from 'store/url-query';
import { IConsumeInfo } from 'store/topic';
import { consume } from 'store/consume';
import { SearchAndFilter } from 'container/cluster-topic';
import { modal } from 'store';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminConsume extends SearchAndFilter {
public state = {
searchKey: '',
};
public columns = [{
title: '消费组名称',
dataIndex: 'consumerGroup',
key: 'consumerGroup',
width: '70%',
sorter: (a: IConsumeInfo, b: IConsumeInfo) => a.consumerGroup.charCodeAt(0) - b.consumerGroup.charCodeAt(0),
}, {
title: 'location',
dataIndex: 'location',
key: 'location',
width: '20%',
render: (t: string) => t.toLowerCase(),
}, {
title: '操作',
key: 'operation',
width: '10%',
render: (t: string, r: IConsumeInfo) => {
return (
<a onClick={modal.showConsumerTopic.bind(null, Object.assign({ clusterId: urlQuery.clusterId }, r))}></a>);
},
},
];
public componentDidMount() {
consume.getConsumeInfo(urlQuery.clusterId);
}
public render() {
const data = consume.data.filter((d) => d.consumerGroup.includes(this.state.searchKey));
return (
<div className="k-row">
<ul className="table-operation-bar">
{this.renderSearch('请输入消费组名称')}
</ul>
<div style={{ marginTop: '48px' }}>
<Table
columns={this.columns}
dataSource={data}
pagination={pagination}
rowKey="consumerGroup"
/>
</div>
</div>
);
}
}

View File

@@ -1,87 +0,0 @@
import * as React from 'react';
import { Table, Tabs, PaginationConfig } from 'component/antd';
import { observer } from 'mobx-react';
import urlQuery from 'store/url-query';
import { controller } from 'store/controller';
import { SearchAndFilter } from 'container/cluster-topic';
import moment from 'moment';
const TabPane = Tabs.TabPane;
const columns = [
{
title: 'BrokerId',
dataIndex: 'brokerId',
key: 'brokerId',
sorter: (a: any, b: any) => a.brokerNum - b.brokerNum,
},
{
title: 'host',
key: 'host',
dataIndex: 'host',
render: (r: string, t: any) => {
return (
<a href={`/admin/broker_detail?clusterId=${urlQuery.clusterId}&brokerId=${t.brokerId}`} target="_blank">{r}
</a>
); },
},
{
title: '版本',
dataIndex: 'controllerVersion',
key: 'controllerVersion',
},
{
title: '变更时间',
dataIndex: 'controllerTimestamp',
key: 'controllerTimestamp',
sorter: (a: any, b: any) => a.controllerTimestamp - b.updacontrollerTimestampteTime,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
},
];
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminController extends SearchAndFilter {
public state = {
searchKey: '',
};
public componentDidMount() {
controller.getController(urlQuery.clusterId);
}
public renderController() {
if (!controller.data) return null;
const data = controller.data.filter((d) => d.host.includes(this.state.searchKey));
return (
<Table
columns={columns}
dataSource={data}
pagination={pagination}
rowKey="controllerTimestamp"
/>
);
}
public render() {
return (
<>
<ul className="table-operation-bar">
{this.renderSearch('请输入关键词')}
</ul>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="Controller变更历史" key="1">
{this.renderController()}
</TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,60 +0,0 @@
import * as React from 'react';
import urlQuery from 'store/url-query';
import { NetWorkFlow } from 'container/topic-detail/com';
import { Tabs } from 'component/antd';
import { broker } from 'store/broker';
import { BrokerStatus } from 'container/broker-info/base-info';
import { BrokerList } from 'container/broker-info/base-info';
import { AdminConsume } from 'container/admin-consume';
import { AdminRegion } from 'container/admin-region';
import { AdminController } from 'container/admin-controller';
import AdminTopic from 'container/admin-topic/index';
import { handleTabKey } from 'lib/utils';
export class ClusterDetail extends React.Component {
public updateStatus = () => {
broker.getBrokerNetwork(urlQuery.clusterId);
}
public componentDidMount() {
this.updateStatus();
}
public render() {
return (
<>
<Tabs type="card" activeKey={location.hash.substr(1) || '0'} onChange={handleTabKey}>
<Tabs.TabPane tab="集群流量" key="0">
<div className="k-row right-flow">
<p className="k-title"></p>
<NetWorkFlow clusterId={urlQuery.clusterId} />
</div>
<div className="k-row right-flow" style={{ marginTop: '50px' }}>
<p className="k-title"></p>
<span className="k-abs" onClick={this.updateStatus}>
<i className="k-icon-shuaxin didi-theme" />
</span>
<BrokerStatus />
</div>
</Tabs.TabPane>
<Tabs.TabPane tab="Topic管理" key="1">
<AdminTopic />
</Tabs.TabPane>
<Tabs.TabPane tab="Broker状态概览" key="2">
<BrokerList />
</Tabs.TabPane>
<Tabs.TabPane tab="ConsumerGroup列表" key="3">
<AdminConsume />
</Tabs.TabPane>
<Tabs.TabPane tab="Region管理" key="4">
<AdminRegion />
</Tabs.TabPane>
<Tabs.TabPane tab="Controller变更历史" key="5">
<AdminController />
</Tabs.TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,9 +0,0 @@
.right-flow {
.k-abs {
right: 24px;
cursor: pointer;
& > i {
margin-right: 5px;
}
}
}

View File

@@ -1,132 +0,0 @@
import * as React from 'react';
import './index.less';
import { Table, Tabs, ColumnProps, PaginationConfig } from 'component/antd';
import { modal } from 'store';
import { cluster } from 'store/cluster';
import { observer } from 'mobx-react';
import { IClusterData } from 'types/base-type';
const TabPane = Tabs.TabPane;
const detailUrl ='/admin/cluster_detail?clusterId=';
const collectionColumns: Array<ColumnProps<IClusterData>> = [
{
title: '集群ID',
dataIndex: 'clusterId',
key: 'clusterId',
sorter: (a: IClusterData, b: IClusterData) => a.clusterId - b.clusterId,
},
{
title: '集群名称',
key: 'clusterName',
sorter: (a: IClusterData, b: IClusterData) => a.clusterName.charCodeAt(0) - b.clusterName.charCodeAt(0),
render: (text, record) => {
return <a href={`${detailUrl}${record.clusterId}`}>{record.clusterName}</a>;
},
},
{
title: 'Topic 数',
key: 'topicNum',
sorter: (a: IClusterData, b: IClusterData) => a.topicNum - b.topicNum,
render: (text, record) => {
return <a href={`${detailUrl}${record.clusterId}#1`}>{record.topicNum}</a>;
},
},
{
title: 'Broker 数量',
dataIndex: 'brokerNum',
key: 'brokerNum',
sorter: (a: IClusterData, b: IClusterData) => a.brokerNum - b.brokerNum,
render: (text, record) => {
return (
<a
href={
`${detailUrl}${record.clusterId}&clusterName=${btoa(encodeURIComponent(record.clusterName))}#2`}
>
{record.brokerNum}
</a>);
},
},
{
title: 'ConsumerGroup 数',
key: 'consumerGroupNum',
sorter: (a: IClusterData, b: IClusterData) => a.consumerGroupNum - b.consumerGroupNum,
render: (text, record) => {
return <a href={`${detailUrl}${record.clusterId}#3`}>{record.consumerGroupNum}</a>;
},
},
{
title: 'Region 数',
key: 'regionNum',
sorter: (a: IClusterData, b: IClusterData) => a.regionNum - b.regionNum,
render: (text, record) => {
return <a href={`${detailUrl}${record.clusterId}&#4`}>{record.regionNum}</a>;
},
},
{
title: 'ControllerID',
key: 'controllerId',
sorter: (a: IClusterData, b: IClusterData) => a.controllerId - b.controllerId,
render: (text, record) => {
return <a href={`${detailUrl}${record.clusterId}#5`}>{record.controllerId}</a>;
},
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (text, record) => {
return (
<span className="table-operation">
<a onClick={modal.showModifyCluster.bind(null, record)}></a>
</span>
);
},
},
];
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminHome extends React.Component {
public renderList() {
return (
<Table
columns={collectionColumns}
dataSource={cluster.data.slice(1)}
pagination={pagination}
rowKey="clusterId"
/>
);
}
public componentDidMount() {
cluster.getClusters();
cluster.getKafkaVersions();
}
public render() {
return (
<>
<ul className="table-operation-bar">
<li className="new-topic" onClick={modal.showNewCluster}>
<i className="k-icon-xinjian didi-theme"/>
</li>
</ul>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="集群列表" key="1">
{this.renderList()}
</TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,138 +0,0 @@
import * as React from 'react';
import { Table, Tabs, Modal, notification } from 'component/antd';
import { PaginationConfig } from 'antd/es/table/interface';
import { modal } from 'store';
import { observer } from 'mobx-react';
import { operation, ITask, taskMap } from 'store/operation';
import { cluster } from 'store/cluster';
import moment from 'moment';
import { modifyTask } from 'lib/api';
import { SearchAndFilter } from 'container/cluster-topic';
import { tableFilter } from 'lib/utils';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminOperation extends SearchAndFilter {
public state = {
searchKey: '',
filterClusterVisible: false,
filterStatusVisible: false,
};
public renderColumns = (data: ITask[]) => {
const cluster = Object.assign({
title: '集群名称',
dataIndex: 'clusterName',
key: 'clusterId',
filters: tableFilter<ITask>(data, 'clusterName'),
onFilter: (value: string, record: ITask) => record.clusterName.indexOf(value) === 0,
}, this.renderColumnsFilter('filterClusterVisible'));
const status = Object.assign({
title: '状态',
dataIndex: 'status',
key: 'status',
filters: taskMap.map((ele, index) => ({ text: ele, value: index + '' })),
onFilter: (value: string, record: ITask) => record.status === +value,
render: (t: number) => <span className={t === 2 || t === 1 ? 'success' : t === 3 ? 'fail' : ''}>{taskMap[t]}</span>,
}, this.renderColumnsFilter('filterStatusVisible'));
return [
{
title: '任务id',
dataIndex: 'taskId',
key: 'taskId',
sorter: (a: ITask, b: ITask) => a.taskId - b.taskId,
},
cluster,
{
title: 'Topic名称',
dataIndex: 'topicName',
key: 'topicName',
sorter: (a: ITask, b: ITask) => a.topicName.charCodeAt(0) - b.topicName.charCodeAt(0),
},
{
title: '创建人',
dataIndex: 'operator',
key: 'operator',
sorter: (a: ITask, b: ITask) => a.operator.charCodeAt(0) - b.operator.charCodeAt(0),
},
{
title: '创建时间',
dataIndex: 'gmtCreate',
key: 'gmtCreate',
sorter: (a: ITask, b: ITask) => a.gmtCreate - b.gmtCreate,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
},
status,
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: 200,
render: (text: string, record: ITask) => {
const status: number = record.status;
return (
<span className="table-operation">
<a onClick={modal.showTask.bind(null, record, 'detail')}></a>
{+status === 0 || +status === 1 ? <a onClick={modal.showTask.bind(null, record)}></a> : null}
{!status ? <a onClick={this.handleAction.bind(null, record.taskId, 'start')}></a> : null}
{!status ? <a onClick={this.handleAction.bind(null, record.taskId, 'cancel')}></a> : null}
</span>
);
},
},
];
}
public handleAction(taskId: number, type: string) {
Modal.confirm({
title: `确认${type === 'start' ? '执行Topic迁移任务' : '撤销任务' + taskId}`,
okText: '确定',
cancelText: '取消',
onOk: () => {
modifyTask({ action: type, taskId }).then(() => {
notification.success({ message: `${type === 'start' ? '执行' : '撤销'}任务成功` });
operation.getTask();
});
},
});
}
public componentDidMount() {
operation.getTask();
cluster.getClusters();
}
public render() {
const { searchKey } = this.state;
const data: ITask[] = operation.tasks && searchKey ? operation.tasks.filter((d) => d.taskId === +searchKey) : operation.tasks;
return (
<>
<ul className="table-operation-bar">
<li className="new-topic" onClick={modal.showTask.bind(null, null)}>
<i className="k-icon-xinjian didi-theme" />
</li>
{this.renderSearch('请输入关键字')}
</ul>
<Tabs type="card">
<Tabs.TabPane tab="迁移任务" key="0">
<Table
rowKey="taskId"
columns={this.renderColumns(data)}
dataSource={data}
pagination={pagination}
/>
</Tabs.TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,16 +0,0 @@
.num-container {
position: relative;
.num {
position: absolute;
width: 15px;
height: 15px;
line-height: 15px;
border-radius: 15px;
background-color: #f5222d;
color: #fff;
display: inline-block;
right: -18px;
text-align: center;
top: -1px;
}
}

View File

@@ -1,171 +0,0 @@
import * as React from 'react';
import { Table, Tabs } from 'component/antd';
import { PaginationConfig } from 'antd/es/table/interface';
import { modal } from 'store';
import { observer } from 'mobx-react';
import { order, tableStatusFilter } from 'store/order';
import moment from 'moment';
import { handleTabKey, tableFilter } from 'lib/utils';
import { SearchAndFilter } from 'container/cluster-topic';
import { IBaseOrder } from 'types/base-type';
import './index.less';
const TabPane = Tabs.TabPane;
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminOrder extends SearchAndFilter {
public state = {
searchKey: '',
filterClusterVisible: false,
filterStatusVisible: false,
filterSVisible: false,
filterCVisible: false,
};
public componentDidMount() {
order.getAdminOrder();
}
public renderColumns = (data: IBaseOrder[], type: boolean) => {
const cluster = Object.assign({
title: '集群名称',
dataIndex: 'clusterName',
key: 'clusterName',
filters: tableFilter<IBaseOrder>(data, 'clusterName'),
onFilter: (value: string, record: IBaseOrder) => record.clusterName.indexOf(value) === 0,
}, this.renderColumnsFilter(type ? 'filterClusterVisible' : 'filterCVisible'));
const status = Object.assign({
title: '审批状态',
dataIndex: 'statusStr',
key: 'statusStr',
width: 100,
filters: tableStatusFilter,
onFilter: (value: string, record: IBaseOrder) => record.statusStr.indexOf(value) === 0,
render: (t: string) => <span className={t === '通过' ? 'success' : t === '拒绝' ? 'fail' : ''}>{t}</span>,
}, this.renderColumnsFilter(type ? 'filterStatusVisible' : 'filterSVisible'));
return [
{
title: '工单 ID',
dataIndex: 'orderId',
key: 'orderId',
sorter: (a: IBaseOrder, b: IBaseOrder) => a.orderId - b.orderId,
},
cluster,
{
title: 'Topic 名称',
dataIndex: 'topicName',
key: 'topicName',
sorter: (a: IBaseOrder, b: IBaseOrder) => a.topicName.charCodeAt(0) - b.topicName.charCodeAt(0),
},
{
title: '申请人',
dataIndex: 'applicant',
key: 'applicant',
sorter: (a: IBaseOrder, b: IBaseOrder) => a.applicant.charCodeAt(0) - b.applicant.charCodeAt(0),
},
{
title: '审批人',
dataIndex: 'approver',
key: 'approver',
},
{
title: '申请时间',
dataIndex: 'gmtCreate',
key: 'gmtCreate',
sorter: (a: IBaseOrder, b: IBaseOrder) => a.gmtCreate - b.gmtCreate,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
},
status,
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: 100,
render: (text: string, r: IBaseOrder) => {
if (!+location.hash.substr(1)) {
return (
<span className="table-operation">
<a onClick={modal.showOrderApprove.bind(null, r, 'showOrderDetail')}></a>
{r.orderStatus === 0 ? <a onClick={modal.showOrderApprove.bind(null, r, 'showOrderApprove')}></a> : null}
</span>
);
} else {
return (
<span className="table-operation">
<a onClick={modal.showPartition.bind(null, r, 'showPartitionDetail')}></a>
{r.orderStatus === 0 ? <a onClick={modal.showPartition.bind(null, r, 'showPartition')}></a> : null}
</span>
);
}
},
},
];
}
public renderTopic() {
const data = order.adminTopicOrder.filter((d) => d.topicName.includes(this.state.searchKey));
return (
<Table
columns={this.renderColumns(data, true)}
dataSource={data}
pagination={pagination}
/>
);
}
public renderPartition() {
const data = order.adminPartitionOrder.filter((d) => d.topicName.includes(this.state.searchKey));
return (
<Table
columns={this.renderColumns(data, false)}
dataSource={data}
pagination={pagination}
/>
);
}
public render() {
const defaultKey = location.hash.substr(1) || '0';
return (
<>
<ul className="table-operation-bar">
{this.renderSearch('请输入topic名称')}
</ul>
<Tabs activeKey={defaultKey} type="card" onChange={handleTabKey}>
<TabPane
key="0"
tab={
<div className="num-container">
{order.pendingTopic ? <span className="num">{order.pendingTopic}</span> : null}
Topic
</div>
}
>
{this.renderTopic()}
</TabPane>
<TabPane
tab={
<div className="num-container">
{order.pendingOrder ? <span className="num">{order.pendingOrder}</span> : null}
</div>
}
key="1"
>
{this.renderPartition()}
</TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,138 +0,0 @@
import * as React from 'react';
import { Table, Tabs, Modal, PaginationConfig, notification } from 'component/antd';
import { modal } from 'store';
import { observer } from 'mobx-react';
import { IRegionData, region, statusMap, levelMap } from 'store/region';
import urlQuery from 'store/url-query';
import { SearchAndFilter } from 'container/cluster-topic';
const TabPane = Tabs.TabPane;
const handleDeleteRegion = (record: IRegionData) => {
Modal.confirm({
title: `确认删除 ${record.regionName} `,
okText: '确定',
cancelText: '取消',
onOk: () => {
region.delRegion(record.regionId).then(() => {
notification.success({ message: '删除成功' });
region.getRegions(urlQuery.clusterId);
});
},
});
};
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class AdminRegion extends SearchAndFilter {
public state = {
searchKey: '',
filterStatus: false,
filterLevel: false,
};
public renderColumns = () => {
const status = Object.assign({
title: '状态',
dataIndex: 'status',
key: 'status',
filters: statusMap.map((ele, index) => ({ text: ele, value: index + '' })),
render: (t: number) => <span className={!(t + 1) ? 'fail' : t === 1 ? '' : 'success'}>{statusMap[t + 1]}</span>,
onFilter: (value: string, record: IRegionData) => record.status + 1 === +value,
}, this.renderColumnsFilter('filterStatus'));
const level = Object.assign({
title: '重要程度',
dataIndex: 'level',
key: 'level',
filters: levelMap.map((ele, index) => ({ text: ele, value: index + '' })),
render: (t: number) => {
return levelMap[t];
},
onFilter: (value: string, record: IRegionData) => record.level === +value,
}, this.renderColumnsFilter('filterLevel'));
return [
{
title: 'Region名称',
dataIndex: 'regionName',
key: 'regionName',
},
{
title: 'BrokerList',
key: 'brokerIdList',
render: (text: string, record: IRegionData) => {
return <span>{record.brokerIdList.join(', ')}</span>;
},
},
{
title: '操作者',
dataIndex: 'operator',
key: 'operator',
},
status,
level,
{
title: '备注',
dataIndex: 'description',
key: 'description',
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: 200,
render: (text: string, record: IRegionData) => {
return (
<span className="table-operation">
<a onClick={modal.showRegion.bind(null, record)}></a>
<a onClick={handleDeleteRegion.bind(null, record)}></a>
</span>
);
},
},
];
}
public componentDidMount() {
region.getRegions(urlQuery.clusterId);
}
public renderRegion() {
if (!region.data) return null;
const data = region.data.filter((d) => d.regionName.includes(this.state.searchKey));
return (
<Table
columns={this.renderColumns()}
dataSource={data}
pagination={pagination}
rowKey="regionId"
/>
);
}
public render() {
return (
<>
<ul className="table-operation-bar">
<li className="new-topic" onClick={modal.showRegion.bind(null, null)}>
<i className="k-icon-xinjian didi-theme" />Region
</li>
{this.renderSearch('请输入关键词')}
</ul>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="Region管理" key="1">
{this.renderRegion()}
</TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,148 +0,0 @@
import * as React from 'react';
import { Table, Tabs, Form, notification, Modal, Tooltip } from 'component/antd';
import { PaginationConfig } from 'antd/es/table/interface';
import { UserHome } from 'container/user-home';
import { topic } from 'store/topic';
import urlQuery from 'store/url-query';
import { modal } from 'store';
import { observer } from 'mobx-react';
import { deleteTopic } from 'lib/api';
import { cluster } from 'store/cluster';
import { ITopic } from 'types/base-type';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
class AdminTopic extends UserHome {
public cols = [
{
title: 'Topic名称',
dataIndex: 'topicName',
key: 'topicName',
width: 350,
onCell: () => ({
style: {
maxWidth: 250,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
sorter: (a: ITopic, b: ITopic) => a.topicName.charCodeAt(0) - b.topicName.charCodeAt(0),
render: (t: string, r: ITopic) => {
return <a href={`/user/topic_detail?clusterId=${r.clusterId}&topic=${r.topicName}`}>{t}</a>;
},
},
{
title: '分区数',
dataIndex: 'partitionNum',
key: 'partitionNum',
sorter: (a: ITopic, b: ITopic) => b.partitionNum - a.partitionNum,
},
{
title: '副本数',
dataIndex: 'replicaNum',
key: 'replicaNum',
sorter: (a: ITopic, b: ITopic) => b.replicaNum - a.replicaNum,
},
{
title: '流入 (KB/s)',
dataIndex: 'byteIn',
key: 'byteIn',
sorter: (a: ITopic, b: ITopic) => b.byteIn - a.byteIn,
render: (t: number) => (t / 1024).toFixed(2),
},
{
title: '流入(QPS)',
dataIndex: 'produceRequest',
key: 'produceRequest',
width: 150,
sorter: (a: ITopic, b: ITopic) => b.produceRequest - a.produceRequest,
render: (t: number) => t.toFixed(2),
},
{
title: '负责人',
dataIndex: 'principals',
key: 'principals',
width: 120,
onCell: () => ({
style: {
maxWidth: 100,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (t: string) => <Tooltip placement="top" title={t} >{t}</Tooltip>,
sorter: (a: ITopic, b: ITopic) =>
a.principals && b.principals ? a.principals.charCodeAt(0) - b.principals.charCodeAt(0) : (-1),
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: 200,
render: (text: string, r: ITopic) => {
return (
<span className="table-operation">
<a onClick={modal.showExpandAdmin.bind(null, r)}></a>
<a onClick={modal.showAdimTopic.bind(null, r)}></a>
<a onClick={this.handleDelete.bind(null, r)}></a>
</span>
);
},
},
];
public handleDelete = ({ clusterId, topicName }: ITopic) => {
const topicNameList = [topicName];
Modal.confirm({
title: `确认删除${topicName}`,
okText: '确定',
cancelText: '取消',
onOk: () => {
deleteTopic({ clusterId, topicNameList }).then(() => {
notification.success({ message: '删除成功' });
topic.getAdminTopics(urlQuery.clusterId);
});
},
});
}
public renderTable() {
return (
<>
<Tabs type="card">
<Tabs.TabPane tab="Topic管理" key="0">
<Table pagination={pagination} columns={this.cols} dataSource={this.getData(topic.data)} rowKey="topicName" />
</Tabs.TabPane>
</Tabs>
</>
);
}
public componentDidMount() {
cluster.getClusters();
topic.getAdminTopics(urlQuery.clusterId);
}
public renderClusterTopic() {
return (
<>
{this.renderSearch('请输入Topic名称或者负责人')}
</>
);
}
}
export default Form.create({ name: 'aminTopic' })(AdminTopic);

View File

@@ -1,12 +0,0 @@
.u-container {
width: 100%;
height: 48px;
background: rgba(0,0,0,0.02);
display: flex;
justify-content: space-between;
vertical-align: middle;
line-height: 48px;
padding: 0 12px;
margin-top: 20px;
position: relative;
}

View File

@@ -1,97 +0,0 @@
import * as React from 'react';
import { Table, notification, PaginationConfig, Modal } from 'component/antd';
import { observer } from 'mobx-react';
import { users } from 'store/users';
import { deleteUser } from 'lib/api';
import { modal } from 'store';
import { SearchAndFilter } from 'container/cluster-topic';
import './index.less';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
const handleForbidden = (record: any) => {
Modal.confirm({
title: `确认删除 ${record.username} `,
okText: '确定',
cancelText: '取消',
onOk: () => {
deleteUser(record.username).then(() => {
notification.success({ message: '删除成功' });
users.getUsers();
});
},
});
};
@observer
export class UserManage extends SearchAndFilter {
public state = {
searchKey: '',
filterVisible: false,
};
public renderColumns = () => {
const role = Object.assign({
title: '角色',
key: 'role',
dataIndex: 'role',
filters: users.filterRole,
onFilter: (value: string, record: any) => record.role.indexOf(value) === 0,
}, this.renderColumnsFilter('filterVisible'));
return [
{
title: '用户名',
dataIndex: 'username',
key: 'username',
},
role,
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (t: any, r: any) => {
return (
<span className="table-operation">
<a onClick={modal.showNewUser.bind(null, r)}></a>
<a onClick={handleForbidden.bind(null, r)}></a>
</span>
);
},
},
];
}
public componentDidMount() {
users.getUsers();
}
public render() {
const data = users.userData.filter((d) => d.username.includes(this.state.searchKey));
return (
<>
<div className="u-container">
<span></span>
<ul className="table-operation-bar">
<li className="new-topic" onClick={modal.showNewUser.bind(null, null)}>
<i className="k-icon-xinjian didi-theme" />
</li>
{this.renderSearch('用户名称')}
</ul>
</div>
<Table
columns={this.renderColumns()}
dataSource={data}
pagination={pagination}
rowKey="username"
/>
</>
);
}
}

View File

@@ -1,135 +0,0 @@
import * as React from 'react';
import { Table, Tabs, Select, Input, notification, Modal } from 'component/antd';
import { PaginationConfig } from 'antd/es/table/interface';
import { modal } from 'store';
import { observer } from 'mobx-react';
import { alarm, IAlarm } from 'store/alarm';
import { deleteAlarm } from 'lib/api';
import { SearchAndFilter } from 'container/cluster-topic';
import { getCookie } from 'lib/utils';
import moment = require('moment');
const TabPane = Tabs.TabPane;
const Search = Input.Search;
const handleDeleteAlarm = (record: IAlarm) => {
Modal.confirm({
title: `确认删除 ${record.alarmName} `,
okText: '确定',
cancelText: '取消',
onOk: () => {
deleteAlarm(record.id).then(() => {
notification.success({ message: '删除成功' });
alarm.getAlarm();
});
},
});
};
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class Alarm extends SearchAndFilter {
public state = {
searchKey: '',
filterVisible: false,
};
public componentDidMount() {
alarm.getAlarm();
alarm.getAlarmConstant();
}
public renderColumns = () => {
const status = Object.assign({
title: '状态',
dataIndex: 'status',
key: 'status',
filters: [{ text: '已启用', value: '1' }, { text: '暂停', value: '0' }],
onFilter: (value: string, record: IAlarm) => record.status === +value,
render: (t: string) => <span className={t ? 'success' : ''}>{t ? '已启用' : '暂停'}</span>,
}, this.renderColumnsFilter('filterVisible'));
return [
{
title: '配置名称',
dataIndex: 'alarmName',
key: 'alarmName',
sorter: (a: IAlarm, b: IAlarm) => a.alarmName.charCodeAt(0) - b.alarmName.charCodeAt(0),
},
{
title: '负责人',
dataIndex: 'principalList',
key: 'principalList',
render: (t: string[]) => t.join(','),
},
{
title: '创建时间',
dataIndex: 'gmtCreate',
key: 'gmtCreate',
sorter: (a: IAlarm, b: IAlarm) => a.gmtCreate - b.gmtCreate,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
},
status,
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: 200,
render: (text: string, record: IAlarm) => {
return (
<span className="table-operation">
<a onClick={this.handleModify.bind(null, record)}></a>
<a onClick={handleDeleteAlarm.bind(null, record)}></a>
</span>
);
},
},
];
}
public renderAlarm() {
const data = alarm.data.filter((d) => {
return d.alarmName.includes(this.state.searchKey) || d.principalList.includes(this.state.searchKey);
});
return (
<Table
columns={this.renderColumns()}
dataSource={data}
pagination={pagination}
/>
);
}
public handleModify = (record: IAlarm) => {
if (!getCookie('username') && !record.principalList.includes(getCookie('username'))) {
notification.success({ message: '抱歉,没有修改权限' });
return false;
}
modal.showAlarmModify(record);
}
public render() {
return (
<>
<ul className="table-operation-bar">
<li className="new-topic" onClick={modal.showAlarm.bind(null, null)}>
<i className="k-icon-xinjian didi-theme" />
</li>
{this.renderSearch('请输入关键字')}
</ul>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="告警列表" key="1">
{this.renderAlarm()}
</TabPane>
</Tabs>
</>
);
}
}

View File

@@ -1,82 +0,0 @@
import * as React from 'react';
import { TopicDetail } from 'container/topic-detail';
import './index.less';
import { broker, IBrokerNetworkInfo } from 'store/broker';
import { observer } from 'mobx-react';
import { StatusGraghCom } from 'component/flow-table';
import urlQuery from 'store/url-query';
import { NetWorkFlow } from 'container/topic-detail/com';
@observer
export class OneBrokerStatus extends StatusGraghCom<IBrokerNetworkInfo> {
public getData() {
return broker.oneNetwork;
}
}
export class BrokerBaseDetail extends TopicDetail {
public componentDidMount() {
broker.getOneBrokerNetwork(urlQuery.clusterId, urlQuery.brokerId);
broker.getBrokerTopicAnalyzer(urlQuery.clusterId, urlQuery.brokerId);
}
public render() {
return (
<>
<div className="k-row right-flow mb-24">
<p className="k-title"></p>
<Summary />
</div>
<div className="k-row right-flow mb-24">
<p className="k-title"></p>
<NetWorkFlow clusterId={urlQuery.clusterId} brokerId={urlQuery.brokerId} />
</div>
<div className="k-row right-flow">
<p className="k-title"></p>
<span className="k-abs"><i className="k-icon-shuaxin didi-theme" /></span>
<OneBrokerStatus />
</div>
</>
);
}
}
@observer
class Summary extends React.Component {
public componentDidMount() {
broker.getBrokerBaseInfo(urlQuery.clusterId, urlQuery.brokerId);
}
public render() {
return (
<div className="k-summary">
<div className="k-row-1">
<div>{broker.brokerBaseInfo.host}</div>
<div>{broker.brokerBaseInfo.startTime}</div>
</div>
<div className="k-row-3">
<div>
<span>Topic数</span>
<p>{broker.brokerBaseInfo.topicNum}</p>
</div>
<div>
<span></span>
<p>{broker.brokerBaseInfo.partitionCount}</p>
</div>
<div>
<span>Leader</span>
<p>{broker.brokerBaseInfo.leaderCount}</p>
</div>
<div>
<span>Port</span>
<p>{broker.brokerBaseInfo.port}</p>
</div>
<div>
<span>JMX Port</span>
<p>{broker.brokerBaseInfo.jmxPort}</p>
</div>
</div>
</div>
);
}
}

View File

@@ -1,90 +0,0 @@
import React from 'react';
import { observer } from 'mobx-react';
import { broker } from 'store/broker';
import urlQuery from 'store/url-query';
import echarts from 'echarts/lib/echarts';
import { getBrokerMetricOption } from 'lib/charts-config';
import { MetricChartList as list } from './constant';
import { Spin, DatePicker, notification, Button } from 'component/antd';
import './index.less';
// 引入柱状图
import 'echarts/lib/chart/line';
// 引入提示框和标题组件
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/title';
import 'echarts/lib/component/legend';
import moment from 'moment';
@observer
export class BrokerMetrics extends React.Component {
public chartId: HTMLDivElement[] = [];
public charts: echarts.ECharts[] = [];
public state = {
loading: true,
};
public renderCharts(startTime: moment.Moment, endTime: moment.Moment) {
broker.getBrokerKeyMetrics(urlQuery.clusterId, urlQuery.brokerId,
startTime.format('x'),
endTime.format('x')).then(data => {
getBrokerMetricOption(list, data).forEach((ele: object, index) => {
if (ele) {
this.charts[index] = echarts.init(this.chartId[index]);
this.charts[index].setOption(ele);
this.setState({ loading: false });
}
this.charts[index] = null;
});
});
}
public componentDidMount() {
this.renderCharts(broker.startTime, broker.endTime);
}
public handleSearch = () => {
const { startTime, endTime } = broker;
if (startTime >= endTime) {
notification.error({ message: '开始时间不能大于或等于结束时间' });
return false;
}
this.setState({ loading: true });
this.renderCharts(startTime, endTime);
}
public render() {
const charts = list.map((item, index) => {
if (!item.value) return <div className="emptyChart" key={index} ref={(id) => this.chartId.push(id)} />;
return (
<div key={index}>
<p>{item.label}</p>
<Spin spinning={this.state.loading}>
<div style={{ height: 300, padding: '0px 10px' }} ref={(id) => this.chartId.push(id)} />
</Spin>
</div>
);
});
return (
<>
<div className="status-graph">
<ul className="k-toolbar topic-line-tool">
<li>
<span className="label"></span>
<DatePicker showTime={true} value={broker.startTime} onChange={broker.changeStartTime} />
</li>
<li>
<span className="label" ></span>
<DatePicker showTime={true} value={broker.endTime} onChange={broker.changeEndTime} />
</li>
<li><Button type="primary" size="small" onClick={this.handleSearch}></Button></li>
</ul>
</div>
<div className="charts-container" >
{charts}
</div>
</>
);
}
}

View File

@@ -1,109 +0,0 @@
import React from 'react';
import { Table, PaginationConfig } from 'component/antd';
import { observer } from 'mobx-react';
import { broker, IPartitions } from 'store/broker';
import { columsDefault } from './constant';
import urlQuery from 'store/url-query';
import './index.less';
const columns = [{
title: 'Topic',
dataIndex: 'topicName',
key: 'topicName',
}, {
title: 'Leader',
dataIndex: 'leaderPartitionList',
onCell: () => ({
style: {
maxWidth: 250,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (value: number[]) => {
return value.map(i => <span key={i} className="p-params">{i}</span>);
},
}, {
title: '副本',
dataIndex: 'followerPartitionIdList',
onCell: () => ({
style: {
maxWidth: 250,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: (value: number[]) => {
return value.map(i => <span key={i} className="p-params">{i}</span>);
},
}, {
title: '未同步副本',
dataIndex: 'notUnderReplicatedPartitionIdList',
render: (value: number[]) => {
return value.map(i => <span key={i} className="p-params-unFinished">{i}</span>);
},
}, {
title: '状态',
dataIndex: 'underReplicated',
render: (value: boolean) => {
return value ? '已同步' : '未同步';
},
}, {
title: '操作',
render: (record: IPartitions) => {
return (<a onClick={broker.handleOpen.bind(broker, record.topicName)}></a>);
},
},
];
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class BrokerPartition extends React.Component {
public componentDidMount() {
broker.getPartitions(urlQuery.clusterId, urlQuery.brokerId);
}
public getDescription = (value: any, record: IPartitions) => {
return Object.keys(value).map((key: keyof IPartitions) => {
return (
<p key={key}><span>{value[key]}</span>{(record[key] as []).join(',')}
{(record[key] as []).length})</p>);
});
}
public getMoreDetail = (record: IPartitions) => {
return (
<div className="p-description">
<p><span>Topic: </span>{record.topicName}</p>
<p><span>isUnderReplicated:</span>{record.underReplicated ? '已同步' : '未同步'}</p>
{this.getDescription(columsDefault, record)}
</div>
);
}
public render() {
return (
<Table
columns={columns}
expandIconAsCell={false}
expandIconColumnIndex={-1}
expandedRowRender={this.getMoreDetail}
dataSource={broker.topicPartitionsInfo}
expandedRowKeys={broker.openKeys}
rowKey="topicName"
pagination={pagination}
/>
);
}
}

View File

@@ -1,64 +0,0 @@
export const MetricChartList = [
{
value: 'requestHandlerIdlPercent',
label: '请求处理器空闲百分比(%)',
},
{
value: 'networkProcessorIdlPercent',
label: '网络处理器空闲百分比(%)',
},
{
value: 'requestQueueSize',
label: '请求列表大小(个)',
},
{
value: 'responseQueueSize',
label: '响应列表大小(个)',
},
{
value: 'logFlushTime',
label: '刷日志时间(ms)',
},
{
value: '',
label: '',
},
{
value: 'totalTimeProduceMean',
label: 'produce请求时间-平均值(ms)',
},
{
value: 'totalTimeFetchConsumerMean',
label: 'fetch请求处理时间-平均值(ms)',
},
{
value: 'totalTimeProduce99Th',
label: 'produce请求时间-99分位(ms)',
},
{
value: 'totalTimeFetchConsumer99Th',
label: 'fetch请求处理时间-99分位(ms)',
},
{
value: 'failProduceRequest',
label: '每秒生产失败数(条/秒)',
},
{
value: 'failFetchRequest',
label: '每秒消费失败数(条/秒)',
},
];
export const columsDefault = {
leaderPartitionList: 'leaderPartitions:',
followerPartitionIdList: 'followerPartitions:',
notUnderReplicatedPartitionIdList: 'notUnderReplicatedPartitions:',
};
export const brokerMetrics = {
bytesIn: 'Bytes InMB/ 秒)',
bytesOut: 'Bytes OutMB/ 秒)',
messagesIn: 'Messages In条)',
totalFetchRequests: 'Total Fetch RequestsQPS)',
totalProduceRequests: 'Total Produce RequestsQPS)',
};

View File

@@ -1,37 +0,0 @@
import * as React from 'react';
import { Tabs } from 'component/antd';
import { BrokerBaseDetail } from './base-detail';
import { TopicAnalysis } from './topic-analysis';
import { BrokerTopicInfo } from './topic-info';
import { BrokerPartition } from './broker-partition';
import { BrokerMetrics } from './broker-index';
import { handleTabKey } from 'lib/utils';
const TabPane = Tabs.TabPane;
export class BrokerDetail extends React.Component {
public render() {
return (
<Tabs activeKey={location.hash.substr(1) || '1'} type="card" onChange={handleTabKey}>
<TabPane tab="状态信息" key="1">
<BrokerBaseDetail />
</TabPane>
<TabPane tab="Topic信息" key="2">
<BrokerTopicInfo />
</TabPane>
<TabPane tab="Partition信息" key="3">
<BrokerPartition />
</TabPane>
{/* <TabPane tab="状态图" key="4">
<NetWorkFlow clusterId={urlQuery.clusterId} />
</TabPane> */}
<TabPane tab="Topic分析" key="5">
<TopicAnalysis />
</TabPane>
<TabPane tab="Broker关键指标" key="6">
<BrokerMetrics />
</TabPane>
</Tabs>
);
}
}

View File

@@ -1,94 +0,0 @@
import * as React from 'react';
import { Table } from 'component/antd';
import urlQuery from 'store/url-query';
import { broker, IBrokerMetrics } from 'store/broker';
import { brokerMetrics } from './constant';
import { observer } from 'mobx-react';
const columns = [{
title: 'Topic名称',
dataIndex: 'topicName',
key: 'topicName',
},
{
title: 'Bytes In(MB/s)',
dataIndex: 'bytesInRate',
key: 'bytesInRate',
render: (t: number, record: any) => `${record && record.bytesIn} (${+Math.ceil((t * 100))}%)`,
},
{
title: 'Bytes Out(MB/s)',
dataIndex: 'bytesOutRate',
key: 'bytesOutRate',
render: (t: number, record: any) => `${record && record.bytesOut} (${+Math.ceil((t * 100))}%)`,
},
{
title: 'Message In(秒)',
dataIndex: 'messagesInRate',
key: 'messagesInRate',
render: (t: number, record: any) => `${record && record.messagesIn} (${+Math.ceil((t * 100))}%)`,
},
{
title: 'Total Fetch Requests(秒)',
dataIndex: 'totalFetchRequestsRate',
key: 'totalFetchRequestsRate',
render: (t: number, record: any) => `${record && record.totalFetchRequests} (${+Math.ceil((t * 100))}%)`,
},
{
title: 'Total Produce Requests(秒)',
dataIndex: 'totalProduceRequestsRate',
key: 'totalProduceRequestsRate',
render: (t: number, record: any) => `${record && record.totalProduceRequests} (${+Math.ceil((t * 100))}%)`,
}];
@observer
export class TopicAnalysis extends React.Component {
public componentDidMount() {
broker.getOneBrokerNetwork(urlQuery.clusterId, urlQuery.brokerId);
broker.getBrokerTopicAnalyzer(urlQuery.clusterId, urlQuery.brokerId);
}
public render() {
return (
<>
<div className="k-row right-flow mb-24">
<p className="k-title">Broker </p>
<BrokerStatus />
</div>
<div className="k-row right-flow">
<p className="k-title">Topic </p>
<span className="k-abs didi-theme" style={{ fontSize: '14px' }}>Broker总量的百分比</span>
<Table
rowKey="name"
columns={columns}
dataSource={broker.analyzerData.topicAnalysisVOList}
pagination={false}
/>;
</div>
</>
);
}
}
@observer
class BrokerStatus extends React.Component {
public render() {
return (
<div className="k-summary">
<div className="k-row-3">
<div>
<span>Broker ID</span>
<p>{urlQuery.brokerId}</p>
</div>
{broker.analyzerData ?
Object.keys(brokerMetrics).map((i: keyof IBrokerMetrics) => {
return (
<div key={i}>
<span className={brokerMetrics[i] && brokerMetrics[i].length > 25 ? 'long-text' : ''}>{brokerMetrics[i]}</span>
<p>{broker.analyzerData[i] && broker.analyzerData[i].toFixed(2)}</p>
</div>
);
}) : ''}
</div>
</div>
);
}
}

View File

@@ -1,102 +0,0 @@
import React from 'react';
import { Table, PaginationConfig } from 'component/antd';
import { observer } from 'mobx-react';
import { broker } from 'store/broker';
import urlQuery from 'store/url-query';
import moment from 'moment';
import { ITopic } from 'types/base-type';
import { SearchAndFilter } from 'container/cluster-topic';
const cloumns = [{
title: 'Topic名称',
key: 'topicName',
width: 350,
onCell: () => ({
style: {
maxWidth: 250,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
sorter: (a: ITopic, b: ITopic) => a.topicName.charCodeAt(0) - b.topicName.charCodeAt(0),
render: (t: string, r: ITopic) => {
return (
<a
href={`/admin/topic_detail?clusterId=${urlQuery.clusterId}&topic=${r.topicName}`}
target="_blank"
>
{r.topicName}
</a>
);
},
}, {
title: '分区数',
dataIndex: 'partitionNum',
key: 'partitionNum',
sorter: (a: ITopic, b: ITopic) => b.partitionNum - a.partitionNum,
}, {
title: '副本数',
dataIndex: 'replicaNum',
key: 'replicaNum',
sorter: (a: ITopic, b: ITopic) => b.replicaNum - a.replicaNum,
}, {
title: '流入(KB/s)',
dataIndex: 'byteIn',
key: 'byteIn',
sorter: (a: ITopic, b: ITopic) => b.byteIn - a.byteIn,
render: (t: number) => (t / 1024).toFixed(2),
}, {
title: '流入(QPS)',
dataIndex: 'produceRequest',
key: 'produceRequest',
sorter: (a: ITopic, b: ITopic) => b.produceRequest - a.produceRequest,
render: (t: number) => t.toFixed(2),
}, {
title: '负责人',
dataIndex: 'principals',
key: 'principals',
}, {
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
sorter: (a: ITopic, b: ITopic) => a.updateTime - b.updateTime,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
}, {
}];
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class BrokerTopicInfo extends SearchAndFilter {
public state = {
searchKey: '',
filterClusterVisible: false,
filterStatusVisible: false,
};
public componentDidMount() {
broker.getBrokerTopic(urlQuery.clusterId, urlQuery.brokerId);
}
public render() {
const { searchKey } = this.state;
const data: ITopic[] = broker.topics.filter((d) => d.topicName.includes(searchKey) ||
(d.principals && d.principals.includes(searchKey)));
return (
<>
<div style={{ height: 45 }}>
<ul className="table-operation-bar">
{this.renderSearch('请输入Topic名称或者负责人')}
</ul>
</div>
<Table columns={cloumns} dataSource={data} rowKey="topicName" pagination={pagination} />
</>
);
}
}

View File

@@ -1,245 +0,0 @@
import * as React from 'react';
import './index.less';
import { Table, Modal, notification, PaginationConfig, Button } from 'component/antd';
import { broker, IBroker, IBrokerNetworkInfo, IBrokerPartition } from 'store/broker';
import { observer } from 'mobx-react';
import { StatusGraghCom } from 'component/flow-table';
import urlQuery from 'store/url-query';
import moment from 'moment';
import { deleteBroker } from 'lib/api';
import { SearchAndFilter } from 'container/cluster-topic';
import './index.less';
import { modal } from 'store';
import { tableFilter } from 'lib/utils';
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 5,
showTotal: (total) => `${total}`,
};
@observer
export class BrokerStatus extends StatusGraghCom<IBrokerNetworkInfo> {
public getData() {
return broker.network;
}
}
@observer
export class BrokerList extends SearchAndFilter {
public state = {
searchKey: '',
searchId: '',
filterRegionVisible: false,
filterStatusVisible: false,
filterVisible: false,
filterRVisible: false,
};
public colPartition = (list: IBroker[]) => {
const region = Object.assign({
title: 'Region',
dataIndex: 'regionName',
key: 'regionName',
filters: tableFilter<IBroker>(list, 'regionName'),
onFilter: (value: string, record: IBroker) => record.regionName === value,
}, this.renderColumnsFilter('filterRVisible'));
const status = Object.assign({
title: '已同步',
dataIndex: 'status',
key: 'status',
filters: [{ text: '是', value: '是' }, { text: '否', value: '否' }],
onFilter: (value: string, record: IBrokerPartition) => record.status === value,
}, this.renderColumnsFilter('filterVisible'));
return [{
title: 'BrokerID',
dataIndex: 'brokerId',
key: 'brokerId',
sorter: (a: IBrokerPartition, b: IBrokerPartition) => a.brokerId - b.brokerId,
}, {
title: '峰值(MB/s)',
dataIndex: 'bytesInPerSec',
key: 'bytesInPerSec',
sorter: (a: IBrokerPartition, b: IBrokerPartition) => a.bytesInPerSec - b.bytesInPerSec,
render: (t: number) => (t / (1024 * 1024)).toFixed(2),
}, {
title: '分区数量',
dataIndex: 'partitionCount',
key: 'partitionCount',
sorter: (a: IBrokerPartition, b: IBrokerPartition) => a.partitionCount - b.partitionCount,
}, {
title: 'Leader数量',
dataIndex: 'leaderCount',
key: 'leaderCount',
sorter: (a: IBrokerPartition, b: IBrokerPartition) => a.leaderCount - b.leaderCount,
}, {
title: '未同步副本数量',
dataIndex: 'notUnderReplicatedPartitionCount',
key: 'notUnderReplicatedPartitionCount',
sorter: (a: IBrokerPartition, b: IBrokerPartition) => a.notUnderReplicatedPartitionCount - b.notUnderReplicatedPartitionCount,
},
status,
region,
];
}
public colList = (list: IBroker[]) => {
const region = Object.assign({
title: 'Region',
dataIndex: 'regionName',
key: 'regionName',
filters: tableFilter<IBroker>(list, 'regionName'),
onFilter: (value: string, record: IBroker) => record.regionName === value,
}, this.renderColumnsFilter('filterRegionVisible'));
const status = Object.assign({
title: '状态',
dataIndex: 'status',
key: 'status',
filters: [{ text: '未使用', value: '未使用' }, { text: '使用中', value: '使用中' }],
onFilter: (value: string, record: IBroker) => record.status === value,
render: (t: number) => t ? '未使用' : '使用中',
}, this.renderColumnsFilter('filterStatusVisible'));
return [{
title: 'BrokerID',
dataIndex: 'brokerId',
key: 'brokerId',
sorter: (a: IBroker, b: IBroker) => a.brokerId - b.brokerId,
render: (t: string, record: IBroker) => {
return (
<a
href={`/admin/broker_detail?clusterId=${urlQuery.clusterId}&brokerId=${record.brokerId}`}
target="_blank"
>
{t}
</a>
);
},
}, {
title: '主机',
dataIndex: 'host',
key: 'host',
sorter: (a: IBroker, b: IBroker) => a.host.charCodeAt(0) - b.host.charCodeAt(0),
}, {
title: 'Port',
dataIndex: 'port',
key: 'port',
sorter: (a: IBroker, b: IBroker) => a.port - b.port,
}, {
title: 'JMX Port',
dataIndex: 'jmxPort',
key: 'jmxPort',
sorter: (a: IBroker, b: IBroker) => a.jmxPort - b.jmxPort,
}, {
title: '启动时间',
dataIndex: 'startTime',
key: 'startTime',
sorter: (a: IBroker, b: IBroker) => a.startTime - b.startTime,
render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
}, {
title: '流入(KB/s)',
dataIndex: 'byteIn',
key: 'byteIn',
sorter: (a: IBroker, b: IBroker) => b.byteIn - a.byteIn,
render: (t: number) => (t / 1024).toFixed(2),
}, {
title: '流出(KB/s)',
dataIndex: 'byteOut',
key: 'byteOut',
sorter: (a: IBroker, b: IBroker) => b.byteOut - a.byteOut,
render: (t: number) => (t / 1024).toFixed(2),
},
region,
status,
{
title: '操作',
render: (text: string, record: IBroker) => {
return (
<>
<span className="table-operation">
<a
href={`/admin/broker_detail?clusterId=${urlQuery.clusterId}&brokerId=${record.brokerId}`}
target="_blank"
>
</a>
<a
onClick={!record.status ? () => { } : this.deleteBroker.bind(null, record)}
style={!record.status ? { cursor: 'not-allowed', color: '#999' } : {}}
>
</a>
</span>
</>
);
},
}];
}
public deleteBroker = ({ brokerId }: IBroker) => {
Modal.confirm({
title: `确认删除${brokerId}`,
okText: '确定',
cancelText: '取消',
onOk: () => {
deleteBroker(urlQuery.clusterId, brokerId).then(() => {
notification.success({ message: '删除成功' });
broker.getBrokerList(urlQuery.clusterId);
});
},
});
}
public componentDidMount() {
broker.getBrokerList(urlQuery.clusterId);
broker.getBrokerPartition(urlQuery.clusterId);
}
public render() {
const dataList = this.state.searchKey !== '' ?
broker.list.filter((d) => d.host.includes(this.state.searchKey) || d.brokerId === +this.state.searchKey)
: broker.list;
const dataPartitions = this.state.searchId !== '' ?
broker.partitions.filter((d) => d.brokerId === +this.state.searchId) : broker.partitions;
return (
<>
<div className="k-row">
<ul className="k-tab">
<li>Broker概览</li>
<li className="k-tab-button">
<Button type="primary" onClick={modal.showLeaderRebalance}>Leader Rebalance</Button>
</li>
{this.renderSearch('请输入主机或BrokerId')}
</ul>
<div style={this.state.searchKey ? { minHeight: 370 } : null}>
<Table
columns={this.colList(dataList)}
dataSource={dataList}
rowKey="brokerId"
pagination={pagination}
/>
</div>
</div>
<div className="k-row" style={{ height: 400 }}>
<ul className="k-tab">
<li>Broker分区概览</li>
<li className="k-tab-button">
<Button type="primary" onClick={modal.showLeaderRebalance}>Leader Rebalance</Button>
</li>
{this.renderSearch('请输入BrokerId', 'searchId')}
</ul>
<Table
columns={this.colPartition(dataPartitions)}
dataSource={dataPartitions}
rowKey="brokerId"
pagination={pagination}
/>
</div>
</>
);
}
}

View File

@@ -1,79 +0,0 @@
import * as React from 'react';
import { Select, Button, Tooltip } from 'component/antd';
import { observer } from 'mobx-react';
import urlQuery from 'store/url-query';
import './index.less';
import moment = require('moment');
import { modal } from 'store';
import { selecOptions } from './constant';
import { broker, IBrokerPartition, IOverviewKey } from 'store/broker';
@observer
export class BrokerOverview extends React.Component {
public renderSquare = (type: IOverviewKey) => {
return broker.realPartitions.map((item: IBrokerPartition) => {
const brokerDetail = (
<div>
<p><span>ID:</span>{item.brokerId}</p>
<p><span>{selecOptions[type]}</span>{item[type]}</p>
<p><span>: </span>{item.host}</p>
<p><span>:</span>{item.port}</p>
<p><span>jmx端口:</span>{item.jmxPort}</p>
<p><span>:</span>{moment(item.startTime).format('YYYY-MM-DD HH:mm:ss')}</p>
</div>
);
return (
<Tooltip key={item.brokerId} placement="right" title={brokerDetail}>
<a
className={type === 'notUnderReplicatedPartitionCount' && item[type] ? 'finished' : ''}
href={`/admin/broker_detail?clusterId=${urlQuery.clusterId}&brokerId=${item.brokerId}`}
target="_blank"
>{item[type]}
</a>
</Tooltip>
);
});
}
public render() {
return (
<>
<ul className="topic-line-tool">
<li>
<span className="label">Region</span>
<Select defaultValue="all" style={{ width: '260px' }} onChange={broker.filterSquare}>
<Select.Option value="all"></Select.Option>
{broker.regionOption.map((i: any) => <Select.Option
key={i.brokerId}
value={i.regionName}
>{i.regionName}
</Select.Option>)}
</Select>
</li>
<li>
<span className="label"></span>
<Select defaultValue={broker.viewType} style={{ width: '160px' }} onChange={broker.handleOverview}>
{Object.keys(selecOptions)
.map((i: IOverviewKey) => <Select.Option value={i} key={i}>{selecOptions[i]}</Select.Option>)}
</Select>
</li>
<li>
<Button type="primary" onClick={modal.showLeaderRebalance}>Leader Rebalance</Button>
</li>
{
broker.viewType === 'notUnderReplicatedPartitionCount' ?
<li className="introduce">
<span className="common common-green" />
<span className="label"></span>
<span className="common common-red" />
<span className="label"></span>
</li> : ''
}
</ul>
<div className="square-container">
{this.renderSquare(broker.viewType)}
</div>
</>
);
}
}

View File

@@ -1,5 +0,0 @@
export const selecOptions = {
partitionCount: '分区数量',
leaderCount: 'leader数量',
notUnderReplicatedPartitionCount: '副本状态',
};

View File

@@ -1,84 +0,0 @@
.square-container {
width: 100%;
background-color: #fff;
padding: 17px 20px;
a {
display: inline-block;
width: 35px;
height: 22px;
background: rgba(255, 241, 240, 1);
border-radius: 4px;
line-height: 22px;
margin-right: 20px;
text-align: center;
color: #f5222d;
&.finished {
background: rgba(47, 194, 91, 0.2);
color: #2fc25b;
}
}
}
.topic-line-tool {
height: 48px;
font-size: 14px;
font-family: PingFangSC-Regular;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
background: rgba(250, 250, 250);
li {
display: inline-block;
vertical-align: middle;
margin-left: 24px;
line-height: 48px;
span.label {
padding-right: 10px;
}
&.introduce {
float: right;
span.common {
display: inline-block;
width: 16px;
height: 16px;
border-radius: 8px;
vertical-align: middle;
margin-right: 10px;
&-green {
background: rgba(47, 194, 91, 1);
}
&-red {
background: rgba(245, 34, 45, 1);
}
}
}
}
}
.k-tab {
width: 100%;
height: 48px;
line-height: 48px;
background: rgba(0, 0, 0, 0.02);
padding: 0px 24px;
font-size: 14px;
font-family: PingFangSC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
display: flex;
justify-content: space-between;
position: relative;
margin: 0;
.k-tab-button {
position: absolute;
right: 213px;
}
}
.deleteButton {
&.ant-btn {
color: #f38031;
text-decoration: none;
border: none;
background-color: transparent;
}
}

View File

@@ -1,21 +0,0 @@
import * as React from 'react';
import { Tabs } from 'component/antd';
import { BrokerList } from './base-info';
import { BrokerOverview } from './broker-overview';
const TabPane = Tabs.TabPane;
export class BrokerInfo extends React.Component {
public render() {
return (
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="Broker状态概览" key="1">
<BrokerList />
</TabPane>
{/* <TabPane tab="Broker状态总览" key="2">
<BrokerOverview />
</TabPane> */}
</Tabs>
);
}
}

View File

@@ -1,98 +0,0 @@
import * as React from 'react';
import { Select, Input, Checkbox, Icon } from 'component/antd';
import { cluster } from 'store/cluster';
import { IFiler } from 'types/base-type';
const Option = Select.Option;
const Search = Input.Search;
interface IParams {
filters: IFiler[];
setSelectedKeys: (selectedKeys: string[]) => void;
confirm?: () => void;
}
interface IState {
[filter: string]: boolean | string;
}
export class SearchAndFilter extends React.Component<any, IState> {
public timer: number;
public renderCluster() {
return (
<li>
<Select value={cluster.active} onChange={cluster.changeCluster}>
{cluster.data.map((d) => <Option value={d.clusterId} key={d.clusterId}>{d.clusterName}</Option>)}
</Select>
</li>
);
}
public renderSearch(placeholder?: string, keyName: string = 'searchKey') {
return (
<li><Search placeholder={placeholder || '请输入Topic名称'} onChange={this.onSearchChange.bind(null, keyName)} /></li>
);
}
public onSearchChange = (keyName: string, e: React.ChangeEvent<HTMLInputElement>) => {
const searchKey = e.target.value.trim();
this.setState({
[keyName]: searchKey,
});
}
public handleChange(params: IParams, e: []) {
const { setSelectedKeys, confirm } = params;
setSelectedKeys(e);
confirm();
}
public handleVisble = (type: string) => {
if (this.timer) clearTimeout(this.timer);
setTimeout(() => {
this.setState({ [type]: true });
});
}
public handleUnVisble = (type: string) => {
this.timer = setTimeout(() => {
this.setState({ [type]: false });
}, 100);
}
public renderFilter = (type: string, params: IParams) => {
const { filters } = params;
return filters !== undefined ? (
<ul
onMouseOver={this.handleVisble.bind(null, type)}
onMouseLeave={this.handleUnVisble.bind(null, type)}
className="ant-dropdown-menu ant-dropdown-menu-vertical"
>
<Checkbox.Group onChange={this.handleChange.bind(null, params)}>
{filters.map(i => <li key={i.value} className="ant-dropdown-menu-item">
<Checkbox value={i.value} >{i.text}</Checkbox>
</li>)}
</Checkbox.Group>
</ul>
) : <div />;
}
public renderFilterIcon = (type: string) => {
return (
<span
onMouseOver={this.handleVisble.bind(null, type)}
onMouseLeave={this.handleUnVisble.bind(null, type)}
><Icon type="filter" theme="filled" />
</span>
);
}
public renderColumnsFilter = (type: string) => {
return {
filterIcon: this.renderFilterIcon.bind(null, type),
filterDropdownVisible: this.state[type],
filterDropdown: this.renderFilter.bind(null, type),
};
}
}

View File

@@ -1,34 +0,0 @@
.ant-table-title {
padding: 0px 0px 16px 0px;
}
.consumer-container {
.ant-table-title {
position: absolute;
top: -38px;
}
}
.group-title {
display: inline-block;
font-size: 14px;
font-weight: 700;
color: rgb(105, 105, 105);
> div {
display: inline-block;
border: 0.5px dashed rgba(0, 0, 0, 0.3);
padding: 5px 8px;
margin-right: 10px;
span {
color: #f38031;
font-weight: 700;
}
&.group-select {
width: 250px;
border: none;
.ant-select {
width: 100%;
}
}
}
}

View File

@@ -1,111 +0,0 @@
import * as React from 'react';
import { Table, Tabs, PaginationConfig, Select } from 'component/antd';
import Url from 'lib/url-parser';
import { topic, IGroupInfo } from 'store/topic';
import { observer } from 'mobx-react';
import { TopicDetail } from 'container/topic-detail';
import './index.less';
const TabPane = Tabs.TabPane;
const parColumns = [
{
title: 'Partition ID',
dataIndex: 'partitionId',
key: 'partitionId',
sorter: (a: IGroupInfo, b: IGroupInfo) => a.partitionId - b.partitionId,
},
{
title: 'Consume ID',
dataIndex: 'clientId',
key: 'clientId',
sorter: (a: IGroupInfo, b: IGroupInfo) => +a.clientId - +b.clientId,
},
{
title: 'Consumer Offset',
dataIndex: 'consumeOffset',
key: 'consumeOffset',
sorter: (a: IGroupInfo, b: IGroupInfo) => a.consumeOffset - b.consumeOffset,
},
{
title: 'Partition Offset',
dataIndex: 'partitionOffset',
key: 'partitionOffset',
sorter: (a: IGroupInfo, b: IGroupInfo) => a.partitionOffset - b.partitionOffset,
},
{
title: 'Lag',
dataIndex: 'lag',
key: 'lag',
sorter: (a: IGroupInfo, b: IGroupInfo) => a.lag - b.lag,
},
];
const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
pageSize: 10,
showTotal: (total) => `${total}`,
};
@observer
export class Consumer extends TopicDetail {
public clusterId: number;
public topicName: string;
public group: string;
public location: string;
constructor(props: any) {
super(props);
const url = Url();
this.clusterId = Number(url.search.clusterId);
this.topicName = url.search.topic;
this.location = url.search.location;
this.group = url.search.group;
this.handleGroupChange(this.group + ',' + this.location);
}
public handleGroupChange = (value: string) => {
const { topicName, clusterId } = this;
topic.getGroupInfo(topicName, clusterId, value.split(',')[0], value.split(',')[1]);
}
public renderHeader = () => {
return (
<div className="group-title">
consumerGroup:
<div className="group-select">
<Select defaultValue={this.group} onChange={this.handleGroupChange}>
{topic.consumeInfo.map((d) => <Select.Option value={d.consumerGroup + ',' + d.location} key={d.consumerGroup}>
{d.consumerGroup}</Select.Option>)}
</Select>
</div>
</div>
);
}
public renderConsumer() {
const data = this.state.searchKey ?
topic.groupInfo.filter((g) => g.partitionId === Number(this.state.searchKey)) : topic.groupInfo;
return (
<Table
rowKey="partitionId"
columns={parColumns}
dataSource={data}
pagination={pagination}
title={this.renderHeader}
className={location.pathname.includes('admin') ? 'consumer-container' : ''}
/>
);
}
public renderTab() {
return (
<TabPane tab="消费详情" key="2">
{this.renderConsumer()}
</TabPane>
);
}
}

View File

@@ -1,31 +0,0 @@
.o-container {
width: 100%;
padding: 40px 0 0 10px;
.b-list {
button {
margin: 0 5px 0 10px;
}
}
.headLine {
padding-top: 30px;
margin-top: 30px;
color: #f38031;
border-top: 1px solid rgb(216, 216, 216);
}
.timeButton {
position: relative;
left: 260px;
top: 40px;
}
.partionButton {
float: right;
margin: 20px 15px 0 0;
}
.b-item {
margin-top: 20px;
padding-left: 222px;
button {
margin-right: 10px;
}
}
}

View File

@@ -1,19 +0,0 @@
import * as React from 'react';
import { observer } from 'mobx-react';
import { drawer } from 'store/drawer';
import ResetOffset from './reset-offset';
import TopicSample from './topic-sample';
@observer
export default class AllDrawerInOne extends React.Component {
public render() {
if (!drawer.id) return null;
return (
<>
{drawer.id === 'showResetOffset' ? <ResetOffset /> : null}
{drawer.id === 'showTopicSample' ? <TopicSample /> : null}
</>
);
}
}

View File

@@ -1,118 +0,0 @@
import * as React from 'react';
import { Drawer, Form, Row, Button, Input, DatePicker, Col, Select, message, Alert } from 'component/antd';
import { drawer } from 'store/drawer';
import { topic } from 'store/topic';
import { consume } from 'store/consume';
import { observer } from 'mobx-react';
import './index.less';
import moment = require('moment');
@observer
class ResetOffset extends React.Component<any> {
public handleSubmit = (e: React.MouseEvent<any, MouseEvent>) => {
e.preventDefault();
this.props.form.validateFields((err: Error, values: any) => {
if (err) return;
const { timestamp } = values;
consume.offsetPartition(Object.assign({ timestamp: +moment(timestamp).format('x') }, topic.currentGroup))
.then(() => {
message.success('重置时间成功');
setTimeout(() => {
location.reload();
}, 200);
});
});
}
public submitPartiton = () => {
consume.offsetPartition(topic.currentGroup, 1).then(() => {
message.success('重置分区成功');
setTimeout(() => {
location.reload();
}, 200);
});
}
public render() {
const { getFieldDecorator } = this.props.form;
return (
<Drawer
title="重置消费偏移"
width={520}
closable={false}
onClose={drawer.close}
visible={true}
destroyOnClose={true}
>
<Alert message="重置之前一定要停止消费任务!!!" type="warning" showIcon={true} />
<div className="o-container">
<Form labelAlign="left" onSubmit={this.handleSubmit} >
<Row>
<p style={{ fontSize: '14px', color: '#f38031' }}></p>
</Row>
<Row gutter={16}>
<Col span={6}>
<Form.Item label="请选择时间" >
{getFieldDecorator('timestamp', {
rules: [{ required: true, message: '请选择时间' }],
initialValue: moment(),
})(
<DatePicker showTime={true} style={{ width: '50%' }} />,
)}
</Form.Item>
</Col>
<Col span={6}>
<Form.Item className="timeButton">
<Button type="primary" htmlType="submit">
</Button>
</Form.Item>
</Col>
</Row>
<Row className="headLine">
<p style={{ fontSize: '14px' }}></p>
</Row>
<Row>
<Form.Item>
<Row>
<Col span={8}>partitionId</Col>
<Col span={16}>partitionOffset</Col>
</Row>
{consume.offsetList.map((ele, index) => {
return (
<Row key={index} gutter={16}>
<Col span={8}>
<Select placeholder="请选择" onChange={consume.selectChange.bind(consume, index)}>
{topic.groupInfo.map((r, k) => {
return <Select.Option key={k} value={r.partitionId}>{r.partitionId}</Select.Option>;
})}
</Select></Col>
<Col span={10}>
<Input placeholder="请输入partition offset" onChange={consume.inputChange.bind(consume, index)} />
</Col>
<Col span={6} className="b-list">
<Button type="dashed" icon="plus" onClick={consume.handleList.bind(null, null)} />
<Button
type="dashed"
icon="minus"
disabled={index === 0}
onClick={consume.handleList.bind(null, index)}
/>
</Col>
</Row>
);
})}
<Row className="partionButton">
<Button type="primary" onClick={this.submitPartiton}></Button>
</Row>
</Form.Item>
</Row>
</Form>
</div>
</Drawer>
);
}
}
export default Form.create({ name: 'topicSample' })(ResetOffset);

View File

@@ -1,103 +0,0 @@
import * as React from 'react';
import { Drawer, Form, Row, Button, Input, InputNumber, notification } from 'component/antd';
import { drawer } from 'store/drawer';
import './index.less';
import { topic } from 'store/topic';
const topicFormItemLayout = {
labelCol: {
span: 5,
},
wrapperCol: {
span: 14,
},
};
class TopicSample extends React.Component<any> {
public state = {
loading: false,
};
public handleSubmit = (e: React.MouseEvent<any, MouseEvent>) => {
e.preventDefault();
this.props.form.validateFields((err: Error, values: any) => {
if (err) return;
const { offset, partitionId } = values;
const bothExist = [offset, partitionId].filter(item => item === undefined || item === null).length;
if (bothExist === 1) {
notification.error({ message: '分区号和偏移量必须同时存在' });
return false;
}
this.setState({ loading: true });
topic.addSample(Object.assign(drawer.topicData, values)).then(() => this.setState({ loading: false }));
});
}
public cleanData = () => {
topic.sampleData = null;
drawer.close();
}
public render() {
const { getFieldDecorator } = this.props.form;
return (
<Drawer
title="Topic 采样"
width={620}
closable={false}
onClose={this.cleanData}
visible={true}
destroyOnClose={true}
>
<div className="o-container">
<Form {...topicFormItemLayout} labelAlign="right" onSubmit={this.handleSubmit} >
<Row>
<Form.Item label="最大采样条数" >
{getFieldDecorator('maxMsgNum', {
rules: [{ required: true, message: '请输入最大采样条数' }],
initialValue: 1,
})(<Input />)}
</Form.Item>
</Row>
<Row>
<Form.Item label="最大采样时间">
{getFieldDecorator('timeout', {
rules: [{ required: true, message: '请输入最大采样时间' }],
initialValue: 3000,
})(<Input />)}
</Form.Item>
</Row>
<Row>
<Form.Item label="分区号">
{getFieldDecorator('partitionId')(<InputNumber min={0} />)}
</Form.Item>
</Row>
<Row>
<Form.Item label="偏移量">
{getFieldDecorator('offset')(<InputNumber min={0} />)}
</Form.Item>
</Row>
<Row>
<Form.Item className="b-item">
<Button type="primary" htmlType="submit" loading={this.state.loading}></Button>
<Button type="primary" onClick={this.cleanData}></Button>
</Form.Item>
</Row>
</Form>
{
topic.sampleData ?
topic.sampleData.map((i: any, index: number) => {
return <Input.TextArea
value={i.value}
style={{ height: 120, width: 500, marginTop: 10 }}
key={index}
/>;
}) : null
}
</div>
</Drawer>
);
}
}
export default Form.create({ name: 'topicSample' })(TopicSample);

View File

@@ -1,103 +0,0 @@
.kafka-header-container {
height: 64px;
background-color: #fff;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, .1);
position: relative;
z-index: 100;
display: flex;
flex-flow: row nowrap;
.left-content {
width: 220px;
margin-left: 16px;
}
.mid-content {
flex: 1;
padding-left: 100px;
a {
color: #4A4A4A;
&:hover {
color: #f38031;
}
}
span {
display: inline-block;
vertical-align: middle;
position: relative;
line-height: 64px;
width: 120px;
text-align: center;
&.k-active {
a {
color: #f38031;
}
&:after {
width: 100%;
content: '';
height: 4px;
position: absolute;
bottom: 0;
left: 0;
background: #f38031;
}
}
}
}
.right-content {
margin-right: 24px;
position: relative;
.kafka-avatar-icon {
font-size: 24px;
position: absolute;
top: 15px;
left: -30px;
width: 32px;
height: 32px;
}
.kafka-header-text {
font-size: 14px;
}
}
.left-content,
.right-content {
font-size: 0;
& > span {
display: inline-block;
line-height: 64px;
vertical-align: middle;
}
}
.kafka-header-icon {
height: 45px;
width: 45px;
img {
width: 100%;
height: 100%;
}
}
.kafka-header-text {
margin-left: 16px;
font-size: 18px;
font-weight: 500;
font-family: PingFangSC-Medium;
color: rgba(25,24,24,1);
cursor: pointer;
}
}
.kafka-header-menu {
width: 88px;
background-color: #fff;
position: absolute;
top: -20px;
box-shadow: 0px 0px 4px 0px rgba(217,217,217);
border-radius: 4px;
li {
text-align: center;
height: 32px;
line-height: 32px;
cursor: pointer;
&:hover {
background: rgba(236,111,38,0.1);
}
}
}

View File

@@ -1,56 +0,0 @@
import * as React from 'react';
import './index.less';
import { getCookie, deleteCookie } from 'lib/utils';
import { userLogoff } from 'lib/api';
import { notification, Dropdown } from 'component/antd';
import { users } from 'store/users';
import logoUrl from '../../assets/image/kafka-logo.png';
import devIcon from '../../assets/image/devops.png';
import adminIcon from '../../assets/image/admin.png';
import userIcon from '../../assets/image/normal.png';
interface IHeader {
active: string;
}
export const Header = (props: IHeader) => {
const { active } = props;
const username = getCookie('username');
const role = Number(getCookie('role'));
const logoff = () => {
userLogoff(username).then(() => {
notification.success({ message: '退出成功' });
deleteCookie(['username', 'role']);
location.reload();
});
};
const menu = (
<ul className="kafka-header-menu">
{role ? <li> <a href="/admin/user_manage"></a></li> : ''}
<li onClick={logoff}>退</li>
</ul>
);
return (
<div className="kafka-header-container">
<div className="left-content">
<img className="kafka-header-icon" src={logoUrl} alt="" />
<span className="kafka-header-text">Kafka Manager</span>
</div>
<div className="mid-content">
<span className={active === 'user' ? 'k-active' : ''}><a href="/"></a></span>
{role ? <span className={active === 'admin' ? 'k-active' : ''}><a href="/admin"></a></span> : ''}
</div>
<div className="right-content">
<img className="kafka-avatar-icon" src={role === 2? adminIcon : role === 1 ? devIcon: userIcon } alt="" />
<Dropdown overlay={menu}>
<span className="kafka-header-text">
{users.mapRole(role)} : {username}</span>
</Dropdown>
</div>
</div>
);
};

View File

@@ -1,79 +0,0 @@
export const userMenu = [{
href: '/',
i: 'k-icon-iconfontzhizuobiaozhun023110',
title: 'Topic列表',
}, {
href: '/user/my_order',
i: 'k-icon-order1',
title: '工单列表',
}, {
href: '/user/alarm',
i: 'k-icon-gaojing',
title: '告警配置',
}, {
href: '/user/modify_user',
i: 'k-icon-yonghuguanli',
title: '密码修改',
}];
export const adminMenu = [{
href: '/admin',
i: 'k-icon-jiqun',
title: '集群列表',
}, {
href: '/admin/order',
i: 'k-icon-order1',
title: '资源审批',
},
// }, {
// href: '/admin/task',
// i: 'k-icon-renwuliebiao',
// title: '任务列表',
// }, {
// {
// href: '/admin/alarm',
// i: 'k-icon-gaojing',
// title: '告警配置',
// }, {
{
href: '/admin/user_manage',
i: 'k-icon-yonghuguanli',
title: '用户管理',
},
// }, {
// href: '/admin/auto_approval',
// i: 'k-icon-shenpi1',
// title: '自动审批管理',
// }, {
{
href: '/admin/operation',
i: 'k-icon-xiaofeikecheng',
title: '任务管理',
// }, {
// href: '/admin/modify_user',
// i: 'k-icon-jiaoseshouquan',
// title: '密码修改',
}];
export interface IMenuItem {
href: string;
i: string;
title: string;
}
export const userMap = new Map<string, IMenuItem>();
userMenu.forEach(m => {
userMap.set(m.href, m);
});
export const adminMap = new Map<string, IMenuItem>();
adminMenu.forEach(m => {
adminMap.set(m.href, m);
});
export const getActiveMenu = (mode: 'admin' | 'user', href: string) => {
const map = mode === 'admin' ? adminMap : userMap;
const defaultMenu = mode === 'admin' ? '/admin' : '/';
const menuItem = map.get(href);
return menuItem && menuItem.href || defaultMenu;
};

View File

@@ -1,57 +0,0 @@
import * as React from 'react';
import './index.less';
import { Tooltip, Icon } from 'component/antd';
import { adminMenu, userMenu } from './constant';
import { BrowserRouter as Router, NavLink } from 'react-router-dom';
interface ILeftMenuProps {
page: string;
mode?: 'admin' | 'user';
}
export class LeftMenu extends React.Component<ILeftMenuProps> {
public state = {
status: 'k-open',
};
public open = () => {
const { status } = this.state;
const newStatus = !status ? 'k-open' : '';
this.setState({
status: newStatus,
});
}
public render() {
const { status } = this.state;
const { page, mode } = this.props;
const menu = mode === 'admin' ? adminMenu : userMenu;
return (
<div className={`left-menu ${status}`}>
<ul>
{
menu.map((m, i) => {
const cnt = (
<li key={m.i}>
<NavLink exact={true} to={m.href} activeClassName="active">
<i className={m.i} />
{status ? <span>{m.title}</span> : null}
</NavLink>
</li>
);
if (!status) {
return <Tooltip placement="right" title={m.title} key={m.i} >{cnt}</Tooltip>;
}
return cnt;
})
}
</ul>
<div className="k-float-op" onClick={this.open}>
<Icon type={status ? 'double-left' : 'double-right'} />
</div>
</div>
);
}
}

View File

@@ -1,141 +0,0 @@
import * as React from 'react';
import { Modal, Form, Row, Input, Select, notification } from 'component/antd';
import { modal } from 'store/modal';
import { cluster } from 'store/cluster';
import { operation } from 'store/operation';
import { topic, IAdminExpand } from 'store/topic';
import { observer } from 'mobx-react';
import { broker } from 'store/broker';
import { topicDilatation } from 'lib/api';
import urlQuery from 'store/url-query';
import { IValueLabel } from 'types/base-type';
const topicFormItemLayout = {
labelCol: {
span: 7,
},
wrapperCol: {
span: 11,
},
};
@observer
class Topic extends React.Component<any> {
public handleSubmit = () => {
this.props.form.validateFields((err: Error, values: any) => {
if (err) return;
values.partitionNum = +values.partitionNum;
topicDilatation(values).then(() => {
topic.getAdminTopics(urlQuery.clusterId);
notification.success({ message: '扩容成功' });
modal.close();
});
});
}
public componentDidMount() {
const { clusterId, topicName } = modal.topicDetail;
operation.initRegionOptions(clusterId);
broker.initBrokerOptions(clusterId);
cluster.getClusters();
topic.getTopicMetaData(clusterId, topicName);
}
public render() {
const { getFieldDecorator } = this.props.form;
const initialData = topic.topicDetail || {} as IAdminExpand;
return (
<Modal
title="扩分区"
style={{ top: 70 }}
visible={true}
onCancel={modal.close}
maskClosable={false}
width="680px"
destroyOnClose={true}
okText="确定"
cancelText="取消"
onOk={this.handleSubmit}
>
<Form {...topicFormItemLayout}>
<Row>
<Form.Item label="集群名称">
{getFieldDecorator('clusterId', {
rules: [{ required: true, message: '请选择集群' }],
initialValue: +initialData.clusterId || +cluster.data[1].clusterId,
})(
<Select disabled={true}>
{
cluster.data.slice(1).map(c => {
return <Select.Option value={c.clusterId} key={c.clusterId}>{c.clusterName}</Select.Option>;
})
}
</Select>,
)}
</Form.Item>
</Row>
<Row>
<Form.Item label="Topic名称">
{getFieldDecorator('topicName', {
rules: [{ required: true, message: '请选择Topic' }],
initialValue: initialData.topicName,
})(
<Input disabled={true} />,
)}
</Form.Item>
</Row>
<Form.Item label="所处Broker列表">
<Input value={initialData.brokerIdList && initialData.brokerIdList.join(',')} disabled={true} />
</Form.Item>
<Form.Item
label="已有分区数"
>
<Input value={initialData.partitionNum} disabled={true} />
</Form.Item>
<Form.Item
label="副本数"
>
<Input value={initialData.replicaNum} disabled={true} />
</Form.Item>
<Form.Item
label="新扩Broker列表"
>
{getFieldDecorator('brokerIdList', {
initialValue: initialData.brokerIdList || [],
rules: [{
required: true,
validator: (_: any, value: string, callback: (wrong?: string) => void) => {
if (initialData.replicaNum > value.length) {
callback('Broker数需要大于或等于副本数');
}
callback();
},
}],
})(
<Select mode="multiple" optionLabelProp="title" placeholder="请选择broker">
{
broker.BrokerOptions.map((t: IValueLabel) => {
return <Select.Option value={t.value} title={t.value + ''} key={t.value} >
<span aria-label={t.value}> {t.label} </span>
</Select.Option>;
})
}
</Select>,
)}
</Form.Item>
<Form.Item
label="新增分区数"
>
{getFieldDecorator('partitionNum', {
rules: [{ required: true, message: '请输入新增分区数' }],
})(
<Input placeholder="请输入新增分区数" />,
)}
</Form.Item>
</Form>
</Modal>
);
}
}
export default Form.create({ name: 'topic' })(Topic);

View File

@@ -1,303 +0,0 @@
import * as React from 'react';
import { Modal, Form, Row, Input, Select, notification, Col, Radio } from 'component/antd';
import { modal } from 'store/modal';
import { alarm } from 'store/alarm';
import { observer } from 'mobx-react';
import { cluster } from 'store/cluster';
import { addAlarm, modifyAlarm } from 'lib/api';
import { topic } from 'store/topic';
import { broker } from 'store/broker';
import { getRandomPassword, getCookie } from 'lib/utils';
import { IAlarmBase } from 'types/base-type';
const Option = Select.Option;
const topicFormItemLayout = {
labelCol: {
span: 6,
},
wrapperCol: {
span: 14,
},
};
@observer
class Alarm extends React.Component<any> {
public data: any = null;
public state = {
loading: false,
type: 'Lag',
};
public handleSubmit = () => {
this.props.form.validateFields((err: Error, values: any) => {
if (err) return;
this.setState({ loading: true });
const { metric, opt, threshold, duration, alarmName, principalList: principal, actionTag, status } = values;
const principalList = typeof (principal) === 'object' ? principal : principal.split(',');
const strategyActionList = [{ actionTag, actionWay: 'KAFKA' }];
const strategyFilterList = Array.from(['topicName', 'consumerGroup', 'brokerId', 'clusterId'], (item) => {
if ((this.state.type === 'Lag' || !+getCookie('role')) && item === 'brokerId') return;
if (this.state.type !== 'Lag' && item === 'consumerGroup' || JSON.stringify(values[item]) === '[]') return;
return {
key: item,
value: values[item],
};
}).filter(i => i);
const params: IAlarmBase = {
status, strategyActionList, strategyFilterList, alarmName, principalList,
strategyExpressionList: [{ metric, opt, threshold: +threshold, duration: +duration }],
};
const notiMessage = alarm.curData ? { message: '修改成功' } : { message: '添加告警成功' };
const fn = alarm.curData ? modifyAlarm : addAlarm;
fn(alarm.curData ? Object.assign({ id: alarm.curData.id }, params) : params).then(() => {
notification.success(notiMessage);
alarm.getAlarm();
modal.close();
}, (err) => {
this.setState({ loading: false });
});
});
}
public initSelection = (value: number) => {
topic.getTopicList(value);
broker.initBrokerOptions(value);
}
public componentDidMount = () => {
cluster.getClusters();
if (this.isModify()) {
this.setState({ type: alarm.curData.strategyExpressionList[0].metric }, () => {
this.data = this.getFilterList();
});
}
}
public onChange = (type: any) => {
this.setState({ type });
}
public filterSelection = (input: string, option: any) => {
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
}
public getFilterList = () => {
const filterList = new Map();
alarm.curData.strategyFilterList.forEach(item => {
filterList.set(item.key, item.value);
});
this.initSelection(+filterList.get('clusterId'));
return filterList;
}
public getActionTag = () => {
this.props.form.setFieldsValue({
actionTag: 'KAFKA_' + getRandomPassword(),
});
}
public isModify = () => !!alarm.curData;
public render() {
const { getFieldDecorator } = this.props.form;
const { loading, type } = this.state;
const isModify = this.isModify();
const initialData = alarm.curData;
const { data } = this;
const role = +getCookie('role');
return (
<Modal
title="告警配置"
style={{ top: 30 }}
visible={true}
onCancel={modal.close}
maskClosable={false}
width={700}
destroyOnClose={true}
okText="确定"
cancelText="取消"
onOk={this.handleSubmit}
confirmLoading={loading}
>
<Form {...topicFormItemLayout} >
<Form.Item label="告警名称">
{getFieldDecorator('alarmName', {
rules: [{ required: true, message: '告警规则名称' }],
initialValue: isModify ? initialData.alarmName : '',
})(
<Input placeholder="请输入告警配置名称" />,
)}
</Form.Item>
<Form.Item label="负责人">
{getFieldDecorator('principalList', {
rules: [{ required: true, message: '请输入负责人' }],
initialValue: isModify ? initialData.principalList : getCookie('username'),
})(
<Input placeholder="多个负责人请用逗号隔开" />,
)}
</Form.Item>
<Row>
<Col span={6}>
<p style={{ textAlign: 'right', color: 'rgba(0,0,0,.85)', paddingTop: '8px' }}> </p>
</Col>
<Col span={14} className="ruleArea">
<Row>
<Col span={12}>
<Form.Item wrapperCol={{ span: 22 }}>
{getFieldDecorator('metric', {
rules: [{ required: true, message: '请选择 Metric' }],
initialValue: isModify ? initialData.strategyExpressionList[0].metric : '',
})(
<Select placeholder="请选择 Metric" onChange={this.onChange}>
{
alarm.alarmConstant.metricTypeList.map((ele, index) => {
return <Option key={index} value={Object.keys(ele)[0]}> {Object.keys(ele)[0]}</Option>;
})
}
</Select>,
)}
</Form.Item>
</Col>
<Col span={12}>
<Form.Item wrapperCol={{ span: 22 }}>
{getFieldDecorator('opt', {
rules: [{ required: true, message: '请选择 Condition' }],
initialValue: isModify ? initialData.strategyExpressionList[0].opt : '',
})(
<Select placeholder="请选择 Condition">
{
alarm.alarmConstant.conditionTypeList.map((ele, index) => {
return <Option key={index} value={Object.keys(ele)[0]}> {Object.keys(ele)[0]} </Option>;
})
}
</Select>,
)}
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item wrapperCol={{ span: 22 }}>
{getFieldDecorator('threshold', {
rules: [{ required: true, message: '请输入 value' }],
initialValue: isModify ? initialData.strategyExpressionList[0].threshold : '',
})(
<Input addonBefore="metricValue" />,
)}
</Form.Item>
</Col>
<Col span={12}>
<Form.Item wrapperCol={{ span: 22 }}>
{getFieldDecorator('duration', {
rules: [{ required: true, message: '请输入持续时间' }],
initialValue: isModify ? initialData.strategyExpressionList[0].duration : '',
})(
<Input addonBefore="duration" />,
)}
</Form.Item>
</Col>
</Row>
</Col>
</Row>
<Row>
<Col span={6}>
<p style={{ textAlign: 'right', color: 'rgba(0,0,0,.85)', paddingTop: '8px' }}> </p>
</Col>
<Col span={14} className="ruleArea">
<span className="label"></span>
<Form.Item wrapperCol={{ span: 25 }} className="t-input">
{getFieldDecorator('clusterId', {
rules: [{ required: true, message: '请选择集群' }],
initialValue: data && +data.get('clusterId') || '',
})(
<Select onChange={this.initSelection} placeholder="请选择集群" >
{
cluster.data.slice(1).map(c => {
return <Select.Option value={c.clusterId} key={c.clusterId}>{c.clusterName}</Select.Option>;
})
}
</Select>,
)}
</Form.Item>
<Row>
<span className="label">Topic名称</span>
<Form.Item wrapperCol={{ span: 25 }} className="t-input">
{getFieldDecorator('topicName', {
rules: [{ required: type === 'Lag' || !role, message: '请选择Topic' }],
initialValue: data && data.get('topicName') || '',
})(
<Select
placeholder="请选择Topic"
allowClear={true}
filterOption={this.filterSelection}
showSearch={true}
>
{
topic.topicNameList.map(t => {
return <Select.Option value={t} key={t}>{t}</Select.Option>;
})
}
</Select>,
)}
</Form.Item>
</Row>
{type !== 'Lag' ? role ? (
<Row>
<span className="label">BrokeId</span>
<Form.Item wrapperCol={{ span: 25 }} className="t-input">
{getFieldDecorator('brokerId', {
initialValue: data && data.get('brokerId') || [],
})(
<Select optionLabelProp="title" placeholder="请选择Broker" allowClear={true}>
{
broker.BrokerOptions.map(t => {
return <Select.Option value={t.value} title={t.value + ''} key={t.value} >
<span aria-label={t.value}> {t.label} </span>
</Select.Option>;
})
}
</Select>,
)}
</Form.Item>
</Row>
) : null : (
<>
<span className="label"></span>
<Form.Item wrapperCol={{ span: 25 }} className="t-input">
{getFieldDecorator('consumerGroup', {
rules: [{ required: type === 'Lag', message: '请输入消费组' }],
initialValue: data && data.get('consumerGroup') || '',
})(
<Input placeholder="请输入消费组" />,
)}
</Form.Item>
</>
)}
</Col>
</Row>
<Form.Item label="TagName">
{getFieldDecorator('actionTag', {
rules: [{ required: true, message: '请输入tag' }],
initialValue: isModify ? initialData.strategyActionList[0].actionTag : '',
})(
<Input placeholder="请输入tag" addonAfter={<span style={{ cursor: 'pointer' }} onClick={this.getActionTag}></span>} />,
)}
</Form.Item>
<Form.Item label="开启告警">
{getFieldDecorator('status', {
initialValue: isModify ? initialData.status : 1,
})(
<Radio.Group>
<Radio value={1}></Radio>
<Radio value={0}></Radio>
</Radio.Group>,
)}
</Form.Item>
</Form>
</Modal >
);
}
}
export default Form.create({ name: 'alarm' })(Alarm);

View File

@@ -1,24 +0,0 @@
import * as React from 'react';
import { Modal } from 'component/antd';
import { modal } from 'store/modal';
import { NetWorkFlow } from 'container/topic-detail/com';
export class ClusterDetail extends React.Component<any> {
public render() {
return (
<Modal
title="集群流量"
style={{ top: 70 }}
visible={true}
onCancel={modal.close}
maskClosable={false}
width={1000}
destroyOnClose={true}
>
<div className="k-row">
<NetWorkFlow clusterId={modal.currentCluster.clusterId} />
</div>
</Modal>
);
}
}

View File

@@ -1,173 +0,0 @@
import * as React from 'react';
import { Modal, Form, Row, Input, Select, Radio, message } from 'component/antd';
import { modal } from 'store/modal';
import { cluster } from 'store/cluster';
import { INewCluster } from 'types/base-type';
import { newCluster, modifyCluster } from 'lib/api';
const Option = Select.Option;
const topicFormItemLayout = {
labelCol: {
span: 8,
},
wrapperCol: {
span: 12,
},
};
class Cluster extends React.Component<any> {
public handleSubmit = (e: React.MouseEvent<any, MouseEvent>) => {
e.preventDefault();
const { clusterId } = modal.currentCluster;
this.props.form.validateFieldsAndScroll((err: any, values: INewCluster) => {
if (err) return;
const commonFn = (fn: any) => {
fn.then(() => {
message.success(this.getTips());
modal.close();
cluster.getClusters();
});
};
clusterId ?
commonFn(modifyCluster(Object.assign(values, {clusterId}))) : commonFn(newCluster(values));
});
}
public getTips() {
if (modal.currentCluster.clusterId) return '修改成功';
return '添加成功';
}
public getTitle() {
if (modal.currentCluster.clusterId) return '修改集群';
return '添加集群';
}
public render() {
const { getFieldDecorator } = this.props.form;
return (
<Modal
title={this.getTitle()}
style={{ top: 70 }}
visible={true}
onCancel={modal.close}
maskClosable={false}
width={700}
destroyOnClose={true}
okText="确定"
cancelText="取消"
onOk={this.handleSubmit}
>
<Form {...topicFormItemLayout} >
<Row>
<Form.Item
label="集群名称"
>
{getFieldDecorator('clusterName', {
rules: [{ required: true, message: '请输入集群名称' }],
initialValue: modal.currentCluster.clusterName,
})(
<Input
placeholder="请输入集群名称"
/>,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="zookeeper地址"
>
{getFieldDecorator('zookeeper', {
rules: [{ required: true, message: '请输入 zookeeper 地址' }],
initialValue: modal.currentCluster.zookeeper,
})(
<Input.TextArea
placeholder="请输入 zookeeper 地址"
/>,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="kafka版本"
>
{getFieldDecorator('kafkaVersion', {
rules: [{ required: true, message: '请选择 kafka 版本' }],
initialValue: modal.currentCluster.kafkaVersion,
})(
<Select placeholder="请选择 kafka 版本">
{cluster.kafkaVersions.map((v) => {
return <Option key={v} value={v}>{v}</Option>;
})}
</Select>,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="集群访问地址"
>
{getFieldDecorator('bootstrapServers', {
rules: [{ required: true, message: '请输入集群访问地址' }],
initialValue: modal.currentCluster.bootstrapServers,
})(
<Input.TextArea placeholder="请输入集群访问地址" />,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="SASL JAAS配置"
>
{getFieldDecorator('saslJaasConfig', {
initialValue: modal.currentCluster.saslJaasConfig,
})(
<Input placeholder="请输入SASL JAAS配置" />,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="SASL机制"
>
{getFieldDecorator('saslMechanism', {
initialValue: modal.currentCluster.saslMechanism,
})(
<Input placeholder="请输入SASL机制" />,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="安全协议"
>
{getFieldDecorator('securityProtocol', {
initialValue: modal.currentCluster.securityProtocol,
})(
<Input placeholder="请输入安全协议" />,
)}
</Form.Item>
</Row>
<Row>
<Form.Item
label="是否开启告警"
>
{getFieldDecorator('alarmFlag', {
rules: [{ required: true, message: '请选择是否开启告警' }],
initialValue: modal.currentCluster.alarmFlag === undefined ? 1 : modal.currentCluster.alarmFlag,
})(
<Radio.Group>
<Radio value={1}></Radio>
<Radio value={0}></Radio>
</Radio.Group>,
)}
</Form.Item>
</Row>
</Form>
</Modal>
);
}
}
export default Form.create({ name: 'cluster' })(Cluster);

View File

@@ -1,42 +0,0 @@
import * as React from 'react';
import { modal } from 'store/modal';
import { consume } from 'store/consume';
import Modal from 'antd/es/modal';
import { observer } from 'mobx-react';
import Table from 'antd/es/table';
const columns = [
{
title: 'Topic 列表',
dataIndex: 'topicName',
key: 'topicName',
},
];
@observer
export default class ConsumerTopic extends React.Component {
public componentDidMount() {
const { clusterId, consumerGroup, location } = modal.consumberGroup;
consume.getConsumerTopic(clusterId, consumerGroup, location.toLowerCase());
}
public render() {
return (
<Modal
title="消费的Topic列表"
style={{ top: 200 }}
visible={true}
onCancel={modal.close}
maskClosable={false}
width={500}
footer={null}
>
<Table
rowKey="topicName"
columns={columns}
pagination={false}
dataSource={consume.consumerTopic}
/>
</Modal>
);
}
}

View File

@@ -1,47 +0,0 @@
import * as React from 'react';
import { observer } from 'mobx-react';
import { modal } from 'store/modal';
import TopicNew from './topic-new';
import TopicExpand from './topic-expand';
import Alarm from './alarm-config';
import ClusterNew from './cluster';
import LeaderRebalance from './leader-rebalance';
import Task from './task-new';
import OrderApprove from './order-approve';
import PartitionApprove from './partition-approve';
import NewUser from './new-user';
import Region from './region';
import TopicCreate from './topic-create';
import AdminExpand from './admin-expand';
import ConsumerTopic from './cosumer-topic';
import './index.less';
@observer
export default class AllModalInOne extends React.Component {
public render() {
if (!modal.id) return null;
return (
<>
{modal.id === 'showNewTopic' ? <TopicNew /> : null}
{modal.id === 'showNewCluster' ? <ClusterNew /> : null}
{modal.id === 'showModifyCluster' ? <ClusterNew /> : null}
{modal.id === 'showAdimTopic' ? <TopicCreate /> : null}
{modal.id === 'showExpandTopic' ? <TopicExpand /> : null}
{modal.id === 'showExpandAdmin' ? <AdminExpand /> : null}
{modal.id === 'showAlarm' ? <Alarm /> : null}
{modal.id === 'showAlarmModify' ? <Alarm /> : null}
{modal.id === 'showRegion' ? <Region /> : null}
{modal.id === 'showLeaderRebalance' ? <LeaderRebalance /> : null}
{modal.id === 'showTask' ? <Task /> : null}
{modal.id === 'showTaskDetail' ? <Task /> : null}
{modal.id === 'showOrderApprove' ? <OrderApprove /> : null}
{modal.id === 'showOrderDetail' ? <OrderApprove /> : null}
{modal.id === 'showPartitionDetail' ? <PartitionApprove /> : null}
{modal.id === 'showPartition' ? <PartitionApprove /> : null}
{modal.id === 'showNewUser' ? <NewUser /> : null}
{modal.id === 'showConsumerTopic' ? <ConsumerTopic /> : null}
</>
);
}
}

Some files were not shown because too many files have changed in this diff Show More