this.id = id} />
-
- >
- );
- }
-}
diff --git a/console/src/container/topic-detail/index.less b/console/src/container/topic-detail/index.less
deleted file mode 100644
index 4a005673..00000000
--- a/console/src/container/topic-detail/index.less
+++ /dev/null
@@ -1,173 +0,0 @@
-p.k-title {
- width: 100%;
- font-size: 14px;
- font-family: PingFangSC-Medium;
- font-weight: 500;
- color: rgba(0, 0, 0, 0.85);
- height: 48px;
- line-height: 48px;
- background: rgba(0, 0, 0, 0.02);
- padding-left: 24px;
- margin: 0;
-}
-.right-flow {
- .k-abs {
- right: 24px;
- cursor: pointer;
- & > i {
- margin-right: 5px;
- }
- }
-}
-.status-graph {
- position: relative;
- height: 48px;
- width: 100%;
- background: rgba(250, 250, 250, 1);
-}
-.topic-line-tool {
- font-size: 14px;
- font-family: PingFangSC-Regular;
- font-weight: 400;
- color: rgba(0, 0, 0, 0.85);
- background: rgba(250, 250, 250);
- li {
- margin-right: 20px;
- & > span.label {
- padding-right: 10px;
- }
- }
-}
-.base-detail {
- overflow: hidden;
- width: 100%;
- li {
- float: left;
- color: rgba(3, 2, 2, 0.85);
- background: #fff;
- line-height: 52px;
- font-size: 14px;
- font-family: PingFangSC-Regular;
- white-space: nowrap;
- &:nth-child(2n + 1) {
- width: 65%;
- span:first-child {
- width: 30%;
- }
- }
- &:nth-child(2n) {
- width: 35%;
- padding-left: 13px;
- }
- &.special {
- width: 100%;
- padding-left: 13px;
- height: 52px;
- span:first-child {
- width: 20%;
- text-align: left;
- }
- .principal {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- width: 70%;
- display: inline-block;
- vertical-align: top;
- }
- }
- span:first-child {
- display: inline-block;
- font-size: 12px;
- font-family: PingFangSC-Regular;
- font-weight: 400;
- color: rgba(0, 0, 0, 0.45);
- width: 54%;
- text-align: left;
- }
- }
-}
-
-.k-row {
- width: 100%;
- overflow: hidden;
- position: relative;
- .k-abs {
- position: absolute;
- top: 15px;
- }
- .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;
- margin: 0;
- }
-}
-
-.k-top-row {
- position: relative;
- & + .k-top-row {
- padding-left: 8px;
- }
- .group-search {
- position: absolute;
- top: 8px;
- right: 24px;
- width: 220px;
- }
-}
-
-.k-toolbar {
- margin: 0;
- position: absolute;
- right: 0;
- li {
- display: inline-block;
- vertical-align: middle;
- line-height: 48px;
- }
-}
-
-.nav {
- color: #3f3f3fc9;
- p {
- display: inline-block;
- font-size: 20px;
- height: 48px;
- line-height: 48px;
- font-weight: 800;
- }
-}
-.t-button {
- font-size: 12px;
- button {
- border: 1px solid #f38031;
- color: #f38031;
- margin-left: 10px;
- background: transparent;
- }
-}
-.group-detail {
- .ant-table-body {
- height: 270px;
- }
- .ant-table-placeholder {
- display: none;
- }
-}
-
-.nothing-style {
- position: absolute;
- font-size: 18px;
- color: #999;
- top: 175px;
- left: 520px;
-}
diff --git a/console/src/container/topic-detail/index.tsx b/console/src/container/topic-detail/index.tsx
deleted file mode 100644
index 5d9232a5..00000000
--- a/console/src/container/topic-detail/index.tsx
+++ /dev/null
@@ -1,302 +0,0 @@
-import * as React from 'react';
-import './index.less';
-import { NetWorkFlow, StatusGragh, Group, Base } from './com';
-import { Table, Tabs, Button, PaginationConfig } from 'component/antd';
-import Url from 'lib/url-parser';
-import { topic, ITopicPartition, ITopicBroker } from 'store/topic';
-import { observer } from 'mobx-react';
-import { modal } from 'store';
-import { drawer } from 'store/drawer';
-import { handleTabKey } from 'lib/utils';
-import { getCookie } from 'lib/utils';
-import { SearchAndFilter } from 'container/cluster-topic';
-import { broker } from 'store/broker';
-
-const pagination: PaginationConfig = {
- position: 'bottom',
- showQuickJumper: true,
- pageSize: 10,
- showTotal: (total) => `共 ${total} 条`,
-};
-
-@observer
-export class TopicDetail extends SearchAndFilter {
- public clusterId: number;
- public topicName: string;
- public role: string;
-
- public brokerColumns = [{
- title: 'BrokerID',
- key: 'brokerId',
- dataIndex: 'brokerId',
- sorter: (a: ITopicBroker, b: ITopicBroker) => a.brokerId - b.brokerId,
- render: (t: string) => {
- return (
-
- {t}
-
- );
- },
- }, {
- title: 'Host',
- key: 'host',
- dataIndex: 'host',
- }, {
- title: 'Leader个数',
- key: 'leaderPartitionIdListLength',
- dataIndex: 'leaderPartitionIdList',
- render: (t: []) => {
- return t.length;
- },
- }, {
- title: '分区LeaderID',
- key: 'leaderPartitionIdList',
- dataIndex: 'leaderPartitionIdList',
- onCell: () => ({
- style: {
- maxWidth: 180,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- cursor: 'pointer',
- },
- }),
- render: (t: []) => {
- return t.map(i =>
{i});
- },
- }, {
- title: '分区个数',
- key: 'partitionNum',
- dataIndex: 'partitionNum',
- }, {
- title: '分区ID',
- key: 'partitionIdList',
- dataIndex: 'partitionIdList',
- onCell: () => ({
- style: {
- maxWidth: 180,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- cursor: 'pointer',
- },
- }),
- render: (t: []) => {
- return t.map(i =>
{i});
- },
- }, {
- title: '操作',
- render: (record: ITopicBroker) => {
- return (
查看详情);
- },
- }];
-
- public state = {
- searchKey: '',
- partitionKey: '',
- brokerKey: '',
- consumerKey: '',
- filterVisible: false,
- };
-
- constructor(props: any) {
- super(props);
- const url = Url();
- this.clusterId = Number(url.search.clusterId);
- this.topicName = url.search.topic;
- this.role = getCookie('role');
- }
-
- public renderColumns = () => {
- const underReplicated = Object.assign({
- title: '已同步',
- key: 'underReplicated',
- dataIndex: 'underReplicated',
- filters: [{ text: '是', value: '0' }, { text: '否', value: '1' }],
- onFilter: (value: string, record: ITopicPartition) => +record.underReplicated === +value,
- render: (t: any) =>
{t ? '否' : '是'},
- }, this.renderColumnsFilter('filterVisible'));
-
- return [{
- title: '分区号',
- key: 'partitionId',
- dataIndex: 'partitionId',
- sorter: (a: ITopicPartition, b: ITopicPartition) => a.partitionId - b.partitionId,
- }, {
- title: '偏移量',
- key: 'offset',
- dataIndex: 'offset',
- }, {
- title: 'LeaderBrokerID',
- key: 'leaderBrokerId',
- dataIndex: 'leaderBrokerId',
- }, {
- title: '副本BrokerID',
- key: 'replicaBrokerIdList',
- dataIndex: 'replicaBrokerIdList',
- render: (t: []) => {
- return t.map(i =>
{i});
- },
- }, {
- title: 'ISR',
- key: 'isrBrokerIdList',
- dataIndex: 'isrBrokerIdList',
- render: (t: []) => {
- return t.map(i =>
{i});
- },
- }, {
- title: '首选Leader副本',
- key: 'preferredBrokerId',
- dataIndex: 'preferredBrokerId',
- },
- underReplicated];
- }
-
- public componentDidMount() {
- const { topicName, clusterId } = this;
- topic.getTopicBasicInfo(topicName, clusterId);
- topic.getTopicStatusInfo(topicName, clusterId);
- topic.getTopicConsumeInfo(clusterId, topicName);
- topic.getTopicBroker(clusterId, topicName);
- topic.getTopicPartition(clusterId, topicName);
- }
-
- public updateStatus = () => {
- topic.getTopicStatusInfo(this.topicName, this.clusterId);
- }
-
- public getMoreDetail = (record: ITopicBroker) => {
- return (
-
-
BrokerID: {record.brokerId}
-
Host:{record.host}
-
LeaderID: {record.leaderPartitionIdList.join(',')}(共{record.leaderPartitionIdList.length}个)
-
分区ID:{record.partitionIdList.join(',')}(共{record.partitionIdList.length}个)
-
- );
- }
-
- public renderMore() {
- const data = this.state.brokerKey ?
- topic.topicBrokers.filter((d) => d.host.includes(this.state.brokerKey)) : topic.topicBrokers;
- return (
- <>
-
-
- - Broker信息
- {this.renderSearch('请输入Host', 'brokerKey')}
-
-
-
- >
- );
- }
-
- public renderOperation() {
- const { topicName, clusterId } = this;
- return (
-
- {location.hash.substr(1) === '2' ? :
- <>
-
-
- >}
-
- );
- }
-
- public renderFlow() {
- return (
- <>
-
-
- >
- );
- }
-
- public renderMessage() {
- const data = this.state.partitionKey ?
- topic.topicPartitions.filter((d) => d.partitionId + '' === this.state.partitionKey) : topic.topicPartitions;
- const consumerData = this.state.consumerKey ?
- topic.consumeInfo.filter((d) => d.consumerGroup.includes(this.state.consumerKey)) : topic.consumeInfo;
- return (
- <>
-
-
-
-
- - 消费组信息
- {this.renderSearch('请输入消费组名称', 'consumerKey')}
-
-
-
-
- {+this.role ? this.renderMore() : null}
-
-
- - 分区信息
- {this.renderSearch('请输入分区号', 'partitionKey')}
-
-
-
- >
- );
- }
-
- public renderTab() { };
-
- public render() {
- return (
- <>
-
-
-
- {this.renderMessage()}
-
-
- {this.renderFlow()}
-
- {this.renderTab()}
-
- >
- );
- }
-}
diff --git a/console/src/container/user-home/index.less b/console/src/container/user-home/index.less
deleted file mode 100644
index 990d47ad..00000000
--- a/console/src/container/user-home/index.less
+++ /dev/null
@@ -1,73 +0,0 @@
-.content-container {
- position: relative;
- .table-operation {
- a {
- color: #f38031;
- }
- a + a {
- margin-left: 10px;
- }
- }
- .table-operation-bar {
- position: absolute;
- right: 24px;
- z-index: 100;
- li {
- display: inline-block;
- vertical-align: middle;
- .ant-select {
- width: 150px;
- }
- .ant-input-search {
- width: 200px;
- }
- &.new-topic {
- margin-right: 30px;
- cursor: pointer;
- & > i {
- margin-right: 5px;
- }
- }
- }
- }
- .k-collect {
- width: 300px;
- position: relative;
- margin-bottom: 12px;
- .ant-alert-close-icon {
- top: 7px;
- }
- .k-coll-btn {
- position: absolute;
- top: 9px;
- right: 15px;
- }
- }
- .p-params {
- display: inline-block;
- padding: 0px 10px;
- border-radius: 4px;
- border: 1px solid rgba(217, 217, 217, 1);
- margin: 0px 8px 8px 0px;
- &-unFinished {
- background: rgba(245, 34, 45, 0.2);
- }
- }
-}
-
-.icon:hover {
- position: relative;
- .ant-checkbox-disabled {
- &::after {
- content: '已收藏';
- color: #fff;
- background-color: rgba(0, 0, 0, 0.65);
- position: absolute;
- padding: 8px 0px;
- width: 60px;
- border-radius: 4px;
- top: -30px;
- left: 1px;
- }
- }
-}
diff --git a/console/src/container/user-home/index.tsx b/console/src/container/user-home/index.tsx
deleted file mode 100644
index 859a0998..00000000
--- a/console/src/container/user-home/index.tsx
+++ /dev/null
@@ -1,286 +0,0 @@
-import * as React from 'react';
-import './index.less';
-
-import { Table, Tabs, Alert, notification, PaginationConfig, Modal, Tooltip } from 'component/antd';
-import { modal } from 'store';
-import { cluster } from 'store/cluster';
-import { observer } from 'mobx-react';
-import { topic } from 'store/topic';
-import ReactDOM from 'react-dom';
-import { collect, uncollect } from 'lib/api';
-import { SearchAndFilter } from 'container/cluster-topic';
-import moment from 'moment';
-import { handleTabKey, tableFilter } from 'lib/utils';
-import { ITopic } from 'types/base-type';
-
-const TabPane = Tabs.TabPane;
-
-const pagination: PaginationConfig = {
- position: 'bottom',
- showQuickJumper: true,
- pageSize: 10,
- showTotal: (total) => `共 ${total} 条`,
-};
-
-@observer
-export class UserHome extends SearchAndFilter {
- public state = {
- searchKey: '',
- filterCollVisible: false,
- filterUnCollVisible: false,
- filterFavorite: false,
- };
-
- public collRef: HTMLDivElement = null;
- public uncollRef: HTMLDivElement = null;
-
- public rowSelection = {
- onChange: (selectedRowKeys: string[], selectedRows: ITopic[]) => {
- const num = selectedRows.length;
- ReactDOM.render(
- selectedRows.length ? (
- <>
-
-
收藏
- >) : null,
- this.collRef,
- );
- },
- getCheckboxProps: (record: any) => ({ disabled: record.favorite, className: 'icon' }),
- };
-
- public unrowSelection = {
- onChange: (selectedRowKeys: string[], selectedRows: ITopic[]) => {
- const num = selectedRows.length;
- ReactDOM.render(
- selectedRows.length ? (
- <>
-
-
取消收藏
- >) : null,
- this.uncollRef,
- );
- },
- };
-
- public renderColumns = (data: ITopic[], type: boolean) => {
- const cluster = Object.assign({
- title: '集群名称',
- dataIndex: 'clusterName',
- key: 'clusterName',
- width: '12%',
- filters: tableFilter
(data, 'clusterName'),
- onFilter: (value: string, record: ITopic) => record.clusterName.indexOf(value) === 0,
- }, this.renderColumnsFilter(type ? 'filterCollVisible' : 'filterUnCollVisible'));
-
- const favorite = Object.assign({
- title: '状态',
- dataIndex: 'favorite',
- key: 'favorite',
- filters: [{ text: '已收藏', value: 'true' }, { text: '未收藏', value: 'false' }],
- onFilter: (value: string, record: ITopic) => record.favorite + '' === value,
- render: (t: boolean) => t ? '已收藏' : '未收藏',
- }, this.renderColumnsFilter('filterFavorite'));
-
- const columns = [
- {
- title: 'Topic 名称',
- dataIndex: 'topicName',
- key: 'topicName',
- width: 250,
- onCell: () => ({
- style: {
- maxWidth: 250,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- cursor: 'pointer',
- },
- }),
- sorter: (a: ITopic, b: ITopic) => a.topicName ? a.topicName.charCodeAt(0) - b.topicName.charCodeAt(0) : null,
- render: (t: string, r: ITopic) => {
- return (
-
- {t}
- );
- },
- },
- cluster,
- {
- title: '分区数',
- dataIndex: 'partitionNum',
- key: 'partitionNum',
- width: 120,
- sorter: (a: ITopic, b: ITopic) => b.partitionNum - a.partitionNum,
- },
- {
- title: '流入(KB/s)',
- dataIndex: 'byteIn',
- key: 'byteIn',
- width: 120,
- sorter: (a: ITopic, b: ITopic) => b.byteIn - a.byteIn,
- render: (t: number) => (t / 1024).toFixed(2),
- },
- {
- title: '流入(QPS)',
- dataIndex: 'produceRequest',
- key: 'produceRequest',
- width: 120,
- 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) => {t},
- sorter: (a: ITopic, b: ITopic) =>
- a.principals && b.principals ? a.principals.charCodeAt(0) - b.principals.charCodeAt(0) : (-1),
- },
- {
- title: '修改时间',
- dataIndex: 'updateTime',
- key: 'updateTime',
- width: '15%',
- sorter: (a: ITopic, b: ITopic) => a.updateTime - b.updateTime,
- render: (t: number) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
- },
- favorite,
- ];
- if (!type) return columns.splice(0, columns.length - 1);
- return columns;
- }
-
- public renderCollection(favData: ITopic[]) {
- return (
-
- );
- }
-
- public renderList(data: ITopic[]) {
- return (
-
- );
- }
-
- public componentDidMount() {
- if (cluster.data.length === 0) {
- cluster.getClustersBasic();
- }
-
- if (topic.data.length === 0) {
- topic.getTopics();
- }
- }
-
- public collect = (selectedRowKeys: ITopic[]) => {
- collect(selectedRowKeys.map(s => ({ clusterId: s.clusterId, topicName: s.topicName } as ITopic))).then(() => {
- ReactDOM.unmountComponentAtNode(this.collRef);
- topic.getTopics();
- notification.success({ message: '收藏成功' });
- });
- }
-
- public uncollect = (selectedRowKeys: ITopic[]) => {
- Modal.confirm({
- title: `确认取消收藏?`,
- okText: '确定',
- cancelText: '取消',
- onOk: () => {
- uncollect(selectedRowKeys.map(s => ({ clusterId: s.clusterId, topicName: s.topicName } as ITopic))).then(() => {
- ReactDOM.unmountComponentAtNode(this.uncollRef);
- notification.success({ message: '取消收藏成功' });
- topic.getTopics();
- });
- },
- });
- }
-
- public getData(origin: T[]) {
- let data: T[] = [];
- origin.forEach((d) => {
- if (cluster.active === -1 || d.clusterId === cluster.active) {
- return data.push(d);
- }
- });
- const { searchKey } = this.state;
-
- if (searchKey) {
- data = origin.filter((d) => d.topicName.includes(searchKey) ||
- (d.principals && d.principals.includes(searchKey)));
- }
-
- return data;
- }
-
- public renderTable() {
- return (
-
-
- this.uncollRef = id} />
- {this.renderCollection(this.getData(topic.favData))}
-
-
- this.collRef = id} />
- {this.renderList(this.getData(topic.data))}
-
-
- );
- }
-
- public renderClusterTopic() {
- return (
- <>
- {this.renderCluster()}
- {this.renderSearch('请输入Topic名称或者负责人')}
- >
- );
- }
-
- public render() {
- const isAdmin = location.pathname.includes('admin');
- return (
- <>
-
- -
- {`Topic${isAdmin ? '创建' : '申请'}`}
-
- {this.renderClusterTopic()}
-
- {this.renderTable()}
- >
- );
- }
-}
diff --git a/console/src/lib/api.ts b/console/src/lib/api.ts
deleted file mode 100644
index d3b9e294..00000000
--- a/console/src/lib/api.ts
+++ /dev/null
@@ -1,379 +0,0 @@
-import fetch from './fetch';
-import { INewCluster, ITopic, IAlarmBase, IDilation, ITaskBase, IRebalance, IOrderTopic, IUser, ISample, IDeleteTopic, IOffset } from 'types/base-type';
-import { IRegionData } from 'store/region';
-
-export const getClusters = (cluster?: number) => {
- return fetch(`/clusters${cluster ? '/' + cluster : ''}`);
-};
-
-export const getTopic = (clusterId?: number, favorite?: boolean) => {
- const query = !clusterId && favorite === undefined ? '/topics' :
- (clusterId ? `/topics?clusterId=${clusterId}` : `/topics?favorite=${favorite}`);
- return fetch(query);
-};
-
-export const collect = (topicFavoriteList: ITopic[]) => {
- return fetch('/topics/favorite', {
- body: {
- topicFavoriteList,
- },
- });
-};
-
-export const uncollect = (topicFavoriteList: ITopic[]) => {
- return fetch('/topics/favorite', {
- method: 'DELETE',
- body: {
- topicFavoriteList,
- },
- });
-};
-
-export const getTopicBasicInfo = (topicName: string, clusterId: number) => {
- return fetch(`/${clusterId}/topics/${topicName}/basic-info`);
-};
-
-export const getTopicConsumeInfo = (clusterId: number, topicName: string) => {
- return fetch(`/${clusterId}/topics/${topicName}/consumer-groups`);
-};
-
-export const getConsumeInfo = (clusterId: number) => {
- return fetch(`/${clusterId}/consumers/consumer-groups`);
-};
-
-export const getTopicStatusInfo = (topicName: string, clusterId: number) => {
- return fetch(`/${clusterId}/topics/${topicName}/metrics`);
-};
-
-export const getGroupInfo = (topicName: string, clusterId: number, group: string, location: string) => {
- return fetch(`/${clusterId}/consumers/${group}/topics/${topicName}/consume-detail?location=${location}`);
-};
-
-export const getTopicOrder = () => {
- return fetch('/orders/topic');
-};
-
-export const getPartitionOrder = () => {
- return fetch('/orders/partition');
-};
-
-export const getAlarm = () => {
- return fetch(`/alarms/alarm-rules`);
-};
-
-export const createTopic = (params: ITopic) => {
- return fetch('/orders/topic', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const getRegions = (clusterId: number) => {
- return fetch(`/admin/${clusterId}/regions`);
-};
-
-export const delRegion = (regionId: number) => {
- return fetch(`/admin/regions/${regionId}`, {
- method: 'DELETE',
- });
-};
-
-export const addRegion = (params: IRegionData) => {
- return fetch(`/admin/regions/region`, {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const modifyRegion = (params: IRegionData) => {
- return fetch(`/admin/regions/region`, {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const topicDilatation = (params: IDilation) => {
- return fetch('/admin/utils/topic/dilatation', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const addAlarm = (params: IAlarmBase) => {
- return fetch('/alarms/alarm-rule', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const modifyAlarm = (params: IAlarmBase) => {
- return fetch('/alarms/alarm-rule', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const deleteAlarm = (alarmRuleId: number) => {
- return fetch(`/alarms/alarm-rule?alarmRuleId=${alarmRuleId}`, {
- method: 'DELETE',
- });
-};
-
-export const recallOrder = (orderId: number) => {
- return fetch(`/orders/topic?orderId=${orderId}`, {
- method: 'DELETE',
- });
-};
-
-export const getBrokerBaseInfo = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/basic-info`);
-};
-
-export const getBrokerList = (clusterId: number) => {
- return fetch(`/${clusterId}/brokers/overview`);
-};
-
-export const getTopicBroker = (clusterId: number, topicName: string) => {
- return fetch(`/${clusterId}/topics/${topicName}/brokers`);
-};
-
-export const getTopicPartition = (clusterId: number, topicName: string) => {
- return fetch(`/${clusterId}/topics/${topicName}/partitions`);
-};
-
-export const getBrokerNetwork = (clusterId: number) => {
- return fetch(`/clusters/${clusterId}/metrics`);
-};
-
-export const getOneBrokerNetwork = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/metrics`);
-};
-
-export const getBrokerPartition = (clusterId: number) => {
- return fetch(`/${clusterId}/brokers/overall`);
-};
-
-export const getBrokerTopic = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/topics`);
-};
-
-export const getController = (clusterId: number) => {
- return fetch(`/clusters/${clusterId}/controller-history`);
-};
-
-export const getConsumeGroup = (clusterId: number, consumerGroup: string, location: string) => {
- return fetch(`/${clusterId}/consumer/${consumerGroup}/topics?location=${location}`);
-};
-
-export const newCluster = (cluster: INewCluster) => {
- return fetch(`/clusters`, {
- method: 'POST',
- body: JSON.stringify(cluster),
- });
-};
-
-export const modifyCluster = (cluster: INewCluster) => {
- return fetch(`/clusters`, {
- method: 'PUT',
- body: JSON.stringify(cluster),
- });
-};
-
-export const getKafkaVersion = () => {
- return fetch(`/clusters/kafka-version`);
-};
-
-export const getClusterMetricsHistory = (clusterId: number, startTime: string, endTime: string) => {
- return fetch(`/clusters/${clusterId}/metrics-history?startTime=${startTime}&endTime=${endTime}`);
-};
-
-export const getPartitions = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/partitions`);
-};
-
-export const getBrokerKeyMetrics = (clusterId: number, brokerId: number, startTime: string, endTime: string) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/key-metrics?startTime=${startTime}&endTime=${endTime}`);
-};
-
-export const getTask = (value?: number) => {
- return fetch(`/admin/migration/tasks${value ? '/' + value : ''}`);
-};
-
-export const executeTask = (params: ITaskBase) => {
- return fetch('/admin/migration/tasks', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const modifyTask = (params: ITaskBase) => {
- return fetch('/admin/migration/tasks', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const getAdminTopicOrder = () => {
- return fetch('/admin/orders/topic');
-};
-
-export const getAdminPartitionOrder = (orderId?: number) => {
- return fetch(`/admin/orders/partition${orderId ? '?orderId=' + orderId : ''}`);
-};
-
-export const getRebalanceStatus = (clusterId: number) => {
- return fetch(`/admin/utils/rebalance/clusters/${clusterId}/status`);
-};
-
-export const addRebalance = (params: IRebalance) => {
- return fetch('/admin/utils/rebalance', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const getBrokerTopicAnalyzer = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/analysis`);
-};
-
-export const addTopicApprove = (params: IOrderTopic) => {
- return fetch('/admin/orders/topic', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const addAdminPartition = (params: IOrderTopic) => {
- return fetch('/admin/orders/partition', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const addPartitionApprove = (params: IOrderTopic) => {
- return fetch('/orders/partition', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const getUsers = () => {
- return fetch('/admin/accounts');
-};
-
-export const addUser = (params: IUser) => {
- return fetch('/admin/accounts/account', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const deleteUser = (username: string) => {
- return fetch(`/admin/accounts/account?username=${username}`, {
- method: 'DELETE',
- });
-};
-
-export const modifyUser = (params: IUser) => {
- return fetch('/admin/accounts/account', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const getLogin = () => {
- return fetch('/login/loginPage');
-};
-
-export const userLogin = (params: IUser) => {
- return fetch('/login/login', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const userLogoff = (value: string) => {
- return fetch(`/login/logoff?username=${value}`, {
- method: 'POST',
- });
-};
-
-export const addSample = (params: ISample) => {
- const {clusterId, topicName, ...rest} = params;
- return fetch(`/${clusterId}/topics/${topicName}/sample`, {
- method: 'POST',
- body: JSON.stringify(rest),
- });
-};
-
-export const deleteTopic = (params: IDeleteTopic) => {
- return fetch(`/admin/utils/topic`, {
- method: 'DELETE',
- body: JSON.stringify(params),
- });
-};
-
-export const modifyTopic = (params: ITopic) => {
- return fetch('/admin/utils/topic/config', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const resetOffset = (params: IOffset) => {
- return fetch('/consumers/offsets', {
- method: 'PUT',
- body: JSON.stringify(params),
- });
-};
-
-export const getClustersBasic = () => {
- return fetch('/clusters/basic-info');
-};
-
-export const getAlarmConstant = () => {
- return fetch('/alarms/alarm/constant');
-};
-
-export const getTopicNameById = (clusterId: number) => {
- return fetch(`/${clusterId}/topics/topic-names`);
-};
-
-export const deleteBroker = (clusterId: number, brokerId: number) => {
- return fetch(`/${clusterId}/brokers/${brokerId}`, {
- method: 'DELETE',
- });
-};
-
-export const recallPartition = (orderId: number) => {
- return fetch(`/orders/partition?orderId=${orderId}`, {
- method: 'DELETE',
- });
-};
-
-export const getBrokerNameList = (clusterId: number) => {
- return fetch(`/${clusterId}/brokers/broker-metadata`);
-};
-
-export const adminCreateTopic = (params: ITopic) => {
- return fetch('/admin/utils/topic', {
- method: 'POST',
- body: JSON.stringify(params),
- });
-};
-
-export const getAdminTopicDetail = (clusterId: number, topicName: string) => {
- return fetch(`/admin/utils/${clusterId}/topics/${topicName}/detail`);
-};
-
-export const getTopicMetriceInfo = (clusterId: number, topicName: string, startTime: string, endTime: string) => {
- return fetch(`/${clusterId}/topics/${topicName}/metrics-history?startTime=${startTime}&endTime=${endTime}`);
-};
-
-export const getBrokerMetrics = (clusterId: number, brokerId: number, startTime: string, endTime: string) => {
- return fetch(`/${clusterId}/brokers/${brokerId}/metrics-history?startTime=${startTime}&endTime=${endTime}`);
-};
-
-export const getTopicMetaData = (clusterId: number, topicName: string) => {
- return fetch(`/${clusterId}/topics/${topicName}/metadata`);
-};
diff --git a/console/src/lib/charts-config.ts b/console/src/lib/charts-config.ts
deleted file mode 100644
index 3b57654c..00000000
--- a/console/src/lib/charts-config.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-import { ISeriesOption, IOptionType, IClusterMetrics, IBrokerMetrics, IValueLabel } from 'types/base-type';
-import moment = require('moment');
-
-export const getClusterMetricOption = (type: IOptionType, data: IClusterMetrics[]) => {
- let name;
- let series: ISeriesOption[];
- const date = data.map(i => moment(i.gmtCreate).format('YYYY-MM-DD HH:mm:ss'));
- const legend = type === 'byteIn/byteOut' ? ['bytesInPerSec', 'bytesOutPerSec'] :
- type === 'messageIn/totalProduceRequests' ? ['messagesInPerSec', 'totalProduceRequestsPerSec'] : [type];
- series = Array.from(legend, (item: IOptionType) => ({
- name: item,
- type: 'line',
- symbol: 'circle',
- data: data.map(i => {
- let seriesType = item as keyof IClusterMetrics;
- if (type !== 'byteIn/byteOut' && type !== 'messageIn/totalProduceRequests') {
- seriesType = item === 'byteRejected' ? 'bytesRejectedPerSec' : 'messagesInPerSec';
- }
- return Number(i[seriesType]);
- }),
- }));
- switch (type) {
- case 'byteRejected':
- name = 'B/s';
- break;
- case 'messageIn/totalProduceRequests':
- name = 'QPS';
- break;
- case 'messageIn':
- name = '条';
- break;
- default:
- if (series.map(i => isMB(i.data)).some(i => i === true)) {
- name = 'MB/s';
- series.map(i => {i.data = i.data.map(ele => (ele / (1024 * 1024)).toFixed(2)) as []; });
- } else {
- name = 'KB/s';
- series.map(i => {i.data = i.data.map(ele => (ele / 1024).toFixed(2)) as []; });
- }
- }
- return {
- tooltip: {
- trigger: 'axis',
- padding: 10,
- backgroundColor: 'rgba(0,0,0,0.7)',
- borderColor: '#333',
- textStyle: {
- color: '#f3f3f3',
- fontSize: '12px',
- },
- },
- xAxis: {
- boundaryGap: false,
- data: date,
- },
- legend: {
- data: legend,
- right: '1%',
- top: '10px',
- },
- yAxis: {
- type: 'value',
- name,
- nameLocation: 'end',
- nameGap: 10,
- },
- grid: {
- left: '1%',
- right: '1%',
- bottom: '3%',
- top: '40px',
- containLabel: true,
- },
- series,
- };
-};
-
-export const getBrokerMetricOption = (charts: IValueLabel[], data: any) => {
- const legend: string[] = [];
- const seriesData = new Map();
- let date: string[] = [];
- const valueData = Object.keys(data).map(item => {
- legend.push(item);
- return data[item];
- });
-
- if (valueData.length) {
- date = valueData[0].map((i: IBrokerMetrics) => moment(i.gmtCreate).format('HH:mm:ss'));
- }
- charts.forEach(item => {
- if (!item.value) return false;
- seriesData.set(item.value, legend.map((ele, index) => {
- return {
- name: ele,
- type: 'line',
- smooth: true,
- symbol: 'circle',
- data: valueData[index].map((i: IBrokerMetrics) => i[item.value as keyof IBrokerMetrics]),
- };
- }));
- });
- return charts.map(i => {
- if (!i.value) return null;
- return {
- tooltip: {
- trigger: 'axis',
- padding: 10,
- backgroundColor: 'rgba(0,0,0,0.7)',
- borderColor: '#333',
- textStyle: {
- color: '#f3f3f3',
- fontSize: '12px',
- },
- },
- xAxis: {
- boundaryGap: false,
- data: date,
- },
- legend: {
- data: legend,
- right: '1%',
- top: '10px',
- },
- yAxis: {},
- grid: {
- left: '1%',
- right: '1%',
- bottom: '3%',
- top: '40px',
- containLabel: true,
- },
- series: seriesData.get(i.value),
- };
- });
-};
-
-function isMB(arr: number[]) {
- const filterData = arr.filter(i => i !== 0);
- if (filterData.length) return filterData.reduce((cur, pre) => cur + pre) / filterData.length >= 100000;
- return false;
-}
diff --git a/console/src/lib/fetch.ts b/console/src/lib/fetch.ts
deleted file mode 100644
index 0be22f53..00000000
--- a/console/src/lib/fetch.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { notification } from 'component/antd';
-
-const window = self.window;
-
-export interface IRes {
- code: number;
- message: string;
- data: any;
-}
-
-const checkStatus = (res: Response) => {
- if (res.status === 200 && res.redirected) {
- let url = res.url;
-
- if (!/^http(s)?:\/\//.test(url)) {
- url = `${window.location.protocol}//${url}`;
- }
-
- if (url) {
- window.location.href = `${url}?jumpto=${encodeURIComponent(window.location.href)}`;
- return null;
- }
-
- return res;
- }
- return res;
-};
-
-const filter = (init: IInit) => (res: IRes) => {
- if (res.code === 401) {
- let url = res.data;
-
- if (!/^http(s)?:\/\//.test(url)) {
- url = `${window.location.protocol}//${url}`;
- }
-
- window.location.href = `${url}?jumpto=${encodeURIComponent(window.location.href)}`;
- return null;
- }
-
- if (res.code !== 0) {
- if (!init.errorNoTips) {
- notification.error({
- message: '错误',
- description: res.message || '服务器错误,请重试!',
- });
- }
- throw res;
- }
-
- return res.data;
-};
-
-const preFix = '/api/v1';
-
-interface IInit extends RequestInit {
- errorNoTips?: boolean;
- body?: BodyInit | null | any;
-}
-
-const csrfTokenMethod = ['POST', 'PUT', 'DELETE'];
-
-export default function fetch(url: string, init?: IInit) {
- if (!init) init = {};
-
- if (!init.credentials) init.credentials = 'include';
- if (init.body && typeof init.body === 'object') init.body = JSON.stringify(init.body);
- if (init.body && !init.method) init.method = 'POST';
- if (init.method) init.method = init.method.toUpperCase();
-
- if (csrfTokenMethod.includes(init.method)) {
- init.headers = Object.assign({}, init.headers || {
- 'Content-Type': 'application/json',
- });
- }
-
- let realUrl = url;
- if (!/^http(s)?:\/\//.test(url)) {
- realUrl = `${preFix}${url}`;
- }
- return window
- .fetch(realUrl, init)
- .then(res => checkStatus(res))
- .then((res) => res.json())
- .then(filter(init));
-}
diff --git a/console/src/lib/utils.ts b/console/src/lib/utils.ts
deleted file mode 100644
index e4c6a24e..00000000
--- a/console/src/lib/utils.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { IFiler } from 'types/base-type';
-
-export interface IMap {
- [index: string]: string;
-}
-interface ICookie {
- key: string;
- value?: string;
- time?: number;
-}
-export const getCookie = (key: string): string => {
- const map: IMap = {};
- document.cookie.split(';').map((kv) => {
- const d = kv.trim().split('=');
- map[d[0]] = d[1];
- return null;
- });
- return map[key];
-};
-
-export const uuid = (): string => {
- return 'c' + `${Math.random()}`.slice(2);
-};
-
-export const getRandomPassword = (len?: number) => {
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
- if (len) {
- let res = '';
- for (let i = 0; i < len; i++) {
- const id = Math.ceil(Math.random() * 62);
- res += chars[id];
- }
- return res;
- }
- return Math.ceil(Math.random() * 100000);
-};
-
-export const setCookie = (cData: ICookie[]) => {
- const date = new Date();
- cData.forEach(ele => {
- date.setTime(date.getTime() + (ele.time * 24 * 60 * 60 * 1000));
- const expires = 'expires=' + date.toUTCString();
- document.cookie = ele.key + '=' + ele.value + '; ' + expires + '; path=/';
- });
-};
-
-export const deleteCookie = (cData: string[]) => {
- setCookie(cData.map(i => ({key: i, value: '', time: -1})));
-};
-
-export const handleTabKey = (key: string) => {
- location.hash = key;
-};
-
-export const tableFilter =
(data: T[], name: keyof T): IFiler[] => {
- if (!data) return [];
- const obj: any = {};
- return data.reduce((cur, pre) => {
- if (!obj[pre[name]]) {
- obj[pre[name]] = true;
- cur.push({ text: pre[name], value: pre[name] });
- }
- return cur;
- }, []);
-};
diff --git a/console/src/routers/page/admin/index.tsx b/console/src/routers/page/admin/index.tsx
deleted file mode 100644
index 2e2d0106..00000000
--- a/console/src/routers/page/admin/index.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import * as React from 'react';
-
-import 'component/antd';
-import { Header } from 'container/header';
-import { LeftMenu } from 'container/left-menu';
-import AllModalInOne from 'container/modal';
-import { TopicDetail } from 'container/topic-detail';
-import { BrokerDetail } from 'container/broker-detail';
-import { BrokerInfo } from 'container/broker-info';
-import { AdminHome } from 'container/admin-home';
-import AdminTopic from 'container/admin-topic';
-import { BrowserRouter as Router, Route } from 'react-router-dom';
-import { AdminOrder } from 'container/admin-order';
-import urlParser from 'lib/url-parser';
-import urlQuery from 'store/url-query';
-// import { AdminAlarm } from 'container/admin-alarm';
-import { AdminRegion } from 'container/admin-region';
-import { AdminController } from 'container/admin-controller';
-import { AdminConsume } from 'container/admin-consume';
-// import { ConsumerDetail } from 'container/admin-consume/detail';
-import { AdminOperation } from 'container/admin-operation';
-import { UserManage } from 'container/admin-usermanage';
-import ModifyUser from 'container/modify-user';
-import AllDrawerInOne from 'container/drawer';
-import { ClusterDetail } from 'container/admin-home/cluster-detail';
-
-export default class Home extends React.Component {
- constructor(props: any) {
- super(props);
- const search = urlParser().search;
- urlQuery.clusterId = Number(search.clusterId);
- urlQuery.brokerId = Number(search.brokerId);
- urlQuery.group = search.group;
- urlQuery.location = search.location;
- urlQuery.topicName = search.topic;
- }
-
- public render() {
- const { match } = this.props;
- const page = match.url;
- return (
- <>
-
-
-
-
-
-
-
-
-
- {/* */}
-
-
-
-
-
- {/* */}
-
-
-
-
-
-
-
-
-
- >
- );
- }
-}
diff --git a/console/src/routers/page/home/index.tsx b/console/src/routers/page/home/index.tsx
deleted file mode 100644
index bce5d649..00000000
--- a/console/src/routers/page/home/index.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import * as React from 'react';
-
-import 'component/antd';
-import './index.less';
-import { Header } from 'container/header';
-import { LeftMenu } from 'container/left-menu';
-import { UserHome } from 'container/user-home';
-import { TopicDetail } from 'container/topic-detail';
-import AllModalInOne from 'container/modal';
-import AllDrawerInOne from 'container/drawer';
-import { MyOrder } from 'container/my-order';
-import { Alarm } from 'container/alarm';
-import { Consumer } from 'container/consumer';
-import ModifyUser from 'container/modify-user';
-import { BrowserRouter as Router, Route } from 'react-router-dom';
-
-export default class Home extends React.Component {
-
- public render() {
- const { match } = this.props;
- const page = match.url;
- return (
- <>
-
-
-
-
-
-
- >
- );
- }
-}
diff --git a/console/src/routers/router.tsx b/console/src/routers/router.tsx
deleted file mode 100644
index 57b3caf9..00000000
--- a/console/src/routers/router.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
-import { hot } from 'react-hot-loader/root';
-import * as React from 'react';
-import { notification } from 'component/antd';
-import { getCookie } from 'lib/utils';
-
-import Home from './page/home';
-import Admin from './page/admin';
-import Login from './page/login';
-
-class RouterDom extends React.Component {
- public render() {
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-class RouteGuard extends React.Component {
- public isLogin = getCookie('username');
- public isAdmin = getCookie('role');
- public render() {
- const { component: Component, ...rest } = this.props;
- const renderRoute = (props: any) => {
- if (!this.isLogin) {
- return ;
- } else if (this.props.path.indexOf('admin') !== -1 && this.isAdmin === '0') {
- notification.error({ message: '暂无权限,请联系管理员' });
- window.history.go(-1);
- } else {
- return ;
- }
- };
- return (
-
- );
- }
-}
-export default hot(RouterDom);
diff --git a/console/src/store/alarm.ts b/console/src/store/alarm.ts
deleted file mode 100644
index 2ab1c6b7..00000000
--- a/console/src/store/alarm.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { observable, action } from 'mobx';
-import { getAlarm, getAlarmConstant } from 'lib/api';
-import { IAlarmBase } from 'types/base-type';
-
-export interface IAlarm extends IAlarmBase {
- gmtCreate: number;
- gmtModify: number;
- status: number;
- key?: number;
-}
-
-export interface IConstant {
- conditionTypeList: [];
- ruleTypeList: [];
- notifyTypeList: [];
- metricTypeList: [];
-}
-
-class Alarm {
- @observable
- public data: IAlarm[] = [];
-
- @observable
- public alarmConstant: IConstant = null;
-
- public curData: IAlarm = null;
-
- public setCurData(data: IAlarm) {
- this.curData = data;
- }
-
- @action.bound
- public setAlarm(data: IAlarm[]) {
- this.data = data.map((d, i) => {
- d.key = i;
- return d;
- });
- }
-
- @action.bound
- public setAlarmConstant(data: IConstant) {
- this.alarmConstant = data;
- }
-
- public getAlarm() {
- getAlarm().then(this.setAlarm);
- }
-
- public getAlarmConstant() {
- getAlarmConstant().then(this.setAlarmConstant);
- }
-}
-
-export const alarm = new Alarm();
diff --git a/console/src/store/broker.ts b/console/src/store/broker.ts
deleted file mode 100644
index f09470bf..00000000
--- a/console/src/store/broker.ts
+++ /dev/null
@@ -1,266 +0,0 @@
-import { observable, action } from 'mobx';
-import { getBrokerBaseInfo, getBrokerList, getBrokerNetwork, getBrokerPartition, getOneBrokerNetwork, getBrokerTopic, getPartitions, getBrokerKeyMetrics, getBrokerTopicAnalyzer, getBrokerNameList } from 'lib/api';
-import { IFlowInfo } from 'component/flow-table';
-import { ITopic, IValueLabel } from 'types/base-type';
-import moment from 'moment';
-
-export interface IBrokerBaseInfo {
- host: string;
- jmxPort: number;
- leaderCount: number;
- partitionCount: number;
- port: number;
- startTime: number | string;
- topicNum: number;
-}
-
-export interface IBroker {
- brokerId: number;
- byteIn: number;
- byteOut: number;
- host: string;
- jmxPort: number;
- port: number;
- startTime: number;
- status: string;
- regionName: string;
-}
-
-export interface IBrokerNetworkInfo extends IFlowInfo {
- produceRequest: number[];
- fetchConsumerRequest: number[];
-}
-
-export interface IBrokerPartition extends IBroker {
- leaderCount: number;
- partitionCount: number;
- notUnderReplicatedPartitionCount: number;
- underReplicatedPartitionCount?: number;
- regionName: string;
- bytesInPerSec: number;
-}
-
-export interface IPartitions {
- followerPartitionIdList: number[];
- leaderPartitionList: number[];
- topicName: string;
- underReplicated: boolean;
- underReplicatedPartitionsIdList: number[];
-}
-
-export interface ITopicStatus {
- BytesOutPerSec_rate: number;
- BytesInPerSec_rate: number;
-}
-
-export interface IBrokerMetrics {
- bytesIn?: number;
- bytesOut?: number;
- messagesIn?: number;
- totalFetchRequests?: number;
- totalProduceRequests?: number;
-}
-
-export interface IAnalyzerData extends IBrokerMetrics {
- topicAnalysisVOList: [];
- baseTime?: number;
- brokerId?: number;
-}
-
-export type IOverviewKey = 'partitionCount' | 'leaderCount' | 'notUnderReplicatedPartitionCount';
-
-interface IBrokerOption {
- host: string;
- brokerId: string;
-}
-
-class Broker {
- @observable
- public loading: boolean = false;
-
- @observable
- public brokerBaseInfo: IBrokerBaseInfo = {} as IBrokerBaseInfo;
-
- @observable
- public list: IBroker[] = [];
-
- @observable
- public network: IBrokerNetworkInfo = null;
-
- @observable
- public oneNetwork: IBrokerNetworkInfo = null;
-
- @observable
- public partitions: IBrokerPartition[] = [];
-
- @observable
- public topics: ITopic[] = [];
-
- @observable
- public topicPartitionsInfo: [] = [];
-
- @observable
- public openKeys: string[] = [];
-
- @observable
- public realPartitions: IBrokerPartition[] = [];
-
- @observable
- public analyzerData: IAnalyzerData = {topicAnalysisVOList: []};
-
- @observable
- public viewType: IOverviewKey = 'partitionCount';
-
- @observable
- public regionOption: any = ['all'];
-
- @observable
- public endTime = moment();
-
- @observable
- public startTime = moment().subtract(1, 'hour');
-
- @observable
- public BrokerOptions: IValueLabel[] = [{ value: null, label: '请选择Broker' }];
-
- @action.bound
- public setLoading(value: boolean) {
- this.loading = value;
- }
-
- @action.bound
- public setBrokerBaseInfo(data: IBrokerBaseInfo) {
- data.startTime = moment(data.startTime).format('YYYY-MM-DD HH:mm:ss'),
- this.brokerBaseInfo = data;
- }
-
- @action.bound
- public setBrokerList(list: IBroker[]) {
- this.list = list;
- }
-
- @action.bound
- public setBrokerNetWork(network: IBrokerNetworkInfo) {
- if (!network) return false;
- this.network = network;
- }
-
- @action.bound
- public setBrokerPartition(pars: IBrokerPartition[]) {
- const res = new Map();
- this.partitions = pars.map(i => {
- i.status = i.notUnderReplicatedPartitionCount ? '是' : '否';
- return i;
- });
- this.realPartitions = pars;
- this.regionOption = pars.filter((a) => !res.has(a.regionName) && res.set(a.regionName, 1));
- }
-
- @action.bound
- public setOneBrokerNetwork(network: IBrokerNetworkInfo) {
- this.oneNetwork = network;
- }
-
- @action.bound
- public setBrokerTopic(topics: ITopic[]) {
- this.topics = topics;
- }
-
- @action.bound
- public setPartitionsInfo(pI: []) {
- this.topicPartitionsInfo = pI;
- }
-
- @action.bound
- public handleOpen(key: string) {
- if (this.openKeys.includes(key)) {
- this.openKeys = this.openKeys.filter(k => k !== key);
- } else {
- this.openKeys.push(key);
- this.openKeys = this.openKeys.slice(0);
- }
- }
-
- @action.bound
- public handleOverview(type: IOverviewKey) {
- this.viewType = type;
- }
-
- @action.bound
- public filterSquare(type: string) {
- this.realPartitions = this.partitions;
- if (type !== 'all') {
- this.realPartitions = this.partitions.filter(i => i.regionName === type);
- }
- }
-
- @action.bound
- public setBrokerTopicAnalyzer(data: IAnalyzerData) {
- for (const item of Object.keys(data)) {
- if (item === 'bytesIn' || item === 'bytesOut') data[item] = +(data[item] / (1024 * 1024)).toFixed(2);
- }
- this.analyzerData = data;
- }
-
- @action.bound
- public changeStartTime(value: moment.Moment) {
- this.startTime = value;
- }
-
- @action.bound
- public changeEndTime(value: moment.Moment) {
- this.endTime = value;
- }
-
- @action.bound
- public setBrokerOptions(data: IBrokerOption[]) {
- this.BrokerOptions = data.map(i => ({
- label: `BrokerID: ${i.brokerId}, Host: ${i.host}`,
- value: i.brokerId,
- }));
- }
-
- public getBrokerBaseInfo(clusterId: number, brokerId: number) {
- getBrokerBaseInfo(clusterId, brokerId).then(this.setBrokerBaseInfo);
- }
-
- public getBrokerList(clusterId: number) {
- this.setLoading(true);
- getBrokerList(clusterId).then(this.setBrokerList).finally(() => this.setLoading(false));
- }
-
- public getBrokerNetwork(clusterId: number) {
- getBrokerNetwork(clusterId).then(this.setBrokerNetWork);
- }
-
- public getBrokerPartition(clusterId: number) {
- this.setLoading(true);
- getBrokerPartition(clusterId).then(this.setBrokerPartition).finally(() => this.setLoading(false));
- }
-
- public getOneBrokerNetwork(clusterId: number, brokerId: number) {
- getOneBrokerNetwork(clusterId, brokerId).then(this.setOneBrokerNetwork);
- }
-
- public getBrokerTopic(clusterId: number, brokerId: number) {
- getBrokerTopic(clusterId, brokerId).then(this.setBrokerTopic);
- }
-
- public getPartitions(clusterId: number, brokerId: number) {
- getPartitions(clusterId, brokerId).then(this.setPartitionsInfo);
- }
-
- public getBrokerKeyMetrics(clusterId: number, brokerId: number, startTime: string, endTime: string) {
- return getBrokerKeyMetrics(clusterId, brokerId, startTime, endTime);
- }
-
- public getBrokerTopicAnalyzer(clusterId: number, brokerId: number) {
- getBrokerTopicAnalyzer(clusterId, brokerId).then(this.setBrokerTopicAnalyzer);
- }
-
- public initBrokerOptions = (clusterId: number) => {
- getBrokerNameList(clusterId).then(this.setBrokerOptions);
- }
-}
-
-export const broker = new Broker();
diff --git a/console/src/store/cluster.ts b/console/src/store/cluster.ts
deleted file mode 100644
index 34e957bd..00000000
--- a/console/src/store/cluster.ts
+++ /dev/null
@@ -1,128 +0,0 @@
-import { observable, action } from 'mobx';
-import { getClusters, getKafkaVersion, getClusterMetricsHistory, getRebalanceStatus, getClustersBasic, getTopicMetriceInfo, getBrokerMetrics } from 'lib/api';
-import { getClusterMetricOption } from 'lib/charts-config';
-import { IClusterData, IClusterMetrics, IOptionType } from 'types/base-type';
-
-import moment from 'moment';
-
-class Cluster {
- @observable
- public data: IClusterData[] = [];
-
- @observable
- public active: number = null;
-
- @observable
- public kafkaVersions: string[] = [];
-
- @observable
- public startTime: moment.Moment;
-
- @observable
- public endTime: moment.Moment;
-
- @observable
- public clusterMetrics: IClusterMetrics[] = [];
-
- @observable
- public leaderStatus: string = '';
-
- @observable
- public type: IOptionType = 'byteIn/byteOut' ;
-
- @action.bound
- public setData(data: IClusterData[]) {
- data.unshift({
- clusterId: -1,
- clusterName: '所有集群',
- } as IClusterData);
- this.data = data;
- this.active = (this.data[0] || { clusterId: null }).clusterId;
- }
-
- @action.bound
- public changeCluster(data: number) {
- this.active = data;
- }
-
- @action.bound
- public setKafkaVersion(data: string[]) {
- this.kafkaVersions = data;
- }
-
- @action.bound
- public setChartsOpton(data: IClusterMetrics[]) {
- this.clusterMetrics = data;
- return this.changeType(this.type);
- }
-
- @action.bound
- public changeType(type: IOptionType) {
- cluster.type = type;
- return getClusterMetricOption(type, this.clusterMetrics);
- }
-
- @action.bound
- public changeStartTime(value: moment.Moment) {
- this.startTime = value;
- }
-
- @action.bound
- public changeEndTime(value: moment.Moment ) {
- this.endTime = value;
- }
-
- @action.bound
- public initTime() {
- this.startTime = moment().subtract(1, 'hour');
- this.endTime = moment();
- }
-
- @action.bound
- public setLeaderStatus(type: string) {
- this.leaderStatus = type;
- }
-
- public getClusters() {
- getClusters().then(this.setData);
- }
-
- public getClustersBasic() {
- getClustersBasic().then(this.setData);
- }
-
- public getKafkaVersions() {
- getKafkaVersion().then(this.setKafkaVersion);
- }
-
- public getClusterMetricsHistory(clusterId: number) {
- return getClusterMetricsHistory(clusterId,
- this.startTime.format('x'),
- this.endTime.format('x')).then(this.setChartsOpton);
- }
-
- public getMetriceInfo(clusterId: number, topicName: string) {
- return getTopicMetriceInfo(clusterId, topicName,
- this.startTime.format('x'),
- this.endTime.format('x')).then(this.setChartsOpton);
- }
-
- public getRebalance(clusterId: number) {
- return getRebalanceStatus(clusterId).then((type) => {
- this.setLeaderStatus(type);
- if (type === 'RUNNING') {
- window.setTimeout(() => {
- this.getRebalance(clusterId);
- }, 1000 * 2);
- }
- });
- }
-
- public getBrokerMetrics(clusterId: number, brokerId: number) {
- return getBrokerMetrics(clusterId, brokerId,
- this.startTime.format('x'),
- this.endTime.format('x')).then(this.setChartsOpton);
- }
-}
-
-export const cluster = new Cluster();
diff --git a/console/src/store/controller.ts b/console/src/store/controller.ts
deleted file mode 100644
index c102b43a..00000000
--- a/console/src/store/controller.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { observable, action } from 'mobx';
-import { getController } from 'lib/api';
-
-export interface IController {
- brokerId: number;
- controllerTimestamp: number;
- controllerVersion: number;
- host: string;
-}
-
-class Controller {
- @observable
- public data: IController[] = [];
-
- @action.bound
- public setData(data: IController[]) {
- this.data = data;
- }
-
- public getController(clusterId: number) {
- getController(clusterId).then(this.setData);
- }
-}
-
-export const controller = new Controller();
diff --git a/console/src/store/drawer.ts b/console/src/store/drawer.ts
deleted file mode 100644
index 8dcd30de..00000000
--- a/console/src/store/drawer.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { observable, action } from 'mobx';
-
-class Drawer {
- @observable
- public id: string = null;
-
- @observable
- public topicData: any = null;
-
- @observable
- public offsetDetail: any = null;
-
- @action.bound
- public showResetOffset(r: any) {
- this.id = 'showResetOffset';
- this.offsetDetail = r;
- }
-
- @action.bound
- public showTopicSample({ clusterId, topicName }: any) {
- this.id = 'showTopicSample';
- this.topicData = { clusterId, topicName };
- }
-
- @action.bound
- public close() {
- this.id = null;
- }
-}
-
-export const drawer = new Drawer();
diff --git a/console/src/store/modal.ts b/console/src/store/modal.ts
deleted file mode 100644
index e6098e69..00000000
--- a/console/src/store/modal.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-import { observable, action } from 'mobx';
-import { alarm, IAlarm } from './alarm';
-import { IRegionData } from './region';
-import { operation, ITask } from './operation';
-import { IClusterData, IBaseOrder, ITopic } from 'types/base-type';
-import { getAdminPartitionOrder, getAdminTopicDetail } from 'lib/api';
-import { IUserDetail } from './users';
-import { topic, IConsumeInfo } from './topic';
-
-class Modal {
- @observable
- public id: string = null;
-
- @observable
- public orderDetail: IBaseOrder = {} as IBaseOrder;
-
- @observable
- public topicData: ITopic = null;
-
- public topicDetail: IBaseOrder = null;
- public regionData: IRegionData = null;
- public currentCluster: IClusterData = {} as IClusterData;
- public userDetail: IUserDetail = null;
- public consumberGroup: IConsumeInfo = null;
-
- @action.bound
- public showNewTopic(r: ITopic) {
- this.topicData = r;
- this.id = 'showNewTopic';
- }
-
- @action.bound
- public showNewCluster() {
- this.id = 'showNewCluster';
- }
-
- @action.bound
- public showModifyCluster(cluster: IClusterData) {
- this.id = 'showModifyCluster';
- this.currentCluster = cluster;
- }
-
- @action.bound
- public setTopic(data: ITopic) {
- this.topicData = data;
- }
-
- @action.bound
- public showAdimTopic(r: ITopic) {
- this.id = 'showAdimTopic';
- this.topicData = r;
- if (r) {
- getAdminTopicDetail(r.clusterId, r.topicName).then(this.setTopic);
- topic.getTopicMetaData(r.clusterId, r.topicName);
- }
- }
-
- @action.bound
- public showAlarm(r: IAlarm) {
- alarm.setCurData(r);
- this.id = 'showAlarm';
- }
-
- @action.bound
- public showRegion(r: IRegionData) {
- this.id = 'showRegion';
- this.regionData = r;
- }
-
- @action.bound
- public showExpandTopic(data: IBaseOrder) {
- this.topicDetail = data;
- this.id = 'showExpandTopic';
- }
-
- @action.bound
- public showExpandAdmin(data: IBaseOrder) {
- this.topicDetail = data;
- this.id = 'showExpandAdmin';
- }
-
- @action.bound
- public showResetOffset() {
- this.id = 'showResetOffset';
- }
-
- @action.bound
- public showLeaderRebalance() {
- this.id = 'showLeaderRebalance';
- }
-
- @action.bound
- public showTask(value: ITask, type?: string) {
- this.id = type === 'detail' ? 'showTaskDetail' : 'showTask';
- value ? operation.getTaskDetail(value.taskId) : operation.setTaskDetail(value);
- }
-
- @action.bound
- public showOrderApprove(value: any, type: string) {
- this.id = type === 'showOrderApprove' ? 'showOrderApprove' : 'showOrderDetail';
- this.orderDetail = value;
- }
-
- @action.bound
- public setDetail(data: any) {
- if (data[0]) this.orderDetail = data[0];
- }
-
- @action.bound
- public showPartition(value: any, type: string) {
- this.orderDetail = value;
- this.id = type === 'showPartition' ? 'showPartition' : 'showPartitionDetail';
- getAdminPartitionOrder(value.orderId).then(this.setDetail);
- }
-
- @action.bound
- public showNewUser(data: IUserDetail) {
- this.userDetail = data;
- this.id = 'showNewUser';
- }
-
- @action.bound
- public shoeTopicConfig(data: IBaseOrder) {
- this.topicDetail = data;
- this.id = 'shoeTopicConfig';
- }
-
- @action.bound
- public showAlarmModify(r: IAlarm) {
- alarm.setCurData(r);
- this.id = 'showAlarmModify';
- }
-
- @action.bound
- public showConsumerTopic(r: IConsumeInfo) {
- this.consumberGroup = r;
- this.id = 'showConsumerTopic';
- }
-
- @action.bound
- public close() {
- this.id = null;
- this.currentCluster = {} as IClusterData;
- }
-}
-
-export const modal = new Modal();
diff --git a/console/src/store/operation.ts b/console/src/store/operation.ts
deleted file mode 100644
index 9152342d..00000000
--- a/console/src/store/operation.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { observable, action } from 'mobx';
-import { getTask, getRegions } from 'lib/api';
-import { ITaskBase } from 'types/base-type';
-
-interface IReassign {
- [propname: string]: number[];
-}
-
-interface IMigration {
- [index: string]: number;
-}
-
-export const taskMap = ['待执行', '执行中', '迁移成功', '迁移失败', '已撤销'];
-
-export interface ITask extends ITaskBase {
- clusterName: string;
- gmtCreate: number;
- operator: string;
- reassignmentMap?: IReassign;
- migrationStatus?: IMigration;
- regionList?: Array<[string, number[]]>;
-}
-
-class Operation {
- @observable
- public tasks: ITask[] = null;
-
- @observable
- public taskDetail: ITask = null;
-
- @observable
- public RegionOptions: any[] = ['请选择集群'];
-
- @action.bound
- public setTask(data: ITask[]) {
- this.tasks = data;
- }
-
- @action.bound
- public setTaskDetail(data: ITask) {
- if (data) data.regionList = Object.keys(data.reassignmentMap).map(i => [i, data.reassignmentMap[i]]);
- this.taskDetail = data;
- }
-
- @action.bound
- public setRegionOptions(data: any) {
- this.RegionOptions = data.map((i: any) => ({
- value: i.regionId,
- label: i.regionName,
- }));
- }
-
- public getTask() {
- getTask().then(this.setTask);
- }
-
- public initRegionOptions = (clusterId: number) => {
- getRegions(clusterId).then(this.setRegionOptions);
- }
-
- public getTaskDetail(value: number) {
- getTask(value).then(this.setTaskDetail);
- }
-}
-
-export const operation = new Operation();
diff --git a/console/src/store/order.ts b/console/src/store/order.ts
deleted file mode 100644
index 811a17bc..00000000
--- a/console/src/store/order.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { observable, action } from 'mobx';
-import { getTopicOrder, getPartitionOrder, getAdminTopicOrder, getAdminPartitionOrder } from 'lib/api';
-import { IBaseOrder } from 'types/base-type';
-
-const statusMap = ['待审批', '通过', '拒绝', '撤销'];
-export const tableStatusFilter = statusMap.map(i => ({text: i, value: i}));
-
-export interface IPartitionOrder extends IBaseOrder {
- peakAvgBytesInPerSec: number;
-}
-
-class Order {
- @observable
- public topicOrder: IBaseOrder[] = [];
-
- @observable
- public partitionOrder: IPartitionOrder[] = [];
-
- @observable
- public adminTopicOrder: IBaseOrder[] = [];
-
- @observable
- public adminPartitionOrder: IPartitionOrder[] = [];
-
- @observable
- public pendingTopic: number = 0;
-
- @observable
- public pendingOrder: number = 0;
-
- @action
- public mapData(data: any, type?: 'pendingTopic' | 'pendingOrder') {
- this[type] = 0;
- return data.map((d: any) => {
- if (!d.orderStatus) this[type] += 1;
- d.statusStr = statusMap[d.orderStatus];
- d.key = d.orderId;
- return d;
- });
- }
-
- @action.bound
- public setTopicOrder(data: IBaseOrder[]) {
- this.topicOrder = this.mapData(data);
- }
-
- @action.bound
- public setPartitionOrder(data: IPartitionOrder[]) {
- this.partitionOrder = this.mapData(data);
- }
-
- @action.bound
- public setAdiminTopicOrder(data: IBaseOrder[]) {
- this.adminTopicOrder = this.mapData(data, 'pendingTopic');
- }
-
- @action.bound
- public setAdminPartitionOrder(data: IPartitionOrder[]) {
- this.adminPartitionOrder = this.mapData(data, 'pendingOrder');
- }
-
- public getOrder() {
- getTopicOrder().then(this.setTopicOrder);
- getPartitionOrder().then(this.setPartitionOrder);
- }
-
- public getAdminOrder() {
- getAdminTopicOrder().then(this.setAdiminTopicOrder);
- getAdminPartitionOrder().then(this.setAdminPartitionOrder);
- }
-}
-
-export const order = new Order();
diff --git a/console/src/store/region.ts b/console/src/store/region.ts
deleted file mode 100644
index 4c41e1e9..00000000
--- a/console/src/store/region.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { observable, action } from 'mobx';
-import { getRegions, delRegion } from 'lib/api';
-
-export const statusMap = ['废弃', '正常', '容量已满'];
-export const levelMap = ['普通', '重要'];
-export interface IRegionData {
- brokerIdList: number[];
- clusterId: number;
- description: string;
- gmtCreate: number;
- gmtModify: number;
- level: number;
- regionId: number;
- regionName: string;
- status: number;
-}
-
-class Region {
- @observable
- public data: IRegionData[] = [];
-
- @action.bound
- public setData(data: IRegionData[]) {
- this.data = data;
- }
-
- public getRegions(clusterId: number) {
- getRegions(clusterId).then(this.setData);
- }
-
- public delRegion(regionId: number) {
- return delRegion(regionId);
- }
-}
-
-export const region = new Region();
diff --git a/console/src/store/topic.ts b/console/src/store/topic.ts
deleted file mode 100644
index 3ee2489e..00000000
--- a/console/src/store/topic.ts
+++ /dev/null
@@ -1,239 +0,0 @@
-import { observable, action } from 'mobx';
-import { getTopic, getTopicBasicInfo, getTopicConsumeInfo, getTopicStatusInfo, getGroupInfo, getConsumeGroup, addSample, getTopicBroker, getTopicPartition, getTopicNameById, getTopicMetaData } from 'lib/api';
-import { IFlowInfo } from 'component/flow-table';
-import urlQuery from './url-query';
-import { ITopic, IOffset, ISample } from 'types/base-type';
-
-export interface ITopicBaseInfo {
- brokerNum: number;
- createTime: string;
- description: string;
- modifyTime: string;
- partitionNum: number;
- principals: string;
- regionNames: string;
- replicaNum: number;
- retentionTime: number;
- topicName: string;
-}
-
-export interface IConsumeInfo {
- location: string;
- consumerGroup: string;
- clusterId?: number;
- key?: string;
-}
-
-export interface ITopicStatusInfo extends IFlowInfo {
- totalProduceRequest: number[];
-}
-
-export interface IGroupInfo {
- clientId: string;
- clusterId: number;
- consumeOffset: number;
- consumerGroup: string;
- lag: number;
- location: string;
- partitionId: number;
- partitionOffset: number;
- topicName: string;
- key?: string;
-}
-
-export interface ITopicBroker {
- brokerId: number;
- host: string;
- leaderPartitionIdList: number[];
- partitionIdList: number[];
- partitionNum: number;
-}
-
-export interface ITopicPartition {
- isrBrokerIdList: number[];
- leaderBrokerId: number;
- leaderEpoch: number;
- offset: number;
- partitionId: number;
- preferredBrokerId: number;
- replicaBrokerIdList: number[];
- underReplicated: boolean;
-}
-
-export interface IAdminExpand {
- brokerIdList: number[];
- clusterId: number;
- partitionNum: number;
- replicaNum: number;
- topicName: string;
-}
-
-class Topic {
- @observable
- public data: ITopic[] = [];
-
- @observable
- public favData: ITopic[] = [];
-
- @observable
- public comsumeTopics: string[] = [];
-
- @observable
- public baseInfo: ITopicBaseInfo = null;
-
- @observable
- public consumeInfo: IConsumeInfo[] = [];
-
- @observable
- public groupInfo: IGroupInfo[] = [];
-
- @observable
- public statusInfo: ITopicStatusInfo = null;
-
- @observable
- public sampleData: ISample[] = null;
-
- @observable
- public topicBrokers: ITopicBroker[] = [];
-
- @observable
- public topicPartitions: ITopicPartition[] = [];
-
- @observable
- public topicNameList: string[] = [];
-
- @observable
- public topicDetail: IAdminExpand = null;
-
- public currentTopicName = '';
- public currentClusterId: number = null;
- public currentGroup: IOffset = null;
-
- @action.bound
- public setData(data: ITopic[]) {
- this.data = data.map((i, index) => {
- i.key = index;
- return i;
- });
- }
-
- @action.bound
- public setFavData(data: ITopic[]) {
- this.favData = data.map((i, index) => {
- i.key = index;
- return i;
- });
- }
-
- @action.bound
- public setTopicBaseInfo(data: ITopicBaseInfo) {
- this.baseInfo = data;
- }
-
- @action.bound
- public setTopicConsumeInfo(data: IConsumeInfo[]) {
- this.consumeInfo = data.map(d => {
- d.key = d.consumerGroup;
- return d;
- });
- }
-
- @action.bound
- public setTopicStatusInfo(data: ITopicStatusInfo) {
- this.statusInfo = data;
- }
-
- @action.bound
- public setGroupInfo(data: IGroupInfo[]) {
- this.groupInfo = data.map(d => { d.key = d.clientId; return d; });
- }
-
- @action.bound
- public setComsumeTopics(topics: string[]) {
- this.comsumeTopics = topics;
- }
-
- @action.bound
- public setSampleData(data: ISample[]) {
- this.sampleData = data;
- }
-
- @action.bound
- public setTopicBrokers(tb: ITopicBroker[]) {
- this.topicBrokers = tb;
- }
-
- @action.bound
- public setTopicPartitions(tp: ITopicPartition[]) {
- this.topicPartitions = tp;
- }
-
- @action.bound
- public setTopicNameList(data: string[]) {
- this.topicNameList = data;
- }
-
- @action.bound
- public setTopicDetail(data: IAdminExpand) {
- this.topicDetail = data;
- }
-
- public setCurrent({ topicName, clusterId }: ITopic) {
- this.currentTopicName = topicName;
- this.currentClusterId = clusterId;
- }
-
- public getTopics() {
- getTopic(null, false).then(this.setData);
- getTopic(null, true).then(this.setFavData);
- }
-
- public getAdminTopics(clusterId: number) {
- getTopic(clusterId).then(this.setData);
- }
-
- public getTopicBasicInfo(topic: string, clusterId: number) {
- getTopicBasicInfo(topic, clusterId).then(this.setTopicBaseInfo);
- }
-
- public getTopicConsumeInfo(clusterId: number, topicName: string) {
- getTopicConsumeInfo(clusterId, topicName).then(this.setTopicConsumeInfo);
- }
-
- public getTopicStatusInfo(topic: string, clusterId: number) {
- this.currentTopicName = topic;
- this.currentClusterId = clusterId;
- getTopicStatusInfo(topic, clusterId).then(this.setTopicStatusInfo);
- }
-
- public getGroupInfo(topicName: string, clusterId: number, consumerGroup: string, location: string) {
- this.currentGroup = { topicName, clusterId, consumerGroup, location: location.toLowerCase() };
- getGroupInfo(topicName, clusterId, consumerGroup, location).then(this.setGroupInfo);
- }
-
- public getConsumeGroup(group: string, location: string) {
- return getConsumeGroup(urlQuery.clusterId, group, location).then(this.setComsumeTopics);
- }
-
- public addSample(params: ISample) {
- return addSample(params).then(this.setSampleData);
- }
-
- public getTopicBroker(clusterId: number, topicName: string) {
- return getTopicBroker(clusterId, topicName).then(this.setTopicBrokers);
- }
-
- public getTopicPartition(clusterId: number, topicName: string) {
- return getTopicPartition(clusterId, topicName).then(this.setTopicPartitions);
- }
-
- public getTopicList = (value: number) => {
- getTopicNameById(value).then(this.setTopicNameList);
- }
-
- public getTopicMetaData = (clusterId: number, topicName: string) => {
- getTopicMetaData(clusterId, topicName).then(this.setTopicDetail);
- }
-}
-
-export const topic = new Topic();
diff --git a/console/src/store/users.ts b/console/src/store/users.ts
deleted file mode 100644
index 0a74bd39..00000000
--- a/console/src/store/users.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { observable, action } from 'mobx';
-import { getUsers } from 'lib/api';
-
-export interface IUserDetail {
- password: number;
- role: number;
- username: string;
-}
-
-export class Users {
- public roleMap = ['普通用户', '运维人员', '管理员'];
- public filterRole = this.roleMap.map(i => ({ text: i, value: i }));
-
- @observable
- public userData: IUserDetail[] = [];
-
- @action.bound
- public setUserData(data: []) {
- this.userData = data.map((d: any) => {
- d.roleName = this.roleMap[d.role];
- return d;
- });
- }
-
- public mapRole(role: number) {
- return this.roleMap[role];
- }
-
- public getUsers() {
- getUsers().then(this.setUserData);
- }
-}
-
-export const users = new Users();
diff --git a/console/src/types/base-type.ts b/console/src/types/base-type.ts
deleted file mode 100644
index c9589318..00000000
--- a/console/src/types/base-type.ts
+++ /dev/null
@@ -1,218 +0,0 @@
-export interface INewCluster {
- alarmFlag: number;
- bootstrapServers: string;
- clusterId: number;
- clusterName: string;
- kafkaVersion: string;
- saslJaasConfig: string;
- saslMechanism: string;
- securityProtocol: string;
- zookeeper: string;
-}
-
-export interface IClusterData {
- bootstrapServers: string;
- brokerNum: number;
- clusterId: number;
- clusterName: string;
- controllerId: number;
- consumerGroupNum: number;
- gmtCreate: string;
- gmtModify: string;
- kafkaVersion: string;
- regionNum: number;
- status: number;
- topicNum: number;
- zookeeper: string;
- alarmFlag: number;
- saslJaasConfig: string;
- saslMechanism: string;
- securityProtocol: string;
-}
-
-export interface ISeriesOption {
- name: string;
- type: string;
- data: number[];
-}
-
-export interface IClusterMetrics {
- gmtCreate: number;
- bytesInPerSec: number;
- bytesOutPerSec: number;
- bytesRejectedPerSec: number;
- messagesInPerSec: number;
-}
-
-export interface IBrokerMetrics {
- requestHandlerIdlPercent: number;
- networkProcessorIdlPercent: number;
- requestQueueSize: number;
- responseQueueSize: number;
- logFlushTime: number;
- failFetchRequest: number;
- failProduceRequest: number;
- totalTimeProduceMean: number;
- totalTimeProduce99Th: number;
- totalTimeFetchConsumerMean: number;
- totalTimeFetchConsumer99Th: number;
- gmtCreate: number;
-}
-
-export interface IValueLabel {
- value: string;
- label: string;
-}
-
-export type IOptionType = 'byteIn/byteOut' | 'byteRejected' | 'messageIn' | 'messageIn/totalProduceRequests';
-
-export interface ITaskDetail {
- clusterId: number;
- operator: number;
- throttle: number;
- topicName: string;
- brokerIdList: number[];
-}
-
-interface IBase {
- clusterId: number;
- clusterName: string;
- topicName: string;
- principals: string;
- description: string;
- brokerIdList: string[];
- partitionNum: number;
-}
-
-export interface IBaseOrder extends IBase {
- peakBytesInPerSec: number;
- orderId: number;
- gmtModify: number;
- gmtCreate: number;
- orderStatus: number;
- approver: string;
- approvalOpinions: string;
- applicant: string;
- predictBytesIn: number;
- realBytesIn: number;
- regionBrokerIdList: any[];
- regionNameList: string[];
- statusStr?: string;
- replicaNum?: number;
- retentionTime?: number;
- peakBytesIn?: number;
- regions?: string;
- brokers?: string;
-}
-
-export interface ITopic extends IBase {
- brokerNum: number;
- byteIn: number;
- byteOut: number;
- favorite: boolean;
- messageIn: number;
- produceRequest: number;
- replicaNum: number;
- updateTime: number;
- principalList: string[];
- properties: string;
- regionIdList: number[];
- retentionTime: number;
- peakBytesIn: number;
- key?: number;
-}
-
-export interface IFiler {
- text: string;
- value: string;
-}
-
-export interface IDilation {
- brokerIdList: number[];
- clusterId: number;
- partitionNum: number;
- regionIdList: number[];
- topicName: string;
-}
-
-export interface IAlarmBase {
- alarmName: string;
- id?: number;
- strategyExpressionList: IExpressionList[];
- strategyFilterList: IStrategyFilter[];
- strategyActionList: IActionList[];
- principalList: string[];
- status: number;
-}
-
-export interface IExpressionList {
- metric: string;
- opt: string;
- threshold: number;
- duration: number;
-}
-export interface IStrategyFilter {
- key: string | string[];
- value: string;
-}
-
-export interface IActionList {
- actionWay: string;
- actionTag: string;
-}
-export interface ITaskBase {
- taskId: number;
- clusterId?: number;
- topicName?: string;
- status?: number;
- throttle?: number;
- partitionIdList?: string[];
- brokerIdList?: number[];
- description?: string;
- action: string;
-}
-
-export interface IRebalance {
- brokerId: number;
- clusterId: number;
- dimension: number;
-}
-
-export interface IOrderTopic {
- orderId: number;
- orderStatus: number;
- retentionTime: number;
- regionIdList: number[];
- brokerIdList: number[];
- approvalOpinions: string;
- partitionNum: number;
- replicaNum: number;
-}
-
-export interface IUser {
- password: string;
- role: string;
- username: string;
- oldPassword: string;
-}
-
-export interface ISample {
- maxMsgNum: number;
- offset: number;
- partitionId: number;
- clusterId: number;
- topicName: string;
-}
-
-export interface IDeleteTopic {
- clusterId: number;
- topicNameList: string[];
-}
-
-export interface IOffset {
- clusterId: number;
- consumerGroup: string;
- location: string;
- offsetList?: [];
- topicName: string;
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/AlarmRuleDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/AlarmRuleDao.java
deleted file mode 100644
index 4f98264e..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/AlarmRuleDao.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.AlarmRuleDO;
-
-import java.util.List;
-
-public interface AlarmRuleDao {
- int insert(AlarmRuleDO alarmRuleDO);
-
- int deleteById(Long id);
-
- int updateById(AlarmRuleDO alarmRuleDO);
-
- AlarmRuleDO getById(Long id);
-
- List listAll();
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/MigrationTaskDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/MigrationTaskDao.java
deleted file mode 100644
index 692c38cc..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/MigrationTaskDao.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.MigrationTaskDO;
-
-import java.util.List;
-
-/**
- * migrate topic task dao
- * @author zengqiao_cn@163.com
- * @date 19/4/16
- */
-public interface MigrationTaskDao {
-
- /**
- * 增加一个迁移任务
- */
- int addMigrationTask(MigrationTaskDO migrationTaskDO);
-
- /**
- * 查询迁移任务
- */
- MigrationTaskDO getById(Long id);
-
- /**
- * 查询所有的迁移任务
- */
- List listAll();
-
- /**
- * 查询所有的迁移任务
- */
- List getByStatus(Integer status);
-
- /**
- * 修改任务
- */
- int updateById(Long id, Integer status, Long throttle);
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OperationHistoryDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OperationHistoryDao.java
deleted file mode 100644
index fd127256..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OperationHistoryDao.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OperationHistoryDO;
-
-/**
- * @author arthur
- * @date 2017/7/20.
- */
-public interface OperationHistoryDao {
- int insert(OperationHistoryDO operationHistoryDO);
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderPartitionDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderPartitionDao.java
deleted file mode 100644
index 335c207b..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderPartitionDao.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OrderPartitionDO;
-
-import java.util.List;
-
-public interface OrderPartitionDao {
- int insert(OrderPartitionDO orderPartitionDO);
-
- int deleteById(Long id);
-
- int updateById(OrderPartitionDO orderPartitionDO);
-
- OrderPartitionDO getById(Long id);
-
- List list();
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderTopicDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderTopicDao.java
deleted file mode 100644
index 61b5e1c0..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/OrderTopicDao.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OrderTopicDO;
-
-import java.util.List;
-
-public interface OrderTopicDao {
- int insert(OrderTopicDO orderTopicDO);
-
- int deleteById(Long id);
-
- int updateById(OrderTopicDO orderTopicDO);
-
- OrderTopicDO getById(Long id);
-
- List list();
-
- List getByUsername(String username);
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/TopicFavoriteDao.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/TopicFavoriteDao.java
deleted file mode 100644
index 8810364d..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/TopicFavoriteDao.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.TopicFavoriteDO;
-
-import java.util.List;
-
-public interface TopicFavoriteDao {
- int batchAdd(List topicFavoriteDOList);
-
- Boolean batchDelete(List idList);
-
- List getByUserName(String username);
-
- List getByUserNameAndClusterId(String username, Long clusterId);
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/AlarmRuleDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/AlarmRuleDaoImpl.java
deleted file mode 100644
index d7fb6332..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/AlarmRuleDaoImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.AlarmRuleDO;
-import com.xiaojukeji.kafka.manager.common.entity.po.query.AlarmRuleQueryOption;
-import com.xiaojukeji.kafka.manager.dao.AlarmRuleDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @author zengqiao
- * @date 19/6/23
- */
-@Repository("alarmRuleDao")
-public class AlarmRuleDaoImpl implements AlarmRuleDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int insert(AlarmRuleDO alarmRuleDO) {
- return sqlSession.insert("AlarmRuleDao.insert", alarmRuleDO);
- }
-
- @Override
- public int deleteById(Long id) {
- return sqlSession.delete("AlarmRuleDao.deleteById", id);
- }
-
- @Override
- public int updateById(AlarmRuleDO alarmRuleDO) {
- return sqlSession.update("AlarmRuleDao.updateById", alarmRuleDO);
- }
-
- @Override
- public AlarmRuleDO getById(Long id) {
- AlarmRuleQueryOption alarmRuleQueryOption = new AlarmRuleQueryOption();
- alarmRuleQueryOption.setId(id);
- List alarmRuleDOList = sqlSession.selectList("AlarmRuleDao.getByOption", alarmRuleQueryOption);
- if (alarmRuleDOList == null || alarmRuleDOList.isEmpty()) {
- return null;
- }
- return alarmRuleDOList.get(0);
- }
-
- @Override
- public List listAll() {
- return sqlSession.selectList("AlarmRuleDao.getByOption", new AlarmRuleQueryOption());
- }
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/KafkaManagerProperties.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/KafkaManagerProperties.java
deleted file mode 100644
index d762c4ce..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/KafkaManagerProperties.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-@Component
-@ConfigurationProperties("spring.datasource.kafka-manager")
-public class KafkaManagerProperties {
- private String jdbcUrl;
-
- public String getJdbcUrl() {
- return jdbcUrl;
- }
-
- public void setJdbcUrl(String jdbcUrl) {
- this.jdbcUrl = jdbcUrl;
- }
-
- public boolean hasPG() {
- return jdbcUrl.startsWith("jdbc:postgres");
- }
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/MigrationTaskDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/MigrationTaskDaoImpl.java
deleted file mode 100644
index a537c7ae..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/MigrationTaskDaoImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.MigrationTaskDO;
-import com.xiaojukeji.kafka.manager.dao.MigrationTaskDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * migrate topic task dao
- * @author zengqiao_cn@163.com
- * @date 19/4/16
- */
-@Repository("migrationTaskDao")
-public class MigrationTaskDaoImpl implements MigrationTaskDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int addMigrationTask(MigrationTaskDO migrationTaskDO) {
- return sqlSession.insert("MigrationTaskDao.addMigrationTask", migrationTaskDO);
- }
-
- @Override
- public MigrationTaskDO getById(Long id) {
- return sqlSession.selectOne("MigrationTaskDao.getById", id);
- }
-
- @Override
- public List listAll() {
- return sqlSession.selectList("MigrationTaskDao.listAll");
- }
-
- @Override
- public List getByStatus(Integer status) {
- return sqlSession.selectList("MigrationTaskDao.getByStatus", status);
- }
-
- @Override
- public int updateById(Long id, Integer status, Long throttle) {
- Map params = new HashMap<>();
- params.put("id", id);
- params.put("status", status);
- params.put("throttle", throttle);
- return sqlSession.update("MigrationTaskDao.updateById", params);
- }
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OperationHistoryDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OperationHistoryDaoImpl.java
deleted file mode 100644
index 23015526..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OperationHistoryDaoImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OperationHistoryDO;
-import com.xiaojukeji.kafka.manager.dao.OperationHistoryDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-/**
- * @author arthur
- * @date 2017/7/20.
- */
-@Repository("operationHistoryDao")
-public class OperationHistoryDaoImpl implements OperationHistoryDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int insert(OperationHistoryDO operationHistoryDO) {
- return sqlSession.insert("OperationHistoryDao.insert", operationHistoryDO);
- }
-}
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderPartitionDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderPartitionDaoImpl.java
deleted file mode 100644
index 3a3877af..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderPartitionDaoImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OrderPartitionDO;
-import com.xiaojukeji.kafka.manager.dao.OrderPartitionDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @author zengqiao
- * @date 19/6/21
- */
-@Repository("orderPartitionDao")
-public class OrderPartitionDaoImpl implements OrderPartitionDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int insert(OrderPartitionDO orderPartitionDO) {
- return sqlSession.insert("OrderPartitionDao.insert", orderPartitionDO);
- }
-
- @Override
- public int deleteById(Long id) {
- return sqlSession.delete("OrderPartitionDao.deleteById", id);
- }
-
- @Override
- public int updateById(OrderPartitionDO orderPartitionDO) {
- return sqlSession.update("OrderPartitionDao.updateById", orderPartitionDO);
- }
-
- @Override
- public OrderPartitionDO getById(Long id) {
- return sqlSession.selectOne("OrderPartitionDao.getById", id);
- }
-
- @Override
- public List list() {
- return sqlSession.selectList("OrderPartitionDao.list");
- }
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderTopicDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderTopicDaoImpl.java
deleted file mode 100644
index dacd3891..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/OrderTopicDaoImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.OrderTopicDO;
-import com.xiaojukeji.kafka.manager.dao.OrderTopicDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * @author zengqiao
- * @date 19/6/21
- */
-@Repository("orderTopicDao")
-public class OrderTopicDaoImpl implements OrderTopicDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int insert(OrderTopicDO orderTopicDO) {
- return sqlSession.insert("OrderTopicDao.insert", orderTopicDO);
- }
-
- @Override
- public int deleteById(Long id) {
- return sqlSession.delete("OrderTopicDao.deleteById", id);
- }
-
- @Override
- public int updateById(OrderTopicDO orderTopicDO) {
- return sqlSession.update("OrderTopicDao.updateById", orderTopicDO);
- }
-
- @Override
- public OrderTopicDO getById(Long id) {
- return sqlSession.selectOne("OrderTopicDao.getById", id);
- }
-
- @Override
- public List list() {
- return sqlSession.selectList("OrderTopicDao.list");
- }
-
- @Override
- public List getByUsername(String username) {
- return sqlSession.selectList("OrderTopicDao.getByUsername", username);
- }
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicDaoImpl.java
deleted file mode 100644
index 7c5bac5f..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicDaoImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.TopicDO;
-import com.xiaojukeji.kafka.manager.dao.TopicDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author zengqiao
- * @date 19/7/12
- */
-@Repository("TopicDao")
-public class TopicDaoImpl implements TopicDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- @Autowired
- private KafkaManagerProperties kafkaManagerProperties;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int replace(TopicDO topicDO) {
- if (kafkaManagerProperties.hasPG()) {
- return sqlSession.insert("TopicDao.replaceOnPG", topicDO);
- }
- return sqlSession.insert("TopicDao.replace", topicDO);
- }
-
- @Override
- public int deleteById(Long id) {
- return sqlSession.delete("TopicDao.deleteById", id);
- }
-
- @Override
- public int deleteByName(Long clusterId, String topicName) {
- Map params = new HashMap<>();
- params.put("clusterId", clusterId);
- params.put("topicName", topicName);
- return sqlSession.delete("TopicDao.deleteByName", params);
- }
-
- @Override
- public TopicDO getByTopicName(Long clusterId, String topicName) {
- Map params = new HashMap<>();
- params.put("clusterId", clusterId);
- params.put("topicName", topicName);
- return sqlSession.selectOne("TopicDao.getByTopicName", params);
- }
-
- @Override
- public List getByClusterId(Long clusterId) {
- return sqlSession.selectList("TopicDao.getByClusterId", clusterId);
- }
-
- @Override
- public List list() {
- return sqlSession.selectList("TopicDao.list");
- }
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicFavoriteDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicFavoriteDaoImpl.java
deleted file mode 100644
index f8d0c7fc..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicFavoriteDaoImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.po.TopicFavoriteDO;
-import com.xiaojukeji.kafka.manager.dao.TopicFavoriteDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author zengqiao
- * @date 19/6/23
- */
-@Repository("topicFavoriteDao")
-public class TopicFavoriteDaoImpl implements TopicFavoriteDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- @Autowired
- private TransactionTemplate transactionTemplate;
-
- @Autowired
- private KafkaManagerProperties kafkaManagerProperties;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int batchAdd(List topicFavoriteDOList) {
- if (kafkaManagerProperties.hasPG()) {
- return sqlSession.insert("TopicFavoriteDao.batchAddOnPG", topicFavoriteDOList);
- }
- return sqlSession.insert("TopicFavoriteDao.batchAdd", topicFavoriteDOList);
- }
-
- @Override
- public Boolean batchDelete(List idList) {
- return transactionTemplate.execute(new TransactionCallback() {
- @Override
- public Boolean doInTransaction(TransactionStatus status) {
- if (idList == null) {
- return Boolean.TRUE;
- }
- for (Long id: idList) {
- try {
- if (deleteById(id) <= 0) {
- status.setRollbackOnly();
- return Boolean.FALSE;
- }
- } catch (Throwable t) {
- status.setRollbackOnly();
- return Boolean.FALSE;
- }
- }
- return Boolean.TRUE;
- }
- });
- }
-
- private int deleteById(Long id) {
- return sqlSession.delete("TopicFavoriteDao.deleteById", id);
- }
-
- @Override
- public List getByUserName(String username) {
- return sqlSession.selectList("TopicFavoriteDao.getByUserName", username);
- }
-
- @Override
- public List getByUserNameAndClusterId(String username, Long clusterId) {
- Map params = new HashMap<>();
- params.put("username", username);
- params.put("clusterId", clusterId);
- return sqlSession.selectList("TopicFavoriteDao.getByUserNameAndClusterId", params);
- }
-
-}
\ No newline at end of file
diff --git a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicMetricsDaoImpl.java b/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicMetricsDaoImpl.java
deleted file mode 100644
index 8585ced5..00000000
--- a/dao/src/main/java/com/xiaojukeji/kafka/manager/dao/impl/TopicMetricsDaoImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.xiaojukeji.kafka.manager.dao.impl;
-
-import com.xiaojukeji.kafka.manager.common.entity.metrics.TopicMetrics;
-import com.xiaojukeji.kafka.manager.dao.TopicMetricsDao;
-import org.mybatis.spring.SqlSessionTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import java.util.*;
-
-/**
- * dao实现
- * @author tukun
- * @date 2015/11/11.
- */
-@Repository("topicMetricDao")
-public class TopicMetricsDaoImpl implements TopicMetricsDao {
- @Autowired
- private SqlSessionTemplate sqlSession;
-
- public void setSqlSession(SqlSessionTemplate sqlSession) {
- this.sqlSession = sqlSession;
- }
-
- @Override
- public int batchAdd(List topicMetricsList) {
- return sqlSession.insert("TopicMetricsDao.batchAdd", topicMetricsList);
- }
-
- @Override
- public List getTopicMetricsByInterval(Long clusterId,
- String topicName,
- Date startTime,
- Date endTime) {
- Map map = new HashMap<>();
- map.put("clusterId", clusterId);
- map.put("topicName", topicName);
- map.put("startTime", startTime);
- map.put("endTime", endTime);
- return sqlSession.selectList("TopicMetricsDao.getTopicMetricsByInterval", map);
- }
-
- @Override
- public int deleteBeforeTime(Date endTime) {
- return sqlSession.delete("TopicMetricsDao.deleteBeforeTime", endTime);
- }
-}
diff --git a/dao/src/main/resources/mapper/AccountDao.xml b/dao/src/main/resources/mapper/AccountDao.xml
deleted file mode 100644
index feed2727..00000000
--- a/dao/src/main/resources/mapper/AccountDao.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DELETE FROM account WHERE username = #{username}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/AlarmRuleDao.xml b/dao/src/main/resources/mapper/AlarmRuleDao.xml
deleted file mode 100644
index a2e038e2..00000000
--- a/dao/src/main/resources/mapper/AlarmRuleDao.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/BrokerDao.xml b/dao/src/main/resources/mapper/BrokerDao.xml
deleted file mode 100644
index 50af2ef1..00000000
--- a/dao/src/main/resources/mapper/BrokerDao.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- REPLACE broker
- (cluster_id, broker_id, host, port, timestamp, status)
- VALUES
- (#{clusterId}, #{brokerId}, #{host}, #{port}, #{timestamp}, #{status})
-
-
-
- insert into broker
- (cluster_id, broker_id, host, port, timestamp, status)
- values (#{clusterId}, #{brokerId}, #{host}, #{port}, #{timestamp}, #{status})
- on conflict (cluster_id, broker_id) do update set host = excluded.host,
- port = excluded.port,
- timestamp = excluded.timestamp,
- status = excluded.status
-
-
-
- DELETE FROM broker WHERE cluster_id = #{clusterId} AND broker_id = #{brokerId}
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/BrokerMetricsDao.xml b/dao/src/main/resources/mapper/BrokerMetricsDao.xml
deleted file mode 100644
index b932a010..00000000
--- a/dao/src/main/resources/mapper/BrokerMetricsDao.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO broker_metrics (cluster_id, broker_id, bytes_in, bytes_out, messages_in, bytes_rejected, fail_fetch_request, fail_produce_request, fetch_consumer_request, produce_request, request_handler_idl_percent, network_processor_idl_percent, request_queue_size, response_queue_size, log_flush_time, total_time_produce_mean, total_time_produce_99th, total_time_fetch_consumer_mean, total_time_fetch_consumer_99th, gmt_create)
- VALUES
-
- (#{BrokerMetrics.clusterId}, #{BrokerMetrics.brokerId}, #{BrokerMetrics.bytesInPerSec}, #{BrokerMetrics.bytesOutPerSec}, #{BrokerMetrics.messagesInPerSec}, #{BrokerMetrics.bytesRejectedPerSec}, #{BrokerMetrics.failFetchRequestPerSec}, #{BrokerMetrics.failProduceRequestPerSec}, #{BrokerMetrics.fetchConsumerRequestPerSec}, #{BrokerMetrics.produceRequestPerSec}, #{BrokerMetrics.requestHandlerAvgIdlePercent}, #{BrokerMetrics.networkProcessorAvgIdlePercent}, #{BrokerMetrics.requestQueueSize}, #{BrokerMetrics.responseQueueSize}, #{BrokerMetrics.logFlushRateAndTimeMs}, #{BrokerMetrics.totalTimeProduceMean}, #{BrokerMetrics.totalTimeProduce99Th}, #{BrokerMetrics.totalTimeFetchConsumerMean}, #{BrokerMetrics.totalTimeFetchConsumer99Th}, now())
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/ClusterDao.xml b/dao/src/main/resources/mapper/ClusterDao.xml
deleted file mode 100644
index 153dd00b..00000000
--- a/dao/src/main/resources/mapper/ClusterDao.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO cluster (
- cluster_name, zookeeper, bootstrap_servers, kafka_version, alarm_flag,
- security_protocol, sasl_mechanism, sasl_jaas_config
- ) VALUES (
- #{clusterName}, #{zookeeper}, #{bootstrapServers}, #{kafkaVersion}, #{alarmFlag},
- #{securityProtocol}, #{saslMechanism}, #{saslJaasConfig}
- )
-
-
-
- DELETE FROM cluster id = #{id}
-
-
-
- UPDATE cluster SET
- cluster_name=#{clusterName},
- zookeeper=#{zookeeper},
- bootstrap_servers=#{bootstrapServers},
- kafka_version=#{kafkaVersion},
- alarm_flag=#{alarmFlag},
- security_protocol=#{securityProtocol},
- sasl_mechanism=#{saslMechanism},
- sasl_jaas_config=#{saslJaasConfig}
- WHERE id = #{id}
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/ClusterMetricsDao.xml b/dao/src/main/resources/mapper/ClusterMetricsDao.xml
deleted file mode 100644
index 6b726639..00000000
--- a/dao/src/main/resources/mapper/ClusterMetricsDao.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO cluster_metrics (cluster_id, topic_num, partition_num, broker_num, bytes_in, bytes_out, bytes_rejected, messages_in, gmt_create)
- VALUES
-
- (#{ClusterMetricsDO.clusterId}, #{ClusterMetricsDO.topicNum}, #{ClusterMetricsDO.partitionNum}, #{ClusterMetricsDO.brokerNum}, #{ClusterMetricsDO.bytesInPerSec}, #{ClusterMetricsDO.bytesOutPerSec}, #{ClusterMetricsDO.bytesRejectedPerSec}, #{ClusterMetricsDO.messagesInPerSec}, now())
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/MigrationTaskDao.xml b/dao/src/main/resources/mapper/MigrationTaskDao.xml
deleted file mode 100644
index d2f9ce24..00000000
--- a/dao/src/main/resources/mapper/MigrationTaskDao.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT LAST_INSERT_ID()
-
-
-
-
-
-
-
-
-
-
-
- UPDATE migration_task
- SET
- real_throttle=#{throttle},
- status=#{status}
- WHERE id=#{id}
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/OperationHistoryDao.xml b/dao/src/main/resources/mapper/OperationHistoryDao.xml
deleted file mode 100644
index e9870a5c..00000000
--- a/dao/src/main/resources/mapper/OperationHistoryDao.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO operation_history (
- cluster_id, topic_name, operator, operation)
- VALUES (
- #{clusterId}, #{topicName}, #{operator}, #{operation}
- )
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/OrderPartitionDao.xml b/dao/src/main/resources/mapper/OrderPartitionDao.xml
deleted file mode 100644
index 8214865b..00000000
--- a/dao/src/main/resources/mapper/OrderPartitionDao.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO order_partition (
- cluster_id, cluster_name, topic_name, applicant,
- peak_bytes_in, description, order_status)
- VALUES (
- #{clusterId}, #{clusterName}, #{topicName}, #{applicant},
- #{peakBytesIn}, #{description}, #{orderStatus}
- )
-
-
-
- DELETE FROM order_partition WHERE id=#{id}
-
-
-
- UPDATE order_partition SET
- cluster_id=#{clusterId},
- cluster_name=#{clusterName},
- topic_name=#{topicName},
- applicant=#{applicant},
-
-
- partition_num=#{partitionNum},
-
-
-
-
- broker_list=#{brokerList},
-
-
- peak_bytes_in=#{peakBytesIn},
- description=#{description},
- order_status=#{orderStatus},
- approver=#{approver},
- opinion=#{opinion}
- WHERE id=#{id}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/OrderTopicDao.xml b/dao/src/main/resources/mapper/OrderTopicDao.xml
deleted file mode 100644
index 32e50032..00000000
--- a/dao/src/main/resources/mapper/OrderTopicDao.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO order_topic (
- cluster_id, cluster_name, topic_name,
- retention_time, partition_num, replica_num,
- applicant, peak_bytes_in, description, principals
- )
- VALUES (
- #{clusterId}, #{clusterName}, #{topicName},
- #{retentionTime}, #{partitionNum}, #{replicaNum},
- #{applicant}, #{peakBytesIn}, #{description}, #{principals}
- )
-
-
-
- DELETE FROM order_topic WHERE id=#{id}
-
-
-
- UPDATE order_topic SET
- cluster_id=#{clusterId},
- cluster_name=#{clusterName},
- topic_name=#{topicName},
- retention_time=#{retentionTime},
- partition_num=#{partitionNum},
- replica_num=#{replicaNum},
- regions=#{regions},
- brokers=#{brokers},
- applicant=#{applicant},
- principals=#{principals},
- peak_bytes_in=#{peakBytesIn},
- description=#{description},
- order_status=#{orderStatus},
- approver=#{approver},
- opinion=#{opinion}
- WHERE id=#{id}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/RegionDao.xml b/dao/src/main/resources/mapper/RegionDao.xml
deleted file mode 100644
index 7b1c7daa..00000000
--- a/dao/src/main/resources/mapper/RegionDao.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- REPLACE region
- (region_name, cluster_id, broker_list, description, operator)
- VALUES
- (#{regionName}, #{clusterId}, #{brokerList}, #{description}, #{operator})
-
-
-
- insert into region
- (region_name, cluster_id, broker_list, description, operator)
- values (#{regionName}, #{clusterId}, #{brokerList}, #{description}, #{operator})
- on conflict (region_name, cluster_id) do update set broker_list = excluded.broker_list,
- description = excluded.description,
- operator = excluded.operator
-
-
-
- DELETE FROM region WHERE id = #{id}
-
-
-
- UPDATE region SET
- region_name=#{regionName},
- cluster_id=#{clusterId},
- broker_list=#{brokerList},
- description=#{description},
- operator=#{operator},
- status=#{status},
- level=#{level}
- WHERE id=#{id}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/TopicDao.xml b/dao/src/main/resources/mapper/TopicDao.xml
deleted file mode 100644
index b078d4cf..00000000
--- a/dao/src/main/resources/mapper/TopicDao.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- REPLACE topic
- (cluster_id, topic_name, principals, description, status)
- VALUES
- (#{clusterId}, #{topicName}, #{principals}, #{description}, #{status})
-
-
-
- insert into topic
- (cluster_id, topic_name, principals, description, status)
- values (#{clusterId}, #{topicName}, #{principals}, #{description}, #{status})
- on conflict (cluster_id, topic_name) do update set principals = excluded.principals,
- description = excluded.description,
- status = excluded.status
-
-
-
- DELETE FROM topic WHERE id = #{id}
-
-
-
- DELETE FROM topic WHERE cluster_id = #{clusterId} and topic_name = #{topicName}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/TopicFavoriteDao.xml b/dao/src/main/resources/mapper/TopicFavoriteDao.xml
deleted file mode 100644
index 218a714c..00000000
--- a/dao/src/main/resources/mapper/TopicFavoriteDao.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- REPLACE topic_favorite (cluster_id, topic_name, username)
- VALUES
-
- (#{TopicFavoriteDO.clusterId}, #{TopicFavoriteDO.topicName}, #{TopicFavoriteDO.username})
-
-
-
-
- insert into topic_favorite (cluster_id, topic_name, username)
- values
-
- (#{TopicFavoriteDO.clusterId}, #{TopicFavoriteDO.topicName}, #{TopicFavoriteDO.username})
-
- on conflict (cluster_id, topic_name, username) do update set gmt_modify = now();
-
-
-
- DELETE FROM topic_favorite WHERE id=#{id}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/mapper/TopicMetricsDao.xml b/dao/src/main/resources/mapper/TopicMetricsDao.xml
deleted file mode 100644
index ece8f826..00000000
--- a/dao/src/main/resources/mapper/TopicMetricsDao.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INSERT INTO topic_metrics
- (cluster_id, topic_name, messages_in, bytes_in, bytes_out, bytes_rejected, total_produce_requests, gmt_create)
- values
-
- (#{TopicMetrics.clusterId}, #{TopicMetrics.topicName}, #{TopicMetrics.messagesInPerSec}, #{TopicMetrics.bytesInPerSec}, #{TopicMetrics.bytesOutPerSec}, #{TopicMetrics.bytesRejectedPerSec}, #{TopicMetrics.totalProduceRequestsPerSec}, now())
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dao/src/main/resources/spring-dao.xml b/dao/src/main/resources/spring-dao.xml
deleted file mode 100644
index 8bb03753..00000000
--- a/dao/src/main/resources/spring-dao.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/assets/images/kafka_manager_cn_guide/admin_add_cluster.jpg b/doc/assets/images/kafka_manager_cn_guide/admin_add_cluster.jpg
deleted file mode 100644
index 20acd79c..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/admin_add_cluster.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/admin_cluster_broker_detail.jpg b/doc/assets/images/kafka_manager_cn_guide/admin_cluster_broker_detail.jpg
deleted file mode 100644
index 8b69f47b..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/admin_cluster_broker_detail.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/admin_cluster_details.jpg b/doc/assets/images/kafka_manager_cn_guide/admin_cluster_details.jpg
deleted file mode 100644
index 8b1f5025..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/admin_cluster_details.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/admin_manager_account.jpg b/doc/assets/images/kafka_manager_cn_guide/admin_manager_account.jpg
deleted file mode 100644
index 52ac59a1..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/admin_manager_account.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/admin_order.jpg b/doc/assets/images/kafka_manager_cn_guide/admin_order.jpg
deleted file mode 100644
index ad857e3b..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/admin_order.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/my_order_list.jpg b/doc/assets/images/kafka_manager_cn_guide/my_order_list.jpg
deleted file mode 100644
index 8583a359..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/my_order_list.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/normal_create_alarm_rule.jpg b/doc/assets/images/kafka_manager_cn_guide/normal_create_alarm_rule.jpg
deleted file mode 100644
index f2cc38b4..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/normal_create_alarm_rule.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/normal_modify_password.jpg b/doc/assets/images/kafka_manager_cn_guide/normal_modify_password.jpg
deleted file mode 100644
index 0fd68e98..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/normal_modify_password.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/normal_reset_consume_offset.jpg b/doc/assets/images/kafka_manager_cn_guide/normal_reset_consume_offset.jpg
deleted file mode 100644
index 0f1c41c6..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/normal_reset_consume_offset.jpg and /dev/null differ
diff --git a/doc/assets/images/kafka_manager_cn_guide/normal_topic_detail.jpg b/doc/assets/images/kafka_manager_cn_guide/normal_topic_detail.jpg
deleted file mode 100644
index 99df01c3..00000000
Binary files a/doc/assets/images/kafka_manager_cn_guide/normal_topic_detail.jpg and /dev/null differ
diff --git a/doc/create_mysql_table.sql b/doc/create_mysql_table.sql
deleted file mode 100644
index 9a66ac67..00000000
--- a/doc/create_mysql_table.sql
+++ /dev/null
@@ -1,243 +0,0 @@
-CREATE DATABASE IF NOT EXISTS `kafka_manager`;
-
-USE `kafka_manager`;
-
-CREATE TABLE `account` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `username` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户名',
- `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码',
- `role` int(16) NOT NULL DEFAULT '0' COMMENT '角色类型, 0:普通用户',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_username` (`username`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账号表';
-INSERT INTO account(username, password, role) VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 2);
-
-
-CREATE TABLE `alarm_rule` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `alarm_name` varchar(128) NOT NULL DEFAULT '' COMMENT '告警名字',
- `strategy_expressions` text COMMENT '表达式',
- `strategy_filters` text COMMENT '过滤条件',
- `strategy_actions` text COMMENT '响应',
- `principals` varchar(512) NOT NULL DEFAULT '' COMMENT '负责人',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '-1:逻辑删除, 0:关闭, 1:正常',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_alarm_name` (`alarm_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='告警规则表';
-
-
-CREATE TABLE `broker` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerID',
- `host` varchar(128) NOT NULL DEFAULT '' COMMENT 'Broker主机名',
- `port` int(32) NOT NULL DEFAULT '-1' COMMENT 'Broker端口',
- `timestamp` bigint(128) NOT NULL DEFAULT '-1' COMMENT '启动时间',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态0有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_broker_id` (`cluster_id`,`broker_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Broker信息表';
-
-
-CREATE TABLE `broker_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerID',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流入',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流出',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒被拒绝字节数',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消息数流入',
- `fail_fetch_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消费失败数',
- `fail_produce_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒失败生产数',
- `fetch_consumer_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消费请求数',
- `produce_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒生产数',
- `request_handler_idl_percent` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '请求处理器繁忙百分比',
- `network_processor_idl_percent` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '网络处理器繁忙百分比',
- `request_queue_size` bigint(20) NOT NULL DEFAULT '0' COMMENT '请求列表大小',
- `response_queue_size` bigint(20) NOT NULL DEFAULT '0' COMMENT '响应列表大小',
- `log_flush_time` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '刷日志时间',
- `total_time_produce_mean` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'produce请求处理总时间-平均值',
- `total_time_produce_99th` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'produce请求处理总时间-99分位',
- `total_time_fetch_consumer_mean` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'fetch请求总时间-平均值',
- `total_time_fetch_consumer_99th` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'fetch请求总时间-99分位',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_broker_id_gmt_create` (`cluster_id`,`broker_id`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='BrokerMetric信息表';
-
-
-CREATE TABLE `cluster` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `zookeeper` varchar(512) NOT NULL DEFAULT '' COMMENT 'ZK地址',
- `bootstrap_servers` varchar(512) NOT NULL DEFAULT '' COMMENT 'Server地址',
- `kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'Kafka版本',
- `alarm_flag` int(4) NOT NULL DEFAULT '0' COMMENT '0:不开启告警, 1开启告警',
- `security_protocol` varchar(512) NOT NULL DEFAULT '' COMMENT '安全协议',
- `sasl_mechanism` varchar(512) NOT NULL DEFAULT '' COMMENT '安全机制',
- `sasl_jaas_config` varchar(512) NOT NULL DEFAULT '' COMMENT 'Jaas配置',
- `status` int(4) NOT NULL DEFAULT '0' COMMENT '删除标记, 0表示未删除, -1表示删除',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_name` (`cluster_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cluster表';
-
-
-CREATE TABLE `cluster_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群ID',
- `topic_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Topic数',
- `partition_num` int(11) NOT NULL DEFAULT '0' COMMENT '分区数',
- `broker_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Broker数',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒流入(B)',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒流出(B)',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒拒绝(B)',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消息数(条)',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_gmt_create` (`cluster_id`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ClusterMetrics信息';
-
-
-CREATE TABLE `controller` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerId',
- `host` varchar(256) NOT NULL DEFAULT '' COMMENT '主机名',
- `timestamp` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'Controller变更时间',
- `version` int(11) NOT NULL DEFAULT '-1' COMMENT 'Controller格式版本',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_broker_id_timestamp` (`cluster_id`,`broker_id`,`timestamp`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Controller历史变更记录表';
-
-CREATE TABLE `migration_task` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `reassignment_json` text COMMENT '任务参数',
- `real_throttle` bigint(20) NOT NULL DEFAULT '0' COMMENT '实际限流值(B/s)',
- `operator` varchar(128) NOT NULL DEFAULT '' COMMENT '操作人',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '备注说明',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '任务状态',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '任务创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '任务修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic迁移信息';
-
-CREATE TABLE `operation_history` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `operator` varchar(128) NOT NULL DEFAULT '' COMMENT '操作人',
- `operation` varchar(256) NOT NULL DEFAULT '' COMMENT '操作描述',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作记录表';
-
-
-CREATE TABLE `order_partition` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表, 逗号分割',
- `partition_num` int(11) NOT NULL DEFAULT 0 COMMENT '新增分区数',
- `applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
- `peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流量',
- `description` text COMMENT '备注信息',
- `order_status` int(16) NOT NULL DEFAULT '0' COMMENT '工单状态',
- `approver` varchar(128) NOT NULL DEFAULT '' COMMENT '审批人',
- `opinion` varchar(256) NOT NULL DEFAULT '' COMMENT '审批意见',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态,0标识有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分区申请工单';
-
-CREATE TABLE `order_topic` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `retention_time` bigint(20) NOT NULL DEFAULT '-1' COMMENT '保留时间(ms)',
- `partition_num` int(16) NOT NULL DEFAULT '-1' COMMENT '分区数',
- `replica_num` int(16) NOT NULL DEFAULT '-1' COMMENT '副本数',
- `regions` varchar(128) NOT NULL DEFAULT '' COMMENT 'RegionId列表',
- `brokers` varchar(128) NOT NULL DEFAULT '' COMMENT 'Broker列表',
- `peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流入流量(KB)',
- `applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
- `principals` varchar(256) NOT NULL DEFAULT '' COMMENT '负责人',
- `description` text COMMENT '备注信息',
- `order_status` int(16) NOT NULL DEFAULT '0' COMMENT '工单状态',
- `approver` varchar(128) NOT NULL DEFAULT '' COMMENT '审批人',
- `opinion` varchar(256) NOT NULL DEFAULT '' COMMENT '审批意见',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '状态,0标识有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic申请工单';
-
-CREATE TABLE `region` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `region_name` varchar(128) NOT NULL DEFAULT '' COMMENT 'Region名称',
- `broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表',
- `level` int(16) NOT NULL DEFAULT '0' COMMENT 'Region重要等级, 0级普通, 1极重要,2级极重要',
- `operator` varchar(45) NOT NULL DEFAULT '' COMMENT '操作人',
- `description` text COMMENT '备注说明',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态,0正常,-1废弃,1容量已满',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_region_name` (`cluster_id`,`region_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Region信息表';
-
-CREATE TABLE `topic` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `applicant` varchar(256) NOT NULL DEFAULT '' COMMENT '申请人',
- `principals` varchar(256) NOT NULL DEFAULT '' COMMENT '负责人',
- `description` text COMMENT '备注信息',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_topic_name` (`cluster_id`,`topic_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic信息表';
-
-
-CREATE TABLE `topic_favorite` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
- `username` varchar(64) NOT NULL DEFAULT '' COMMENT '用户名',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '删除标记, 0表示未删除, -1表示删除',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_username_cluster_id_topic_name` (`username`,`cluster_id`,`topic_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户收藏的Topic表';
-
-CREATE TABLE `topic_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒进入消息条数',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流入',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流出',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒拒绝字节数',
- `total_produce_requests` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒请求数',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_topic_name_gmt_create` (`cluster_id`,`topic_name`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='TopicMetrics表';
\ No newline at end of file
diff --git a/doc/create_postgresql_table.sql b/doc/create_postgresql_table.sql
deleted file mode 100644
index 6d03c005..00000000
--- a/doc/create_postgresql_table.sql
+++ /dev/null
@@ -1,325 +0,0 @@
--- CREATE DATABASE kafka_manager;
--- \c kafka_manager;
-SET TIME ZONE 'Asia/Chongqing';
-SET CLIENT_ENCODING TO 'UTF-8';
-
-CREATE OR REPLACE FUNCTION on_update_timestamp() RETURNS TRIGGER AS
-$$
-BEGIN
- new.gmt_modify = current_timestamp;
- return new;
-END;
-$$ LANGUAGE plpgsql;
-
--- 账号表
-CREATE TABLE account
-(
- id bigserial NOT NULL, -- 'ID',
- username varchar(64) NOT NULL UNIQUE DEFAULT '', -- '用户名',
- password varchar(128) NOT NULL DEFAULT '', -- '密码',
- role int NOT NULL DEFAULT 0, -- '角色类型, 0:普通用户',
- status int NOT NULL DEFAULT 0, -- '0标识使用中,-1标识已废弃',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT account_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX account_uniq_username ON account (username);
-INSERT INTO account(username, password, role)
-VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 2);
-CREATE TRIGGER account_trig_gmt_modify
- BEFORE UPDATE
- ON account
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- 告警规则表
-CREATE TABLE alarm_rule
-(
- id bigserial, -- '自增ID',
- alarm_name varchar(128) NOT NULL DEFAULT '', -- '告警名字',
- strategy_expressions text, -- '表达式',
- strategy_filters text, -- '过滤条件',
- strategy_actions text, -- '响应',
- principals varchar(512) NOT NULL DEFAULT '', -- '负责人',
- status int2 NOT NULL DEFAULT 1, -- '-1:逻辑删除, 0:关闭, 1:正常',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT alarm_rule_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX alarm_rule_uniq_alarm_name ON alarm_rule (alarm_name);
-CREATE TRIGGER alarm_rule_trig_gmt_modify
- BEFORE UPDATE
- ON alarm_rule
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- Broker信息表
-CREATE TABLE broker
-(
- id bigserial, -- 'id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- broker_id int NOT NULL DEFAULT '-1', -- 'BrokerID',
- host varchar(128) NOT NULL DEFAULT '', -- 'Broker主机名',
- port int NOT NULL DEFAULT '-1', -- 'Broker端口',
- timestamp bigint NOT NULL DEFAULT '-1', -- '启动时间',
- status int NOT NULL DEFAULT '0', -- '状态0有效,-1无效',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT broker_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX broker_uniq_cluster_id_broker_id ON broker (cluster_id, broker_id);
-CREATE TRIGGER broker_trig_gmt_modify
- BEFORE UPDATE
- ON broker
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- BrokerMetric信息表
-CREATE TABLE broker_metrics
-(
- id bigserial, -- '自增id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- broker_id int NOT NULL DEFAULT '-1', -- 'BrokerID',
- bytes_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒字节流入',
- bytes_out decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒字节流出',
- bytes_rejected decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒被拒绝字节数',
- messages_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒消息数流入',
- fail_fetch_request decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒消费失败数',
- fail_produce_request decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒失败生产数',
- fetch_consumer_request decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒消费请求数',
- produce_request decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒生产数',
- request_handler_idl_percent decimal(53, 2) NOT NULL DEFAULT '0.00', -- '请求处理器繁忙百分比',
- network_processor_idl_percent decimal(53, 2) NOT NULL DEFAULT '0.00', -- '网络处理器繁忙百分比',
- request_queue_size bigint NOT NULL DEFAULT '0', -- '请求列表大小',
- response_queue_size bigint NOT NULL DEFAULT '0', -- '响应列表大小',
- log_flush_time decimal(53, 2) NOT NULL DEFAULT '0.00', -- '刷日志时间',
- total_time_produce_mean decimal(53, 2) NOT NULL DEFAULT '0.00', -- 'produce请求处理总时间-平均值',
- total_time_produce_99th decimal(53, 2) NOT NULL DEFAULT '0.00', -- 'produce请求处理总时间-99分位',
- total_time_fetch_consumer_mean decimal(53, 2) NOT NULL DEFAULT '0.00', -- 'fetch请求总时间-平均值',
- total_time_fetch_consumer_99th decimal(53, 2) NOT NULL DEFAULT '0.00', -- 'fetch请求总时间-99分位',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- CONSTRAINT broker_metrics_pk PRIMARY KEY (id)
-);
-CREATE INDEX broker_metrics_idx_cluster_id_broker_id_gmt_create ON broker_metrics (cluster_id, broker_id, gmt_create);
-
--- Cluster表
-CREATE TABLE cluster
-(
- id bigserial, -- '集群ID',
- cluster_name varchar(128) NOT NULL DEFAULT '', -- '集群名称',
- zookeeper varchar(512) NOT NULL DEFAULT '', -- 'ZK地址',
- bootstrap_servers varchar(512) NOT NULL DEFAULT '', -- 'Server地址',
- kafka_version varchar(32) NOT NULL DEFAULT '', -- 'Kafka版本',
- alarm_flag int2 NOT NULL DEFAULT '0', -- '0:不开启告警, 1开启告警',
- security_protocol varchar(512) NOT NULL DEFAULT '', -- '安全协议',
- sasl_mechanism varchar(512) NOT NULL DEFAULT '', -- '安全机制',
- sasl_jaas_config varchar(512) NOT NULL DEFAULT '', -- 'Jaas配置',
- status int2 NOT NULL DEFAULT '0', -- '删除标记, 0表示未删除, -1表示删除',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT cluster_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX cluster_uniq_cluster_name ON cluster (cluster_name);
-CREATE TRIGGER cluster_trig_gmt_modify
- BEFORE UPDATE
- ON cluster
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- ClusterMetrics信息
-CREATE TABLE cluster_metrics
-(
- id bigserial, -- '自增id',
- cluster_id bigint NOT NULL DEFAULT '0', -- '集群ID',
- topic_num int NOT NULL DEFAULT '0', -- 'Topic数',
- partition_num int NOT NULL DEFAULT '0', -- '分区数',
- broker_num int NOT NULL DEFAULT '0', -- 'Broker数',
- bytes_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒流入(B)',
- bytes_out decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒流出(B)',
- bytes_rejected decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒拒绝(B)',
- messages_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒消息数(条)',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- CONSTRAINT cluster_metrics_pk PRIMARY KEY (id)
-);
-CREATE INDEX cluster_metrics_idx_cluster_id_gmt_create ON cluster_metrics (cluster_id, gmt_create);
-
--- Controller历史变更记录表
-CREATE TABLE controller
-(
- id bigserial, -- '自增id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- broker_id int NOT NULL DEFAULT '-1', -- 'BrokerId',
- host varchar(256) NOT NULL DEFAULT '', -- '主机名',
- timestamp bigint NOT NULL DEFAULT '-1', -- 'Controller变更时间',
- version int NOT NULL DEFAULT '-1', -- 'Controller格式版本',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- CONSTRAINT controller_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX controller_uniq_cluster_id_broker_id_timestamp ON controller (cluster_id, broker_id, timestamp);
-
--- Topic迁移信息
-CREATE TABLE migration_task
-(
- id bigserial, -- '自增id',
- cluster_id bigint NOT NULL DEFAULT '0', -- '集群ID',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- reassignment_json text, -- '任务参数',
- real_throttle bigint NOT NULL DEFAULT '0', -- '实际限流值(B/s)',
- operator varchar(128) NOT NULL DEFAULT '', -- '操作人',
- description varchar(256) NOT NULL DEFAULT '', -- '备注说明',
- status int NOT NULL DEFAULT '0', -- '任务状态',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '任务创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '任务修改时间',
- CONSTRAINT migration_task_pk PRIMARY KEY (id)
-);
-CREATE TRIGGER migration_task_trig_gmt_modify
- BEFORE UPDATE
- ON migration_task
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
-CREATE TABLE operation_history
-(
- id bigserial, -- 'id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- operator varchar(128) NOT NULL DEFAULT '', -- '操作人',
- operation varchar(256) NOT NULL DEFAULT '', -- '操作描述',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- PRIMARY KEY (id)
-);
---='操作记录表';
-
--- 分区申请工单
-CREATE TABLE order_partition
-(
- id bigserial, -- 'id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- cluster_name varchar(128) NOT NULL DEFAULT '', -- '集群名称',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- applicant varchar(128) NOT NULL DEFAULT '', -- '申请人',
- partition_num int NOT NULL DEFAULT '0', -- '分区数',
- broker_list varchar(128) NOT NULL DEFAULT '', -- 'Broker列表',
- peak_bytes_in bigint NOT NULL DEFAULT '0', -- '峰值流量',
- description text, -- '备注信息',
- order_status int NOT NULL DEFAULT '0', -- '工单状态',
- approver varchar(128) NOT NULL DEFAULT '', -- '审批人',
- opinion varchar(256) NOT NULL DEFAULT '', -- '审批意见',
- status int NOT NULL DEFAULT '0', -- '状态,0标识有效,-1无效',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT order_partition_pk PRIMARY KEY (id)
-);
-CREATE TRIGGER order_partition_trig_gmt_modify
- BEFORE UPDATE
- ON order_partition
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- Topic申请工单
-CREATE TABLE order_topic
-(
- id bigserial, -- 'ID',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- cluster_name varchar(128) NOT NULL DEFAULT '', -- '集群名称',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- retention_time bigint NOT NULL DEFAULT '-1', -- '保留时间(ms)',
- partition_num int NOT NULL DEFAULT '-1', -- '分区数',
- replica_num int NOT NULL DEFAULT '-1', -- '副本数',
- regions varchar(128) NOT NULL DEFAULT '', -- 'RegionId列表',
- brokers varchar(128) NOT NULL DEFAULT '', -- 'Broker列表',
- peak_bytes_in bigint NOT NULL DEFAULT '0', -- '峰值流入流量(KB)',
- applicant varchar(128) NOT NULL DEFAULT '', -- '申请人',
- principals varchar(256) NOT NULL DEFAULT '', -- '负责人',
- description text, -- '备注信息',
- order_status int NOT NULL DEFAULT '0', -- '工单状态',
- approver varchar(128) NOT NULL DEFAULT '', -- '审批人',
- opinion varchar(256) NOT NULL DEFAULT '', -- '审批意见',
- status int NOT NULL DEFAULT '0', -- '状态,0标识有效,-1无效',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT order_topic_pk PRIMARY KEY (id)
-);
-CREATE TRIGGER order_topic_trig_gmt_modify
- BEFORE UPDATE
- ON order_topic
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- Region信息表
-CREATE TABLE region
-(
- id bigserial, -- 'id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- region_name varchar(128) NOT NULL DEFAULT '', -- 'Region名称',
- broker_list varchar(256) NOT NULL DEFAULT '', -- 'Broker列表',
- level int NOT NULL DEFAULT '0', -- 'Region重要等级, 0级普通, 1极重要,2级极重要',
- operator varchar(45) NOT NULL DEFAULT '', -- '操作人',
- description text, -- '备注说明',
- status int NOT NULL DEFAULT '0', -- '状态,0正常,-1废弃,1容量已满',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT region_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX region_uniq_cluster_id_region_name ON region (cluster_id, region_name);
-CREATE TRIGGER region_trig_gmt_modify
- BEFORE UPDATE
- ON region
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- Topic信息表
-CREATE TABLE topic
-(
- id bigserial, -- 'ID',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- applicant varchar(256) NOT NULL DEFAULT '', -- '申请人',
- principals varchar(256) NOT NULL DEFAULT '', -- '负责人',
- description text, -- '备注信息',
- status int NOT NULL DEFAULT '0', -- '0标识使用中,-1标识已废弃',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT topic_pk PRIMARY KEY (id)
-); --='';
-CREATE UNIQUE INDEX topic_uniq_cluster_id_topic_name ON topic (cluster_id, topic_name);
-CREATE TRIGGER topic_trig_gmt_modify
- BEFORE UPDATE
- ON topic
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- 用户收藏的Topic表
-CREATE TABLE topic_favorite
-(
- id bigserial, -- '自增Id',
- username varchar(64) NOT NULL DEFAULT '', -- '用户名',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- status int NOT NULL DEFAULT '0', -- '删除标记, 0表示未删除, -1表示删除',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- gmt_modify timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '修改时间',
- CONSTRAINT topic_favorite_pk PRIMARY KEY (id)
-);
-CREATE UNIQUE INDEX topic_favorite_uniq_username_cluster_id_topic_name ON topic_favorite (username, cluster_id, topic_name);
-CREATE TRIGGER topic_favorite_trig_gmt_modify
- BEFORE UPDATE
- ON topic_favorite
- FOR EACH ROW
-EXECUTE PROCEDURE on_update_timestamp();
-
--- TopicMetrics表
-CREATE TABLE topic_metrics
-(
- id bigserial, -- '自增id',
- cluster_id bigint NOT NULL DEFAULT '-1', -- '集群ID',
- topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
- messages_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒进入消息条数',
- bytes_in decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒字节流入',
- bytes_out decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒字节流出',
- bytes_rejected decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒拒绝字节数',
- total_produce_requests decimal(53, 2) NOT NULL DEFAULT '0.00', -- '每秒请求数',
- gmt_create timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间',
- CONSTRAINT topic_metrics_pk PRIMARY KEY (id)
-);
-CREATE INDEX topic_metrics_idx_cluster_id_topic_name_gmt_create ON topic_metrics (cluster_id, topic_name, gmt_create);
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 10c69adf..00000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-version: '2'
-services:
- mysqldbserver:
- container_name: mysqldbserver
- image: mysql:5.7
- build:
- context: .
- dockerfile: docker/mysql/Dockerfile
- ports:
- - "3306:3306"
- command: [
- 'mysqld',
- '--character-set-server=utf8',
- '--collation-server=utf8_general_ci',
- '--default-time-zone=+8:00'
- ]
- environment:
- MYSQL_ROOT_PASSWORD: 12345678
- MYSQL_DATABASE: kafka_manager
- MYSQL_USER: admin
- MYSQL_PASSWORD: 12345678
- restart: always
- kafka-manager-web:
- container_name: kafka-manager-web
- build:
- context: .
- dockerfile: Dockerfile
- ports:
- - "8080:8080"
- links:
- - mysqldbserver
- restart: always
\ No newline at end of file
diff --git a/docker/kafka-manager/Dockerfile b/docker/kafka-manager/Dockerfile
deleted file mode 100644
index de8d2f25..00000000
--- a/docker/kafka-manager/Dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-FROM java:8
-MAINTAINER xuzhengxi
-ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
-ADD ../../web/target/kafka-manager-web-1.1.0-SNAPSHOT.jar kafka-manager-web.jar
-ADD ./application.yml application.yml
-ENTRYPOINT ["java","-jar","/kafka-manager-web.jar","--spring.config.location=./application.yml"]
-EXPOSE 8080
\ No newline at end of file
diff --git a/docker/kafka-manager/application-standalone.yml b/docker/kafka-manager/application-standalone.yml
deleted file mode 100644
index 581170bc..00000000
--- a/docker/kafka-manager/application-standalone.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-server:
- port: 8080
- tomcat:
- accept-count: 100
- max-connections: 1000
- max-threads: 20
- min-spare-threads: 20
-
-spring:
- application:
- name: kafkamanager
- datasource:
- kafka-manager:
- jdbc-url: jdbc:mysql://mysqldbserver:3306/kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8
- username: admin
- password: 12345678
- driver-class-name: org.mariadb.jdbc.Driver
- main:
- allow-bean-definition-overriding: true
-
- profiles:
- active: dev
-
-logging:
- config: classpath:logback-spring.xml
-
-# kafka监控
-kafka-monitor:
- enabled: true
- notify-kafka:
- cluster-id: 95
- topic-name: kmo_monitor
diff --git a/docker/kafka-manager/application.yml b/docker/kafka-manager/application.yml
deleted file mode 100644
index 581170bc..00000000
--- a/docker/kafka-manager/application.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-server:
- port: 8080
- tomcat:
- accept-count: 100
- max-connections: 1000
- max-threads: 20
- min-spare-threads: 20
-
-spring:
- application:
- name: kafkamanager
- datasource:
- kafka-manager:
- jdbc-url: jdbc:mysql://mysqldbserver:3306/kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8
- username: admin
- password: 12345678
- driver-class-name: org.mariadb.jdbc.Driver
- main:
- allow-bean-definition-overriding: true
-
- profiles:
- active: dev
-
-logging:
- config: classpath:logback-spring.xml
-
-# kafka监控
-kafka-monitor:
- enabled: true
- notify-kafka:
- cluster-id: 95
- topic-name: kmo_monitor
diff --git a/docker/mysql/Dockerfile b/docker/mysql/Dockerfile
deleted file mode 100644
index b2e4afed..00000000
--- a/docker/mysql/Dockerfile
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM mysql:5.7
-MAINTAINER xuzhengxi
-COPY ./docker/mysql/create_mysql_table.sql /docker-entrypoint-initdb.d/
\ No newline at end of file
diff --git a/docker/mysql/create_mysql_table.sql b/docker/mysql/create_mysql_table.sql
deleted file mode 100644
index 9a66ac67..00000000
--- a/docker/mysql/create_mysql_table.sql
+++ /dev/null
@@ -1,243 +0,0 @@
-CREATE DATABASE IF NOT EXISTS `kafka_manager`;
-
-USE `kafka_manager`;
-
-CREATE TABLE `account` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `username` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户名',
- `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码',
- `role` int(16) NOT NULL DEFAULT '0' COMMENT '角色类型, 0:普通用户',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_username` (`username`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账号表';
-INSERT INTO account(username, password, role) VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 2);
-
-
-CREATE TABLE `alarm_rule` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `alarm_name` varchar(128) NOT NULL DEFAULT '' COMMENT '告警名字',
- `strategy_expressions` text COMMENT '表达式',
- `strategy_filters` text COMMENT '过滤条件',
- `strategy_actions` text COMMENT '响应',
- `principals` varchar(512) NOT NULL DEFAULT '' COMMENT '负责人',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '-1:逻辑删除, 0:关闭, 1:正常',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_alarm_name` (`alarm_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='告警规则表';
-
-
-CREATE TABLE `broker` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerID',
- `host` varchar(128) NOT NULL DEFAULT '' COMMENT 'Broker主机名',
- `port` int(32) NOT NULL DEFAULT '-1' COMMENT 'Broker端口',
- `timestamp` bigint(128) NOT NULL DEFAULT '-1' COMMENT '启动时间',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态0有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_broker_id` (`cluster_id`,`broker_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Broker信息表';
-
-
-CREATE TABLE `broker_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerID',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流入',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流出',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒被拒绝字节数',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消息数流入',
- `fail_fetch_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消费失败数',
- `fail_produce_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒失败生产数',
- `fetch_consumer_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消费请求数',
- `produce_request` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒生产数',
- `request_handler_idl_percent` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '请求处理器繁忙百分比',
- `network_processor_idl_percent` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '网络处理器繁忙百分比',
- `request_queue_size` bigint(20) NOT NULL DEFAULT '0' COMMENT '请求列表大小',
- `response_queue_size` bigint(20) NOT NULL DEFAULT '0' COMMENT '响应列表大小',
- `log_flush_time` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '刷日志时间',
- `total_time_produce_mean` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'produce请求处理总时间-平均值',
- `total_time_produce_99th` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'produce请求处理总时间-99分位',
- `total_time_fetch_consumer_mean` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'fetch请求总时间-平均值',
- `total_time_fetch_consumer_99th` double(53,2) NOT NULL DEFAULT '0.00' COMMENT 'fetch请求总时间-99分位',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_broker_id_gmt_create` (`cluster_id`,`broker_id`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='BrokerMetric信息表';
-
-
-CREATE TABLE `cluster` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `zookeeper` varchar(512) NOT NULL DEFAULT '' COMMENT 'ZK地址',
- `bootstrap_servers` varchar(512) NOT NULL DEFAULT '' COMMENT 'Server地址',
- `kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'Kafka版本',
- `alarm_flag` int(4) NOT NULL DEFAULT '0' COMMENT '0:不开启告警, 1开启告警',
- `security_protocol` varchar(512) NOT NULL DEFAULT '' COMMENT '安全协议',
- `sasl_mechanism` varchar(512) NOT NULL DEFAULT '' COMMENT '安全机制',
- `sasl_jaas_config` varchar(512) NOT NULL DEFAULT '' COMMENT 'Jaas配置',
- `status` int(4) NOT NULL DEFAULT '0' COMMENT '删除标记, 0表示未删除, -1表示删除',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_name` (`cluster_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cluster表';
-
-
-CREATE TABLE `cluster_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群ID',
- `topic_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Topic数',
- `partition_num` int(11) NOT NULL DEFAULT '0' COMMENT '分区数',
- `broker_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Broker数',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒流入(B)',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒流出(B)',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒拒绝(B)',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消息数(条)',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_gmt_create` (`cluster_id`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ClusterMetrics信息';
-
-
-CREATE TABLE `controller` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `broker_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'BrokerId',
- `host` varchar(256) NOT NULL DEFAULT '' COMMENT '主机名',
- `timestamp` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'Controller变更时间',
- `version` int(11) NOT NULL DEFAULT '-1' COMMENT 'Controller格式版本',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_broker_id_timestamp` (`cluster_id`,`broker_id`,`timestamp`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Controller历史变更记录表';
-
-CREATE TABLE `migration_task` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `reassignment_json` text COMMENT '任务参数',
- `real_throttle` bigint(20) NOT NULL DEFAULT '0' COMMENT '实际限流值(B/s)',
- `operator` varchar(128) NOT NULL DEFAULT '' COMMENT '操作人',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '备注说明',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '任务状态',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '任务创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '任务修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic迁移信息';
-
-CREATE TABLE `operation_history` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `operator` varchar(128) NOT NULL DEFAULT '' COMMENT '操作人',
- `operation` varchar(256) NOT NULL DEFAULT '' COMMENT '操作描述',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作记录表';
-
-
-CREATE TABLE `order_partition` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表, 逗号分割',
- `partition_num` int(11) NOT NULL DEFAULT 0 COMMENT '新增分区数',
- `applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
- `peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流量',
- `description` text COMMENT '备注信息',
- `order_status` int(16) NOT NULL DEFAULT '0' COMMENT '工单状态',
- `approver` varchar(128) NOT NULL DEFAULT '' COMMENT '审批人',
- `opinion` varchar(256) NOT NULL DEFAULT '' COMMENT '审批意见',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态,0标识有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分区申请工单';
-
-CREATE TABLE `order_topic` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `retention_time` bigint(20) NOT NULL DEFAULT '-1' COMMENT '保留时间(ms)',
- `partition_num` int(16) NOT NULL DEFAULT '-1' COMMENT '分区数',
- `replica_num` int(16) NOT NULL DEFAULT '-1' COMMENT '副本数',
- `regions` varchar(128) NOT NULL DEFAULT '' COMMENT 'RegionId列表',
- `brokers` varchar(128) NOT NULL DEFAULT '' COMMENT 'Broker列表',
- `peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流入流量(KB)',
- `applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
- `principals` varchar(256) NOT NULL DEFAULT '' COMMENT '负责人',
- `description` text COMMENT '备注信息',
- `order_status` int(16) NOT NULL DEFAULT '0' COMMENT '工单状态',
- `approver` varchar(128) NOT NULL DEFAULT '' COMMENT '审批人',
- `opinion` varchar(256) NOT NULL DEFAULT '' COMMENT '审批意见',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '状态,0标识有效,-1无效',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic申请工单';
-
-CREATE TABLE `region` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `region_name` varchar(128) NOT NULL DEFAULT '' COMMENT 'Region名称',
- `broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表',
- `level` int(16) NOT NULL DEFAULT '0' COMMENT 'Region重要等级, 0级普通, 1极重要,2级极重要',
- `operator` varchar(45) NOT NULL DEFAULT '' COMMENT '操作人',
- `description` text COMMENT '备注说明',
- `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态,0正常,-1废弃,1容量已满',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_region_name` (`cluster_id`,`region_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Region信息表';
-
-CREATE TABLE `topic` (
- `id` bigint(128) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `applicant` varchar(256) NOT NULL DEFAULT '' COMMENT '申请人',
- `principals` varchar(256) NOT NULL DEFAULT '' COMMENT '负责人',
- `description` text COMMENT '备注信息',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_cluster_id_topic_name` (`cluster_id`,`topic_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Topic信息表';
-
-
-CREATE TABLE `topic_favorite` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
- `username` varchar(64) NOT NULL DEFAULT '' COMMENT '用户名',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `status` int(16) NOT NULL DEFAULT '0' COMMENT '删除标记, 0表示未删除, -1表示删除',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uniq_username_cluster_id_topic_name` (`username`,`cluster_id`,`topic_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户收藏的Topic表';
-
-CREATE TABLE `topic_metrics` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
- `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
- `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒进入消息条数',
- `bytes_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流入',
- `bytes_out` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒字节流出',
- `bytes_rejected` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒拒绝字节数',
- `total_produce_requests` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒请求数',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_cluster_id_topic_name_gmt_create` (`cluster_id`,`topic_name`,`gmt_create`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='TopicMetrics表';
\ No newline at end of file
diff --git a/doc/assets/images/common/arch.png b/docs/assets/images/common/arch.png
similarity index 100%
rename from doc/assets/images/common/arch.png
rename to docs/assets/images/common/arch.png
diff --git a/doc/assets/images/common/dingding_group.jpg b/docs/assets/images/common/dingding_group.jpg
similarity index 100%
rename from doc/assets/images/common/dingding_group.jpg
rename to docs/assets/images/common/dingding_group.jpg
diff --git a/doc/assets/images/common/logo_name.png b/docs/assets/images/common/logo_name.png
similarity index 100%
rename from doc/assets/images/common/logo_name.png
rename to docs/assets/images/common/logo_name.png
diff --git a/docs/create_mysql_table.sql b/docs/create_mysql_table.sql
new file mode 100644
index 00000000..9b4bfe35
--- /dev/null
+++ b/docs/create_mysql_table.sql
@@ -0,0 +1,577 @@
+--
+-- Table structure for table `account`
+--
+
+-- DROP TABLE IF EXISTS `account`;
+CREATE TABLE `account` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `username` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户名',
+ `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码',
+ `role` tinyint(8) NOT NULL DEFAULT '0' COMMENT '角色类型, 0:普通用户 1:研发 2:运维',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_username` (`username`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账号表';
+INSERT INTO account(username, password, role) VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 2);
+
+--
+-- Table structure for table `app`
+--
+
+-- DROP TABLE IF EXISTS `app`;
+CREATE TABLE `app` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `app_id` varchar(128) NOT NULL DEFAULT '' COMMENT '应用id',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT '应用名称',
+ `password` varchar(256) NOT NULL DEFAULT '' COMMENT '应用密码',
+ `type` int(11) NOT NULL DEFAULT '0' COMMENT '类型, 0:普通用户, 1:超级用户',
+ `applicant` varchar(64) NOT NULL DEFAULT '' COMMENT '申请人',
+ `principals` text COMMENT '应用负责人',
+ `description` text COMMENT '应用描述',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_name` (`name`),
+ UNIQUE KEY `uniq_app_id` (`app_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='应用信息';
+INSERT INTO app(app_id, name, password, type, applicant, principals, description) VALUES ('km-admin-tmp', 'km-admin-tmp', '123456', 0, 'admin', 'admin', '临时应用');
+
+
+--
+-- Table structure for table `authority`
+--
+
+-- DROP TABLE IF EXISTS `authority`;
+CREATE TABLE `authority` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `app_id` varchar(128) NOT NULL DEFAULT '' COMMENT '应用id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `access` int(11) NOT NULL DEFAULT '0' COMMENT '0:无权限, 1:读, 2:写, 3:读写',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_app_id_cluster_id_topic_name` (`app_id`,`cluster_id`,`topic_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限信息(kafka-manager)';
+
+--
+-- Table structure for table `broker`
+--
+
+-- DROP TABLE IF EXISTS `broker`;
+CREATE TABLE `broker` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `broker_id` int(16) NOT NULL DEFAULT '-1' COMMENT 'brokerid',
+ `host` varchar(128) NOT NULL DEFAULT '' COMMENT 'broker主机名',
+ `port` int(16) NOT NULL DEFAULT '-1' COMMENT 'broker端口',
+ `timestamp` bigint(20) NOT NULL DEFAULT '-1' COMMENT '启动时间',
+ `max_avg_bytes_in` bigint(20) NOT NULL DEFAULT '-1' COMMENT '峰值的均值流量',
+ `version` varchar(128) NOT NULL DEFAULT '' COMMENT 'broker版本',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '状态: 0有效,-1无效',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_broker_id` (`cluster_id`,`broker_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='broker信息表';
+
+--
+-- Table structure for table `broker_metrics`
+--
+
+-- DROP TABLE IF EXISTS `broker_metrics`;
+CREATE TABLE `broker_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `broker_id` int(16) NOT NULL DEFAULT '-1' COMMENT 'brokerid',
+ `metrics` text COMMENT '指标',
+ `messages_in` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '每秒消息数流入',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_broker_id_gmt_create` (`cluster_id`,`broker_id`,`gmt_create`),
+ KEY `idx_gmt_create` (`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='broker-metric信息表';
+
+--
+-- Table structure for table `cluster`
+--
+
+-- DROP TABLE IF EXISTS `cluster`;
+CREATE TABLE `cluster` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '集群id',
+ `cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
+ `zookeeper` varchar(512) NOT NULL DEFAULT '' COMMENT 'zk地址',
+ `bootstrap_servers` varchar(512) NOT NULL DEFAULT '' COMMENT 'server地址',
+ `kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'kafka版本',
+ `idc` varchar(64) NOT NULL DEFAULT '' COMMENT '数据中心',
+ `mode` tinyint(4) NOT NULL DEFAULT '0' COMMENT '集群模式, 0:共享, 1:独享, 2:独立',
+ `security_properties` text COMMENT '安全认证参数',
+ `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT ' 监控标记, 0表示未监控, 1表示监控中',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_name` (`cluster_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='cluster信息表';
+
+--
+-- Table structure for table `cluster_metrics`
+--
+
+-- DROP TABLE IF EXISTS `cluster_metrics`;
+CREATE TABLE `cluster_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `metrics` text COMMENT '指标',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_gmt_create` (`cluster_id`,`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='clustermetrics信息';
+
+--
+-- Table structure for table `cluster_tasks`
+--
+
+-- DROP TABLE IF EXISTS `cluster_tasks`;
+CREATE TABLE `cluster_tasks` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `uuid` varchar(128) NOT NULL DEFAULT '' COMMENT '任务UUID',
+ `cluster_id` bigint(128) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `task_type` varchar(128) NOT NULL DEFAULT '' COMMENT '任务类型',
+ `kafka_package` text COMMENT 'kafka包',
+ `kafka_package_md5` varchar(128) NOT NULL DEFAULT '' COMMENT 'kafka包的md5',
+ `server_properties` text COMMENT 'kafkaserver配置',
+ `server_properties_md5` varchar(128) NOT NULL DEFAULT '' COMMENT '配置文件的md5',
+ `agent_task_id` bigint(128) NOT NULL DEFAULT '-1' COMMENT '任务id',
+ `agent_rollback_task_id` bigint(128) NOT NULL DEFAULT '-1' COMMENT '回滚任务id',
+ `host_list` text COMMENT '升级的主机',
+ `pause_host_list` text COMMENT '暂停点',
+ `rollback_host_list` text COMMENT '回滚机器列表',
+ `rollback_pause_host_list` text COMMENT '回滚暂停机器列表',
+ `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人',
+ `task_status` int(11) NOT NULL DEFAULT '0' COMMENT '任务状态',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='集群任务(集群升级部署)';
+
+--
+-- Table structure for table `config`
+--
+
+-- DROP TABLE IF EXISTS `config`;
+CREATE TABLE `config` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `config_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '配置key',
+ `config_value` text COMMENT '配置value',
+ `config_description` text COMMENT '备注说明',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '0标识使用中,-1标识已废弃',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_config_key` (`config_key`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='配置表';
+
+--
+-- Table structure for table `controller`
+--
+
+-- DROP TABLE IF EXISTS `controller`;
+CREATE TABLE `controller` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `broker_id` int(16) NOT NULL DEFAULT '-1' COMMENT 'brokerid',
+ `host` varchar(256) NOT NULL DEFAULT '' COMMENT '主机名',
+ `timestamp` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'controller变更时间',
+ `version` int(16) NOT NULL DEFAULT '-1' COMMENT 'controller格式版本',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_broker_id_timestamp` (`cluster_id`,`broker_id`,`timestamp`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='controller记录表';
+
+--
+-- Table structure for table `gateway_config`
+--
+
+-- DROP TABLE IF EXISTS `gateway_config`;
+CREATE TABLE `gateway_config` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `type` varchar(128) NOT NULL DEFAULT '' COMMENT '配置类型',
+ `name` varchar(128) NOT NULL DEFAULT '' COMMENT '配置名称',
+ `value` text COMMENT '配置值',
+ `version` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '版本信息',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_type_name` (`type`,`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='gateway配置';
+
+--
+-- Table structure for table `heartbeat`
+--
+
+-- DROP TABLE IF EXISTS `heartbeat`;
+CREATE TABLE `heartbeat` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `ip` varchar(128) NOT NULL DEFAULT '' COMMENT '主机ip',
+ `hostname` varchar(256) NOT NULL DEFAULT '' COMMENT '主机名',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_ip` (`ip`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='心跳信息';
+
+--
+-- Table structure for table `kafka_acl`
+--
+
+-- DROP TABLE IF EXISTS `kafka_acl`;
+CREATE TABLE `kafka_acl` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `app_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `access` int(11) NOT NULL DEFAULT '0' COMMENT '0:无权限, 1:读, 2:写, 3:读写',
+ `operation` int(11) NOT NULL DEFAULT '0' COMMENT '0:创建, 1:更新 2:删除, 以最新的一条数据为准',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限信息(kafka-broker)';
+
+--
+-- Table structure for table `kafka_bill`
+--
+
+-- DROP TABLE IF EXISTS `kafka_bill`;
+CREATE TABLE `kafka_bill` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `principal` varchar(64) NOT NULL DEFAULT '' COMMENT '负责人',
+ `quota` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '配额, 单位mb/s',
+ `cost` double(53,2) NOT NULL DEFAULT '0.00' COMMENT '成本, 单位元',
+ `cost_type` int(16) NOT NULL DEFAULT '0' COMMENT '成本类型, 0:共享集群, 1:独享集群, 2:独立集群',
+ `gmt_day` varchar(64) NOT NULL DEFAULT '' COMMENT '计价的日期, 例如2019-02-02的计价结果',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_topic_name_gmt_day` (`cluster_id`,`topic_name`,`gmt_day`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='kafka账单';
+
+--
+-- Table structure for table `kafka_file`
+--
+
+-- DROP TABLE IF EXISTS `kafka_file`;
+CREATE TABLE `kafka_file` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `storage_name` varchar(128) NOT NULL DEFAULT '' COMMENT '存储位置',
+ `file_name` varchar(128) NOT NULL DEFAULT '' COMMENT '文件名',
+ `file_md5` varchar(256) NOT NULL DEFAULT '' COMMENT '文件md5',
+ `file_type` int(16) NOT NULL DEFAULT '-1' COMMENT '0:kafka压缩包, 1:kafkaserver配置',
+ `description` text COMMENT '备注信息',
+ `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '创建用户',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '状态, 0:正常, -1:删除',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_file_name_storage_name` (`cluster_id`,`file_name`,`storage_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件管理';
+
+--
+-- Table structure for table `kafka_user`
+--
+
+-- DROP TABLE IF EXISTS `kafka_user`;
+CREATE TABLE `kafka_user` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `app_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '应用id',
+ `password` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密码',
+ `user_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:普通用户, 1:超级用户',
+ `operation` int(11) NOT NULL DEFAULT '0' COMMENT '0:创建, 1:更新 2:删除, 以最新一条的记录为准',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='kafka用户表';
+
+--
+-- Table structure for table `logical_cluster`
+--
+
+-- DROP TABLE IF EXISTS `logical_cluster`;
+CREATE TABLE `logical_cluster` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT '逻辑集群名称',
+ `mode` int(16) NOT NULL DEFAULT '0' COMMENT '逻辑集群类型, 0:共享集群, 1:独享集群, 2:独立集群',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '所属应用',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `region_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'regionid列表',
+ `description` text COMMENT '备注说明',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_name` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='逻辑集群信息表';
+
+--
+-- Table structure for table `monitor_rule`
+--
+
+-- DROP TABLE IF EXISTS `monitor_rule`;
+CREATE TABLE `monitor_rule` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT '告警名称',
+ `strategy_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '监控id',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'appid',
+ `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_name` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='监控规则';
+
+--
+-- Table structure for table `operate_record`
+--
+
+-- DROP TABLE IF EXISTS `operate_record`;
+CREATE TABLE `operate_record` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `module_id` int(16) NOT NULL DEFAULT '-1' COMMENT '模块类型, 0:topic, 1:应用, 2:配额, 3:权限, 4:集群, -1:未知',
+ `operate_id` int(16) NOT NULL DEFAULT '-1' COMMENT '操作类型, 0:新增, 1:删除, 2:修改',
+ `resource` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称、app名称',
+ `content` text COMMENT '操作内容',
+ `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_module_id_operate_id_operator` (`module_id`,`operate_id`,`operator`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作记录';
+
+--
+-- Table structure for table `reassign_task`
+--
+
+-- DROP TABLE IF EXISTS `reassign_task`;
+CREATE TABLE `reassign_task` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `task_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '任务ID',
+ `name` varchar(256) NOT NULL DEFAULT '' COMMENT '任务名称',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
+ `partitions` text COMMENT '分区',
+ `reassignment_json` text COMMENT '任务参数',
+ `real_throttle` bigint(20) NOT NULL DEFAULT '0' COMMENT '限流值',
+ `max_throttle` bigint(20) NOT NULL DEFAULT '0' COMMENT '限流上限',
+ `min_throttle` bigint(20) NOT NULL DEFAULT '0' COMMENT '限流下限',
+ `begin_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
+ `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人',
+ `description` varchar(256) NOT NULL DEFAULT '' COMMENT '备注说明',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '任务状态',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '任务创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '任务修改时间',
+ `original_retention_time` bigint(20) NOT NULL DEFAULT '86400000' COMMENT 'Topic存储时间',
+ `reassign_retention_time` bigint(20) NOT NULL DEFAULT '86400000' COMMENT '迁移时的存储时间',
+ `src_brokers` text COMMENT '源Broker',
+ `dest_brokers` text COMMENT '目标Broker',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic迁移信息';
+
+--
+-- Table structure for table `region`
+--
+
+-- DROP TABLE IF EXISTS `region`;
+CREATE TABLE `region` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `name` varchar(192) NOT NULL DEFAULT '' COMMENT 'region名称',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'broker列表',
+ `capacity` bigint(20) NOT NULL DEFAULT '0' COMMENT '容量(B/s)',
+ `real_used` bigint(20) NOT NULL DEFAULT '0' COMMENT '实际使用量(B/s)',
+ `estimate_used` bigint(20) NOT NULL DEFAULT '0' COMMENT '预估使用量(B/s)',
+ `description` text COMMENT '备注说明',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '状态,0正常,1已满',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_name` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='region信息表';
+
+--
+-- Table structure for table `topic`
+--
+
+-- DROP TABLE IF EXISTS `topic`;
+CREATE TABLE `topic` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'topic所属appid',
+ `peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流量',
+ `description` text COMMENT '备注信息',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_topic_name` (`cluster_id`,`topic_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic信息表';
+
+--
+-- Table structure for table `topic_app_metrics`
+--
+
+-- DROP TABLE IF EXISTS `topic_app_metrics`;
+CREATE TABLE `topic_app_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'appid',
+ `metrics` text COMMENT '指标',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_topic_name_app_id_gmt_create` (`cluster_id`,`topic_name`,`app_id`,`gmt_create`),
+ KEY `idx_gmt_create` (`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic app metrics';
+
+--
+-- Table structure for table `topic_connections`
+--
+
+-- DROP TABLE IF EXISTS `topic_connections`;
+CREATE TABLE `topic_connections` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '应用id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `type` varchar(16) NOT NULL DEFAULT '' COMMENT 'producer or consumer',
+ `ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'ip地址',
+ `client_version` varchar(8) NOT NULL DEFAULT '' COMMENT '客户端版本',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_app_id_cluster_id_topic_name_type_ip_client_version` (`app_id`,`cluster_id`,`topic_name`,`type`,`ip`,`client_version`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic连接信息表';
+
+--
+-- Table structure for table `topic_expired`
+--
+
+-- DROP TABLE IF EXISTS `topic_expired`;
+CREATE TABLE `topic_expired` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `produce_connection_num` bigint(20) NOT NULL DEFAULT '0' COMMENT '发送连接数',
+ `fetch_connection_num` bigint(20) NOT NULL DEFAULT '0' COMMENT '消费连接数',
+ `expired_day` bigint(20) NOT NULL DEFAULT '0' COMMENT '过期天数',
+ `gmt_retain` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '保留截止时间',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '-1:可下线, 0:过期待通知, 1+:已通知待反馈',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_topic_name` (`cluster_id`,`topic_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic过期信息表';
+
+--
+-- Table structure for table `topic_metrics`
+--
+
+-- DROP TABLE IF EXISTS `topic_metrics`;
+CREATE TABLE `topic_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `metrics` text COMMENT '指标数据JSON',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_topic_name_gmt_create` (`cluster_id`,`topic_name`,`gmt_create`),
+ KEY `idx_gmt_create` (`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topicmetrics表';
+
+--
+-- Table structure for table `topic_report`
+--
+
+-- DROP TABLE IF EXISTS `topic_report`;
+CREATE TABLE `topic_report` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始上报时间',
+ `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束上报时间',
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_topic_name` (`cluster_id`,`topic_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开启jmx采集的topic';
+
+--
+-- Table structure for table `topic_request_time_metrics`
+--
+
+-- DROP TABLE IF EXISTS `topic_request_time_metrics`;
+CREATE TABLE `topic_request_time_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `metrics` text COMMENT '指标',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_topic_name_gmt_create` (`cluster_id`,`topic_name`,`gmt_create`),
+ KEY `idx_gmt_create` (`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic请求耗时信息';
+
+--
+-- Table structure for table `topic_statistics`
+--
+
+-- DROP TABLE IF EXISTS `topic_statistics`;
+CREATE TABLE `topic_statistics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic名称',
+ `offset_sum` bigint(20) NOT NULL DEFAULT '-1' COMMENT 'offset和',
+ `max_avg_bytes_in` double(53,2) NOT NULL DEFAULT '-1.00' COMMENT '峰值的均值流量',
+ `gmt_day` varchar(64) NOT NULL DEFAULT '' COMMENT '日期2020-03-30的形式',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `max_avg_messages_in` double(53,2) NOT NULL DEFAULT '-1.00' COMMENT '峰值的均值消息条数',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uniq_cluster_id_topic_name_gmt_day` (`cluster_id`,`topic_name`,`gmt_day`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic统计信息表';
+
+--
+-- Table structure for table `topic_throttled_metrics`
+--
+
+-- DROP TABLE IF EXISTS `topic_throttled_metrics`;
+CREATE TABLE `topic_throttled_metrics` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id',
+ `topic_name` varchar(192) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'topic name',
+ `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'app',
+ `produce_throttled` tinyint(8) NOT NULL DEFAULT '0' COMMENT '是否是生产耗时',
+ `fetch_throttled` tinyint(8) NOT NULL DEFAULT '0' COMMENT '是否是消费耗时',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ PRIMARY KEY (`id`),
+ KEY `idx_cluster_id_topic_name_app_id` (`cluster_id`,`topic_name`,`app_id`),
+ KEY `idx_gmt_create` (`gmt_create`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='topic限流信息';
+
+--
+-- Table structure for table `work_order`
+--
+
+-- DROP TABLE IF EXISTS `work_order`;
+CREATE TABLE `work_order` (
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `type` int(16) NOT NULL DEFAULT '-1' COMMENT '工单类型',
+ `title` varchar(512) NOT NULL DEFAULT '' COMMENT '工单标题',
+ `applicant` varchar(64) NOT NULL DEFAULT '' COMMENT '申请人',
+ `description` text COMMENT '备注信息',
+ `approver` varchar(64) NOT NULL DEFAULT '' COMMENT '审批人',
+ `gmt_handle` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '审批时间',
+ `opinion` varchar(256) NOT NULL DEFAULT '' COMMENT '审批信息',
+ `extensions` text COMMENT '扩展信息',
+ `status` int(16) NOT NULL DEFAULT '0' COMMENT '工单状态, 0:待审批, 1:通过, 2:拒绝, 3:取消',
+ `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='工单表';
\ No newline at end of file
diff --git a/docs/install_cn_guide.md b/docs/install_cn_guide.md
new file mode 100644
index 00000000..311b92ab
--- /dev/null
+++ b/docs/install_cn_guide.md
@@ -0,0 +1,58 @@
+
+---
+
+
+
+**一站式`Apache Kafka`集群指标监控与运维管控平台**
+
+---
+
+# 安装手册
+
+
+## 环境依赖
+
+- `Maven 3.2+`(后端打包依赖)
+- `node 10+`(前端打包依赖)
+- `Java 8+`(运行环境需要)
+- `MySQL`(数据存储)
+
+---
+
+## 环境初始化
+
+执行[create_mysql_table.sql](./create_mysql_table.sql)中的SQL命令,从而创建所需的MySQL库及表,默认创建的库名是`kafka_manager`。
+
+```
+# 示例:
+mysql -uXXXX -pXXX -h XXX.XXX.XXX.XXX -PXXXX < ./create_mysql_table.sql
+```
+
+---
+
+## 打包
+
+```bash
+
+# 一次性打包
+cd ..
+mvn install
+
+```
+
+---
+
+## 启动
+
+```
+# application.yml 是配置文件
+
+cp web/src/main/resources/application.yml web/target/
+cd web/target/
+nohup java -jar kafka-manager-web-2.0.0-SNAPSHOT.jar --spring.config.location=./application.yml > /dev/null 2>&1 &
+```
+
+## 使用
+
+本地启动的话,访问`http://localhost:8080`,输入帐号及密码进行登录。更多参考:[kafka-manager使用手册](./user_cn_guide.md)
+
diff --git a/docs/manual_kafka_op/add_cluster.md b/docs/manual_kafka_op/add_cluster.md
new file mode 100644
index 00000000..ded5ef93
--- /dev/null
+++ b/docs/manual_kafka_op/add_cluster.md
@@ -0,0 +1,39 @@
+
+---
+
+
+
+**一站式`Apache Kafka`集群指标监控与运维管控平台**
+
+---
+
+# 集群接入
+
+集群的接入总共需要三个步骤,分别是:
+1. 接入物理集群
+2. 创建Region
+3. 创建逻辑集群
+
+备注:接入集群需要2、3两步是因为普通用户的视角下,看到的都是逻辑集群,如果没有2、3两步,那么普通用户看不到任何信息。
+
+
+## 1、接入物理集群
+
+
+
+如上图所示,填写集群信息,然后点击确定,即可完成集群的接入。因为考虑到分布式部署,添加集群之后,需要稍等**`1分钟`**才可以在界面上看到集群的详细信息。
+
+## 2、创建Region
+
+
+
+如上图所示,填写Region信息,然后点击确定,即可完成Region的创建。
+
+备注:Region即为Broker的集合,可以按照业务需要,将Broker归类,从而创建相应的Region。
+
+## 3、创建逻辑集群
+
+
+
+
+如上图所示,填写逻辑集群信息,然后点击确定,即可完成逻辑集群的创建。
\ No newline at end of file
diff --git a/docs/manual_kafka_op/imgs/op_add_cluster.jpg b/docs/manual_kafka_op/imgs/op_add_cluster.jpg
new file mode 100644
index 00000000..98d239ae
Binary files /dev/null and b/docs/manual_kafka_op/imgs/op_add_cluster.jpg differ
diff --git a/docs/manual_kafka_op/imgs/op_add_logical_cluster.jpg b/docs/manual_kafka_op/imgs/op_add_logical_cluster.jpg
new file mode 100644
index 00000000..8650fa94
Binary files /dev/null and b/docs/manual_kafka_op/imgs/op_add_logical_cluster.jpg differ
diff --git a/docs/manual_kafka_op/imgs/op_add_region.jpg b/docs/manual_kafka_op/imgs/op_add_region.jpg
new file mode 100644
index 00000000..fe2669a6
Binary files /dev/null and b/docs/manual_kafka_op/imgs/op_add_region.jpg differ
diff --git a/doc/user_cn_guide.md b/docs/user_cn_guide.md
similarity index 100%
rename from doc/user_cn_guide.md
rename to docs/user_cn_guide.md
diff --git a/kafka-manager-common/pom.xml b/kafka-manager-common/pom.xml
new file mode 100644
index 00000000..2782e5eb
--- /dev/null
+++ b/kafka-manager-common/pom.xml
@@ -0,0 +1,105 @@
+
+
+ 4.0.0
+ com.xiaojukeji.kafka
+ kafka-manager-common
+ 2.0.0-SNAPSHOT
+ jar
+
+
+ kafka-manager
+ com.xiaojukeji.kafka
+ 2.0.0-SNAPSHOT
+
+
+
+ 1.0.0-SNAPSHOT
+ true
+ true
+ 1.8
+ 1.8
+ UTF-8
+ UTF-8
+
+
+
+
+ org.apache.httpcomponents
+ httpcore
+
+
+ org.apache.httpcomponents
+ httpclient
+
+
+ commons-httpclient
+ commons-httpclient
+
+
+ org.apache.httpcomponents
+ httpmime
+
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.3
+
+
+ org.apache.curator
+ curator-recipes
+ 2.10.0
+
+
+ org.apache.zookeeper
+ zookeeper
+
+
+ com.alibaba
+ fastjson
+
+
+ org.apache.kafka
+ kafka_2.10
+
+
+ commons-lang
+ commons-lang
+
+
+
+ io.springfox
+ springfox-swagger2
+
+
+ io.springfox
+ springfox-swagger-ui
+
+
+ io.swagger
+ swagger-annotations
+ 1.5.13
+
+
+ org.springframework
+ spring-web
+ 5.0.9.RELEASE
+ compile
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.9.7
+
+
+ org.apache.commons
+ commons-pool2
+
+
+ javax.servlet
+ javax.servlet-api
+
+
+
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/annotations/ApiLevel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/annotations/ApiLevel.java
new file mode 100644
index 00000000..1a3e91d7
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/annotations/ApiLevel.java
@@ -0,0 +1,24 @@
+package com.xiaojukeji.kafka.manager.common.annotations;
+
+import com.xiaojukeji.kafka.manager.common.constant.ApiLevelContent;
+
+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;
+
+/**
+ * 接口分级限流
+ * @author zengqiao
+ * @date 2020-07-20
+ */
+@Target(ElementType.METHOD)
+@Retention(RUNTIME)
+@Documented
+public @interface ApiLevel {
+ int level() default ApiLevelContent.LEVEL_DEFAULT_4;
+
+ int rateLimit() default Integer.MAX_VALUE;
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/AccountRoleEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/AccountRoleEnum.java
new file mode 100644
index 00000000..9c3cc06c
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/AccountRoleEnum.java
@@ -0,0 +1,50 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 用户角色
+ * @author zengqiao_cn@163.com
+ * @date 19/4/15
+ */
+public enum AccountRoleEnum {
+ UNKNOWN(-1, "unknown"),
+
+ NORMAL(0, "normal"),
+
+ RD(1, "rd"),
+
+ OP(2, "op");
+
+ private Integer role;
+
+ private String message;
+
+ AccountRoleEnum(Integer role, String message) {
+ this.role = role;
+ this.message = message;
+ }
+
+ public Integer getRole() {
+ return role;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AccountRoleEnum{" +
+ "role=" + role +
+ ", message='" + message + '\'' +
+ '}';
+ }
+
+ public static AccountRoleEnum getUserRoleEnum(Integer role) {
+ for (AccountRoleEnum elem: AccountRoleEnum.values()) {
+ if (elem.role.equals(role)) {
+ return elem;
+ }
+ }
+ return AccountRoleEnum.UNKNOWN;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ApiLevelEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ApiLevelEnum.java
new file mode 100644
index 00000000..73be0d16
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ApiLevelEnum.java
@@ -0,0 +1,19 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/7/27
+ */
+public enum ApiLevelEnum {
+ LEVEL_0(0),
+ LEVEL_1(1),
+ LEVEL_2(2),
+ LEVEL_3(3)
+ ;
+
+ private int level;
+
+ ApiLevelEnum(int level) {
+ this.level = level;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterComboEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterComboEnum.java
new file mode 100644
index 00000000..06f6b91b
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterComboEnum.java
@@ -0,0 +1,37 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/4/21
+ */
+public enum ClusterComboEnum {
+ BYTES_IN_200(200*1024*1024, "200MB/s"),
+ BYTES_IN_400(400*1024*1024, "400MB/s"),
+ BYTES_IN_600(600*1024*1024, "600MB/s"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ ClusterComboEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterComboEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterModeEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterModeEnum.java
new file mode 100644
index 00000000..199cc7cd
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ClusterModeEnum.java
@@ -0,0 +1,48 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 集群模式
+ * @author zengqiao
+ * @date 20/4/1
+ */
+public enum ClusterModeEnum {
+ /**
+ * 共享模式
+ */
+ SHARED_MODE(0, "共享集群"),
+
+ /**
+ * 独享模式
+ */
+ EXCLUSIVE_MODE(1, "独享集群"),
+
+ /**
+ * 独立模式
+ */
+ INDEPENDENT_MODE(2, "独立集群");
+
+ private Integer code;
+
+ private String message;
+
+ ClusterModeEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterModeEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/DBStatusEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/DBStatusEnum.java
new file mode 100644
index 00000000..4f6fb1cf
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/DBStatusEnum.java
@@ -0,0 +1,25 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/6/4
+ */
+public enum DBStatusEnum {
+ DEAD(-1),
+ ALIVE(0)
+ ;
+
+ private int status;
+
+ DBStatusEnum(int status) {
+ this.status = status;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/IDCEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/IDCEnum.java
new file mode 100644
index 00000000..0c4c877a
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/IDCEnum.java
@@ -0,0 +1,45 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/5/26
+ */
+public enum IDCEnum {
+ CN("cn", "国内"),
+ US("us", "美东"),
+ RU("ru", "俄罗斯"),
+ ;
+
+ private String idc;
+
+ private String name;
+
+ IDCEnum(String idc, String name) {
+ this.idc = idc;
+ this.name = name;
+ }
+
+ public String getIdc() {
+ return idc;
+ }
+
+ public void setIdc(String idc) {
+ this.idc = idc;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return "IDCEnum{" +
+ "idc='" + idc + '\'' +
+ ", name='" + name + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaBrokerRoleEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaBrokerRoleEnum.java
new file mode 100644
index 00000000..befd5257
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaBrokerRoleEnum.java
@@ -0,0 +1,34 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/5/20
+ */
+public enum KafkaBrokerRoleEnum {
+ NORMAL("NormalBroker"),
+
+ COORDINATOR("Coordinator"),
+
+ CONTROLLER("Controller"),
+ ;
+ private String role;
+
+ KafkaBrokerRoleEnum(String role) {
+ this.role = role;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaBrokerRoleEnum{" +
+ "role='" + role + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaClientEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaClientEnum.java
new file mode 100644
index 00000000..6e5bea6f
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaClientEnum.java
@@ -0,0 +1,46 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/5/29
+ */
+public enum KafkaClientEnum {
+ PRODUCE_CLIENT(0, "Produce"),
+
+ FETCH_CLIENT(1, "Fetch"),
+
+ ;
+
+ private Integer code;
+
+ private String name;
+
+ KafkaClientEnum(Integer code, String name) {
+ this.code = code;
+ this.name = name;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaClientEnum{" +
+ "code=" + code +
+ ", name='" + name + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaFileEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaFileEnum.java
new file mode 100644
index 00000000..f1196f91
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/KafkaFileEnum.java
@@ -0,0 +1,54 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/4/26
+ */
+public enum KafkaFileEnum {
+ PACKAGE(0, "Kafka压缩包", ".tgz"),
+
+ SERVER_CONFIG(1, "KafkaServer配置", ".properties"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ private String suffix;
+
+ KafkaFileEnum(Integer code, String message, String suffix) {
+ this.code = code;
+ this.message = message;
+ this.suffix = suffix;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public String getSuffix() {
+ return suffix;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaFileEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ ", suffix=" + suffix +
+ '}';
+ }
+
+ public static KafkaFileEnum getByCode(Integer code) {
+ for (KafkaFileEnum elem: KafkaFileEnum.values()) {
+ if (elem.getCode().equals(code)) {
+ return elem;
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ModuleEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ModuleEnum.java
new file mode 100644
index 00000000..ac2a8947
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/ModuleEnum.java
@@ -0,0 +1,76 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+import com.google.common.collect.Maps;
+
+import java.util.Map;
+
+/**
+ * @author zhongyuankai_i
+ * @date 20/09/03
+ */
+public enum ModuleEnum {
+ TOPIC(0, "Topic"),
+
+ APP(1, "应用"),
+
+ QUOTA(2, "配额"),
+
+ AUTHORITY(3, "权限"),
+
+ CLUSTER(4, "集群"),
+
+ PARTITION(5, "分区"),
+
+ UNKNOWN(-1, "未知")
+ ;
+ ModuleEnum(int code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ private int code;
+
+ private String message;
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Map toMap() {
+ Map map = Maps.newHashMap();
+ map.put("code", code);
+ map.put("message", message);
+ return map;
+ }
+
+ public static ModuleEnum valueOf(Integer code) {
+ if (code == null) {
+ return ModuleEnum.UNKNOWN;
+ }
+ for (ModuleEnum state : ModuleEnum.values()) {
+ if (state.getCode() == code) {
+ return state;
+ }
+ }
+
+ return ModuleEnum.UNKNOWN;
+ }
+
+ public static boolean validate(Integer code) {
+ if (code == null) {
+ return false;
+ }
+ for (ModuleEnum state : ModuleEnum.values()) {
+ if (state.getCode() == code) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetLocationEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetLocationEnum.java
new file mode 100644
index 00000000..aeeff95d
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetLocationEnum.java
@@ -0,0 +1,36 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author limeng
+ * @date 2017/11/21
+ */
+public enum OffsetLocationEnum {
+ /**
+ * 存储于zk
+ */
+ ZOOKEEPER("zookeeper"),
+
+ /**
+ * 存储于broker
+ */
+ BROKER("broker");
+
+ public final String location;
+
+ OffsetLocationEnum(String location) {
+ this.location = location;
+ }
+
+ public static OffsetLocationEnum getOffsetStoreLocation(String location) {
+ if (location == null) {
+ return null;
+ }
+
+ for (OffsetLocationEnum offsetStoreLocation: OffsetLocationEnum.values()) {
+ if (offsetStoreLocation.location.equals(location)) {
+ return offsetStoreLocation;
+ }
+ }
+ return null;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetPosEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetPosEnum.java
new file mode 100644
index 00000000..7f5deea2
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OffsetPosEnum.java
@@ -0,0 +1,42 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * offset获取的位置
+ * @author zengqiao
+ * @date 19/5/29
+ */
+public enum OffsetPosEnum {
+ NONE(0),
+
+ BEGINNING(1),
+
+ END(2),
+
+ BOTH(3);
+
+ public final Integer code;
+
+ OffsetPosEnum(Integer code) {
+ this.code = code;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public static OffsetPosEnum getOffsetPosEnum(Integer code) {
+ for (OffsetPosEnum offsetPosEnum : values()) {
+ if (offsetPosEnum.getCode().equals(code)) {
+ return offsetPosEnum;
+ }
+ }
+ return NONE;
+ }
+
+ @Override
+ public String toString() {
+ return "OffsetPosEnum{" +
+ "code=" + code +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperateEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperateEnum.java
new file mode 100644
index 00000000..2bc874ec
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperateEnum.java
@@ -0,0 +1,59 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zhongyuankai
+ * @date 20/09/03
+ */
+public enum OperateEnum {
+ ADD(0, "新增"),
+
+ DELETE(1, "删除"),
+
+ EDIT(2, "修改"),
+
+ UNKNOWN(-1, "unknown"),
+ ;
+
+ OperateEnum(int code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ private int code;
+
+ private String message;
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public static OperateEnum valueOf(Integer code) {
+ if (code == null) {
+ return OperateEnum.UNKNOWN;
+ }
+ for (OperateEnum state : OperateEnum.values()) {
+ if (state.getCode() == code) {
+ return state;
+ }
+ }
+
+ return OperateEnum.UNKNOWN;
+ }
+
+ public static boolean validate(Integer code) {
+ if (code == null) {
+ return false;
+ }
+ for (OperateEnum state : OperateEnum.values()) {
+ if (state.getCode() == code) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperationStatusEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperationStatusEnum.java
new file mode 100644
index 00000000..cf8f53d2
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/OperationStatusEnum.java
@@ -0,0 +1,30 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 操作状态类型
+ * @author zengqiao
+ * @date 19/11/21
+ */
+public enum OperationStatusEnum {
+ CREATE(0, "创建"),
+ UPDATE(1, "更新"),
+ DELETE(2, "删除"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ OperationStatusEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/PeakFlowStatusEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/PeakFlowStatusEnum.java
new file mode 100644
index 00000000..9b71f038
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/PeakFlowStatusEnum.java
@@ -0,0 +1,50 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 峰值状态枚举
+ * @author zengqiao
+ * @date 20/5/11
+ */
+public enum PeakFlowStatusEnum {
+ BETWEEN_ALL(0, "全部"),
+ BETWEEN_00_60(1, "使用率0%-60%"),
+ BETWEEN_60_80(2, "使用率60%-80%"),
+ BETWEEN_80_100(3, "使用率80%-100%"),
+ BETWEEN_100_PLUS(4, "使用率大于100%"),
+ BETWEEN_EXCEPTION(5, "数据获取失败"),
+
+ ;
+
+ public Integer code;
+
+ public String message;
+
+ PeakFlowStatusEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return "PeakFlowStatusEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/RebalanceDimensionEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/RebalanceDimensionEnum.java
new file mode 100644
index 00000000..6659f904
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/RebalanceDimensionEnum.java
@@ -0,0 +1,31 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 优先副本选举维度
+ * @author zengqiao
+ * @date 20/4/23
+ */
+public enum RebalanceDimensionEnum {
+ CLUSTER(0, "Cluster维度"),
+ REGION(1, "Region维度"),
+ BROKER(2, "Broker维度"),
+ TOPIC(3, "Topic维度"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ RebalanceDimensionEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/SinkMonitorSystemEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/SinkMonitorSystemEnum.java
new file mode 100644
index 00000000..b843a90c
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/SinkMonitorSystemEnum.java
@@ -0,0 +1,45 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 是否上报监控系统
+ * @author zengqiao
+ * @date 20/9/25
+ */
+public enum SinkMonitorSystemEnum {
+ SINK_MONITOR_SYSTEM(0, "上报监控系统"),
+ NOT_SINK_MONITOR_SYSTEM(1, "不上报监控系统"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ SinkMonitorSystemEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return "SinkMonitorSystemEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusEnum.java
new file mode 100644
index 00000000..ebf3dc82
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusEnum.java
@@ -0,0 +1,72 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * 任务状态
+ * @author zengqiao
+ * @date 2017/6/29.
+ */
+public enum TaskStatusEnum {
+ UNKNOWN( -1, "未知"),
+
+ NEW( 0, "新建"),
+
+ RUNNABLE( 20, "就绪"),
+ WAITING( 21, "等待"),
+
+ RUNNING( 30, "运行中"),
+ KILLING( 31, "杀死中"),
+
+ BLOCKED( 40, "暂停"),
+
+ UNFINISHED( 99, "未完成"),
+ FINISHED( 100, "完成"),
+
+ SUCCEED( 101, "成功"),
+ FAILED( 102, "失败"),
+ CANCELED( 103, "取消"),
+ IGNORED( 104, "忽略"),
+ TIMEOUT( 105, "超时"),
+ KILL_FAILED(106, "杀死失败"),
+
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ TaskStatusEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return "TaskStatusEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+
+ public static Boolean isFinished(Integer code) {
+ if (code >= FINISHED.getCode()) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusReassignEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusReassignEnum.java
new file mode 100644
index 00000000..7fd6ef8f
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TaskStatusReassignEnum.java
@@ -0,0 +1,55 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/6/11
+ */
+public enum TaskStatusReassignEnum {
+ UNKNOWN(TaskStatusEnum.UNKNOWN),
+
+ NEW(TaskStatusEnum.NEW),
+
+ RUNNABLE(TaskStatusEnum.RUNNABLE),
+
+ RUNNING(TaskStatusEnum.RUNNING),
+
+// FINISHED(TaskStatusEnum.FINISHED),
+ SUCCEED(TaskStatusEnum.SUCCEED),
+ FAILED(TaskStatusEnum.FAILED),
+ CANCELED(TaskStatusEnum.CANCELED),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ TaskStatusReassignEnum(TaskStatusEnum taskStatusEnum) {
+ this.code = taskStatusEnum.getCode();
+ this.message = taskStatusEnum.getMessage();
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "TaskStatusReassignEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+
+ public static Boolean isFinished(Integer code) {
+ if (SUCCEED.getCode().equals(code)
+ || FAILED.getCode().equals(code)
+ || CANCELED.getCode().equals(code)) {
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicAuthorityEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicAuthorityEnum.java
new file mode 100644
index 00000000..2cfba027
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicAuthorityEnum.java
@@ -0,0 +1,36 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * topic权限
+ * @author zhongyuankai
+ * @date 20/4/29
+ */
+public enum TopicAuthorityEnum {
+ DENY(0, "无"),
+
+ READ(1, "只读"),
+
+ WRITE(2, "只写"),
+
+ READ_WRITE(3, "可读可写"),
+
+ OWNER(4, "可管理"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ TopicAuthorityEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicOffsetChangedEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicOffsetChangedEnum.java
new file mode 100644
index 00000000..ecb6b2f1
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicOffsetChangedEnum.java
@@ -0,0 +1,45 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * @author zengqiao
+ * @date 20/8/24
+ */
+public enum TopicOffsetChangedEnum {
+ UNKNOWN(-1, "unknown"),
+ NO(0, "no"),
+ YES(1, "yes"),
+ ;
+
+ private Integer code;
+
+ private String message;
+
+ TopicOffsetChangedEnum(Integer code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicOffsetChangedEnum{" +
+ "code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicReassignActionEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicReassignActionEnum.java
new file mode 100644
index 00000000..2c4361c6
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/TopicReassignActionEnum.java
@@ -0,0 +1,39 @@
+package com.xiaojukeji.kafka.manager.common.bizenum;
+
+/**
+ * Topic迁移动作
+ * @author zengqiao
+ * @date 20/4/16
+ */
+public enum TopicReassignActionEnum {
+ START("start"),
+ MODIFY("modify"),
+ CANCEL("cancel"),
+ ;
+
+ private String action;
+
+ TopicReassignActionEnum(String action) {
+ this.action = action;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicReassignActionEnum{" +
+ "action='" + action + '\'' +
+ '}';
+ }
+
+ public static TopicReassignActionEnum getByAction(String action) {
+ for (TopicReassignActionEnum elem: TopicReassignActionEnum.values()) {
+ if (elem.action.equals(action)) {
+ return elem;
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/gateway/GatewayConfigKeyEnum.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/gateway/GatewayConfigKeyEnum.java
new file mode 100644
index 00000000..667be791
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/bizenum/gateway/GatewayConfigKeyEnum.java
@@ -0,0 +1,48 @@
+package com.xiaojukeji.kafka.manager.common.bizenum.gateway;
+
+/**
+ * @author zengqiao
+ * @date 20/7/28
+ */
+public enum GatewayConfigKeyEnum {
+ SD_CLUSTER_ID("SERVICE_DISCOVERY_CLUSTER_ID", "SERVICE_DISCOVERY_CLUSTER_ID"),
+ SD_QUEUE_SIZE("SERVICE_DISCOVERY_QUEUE_SIZE", "SERVICE_DISCOVERY_QUEUE_SIZE"),
+ SD_APP_ID_RATE("SERVICE_DISCOVERY_APPID_RATE", "SERVICE_DISCOVERY_APPID_RATE"),
+ SD_IP_RATE("SERVICE_DISCOVERY_IP_RATE", "SERVICE_DISCOVERY_IP_RATE"),
+ SD_SP_RATE("SERVICE_DISCOVERY_SP_RATE", "SERVICE_DISCOVERY_SP_RATE"),
+
+ ;
+
+ private String configType;
+
+ private String configName;
+
+ GatewayConfigKeyEnum(String configType, String configName) {
+ this.configType = configType;
+ this.configName = configName;
+ }
+
+ public String getConfigType() {
+ return configType;
+ }
+
+ public void setConfigType(String configType) {
+ this.configType = configType;
+ }
+
+ public String getConfigName() {
+ return configName;
+ }
+
+ public void setConfigName(String configName) {
+ this.configName = configName;
+ }
+
+ @Override
+ public String toString() {
+ return "GatewayConfigKeyEnum{" +
+ "configType='" + configType + '\'' +
+ ", configName='" + configName + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiLevelContent.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiLevelContent.java
new file mode 100644
index 00000000..2447564f
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiLevelContent.java
@@ -0,0 +1,15 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * @author zengqiao
+ * @date 20/7/28
+ */
+public class ApiLevelContent {
+ public static final int LEVEL_VIP_1 = 1;
+
+ public static final int LEVEL_IMPORTANT_2 = 2;
+
+ public static final int LEVEL_NORMAL_3 = 3;
+
+ public static final int LEVEL_DEFAULT_4 = 4;
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiPrefix.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiPrefix.java
new file mode 100644
index 00000000..5cd1ab5b
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ApiPrefix.java
@@ -0,0 +1,26 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * Api前缀
+ * @author zengqiao
+ * @date 20/4/16
+ */
+public class ApiPrefix {
+ public static final String API_V1_SSO_PREFIX = "/api/v1/sso/";
+
+ public static final String API_V1_NORMAL_PREFIX = "/api/v1/normal/";
+
+ public static final String API_V1_RD_PREFIX = "/api/v1/rd/";
+
+ public static final String API_V1_OP_PREFIX = "/api/v1/op/";
+
+ public static final String API_V1_THIRD_PART_PREFIX = "/api/v1/third-part/";
+
+ public static final String API_V2_THIRD_PART_PREFIX = "/api/v2/third-part/";
+
+ public static final String API_V1_OBSOLETE_PREFIX = "/api/v1/";
+
+ public static final String API_V2_OBSOLETE_PREFIX = "/api/v2/";
+
+ public static final String GATEWAY_API_V1_PREFIX = "/gateway/api/v1/";
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ConfigConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ConfigConstant.java
new file mode 100644
index 00000000..faca17b0
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/ConfigConstant.java
@@ -0,0 +1,33 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * 配置的常量KEY
+ * @author zengqiao
+ * @date 20/7/1
+ */
+public class ConfigConstant {
+ /**
+ * 专家服务
+ */
+ public static final String REGION_HOT_TOPIC_CONFIG_KEY = "REGION_HOT_TOPIC_CONFIG";
+ public static final String TOPIC_INSUFFICIENT_PARTITION_CONFIG_KEY = "TOPIC_INSUFFICIENT_PARTITION_CONFIG";
+ public static final String EXPIRED_TOPIC_CONFIG_KEY = "EXPIRED_TOPIC_CONFIG";
+
+ /**
+ *
+ */
+ public static final String PRODUCE_CONSUMER_METRICS_CONFIG_KEY = "PRODUCE_CONSUMER_METRICS_CONFIG_KEY";
+
+ public static final String PRODUCE_TOPIC_METRICS_CONFIG_KEY = "PRODUCE_TOPIC_METRICS_CONFIG_KEY";
+
+ public static final long MAX_LIMIT_NUM = 200L;
+
+ /**
+ * broker 默认最大峰值流量 100M
+ */
+ public static final Long DEFAULT_BROKER_CAPACITY_LIMIT = 100 * 1024 * 1024L;
+
+ public static final String BROKER_CAPACITY_LIMIT_CONFIG_KEY = "BROKER_CAPACITY_LIMIT_CONFIG";
+
+ public static final String KAFKA_CLUSTER_DO_CONFIG_KEY = "KAFKA_CLUSTER_DO_CONFIG";
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/Constant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/Constant.java
new file mode 100644
index 00000000..81c1dc89
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/Constant.java
@@ -0,0 +1,48 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * @author zengqiao
+ * @date 20/2/28
+ */
+public class Constant {
+ public static final Integer SUCCESS = 0;
+
+ public static final Integer MAX_AVG_BYTES_DURATION = 10;
+
+ public static final Integer BATCH_INSERT_SIZE = 50;
+
+ public static final Integer DEFAULT_SESSION_TIMEOUT_UNIT_MS = 30000;
+
+ public static final Integer MAX_TOPIC_OPERATION_SIZE_PER_REQUEST = 10;
+
+ /**
+ * 不进行过滤的BrokerId
+ */
+ public static final Integer NOT_FILTER_BROKER_ID = -1;
+
+ /**
+ * 默认最近20分钟的连接信息
+ */
+ public static final Long TOPIC_CONNECTION_LATEST_TIME_MS = 20 * 60 * 1000L;
+
+ /**
+ * 工单相关
+ */
+ public static final String HANDLE_APP_APPLY_MAX_NUM = "handle_app_apply_order_num";
+
+ public static final Integer HANDLE_APP_APPLY_MAX_NUM_DEFAULT = 10;
+
+ public static final String AUTO_HANDLE_USER_NAME = "auto_handle";
+
+ public static final String AUTO_HANDLE_CHINESE_NAME = "自动审批";
+
+ public static final String UNKNOWN_VERSION = "unknownVersion";
+
+ public static final String UNKNOWN_USER = "UNKNOWN_USER";
+
+ public static final String DEFAULT_USER_NAME = "kafka-admin";
+
+ public static final Integer DEFAULT_MAX_CAL_TOPIC_EXPIRED_DAY = 90;
+
+ public static final Integer INVALID_CODE = -1;
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaConstant.java
new file mode 100644
index 00000000..b8c5ef19
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaConstant.java
@@ -0,0 +1,17 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * @author zengqiao
+ * @date 20/5/20
+ */
+public class KafkaConstant {
+ public static final String COORDINATOR_TOPIC_NAME = "__consumer_offsets";
+
+ public static final String BROKER_HOST_NAME_SUFFIX = ".diditaxi.com";
+
+ public static final String CLIENT_VERSION_CODE_UNKNOWN = "-1";
+
+ public static final String CLIENT_VERSION_NAME_UNKNOWN = "unknown";
+
+ public static final String RETENTION_MS_KEY = "retention.ms";
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaMetricsCollections.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaMetricsCollections.java
new file mode 100644
index 00000000..9c7f59e3
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/KafkaMetricsCollections.java
@@ -0,0 +1,42 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ *
+ * @author zengqiao
+ * @date 20/4/22
+ */
+public class KafkaMetricsCollections {
+ public static final int COMMON_DETAIL_METRICS = 0;
+
+ /**
+ * Broker流量详情
+ */
+ public static final int BROKER_TO_DB_METRICS = 101; // Broker入DB的Metrics指标
+ public static final int BROKER_OVERVIEW_PAGE_METRICS = 103; // Broker状态概览的指标
+ public static final int BROKER_ANALYSIS_METRICS = 105; // Broker分析的指标
+ public static final int BROKER_TOPIC_ANALYSIS_METRICS = 106; // Broker分析的指标
+ public static final int BROKER_BASIC_PAGE_METRICS = 107; // Broker基本信息页面的指标
+ public static final int BROKER_STATUS_PAGE_METRICS = 108; // Broker状态
+ public static final int BROKER_HEALTH_SCORE_METRICS = 109; // Broker健康分
+
+ /**
+ * Topic流量详情
+ */
+ public static final int TOPIC_FLOW_OVERVIEW = 201;
+ public static final int TOPIC_METRICS_TO_DB = 202;
+ public static final int TOPIC_REQUEST_TIME_METRICS_TO_DB = 203;
+ public static final int TOPIC_BASIC_PAGE_METRICS = 204;
+ public static final int TOPIC_REQUEST_TIME_DETAIL_PAGE_METRICS = 205;
+ public static final int TOPIC_THROTTLED_METRICS_TO_DB = 206;
+
+
+ /**
+ * App+Topic流量详情
+ */
+ public static final int APP_TOPIC_METRICS_TO_DB = 300;
+
+ /**
+ * Broker信息
+ */
+ public static final int BROKER_VERSION = 400;
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LogConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LogConstant.java
new file mode 100644
index 00000000..55fa756f
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LogConstant.java
@@ -0,0 +1,13 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * @author zengqiao
+ * @date 20/8/10
+ */
+public class LogConstant {
+ public static final String COLLECTOR_METRICS_LOGGER = "COLLECTOR_METRICS_LOGGER";
+
+ public static final String API_METRICS_LOGGER = "API_METRICS_LOGGER";
+
+ public static final String SCHEDULED_TASK_LOGGER = "SCHEDULED_TASK_LOGGER";
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LoginConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LoginConstant.java
new file mode 100644
index 00000000..bc95dbc2
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/LoginConstant.java
@@ -0,0 +1,14 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * 登录常量
+ * @author zengqiao
+ * @date 20/5/8
+ */
+public class LoginConstant {
+ public static final String SESSION_USERNAME_KEY = "username";
+
+ public static final String COOKIE_CHINESE_USERNAME_KEY = "chineseName";
+
+ public static final Integer COOKIE_OR_SESSION_MAX_AGE_UNIT_MS = 24 * 60 * 60 * 1000;
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/SystemCodeConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/SystemCodeConstant.java
new file mode 100644
index 00000000..5fc76f03
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/SystemCodeConstant.java
@@ -0,0 +1,17 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * @author zengqiao
+ * @date 20/7/28
+ */
+public class SystemCodeConstant {
+ public static final String LOG_X = "LogX";
+
+ public static final String LEO = "leo";
+
+ public static final String DATA_DREAM = "datadream";
+
+ public static final String KAFKA_MANAGER = "kafka-manager";
+
+ public static final String CHORUS = "chorus"; // 治理平台-服务治理
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicCreationConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicCreationConstant.java
new file mode 100644
index 00000000..423c6d1d
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicCreationConstant.java
@@ -0,0 +1,49 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+import java.util.Properties;
+
+/**
+ * @author zengqiao
+ * @date 20/7/28
+ */
+public class TopicCreationConstant {
+ /**
+ * LogX创建Topic配置KEY
+ */
+ public static final String LOG_X_CREATE_TOPIC_CONFIG_KEY_NAME = "LOG_X_CREATE_TOPIC_CONFIG";
+
+ /**
+ * 治理平台创建Topic配置KEY
+ */
+ public static final String CHORUS_CREATE_TOPIC_CONFIG_KEY_NAME = "CHORUS_CREATE_TOPIC_CONFIG";
+
+ /**
+ * 内部创建Topic配置KEY
+ */
+ public static final String INNER_CREATE_TOPIC_CONFIG_KEY = "INNER_CREATE_TOPIC_CONFIG_KEY";
+
+ public static final Integer DEFAULT_REPLICA = 3;
+
+ public static final Integer DEFAULT_PARTITION_NUM = 1;
+
+ public static final Integer DEFAULT_RETENTION_TIME_UNIT_HOUR = 24;
+
+ public static final String TOPIC_RETENTION_TIME_KEY_NAME = "retention.ms";
+
+ public static Properties createNewProperties(Long retentionTime) {
+ Properties properties = new Properties();
+ properties.put(TOPIC_RETENTION_TIME_KEY_NAME, String.valueOf(retentionTime));
+ return properties;
+ }
+
+ public static final Long AUTO_EXEC_MAX_BYTES_IN_UNIT_B = 30 * 1024 * 1024L;
+
+ /**
+ * Topic 前缀
+ */
+ public static final String TOPIC_NAME_PREFIX_US = "us01_";
+
+ public static final String TOPIC_NAME_PREFIX_RU = "ru01_";
+
+ public static final Integer TOPIC_NAME_MAX_LENGTH = 255;
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicSampleConstant.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicSampleConstant.java
new file mode 100644
index 00000000..5ee15331
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/constant/TopicSampleConstant.java
@@ -0,0 +1,19 @@
+package com.xiaojukeji.kafka.manager.common.constant;
+
+/**
+ * 采样相关配置
+ * @author zengqiao
+ * @date 20/5/8
+ */
+public class TopicSampleConstant {
+ /**
+ * TOPIC_SAMPLE_MAX_MSG_NUM: 最大采样条数
+ * TOPIC_SAMPLE_MAX_TIMEOUT_MS:采样超时时间
+ * TOPIC_SAMPLE_POLL_TIME_OUT_MS:采样单次poll超时时间
+ * TOPIC_SAMPLE_MAX_DATA_LENGTH:截断情况下, 采样的数据最大长度
+ */
+ public static final Integer MAX_MSG_NUM = 100;
+ public static final Integer MAX_TIMEOUT_UNIT_MS = 10000;
+ public static final Integer POLL_TIME_OUT_UNIT_MS = 2000;
+ public static final Integer MAX_DATA_LENGTH_UNIT_BYTE = 2048;
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java
similarity index 73%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java
index ae943c7c..eb384c47 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ConsumerMetadata.java
@@ -3,6 +3,7 @@ package com.xiaojukeji.kafka.manager.common.entity;
import kafka.admin.AdminClient;
import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
/**
* @author zengqiao
@@ -15,12 +16,17 @@ public class ConsumerMetadata {
private Map consumerGroupSummaryMap = new HashMap<>();
+ private Map> consumerGroupAppMap = new ConcurrentHashMap<>();
+
+
public ConsumerMetadata(Set consumerGroupSet,
Map> topicNameConsumerGroupMap,
- Map consumerGroupSummaryMap) {
+ Map consumerGroupSummaryMap,
+ Map> consumerGroupAppMap) {
this.consumerGroupSet = consumerGroupSet;
this.topicNameConsumerGroupMap = topicNameConsumerGroupMap;
this.consumerGroupSummaryMap = consumerGroupSummaryMap;
+ this.consumerGroupAppMap = consumerGroupAppMap;
}
public Set getConsumerGroupSet() {
@@ -34,4 +40,8 @@ public class ConsumerMetadata {
public Map getConsumerGroupSummaryMap() {
return consumerGroupSummaryMap;
}
+
+ public Map> getConsumerGroupAppMap() {
+ return consumerGroupAppMap;
+ }
}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/DeprecatedResponseResult.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/DeprecatedResponseResult.java
new file mode 100644
index 00000000..08b12721
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/DeprecatedResponseResult.java
@@ -0,0 +1,83 @@
+package com.xiaojukeji.kafka.manager.common.entity;
+
+/**
+ * @author zengqiao
+ * @date 20/7/27
+ */
+public class DeprecatedResponseResult {
+ public static final String SUCCESS_STATUS = "success";
+
+ public static final String FAILED_STATUS = "failure";
+
+ public static final String SUCCESS_MESSAGE = "process succeeded!";
+
+ public static final String FAILED_MESSAGE = "process failed!";
+
+ private String status;
+
+ private String message;
+
+ private T data;
+
+ public static DeprecatedResponseResult success(T data) {
+ DeprecatedResponseResult responseCommonResult = new DeprecatedResponseResult();
+ responseCommonResult.setMessage(SUCCESS_MESSAGE);
+ responseCommonResult.setStatus(SUCCESS_STATUS);
+ responseCommonResult.setData(data);
+ return responseCommonResult;
+ }
+
+ public static DeprecatedResponseResult success() {
+ DeprecatedResponseResult responseCommonResult = new DeprecatedResponseResult();
+ responseCommonResult.setStatus(SUCCESS_STATUS);
+ responseCommonResult.setMessage(SUCCESS_MESSAGE);
+ return responseCommonResult;
+ }
+
+ public static DeprecatedResponseResult failure() {
+ DeprecatedResponseResult responseCommonResult = new DeprecatedResponseResult();
+ responseCommonResult.setMessage(FAILED_MESSAGE);
+ responseCommonResult.setStatus(FAILED_STATUS);
+ return responseCommonResult;
+ }
+
+ public static DeprecatedResponseResult failure(String message) {
+ DeprecatedResponseResult responseCommonResult = new DeprecatedResponseResult();
+ responseCommonResult.setMessage(message);
+ responseCommonResult.setStatus(FAILED_STATUS);
+ return responseCommonResult;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ @Override
+ public String toString() {
+ return "DeprecatedResponseResult{" +
+ "status='" + status + '\'' +
+ ", message='" + message + '\'' +
+ ", data=" + data +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/KafkaVersion.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/KafkaVersion.java
new file mode 100644
index 00000000..ba71d612
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/KafkaVersion.java
@@ -0,0 +1,82 @@
+package com.xiaojukeji.kafka.manager.common.entity;
+
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+
+/**
+ * @author zengqiao
+ * @date 20/6/15
+ */
+public class KafkaVersion {
+ private static final String DIDI_VERSION_EXTEND = "d";
+
+ public static final Long VERSION_0_10_3 = 10030000L; // 0.10.2+
+ public static final Long VERSION_MAX = Long.MAX_VALUE;
+
+ private volatile String version = null;
+
+ private volatile long versionNum = Long.MAX_VALUE;
+
+ public boolean initialized() {
+ if (ValidateUtils.isNull(version)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public long getVersionNum() {
+ return versionNum;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaVersion{" +
+ "version='" + version + '\'' +
+ ", versionNum=" + versionNum +
+ '}';
+ }
+
+ public long init(String version) {
+ version = version.toLowerCase();
+ String[] splitElems = version.split("-");
+ int splitElemLength = splitElems.length;
+ if (splitElemLength <= 0) {
+ versionNum = Long.MAX_VALUE;
+ return versionNum;
+ }
+
+ try {
+ // kafka的version
+ String[] kafkaVersion = splitElems[0].split("\\.");
+ int kafkaVersionLength = kafkaVersion.length;
+
+ versionNum = kafkaVersionLength > 0? Integer.valueOf(kafkaVersion[0]): 0;
+ versionNum = versionNum * 100 + (kafkaVersionLength > 1? Integer.valueOf(kafkaVersion[1]): 0);
+ versionNum = versionNum * 100 + (kafkaVersionLength > 2? Integer.valueOf(kafkaVersion[2]): 0);
+ } catch (Exception e) {
+ // Kafka版本信息获取不到时, 直接返回空
+ this.versionNum = Long.MAX_VALUE;
+ return versionNum;
+ }
+
+ // 成功获取版本信息
+ versionNum = versionNum * 10000;
+ this.version = version;
+
+ // 补充扩展信息
+ try {
+ for (int idx = 0; idx < splitElemLength; ++idx) {
+ if (splitElems[idx].equals(DIDI_VERSION_EXTEND) && idx < splitElemLength - 1) {
+ versionNum = versionNum + (Integer.valueOf(splitElems[idx + 1]));
+ return versionNum;
+ }
+ }
+ } catch (Exception e) {
+ // 扩展版本信息获取不到时, 忽略
+ }
+ return versionNum;
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java
similarity index 52%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java
index 27561377..7fc3343f 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/Result.java
@@ -1,7 +1,6 @@
package com.xiaojukeji.kafka.manager.common.entity;
import com.alibaba.fastjson.JSON;
-import com.xiaojukeji.kafka.manager.common.constant.StatusCode;
import java.io.Serializable;
@@ -14,12 +13,13 @@ public class Result implements Serializable {
private T data;
private String message;
- private Integer code;
+ private String tips;
+ private int code;
public Result(T data) {
this.data = data;
- this.code = StatusCode.SUCCESS;
- this.message = "成功";
+ this.code = ResultStatus.SUCCESS.getCode();
+ this.message = ResultStatus.SUCCESS.getMessage();
}
public Result() {
@@ -37,7 +37,6 @@ public class Result implements Serializable {
this.code = code;
}
-
public T getData()
{
return (T)this.data;
@@ -58,12 +57,20 @@ public class Result implements Serializable {
this.message = message;
}
- public Integer getCode()
+ public String getTips() {
+ return tips;
+ }
+
+ public void setTips(String tips) {
+ this.tips = tips;
+ }
+
+ public int getCode()
{
return this.code;
}
- public void setCode(Integer code)
+ public void setCode(int code)
{
this.code = code;
}
@@ -73,4 +80,26 @@ public class Result implements Serializable {
{
return JSON.toJSONString(this);
}
+
+ public static Result buildSuc() {
+ Result result = new Result();
+ result.setCode(ResultStatus.SUCCESS.getCode());
+ result.setMessage(ResultStatus.SUCCESS.getMessage());
+ return result;
+ }
+
+ public static Result buildFrom(ResultStatus resultStatus) {
+ Result result = new Result();
+ result.setCode(resultStatus.getCode());
+ result.setMessage(resultStatus.getMessage());
+ return result;
+ }
+
+ public static Result buildFrom(ResultStatus resultStatus, Object data) {
+ Result result = new Result();
+ result.setCode(resultStatus.getCode());
+ result.setMessage(resultStatus.getMessage());
+ result.setData(data);
+ return result;
+ }
}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ResultStatus.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ResultStatus.java
new file mode 100644
index 00000000..b63151ac
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ResultStatus.java
@@ -0,0 +1,154 @@
+package com.xiaojukeji.kafka.manager.common.entity;
+
+import com.xiaojukeji.kafka.manager.common.constant.Constant;
+
+/**
+ * 返回状态
+ * @author zengqiao
+ * @date 20/4/16
+ */
+public enum ResultStatus {
+ SUCCESS(Constant.SUCCESS, "success"),
+ LOGIN_FAILED(1, "login failed, please check username and password"),
+
+
+ /**
+ * 内部依赖错误, [1000, 1200)
+ * ------------------------------------------------------------------------------------------
+ */
+ MYSQL_ERROR(1000, "operate database failed"),
+
+ CONNECT_ZOOKEEPER_FAILED(1000, "connect zookeeper failed"),
+ READ_ZOOKEEPER_FAILED(1000, "read zookeeper failed"),
+ READ_JMX_FAILED(1000, "read jmx failed"),
+
+
+ // 内部依赖错误 —— Kafka特定错误, [1000, 1100)
+ BROKER_NUM_NOT_ENOUGH(1000, "broker not enough"),
+ CONTROLLER_NOT_ALIVE(1000, "controller not alive"),
+ CLUSTER_METADATA_ERROR(1000, "cluster metadata error"),
+ TOPIC_CONFIG_ERROR(1000, "topic config error"),
+
+
+ /**
+ * 外部依赖错误, [1200, 1400)
+ * ------------------------------------------------------------------------------------------
+ */
+ CALL_CLUSTER_TASK_AGENT_FAILED(1000, " call cluster task agent failed"),
+ CALL_MONITOR_SYSTEM_ERROR(1000, " call monitor-system failed"),
+
+
+
+ /**
+ * 外部用户操作错误, [1400, 1600)
+ * ------------------------------------------------------------------------------------------
+ */
+ PARAM_ILLEGAL(1400, "param illegal"),
+ OPERATION_FAILED(1401, "operation failed"),
+ OPERATION_FORBIDDEN(1402, "operation forbidden"),
+ API_CALL_EXCEED_LIMIT(1403, "api call exceed limit"),
+
+ // 资源不存在
+ CLUSTER_NOT_EXIST(10000, "cluster not exist"),
+ BROKER_NOT_EXIST(10000, "broker not exist"),
+ TOPIC_NOT_EXIST(10000, "topic not exist"),
+ PARTITION_NOT_EXIST(10000, "partition not exist"),
+
+ ACCOUNT_NOT_EXIST(10000, "account not exist"),
+ APP_NOT_EXIST(1000, "app not exist"),
+ ORDER_NOT_EXIST(1000, "order not exist"),
+ CONFIG_NOT_EXIST(1000, "config not exist"),
+ IDC_NOT_EXIST(1000, "idc not exist"),
+ TASK_NOT_EXIST(1110, "task not exist"),
+
+ AUTHORITY_NOT_EXIST(1000, "authority not exist"),
+
+ MONITOR_NOT_EXIST(1110, "monitor not exist"),
+
+ QUOTA_NOT_EXIST(1000, "quota not exist, please check clusterId, topicName and appId"),
+
+ // 资源不存在, 已存在, 已被使用
+ RESOURCE_NOT_EXIST(1200, "资源不存在"),
+ RESOURCE_ALREADY_EXISTED(1200, "资源已经存在"),
+ RESOURCE_NAME_DUPLICATED(1200, "资源名称重复"),
+ RESOURCE_ALREADY_USED(1000, "资源早已被使用"),
+
+
+ /**
+ * 资源参数错误
+ */
+ CG_LOCATION_ILLEGAL(10000, "consumer group location illegal"),
+ ORDER_ALREADY_HANDLED(1000, "order already handled"),
+
+ APP_ID_OR_PASSWORD_ILLEGAL(1000, "app or password illegal"),
+ SYSTEM_CODE_ILLEGAL(1000, "system code illegal"),
+
+
+
+
+
+
+
+
+
+ ///////////////////////////////////////////////////////////////
+
+ USER_WITHOUT_AUTHORITY(1000, "user without authority"),
+
+
+
+ JSON_PARSER_ERROR(1000, "json parser error"),
+
+
+ TOPIC_OPERATION_PARAM_NULL_POINTER(2, "参数错误"),
+ TOPIC_OPERATION_PARTITION_NUM_ILLEGAL(3, "分区数错误"),
+ TOPIC_OPERATION_BROKER_NUM_NOT_ENOUGH(4, "Broker数不足错误"),
+ TOPIC_OPERATION_TOPIC_NAME_ILLEGAL(5, "Topic名称非法"),
+ TOPIC_OPERATION_TOPIC_EXISTED(6, "Topic已存在"),
+ TOPIC_OPERATION_UNKNOWN_TOPIC_PARTITION(7, "Topic未知"),
+ TOPIC_OPERATION_TOPIC_CONFIG_ILLEGAL(8, "Topic配置错误"),
+ TOPIC_OPERATION_TOPIC_IN_DELETING(9, "Topic正在删除"),
+ TOPIC_OPERATION_UNKNOWN_ERROR(10, "未知错误"),
+ TOPIC_EXIST_CONNECT_CANNOT_DELETE(10, "topic exist connect cannot delete"),
+ EXIST_TOPIC_CANNOT_DELETE(10, "exist topic cannot delete"),
+
+
+ /**
+ * 工单
+ */
+ CHANGE_ZOOKEEPER_FORBIDEN(100, "change zookeeper forbiden"),
+// APP_EXIST_TOPIC_AUTHORITY_CANNOT_DELETE(1000, "app exist topic authority cannot delete"),
+
+ UPLOAD_FILE_FAIL(1000, "upload file fail"),
+ FILE_TYPE_NOT_SUPPORT(1000, "File type not support"),
+ DOWNLOAD_FILE_FAIL(1000, "download file fail"),
+
+
+ TOPIC_ALREADY_EXIST(17400, "topic already existed"),
+ CONSUMER_GROUP_NOT_EXIST(17411, "consumerGroup not exist"),
+ ;
+
+ private int code;
+ private String message;
+
+ ResultStatus(int code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/TopicOperationResult.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/TopicOperationResult.java
new file mode 100644
index 00000000..3c979d8d
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/TopicOperationResult.java
@@ -0,0 +1,83 @@
+package com.xiaojukeji.kafka.manager.common.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/2
+ */
+public class TopicOperationResult {
+ @ApiModelProperty(value = "集群ID")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "Topic名称")
+ private String topicName;
+
+ @ApiModelProperty(value = "状态码, 0:成功, 其他失败")
+ private Integer code;
+
+ @ApiModelProperty(value = "信息")
+ private String message;
+
+ 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 getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicOperationResult{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", code=" + code +
+ ", message='" + message + '\'' +
+ '}';
+ }
+
+ public static TopicOperationResult buildFrom(Long clusterId, String topicName, Result rs) {
+ return buildFrom(clusterId, topicName, rs.getCode(), rs.getMessage());
+ }
+
+ public static TopicOperationResult buildFrom(Long clusterId, String topicName, ResultStatus rs) {
+ return buildFrom(clusterId, topicName, rs.getCode(), rs.getMessage());
+ }
+
+ private static TopicOperationResult buildFrom(Long clusterId,
+ String topicName,
+ Integer code,
+ String message) {
+ TopicOperationResult result = new TopicOperationResult();
+ result.setClusterId(clusterId);
+ result.setTopicName(topicName);
+ result.setCode(code);
+ result.setMessage(message);
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/AppTopicDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/AppTopicDTO.java
new file mode 100644
index 00000000..ac202605
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/AppTopicDTO.java
@@ -0,0 +1,91 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao;
+
+/**
+ * AppTopic信息
+ * @author zengqiao
+ * @date 20/5/11
+ */
+public class AppTopicDTO {
+ private Long logicalClusterId;
+
+ private String logicalClusterName;
+
+ private Long physicalClusterId;
+
+ private String topicName;
+
+ private Integer access;
+
+ private String operator;
+
+ private Long gmtCreate;
+
+ public Long getLogicalClusterId() {
+ return logicalClusterId;
+ }
+
+ public void setLogicalClusterId(Long logicalClusterId) {
+ this.logicalClusterId = logicalClusterId;
+ }
+
+ public String getLogicalClusterName() {
+ return logicalClusterName;
+ }
+
+ public void setLogicalClusterName(String logicalClusterName) {
+ this.logicalClusterName = logicalClusterName;
+ }
+
+ public Long getPhysicalClusterId() {
+ return physicalClusterId;
+ }
+
+ public void setPhysicalClusterId(Long physicalClusterId) {
+ this.physicalClusterId = physicalClusterId;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public Integer getAccess() {
+ return access;
+ }
+
+ public void setAccess(Integer access) {
+ this.access = access;
+ }
+
+ public String getOperator() {
+ return operator;
+ }
+
+ public void setOperator(String operator) {
+ this.operator = operator;
+ }
+
+ public Long getGmtCreate() {
+ return gmtCreate;
+ }
+
+ public void setGmtCreate(Long gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ @Override
+ public String toString() {
+ return "AppTopicDTO{" +
+ "logicalClusterId=" + logicalClusterId +
+ ", logicalClusterName='" + logicalClusterName + '\'' +
+ ", physicalClusterId=" + physicalClusterId +
+ ", topicName='" + topicName + '\'' +
+ ", access=" + access +
+ ", operator='" + operator + '\'' +
+ ", gmtCreate=" + gmtCreate +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/BrokerBasicDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerBasicDTO.java
similarity index 97%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/BrokerBasicDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerBasicDTO.java
index 384cdf33..eb8e01d2 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/BrokerBasicDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerBasicDTO.java
@@ -1,4 +1,4 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto;
+package com.xiaojukeji.kafka.manager.common.entity.ao;
/**
* Broker基本信息
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerOverviewDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerOverviewDTO.java
new file mode 100644
index 00000000..7ce643b6
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/BrokerOverviewDTO.java
@@ -0,0 +1,189 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao;
+
+import com.xiaojukeji.kafka.manager.common.entity.metrics.BrokerMetrics;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers.BrokerMetadata;
+
+/**
+ * @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 Object byteIn;
+
+ private Object byteOut;
+
+ private Integer partitionCount;
+
+ private Integer underReplicatedPartitions;
+
+ private Boolean underReplicated;
+
+ private Integer status;
+
+ private Integer peakFlowStatus;
+
+ private String kafkaVersion;
+
+ private Integer leaderCount;
+
+ 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 Object getByteIn() {
+ return byteIn;
+ }
+
+ public void setByteIn(Object byteIn) {
+ this.byteIn = byteIn;
+ }
+
+ public Object getByteOut() {
+ return byteOut;
+ }
+
+ public void setByteOut(Object byteOut) {
+ this.byteOut = byteOut;
+ }
+
+ 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 Boolean getUnderReplicated() {
+ return underReplicated;
+ }
+
+ public void setUnderReplicated(Boolean underReplicated) {
+ this.underReplicated = underReplicated;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ public Integer getPeakFlowStatus() {
+ return peakFlowStatus;
+ }
+
+ public void setPeakFlowStatus(Integer peakFlowStatus) {
+ this.peakFlowStatus = peakFlowStatus;
+ }
+
+ public String getKafkaVersion() {
+ return kafkaVersion;
+ }
+
+ public void setKafkaVersion(String kafkaVersion) {
+ this.kafkaVersion = kafkaVersion;
+ }
+
+ public Integer getLeaderCount() {
+ return leaderCount;
+ }
+
+ public void setLeaderCount(Integer leaderCount) {
+ this.leaderCount = leaderCount;
+ }
+
+ public static BrokerOverviewDTO newInstance(BrokerMetadata brokerMetadata,
+ BrokerMetrics brokerMetrics,
+ String kafkaVersion) {
+ 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(0);
+ if (brokerMetrics == null) {
+ return brokerOverviewDTO;
+ }
+ brokerOverviewDTO.setByteIn(
+ brokerMetrics.getSpecifiedMetrics("BytesInPerSecOneMinuteRate")
+ );
+ brokerOverviewDTO.setByteOut(
+ brokerMetrics.getSpecifiedMetrics("BytesOutPerSecOneMinuteRate")
+ );
+ brokerOverviewDTO.setPartitionCount(
+ brokerMetrics.getSpecifiedMetrics("PartitionCountValue", Integer.class)
+ );
+ brokerOverviewDTO.setUnderReplicatedPartitions(
+ brokerMetrics.getSpecifiedMetrics("UnderReplicatedPartitionsValue", Integer.class)
+ );
+
+ if (!ValidateUtils.isNull(brokerOverviewDTO.getUnderReplicatedPartitions())) {
+ brokerOverviewDTO.setUnderReplicated(brokerOverviewDTO.getUnderReplicatedPartitions() > 0);
+ }
+ brokerOverviewDTO.setLeaderCount(
+ brokerMetrics.getSpecifiedMetrics("LeaderCountValue", Integer.class)
+ );
+ brokerOverviewDTO.setKafkaVersion(kafkaVersion);
+ return brokerOverviewDTO;
+ }
+
+
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/cluster/ClusterDetailVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/ClusterDetailDTO.java
similarity index 56%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/cluster/ClusterDetailVO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/ClusterDetailDTO.java
index e5d2bf7c..937d9cf8 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/cluster/ClusterDetailVO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/ClusterDetailDTO.java
@@ -1,65 +1,43 @@
-package com.xiaojukeji.kafka.manager.web.vo.cluster;
+package com.xiaojukeji.kafka.manager.common.entity.ao;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
/**
- * ClusterDetailVO
- * @author huangyiminghappy@163.com
- * @date 2019/3/15
+ * @author zengqiao
+ * @date 20/4/23
*/
-@ApiModel(value="ClusterDetailVO", description="集群详细信息")
-public class ClusterDetailVO {
- @ApiModelProperty(value="集群Id")
+public class ClusterDetailDTO {
private Long clusterId;
- @ApiModelProperty(value="集群名称")
private String clusterName;
- @ApiModelProperty(value="集群ZK地址")
private String zookeeper;
- @ApiModelProperty(value="bootstrap地址")
private String bootstrapServers;
- @ApiModelProperty(value="kafka版本")
private String kafkaVersion;
- @ApiModelProperty(value="broker数量")
- private Integer brokerNum;
+ private String idc;
- @ApiModelProperty(value="topic数量")
- private Integer topicNum;
+ private Integer mode;
- @ApiModelProperty(value="consumerGroup数量")
- private Integer consumerGroupNum;
+ private String securityProperties;
- @ApiModelProperty(value="controllerId")
- private Integer controllerId;
-
- @ApiModelProperty(value="安全协议")
- private String securityProtocol;
-
- @ApiModelProperty(value="SASL机制")
- private String saslMechanism;
-
- @ApiModelProperty(value="SASL的JSSA配置")
- private String saslJaasConfig;
-
- @ApiModelProperty(value="regionNum数")
- private Integer regionNum;
-
- @ApiModelProperty(value = "开启告警[0:不开启, 1:开启]")
- private Integer alarmFlag;
-
- @ApiModelProperty(value="是否已经删除,0不删除,1删除")
private Integer status;
- @ApiModelProperty(value="集群创建时间")
- private Long gmtCreate;
+ private Date gmtCreate;
- @ApiModelProperty(value="集群修改时间")
- private Long gmtModify;
+ private Date gmtModify;
+
+ private Integer brokerNum;
+
+ private Integer topicNum;
+
+ private Integer consumerGroupNum;
+
+ private Integer controllerId;
+
+ private Integer regionNum;
public Long getClusterId() {
return clusterId;
@@ -101,6 +79,54 @@ public class ClusterDetailVO {
this.kafkaVersion = kafkaVersion;
}
+ public String getIdc() {
+ return idc;
+ }
+
+ public void setIdc(String idc) {
+ this.idc = idc;
+ }
+
+ public Integer getMode() {
+ return mode;
+ }
+
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ public String getSecurityProperties() {
+ return securityProperties;
+ }
+
+ public void setSecurityProperties(String securityProperties) {
+ this.securityProperties = securityProperties;
+ }
+
+ 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;
+ }
+
public Integer getBrokerNum() {
return brokerNum;
}
@@ -133,30 +159,6 @@ public class ClusterDetailVO {
this.controllerId = controllerId;
}
- public String getSecurityProtocol() {
- return securityProtocol;
- }
-
- public void setSecurityProtocol(String securityProtocol) {
- this.securityProtocol = securityProtocol;
- }
-
- public String getSaslMechanism() {
- return saslMechanism;
- }
-
- public void setSaslMechanism(String saslMechanism) {
- this.saslMechanism = saslMechanism;
- }
-
- public String getSaslJaasConfig() {
- return saslJaasConfig;
- }
-
- public void setSaslJaasConfig(String saslJaasConfig) {
- this.saslJaasConfig = saslJaasConfig;
- }
-
public Integer getRegionNum() {
return regionNum;
}
@@ -165,58 +167,25 @@ public class ClusterDetailVO {
this.regionNum = regionNum;
}
- public Integer getAlarmFlag() {
- return alarmFlag;
- }
-
- public void setAlarmFlag(Integer alarmFlag) {
- this.alarmFlag = alarmFlag;
- }
-
- public Integer getStatus() {
- return status;
- }
-
- public void setStatus(Integer status) {
- this.status = status;
- }
-
- public Long getGmtCreate() {
- return gmtCreate;
- }
-
- public void setGmtCreate(Long gmtCreate) {
- this.gmtCreate = gmtCreate;
- }
-
- public Long getGmtModify() {
- return gmtModify;
- }
-
- public void setGmtModify(Long gmtModify) {
- this.gmtModify = gmtModify;
- }
-
@Override
public String toString() {
- return "ClusterDetailVO{" +
+ return "ClusterDetailDTO{" +
"clusterId=" + clusterId +
", clusterName='" + clusterName + '\'' +
", zookeeper='" + zookeeper + '\'' +
", bootstrapServers='" + bootstrapServers + '\'' +
", kafkaVersion='" + kafkaVersion + '\'' +
+ ", idc='" + idc + '\'' +
+ ", mode='" + mode + '\'' +
+ ", securityProperties='" + securityProperties + '\'' +
+ ", status=" + status +
+ ", gmtCreate=" + gmtCreate +
+ ", gmtModify=" + gmtModify +
", brokerNum=" + brokerNum +
", topicNum=" + topicNum +
", consumerGroupNum=" + consumerGroupNum +
", controllerId=" + controllerId +
- ", securityProtocol='" + securityProtocol + '\'' +
- ", saslMechanism='" + saslMechanism + '\'' +
- ", saslJaasConfig='" + saslJaasConfig + '\'' +
", regionNum=" + regionNum +
- ", alarmFlag=" + alarmFlag +
- ", status=" + status +
- ", gmtCreate=" + gmtCreate +
- ", gmtModify=" + gmtModify +
'}';
}
-}
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionAttributeDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionAttributeDTO.java
new file mode 100644
index 00000000..e9e648ff
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionAttributeDTO.java
@@ -0,0 +1,24 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao;
+
+/**
+ * @author zhongyuankai
+ * @date 2020/5/26
+ */
+public class PartitionAttributeDTO {
+ private Long logSize;
+
+ public Long getLogSize() {
+ return logSize;
+ }
+
+ public void setLogSize(Long logSize) {
+ this.logSize = logSize;
+ }
+
+ @Override
+ public String toString() {
+ return "PartitionAttributeDTO{" +
+ "logSize=" + logSize +
+ '}';
+ }
+}
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/PartitionOffsetDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionOffsetDTO.java
similarity index 95%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/PartitionOffsetDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionOffsetDTO.java
index 3ce2059f..bfe80a6b 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/PartitionOffsetDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/PartitionOffsetDTO.java
@@ -1,4 +1,4 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto;
+package com.xiaojukeji.kafka.manager.common.entity.ao;
/**
* Topic Offset
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/RdTopicBasic.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/RdTopicBasic.java
new file mode 100644
index 00000000..3cecd3cf
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/RdTopicBasic.java
@@ -0,0 +1,103 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao;
+
+import java.util.Properties;
+
+/**
+ * @author zengqiao
+ * @date 20/6/10
+ */
+public class RdTopicBasic {
+ private Long clusterId;
+
+ private String clusterName;
+
+ private String topicName;
+
+ private Long retentionTime;
+
+ private String appId;
+
+ private String appName;
+
+ private Properties properties;
+
+ private String description;
+
+ 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 String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties properties) {
+ this.properties = properties;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "RdTopicBasic{" +
+ "clusterId=" + clusterId +
+ ", clusterName='" + clusterName + '\'' +
+ ", topicName='" + topicName + '\'' +
+ ", retentionTime=" + retentionTime +
+ ", appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", properties=" + properties +
+ ", description='" + description + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/TopicDiskLocation.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/TopicDiskLocation.java
new file mode 100644
index 00000000..dde7deb8
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/TopicDiskLocation.java
@@ -0,0 +1,103 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/7/8
+ */
+public class TopicDiskLocation {
+ private Long clusterId;
+
+ private String topicName;
+
+ private Integer brokerId;
+
+ private String diskName;
+
+ private List leaderPartitions;
+
+ private List followerPartitions;
+
+ private Boolean isUnderReplicated;
+
+ private List underReplicatedPartitions;
+
+ 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 getBrokerId() {
+ return brokerId;
+ }
+
+ public void setBrokerId(Integer brokerId) {
+ this.brokerId = brokerId;
+ }
+
+ public String getDiskName() {
+ return diskName;
+ }
+
+ public void setDiskName(String diskName) {
+ this.diskName = diskName;
+ }
+
+ public List getLeaderPartitions() {
+ return leaderPartitions;
+ }
+
+ public void setLeaderPartitions(List leaderPartitions) {
+ this.leaderPartitions = leaderPartitions;
+ }
+
+ public List getFollowerPartitions() {
+ return followerPartitions;
+ }
+
+ public void setFollowerPartitions(List followerPartitions) {
+ this.followerPartitions = followerPartitions;
+ }
+
+ public Boolean getUnderReplicated() {
+ return isUnderReplicated;
+ }
+
+ public void setUnderReplicated(Boolean underReplicated) {
+ isUnderReplicated = underReplicated;
+ }
+
+ public List getUnderReplicatedPartitions() {
+ return underReplicatedPartitions;
+ }
+
+ public void setUnderReplicatedPartitions(List underReplicatedPartitions) {
+ this.underReplicatedPartitions = underReplicatedPartitions;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicDiskLocation{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", brokerId=" + brokerId +
+ ", diskName='" + diskName + '\'' +
+ ", leaderPartitions=" + leaderPartitions +
+ ", followerPartitions=" + followerPartitions +
+ ", isUnderReplicated=" + isUnderReplicated +
+ ", underReplicatedPartitions=" + underReplicatedPartitions +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/account/Account.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/account/Account.java
new file mode 100644
index 00000000..b387e6d5
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/account/Account.java
@@ -0,0 +1,71 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.account;
+
+import com.xiaojukeji.kafka.manager.common.bizenum.AccountRoleEnum;
+
+/**
+ * 用户信息
+ * @author zengqiao
+ * @date 20/6/10
+ */
+public class Account {
+ private String username;
+
+ private String chineseName;
+
+ private String department;
+
+ private AccountRoleEnum accountRoleEnum;
+
+ public Account(String username, String chineseName, String department, AccountRoleEnum accountRoleEnum) {
+ this.username = username;
+ this.chineseName = chineseName;
+ this.department = department;
+ this.accountRoleEnum = accountRoleEnum;
+ }
+
+ public Account() {
+ super();
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getChineseName() {
+ return chineseName;
+ }
+
+ public void setChineseName(String chineseName) {
+ this.chineseName = chineseName;
+ }
+
+ public String getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+
+ public AccountRoleEnum getAccountRoleEnum() {
+ return accountRoleEnum;
+ }
+
+ public void setAccountRoleEnum(AccountRoleEnum accountRoleEnum) {
+ this.accountRoleEnum = accountRoleEnum;
+ }
+
+ @Override
+ public String toString() {
+ return "Account{" +
+ "username='" + username + '\'' +
+ ", chineseName='" + chineseName + '\'' +
+ ", department='" + department + '\'' +
+ ", accountRoleEnum=" + accountRoleEnum +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisBrokerDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisBrokerDTO.java
similarity index 97%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisBrokerDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisBrokerDTO.java
index b47e071b..a5441f86 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisBrokerDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisBrokerDTO.java
@@ -1,4 +1,4 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto.analysis;
+package com.xiaojukeji.kafka.manager.common.entity.ao.analysis;
import java.util.List;
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisTopicDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisTopicDTO.java
similarity index 98%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisTopicDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisTopicDTO.java
index 6428f3a4..cf78e887 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/analysis/AnalysisTopicDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/analysis/AnalysisTopicDTO.java
@@ -1,4 +1,4 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto.analysis;
+package com.xiaojukeji.kafka.manager.common.entity.ao.analysis;
/**
* @author zengqiao
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/api/ApiCount.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/api/ApiCount.java
new file mode 100644
index 00000000..aefe940a
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/api/ApiCount.java
@@ -0,0 +1,50 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.api;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author zengqiao
+ * @date 20/7/27
+ */
+public class ApiCount {
+ private int apiLevel;
+
+ private Integer maxNum;
+
+ private AtomicInteger currentNum;
+
+ public ApiCount(int apiLevel, Integer maxNum, AtomicInteger currentNum) {
+ this.apiLevel = apiLevel;
+ this.maxNum = maxNum;
+ this.currentNum = currentNum;
+ }
+
+ public int getApiLevel() {
+ return apiLevel;
+ }
+
+ public Integer getMaxNum() {
+ return maxNum;
+ }
+
+ public AtomicInteger getCurrentNum() {
+ return currentNum;
+ }
+
+ public Boolean incAndCheckIsOverFlow() {
+ return maxNum < currentNum.incrementAndGet();
+ }
+
+ public int decPresentNum() {
+ return currentNum.decrementAndGet();
+ }
+
+ @Override
+ public String toString() {
+ return "ApiCount{" +
+ "apiLevel=" + apiLevel +
+ ", maxNum=" + maxNum +
+ ", currentNum=" + currentNum +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/ClusterBrokerStatus.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/ClusterBrokerStatus.java
new file mode 100644
index 00000000..33f1e74e
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/ClusterBrokerStatus.java
@@ -0,0 +1,37 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.cluster;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/7/14
+ */
+public class ClusterBrokerStatus {
+ private List brokerReplicaStatusList;
+
+ private List brokerBytesInStatusList;
+
+ public List getBrokerReplicaStatusList() {
+ return brokerReplicaStatusList;
+ }
+
+ public void setBrokerReplicaStatusList(List brokerReplicaStatusList) {
+ this.brokerReplicaStatusList = brokerReplicaStatusList;
+ }
+
+ public List getBrokerBytesInStatusList() {
+ return brokerBytesInStatusList;
+ }
+
+ public void setBrokerBytesInStatusList(List brokerBytesInStatusList) {
+ this.brokerBytesInStatusList = brokerBytesInStatusList;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterBrokerStatus{" +
+ "brokerReplicaStatusList=" + brokerReplicaStatusList +
+ ", brokerBytesInStatusList=" + brokerBytesInStatusList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java
new file mode 100644
index 00000000..86941d0e
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java
@@ -0,0 +1,123 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.cluster;
+
+/**
+ * @author zengqiao
+ * @date 20/4/1
+ */
+public class LogicalCluster {
+ private Long logicalClusterId;
+
+ private String logicalClusterName;
+
+ private Integer mode;
+
+ private Integer topicNum;
+
+ private String clusterVersion;
+
+ private Long physicalClusterId;
+
+ private String bootstrapServers;
+
+ private String description;
+
+ private Long gmtCreate;
+
+ private Long gmtModify;
+
+ public Long getLogicalClusterId() {
+ return logicalClusterId;
+ }
+
+ public void setLogicalClusterId(Long logicalClusterId) {
+ this.logicalClusterId = logicalClusterId;
+ }
+
+ public String getLogicalClusterName() {
+ return logicalClusterName;
+ }
+
+ public void setLogicalClusterName(String logicalClusterName) {
+ this.logicalClusterName = logicalClusterName;
+ }
+
+ public Integer getMode() {
+ return mode;
+ }
+
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ public Integer getTopicNum() {
+ return topicNum;
+ }
+
+ public void setTopicNum(Integer topicNum) {
+ this.topicNum = topicNum;
+ }
+
+ public String getClusterVersion() {
+ return clusterVersion;
+ }
+
+ public void setClusterVersion(String clusterVersion) {
+ this.clusterVersion = clusterVersion;
+ }
+
+ public Long getPhysicalClusterId() {
+ return physicalClusterId;
+ }
+
+ public void setPhysicalClusterId(Long physicalClusterId) {
+ this.physicalClusterId = physicalClusterId;
+ }
+
+ public String getBootstrapServers() {
+ return bootstrapServers;
+ }
+
+ public void setBootstrapServers(String bootstrapServers) {
+ this.bootstrapServers = bootstrapServers;
+ }
+
+ public Long getGmtCreate() {
+ return gmtCreate;
+ }
+
+ public void setGmtCreate(Long gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ public Long getGmtModify() {
+ return gmtModify;
+ }
+
+ public void setGmtModify(Long gmtModify) {
+ this.gmtModify = gmtModify;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "LogicalCluster{" +
+ "logicalClusterId=" + logicalClusterId +
+ ", logicalClusterName='" + logicalClusterName + '\'' +
+ ", mode=" + mode +
+ ", topicNum=" + topicNum +
+ ", clusterVersion='" + clusterVersion + '\'' +
+ ", physicalClusterId=" + physicalClusterId +
+ ", bootstrapServers='" + bootstrapServers + '\'' +
+ ", description='" + description + '\'' +
+ ", gmtCreate=" + gmtCreate +
+ ", gmtModify=" + gmtModify +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicMetricsVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalClusterMetrics.java
similarity index 70%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicMetricsVO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalClusterMetrics.java
index 7ca5000c..a3cb9c34 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicMetricsVO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalClusterMetrics.java
@@ -1,40 +1,23 @@
-package com.xiaojukeji.kafka.manager.web.vo.topic;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+package com.xiaojukeji.kafka.manager.common.entity.ao.cluster;
/**
- * @author huangyiminghappy@163.com
- * @date 2019-03-20
+ * @author zengqiao
+ * @date 20/6/29
*/
-@ApiModel(value = "Topic流量信息")
-public class TopicMetricsVO {
- @ApiModelProperty(value = "每秒流入消息数")
- private Double messagesInPerSec = 0.0;
+public class LogicalClusterMetrics {
- @ApiModelProperty(value = "每秒流入字节数")
- private Double bytesInPerSec = 0.0;
-
- @ApiModelProperty(value = "每秒流出字节数")
- private Double bytesOutPerSec = 0.0;
-
- @ApiModelProperty(value = "每秒拒绝字节数")
- private Double bytesRejectedPerSec = 0.0;
-
- @ApiModelProperty(value = "每秒请求数")
private Double totalProduceRequestsPerSec = 0.0;
- @ApiModelProperty(value = "创建时间")
+ private Double bytesInPerSec = 0.0;
+
+ private Double bytesOutPerSec = 0.0;
+
+ private Double bytesRejectedPerSec = 0.0;
+
+ private Double messagesInPerSec = 0.0;
+
private Long gmtCreate;
- public Double getMessagesInPerSec() {
- return messagesInPerSec;
- }
-
- public void setMessagesInPerSec(Double messagesInPerSec) {
- this.messagesInPerSec = messagesInPerSec;
- }
-
public Double getBytesInPerSec() {
return bytesInPerSec;
}
@@ -59,12 +42,12 @@ public class TopicMetricsVO {
this.bytesRejectedPerSec = bytesRejectedPerSec;
}
- public Double getTotalProduceRequestsPerSec() {
- return totalProduceRequestsPerSec;
+ public Double getMessagesInPerSec() {
+ return messagesInPerSec;
}
- public void setTotalProduceRequestsPerSec(Double totalProduceRequestsPerSec) {
- this.totalProduceRequestsPerSec = totalProduceRequestsPerSec;
+ public void setMessagesInPerSec(Double messagesInPerSec) {
+ this.messagesInPerSec = messagesInPerSec;
}
public Long getGmtCreate() {
@@ -75,15 +58,23 @@ public class TopicMetricsVO {
this.gmtCreate = gmtCreate;
}
+ public Double getTotalProduceRequestsPerSec() {
+ return totalProduceRequestsPerSec;
+ }
+
+ public void setTotalProduceRequestsPerSec(Double totalProduceRequestsPerSec) {
+ this.totalProduceRequestsPerSec = totalProduceRequestsPerSec;
+ }
+
@Override
public String toString() {
- return "TopicMetricsVO{" +
- "messagesInPerSec=" + messagesInPerSec +
+ return "LogicalClusterMetrics{" +
+ "totalProduceRequestsPerSec=" + totalProduceRequestsPerSec +
", bytesInPerSec=" + bytesInPerSec +
", bytesOutPerSec=" + bytesOutPerSec +
", bytesRejectedPerSec=" + bytesRejectedPerSec +
- ", totalProduceRequestsPerSec=" + totalProduceRequestsPerSec +
+ ", messagesInPerSec=" + messagesInPerSec +
", gmtCreate=" + gmtCreate +
'}';
}
-}
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicConfig.java
new file mode 100644
index 00000000..35f694f8
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicConfig.java
@@ -0,0 +1,26 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/7/24
+ */
+public class CreateTopicConfig {
+ private List configList;
+
+ public List getConfigList() {
+ return configList;
+ }
+
+ public void setConfigList(List configList) {
+ this.configList = configList;
+ }
+
+ @Override
+ public String toString() {
+ return "CreateTopicConfig{" +
+ "configList=" + configList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/AdminExpandTopicModel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicElemConfig.java
similarity index 50%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/AdminExpandTopicModel.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicElemConfig.java
index 057b7951..0f74b1e4 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/AdminExpandTopicModel.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/CreateTopicElemConfig.java
@@ -1,32 +1,26 @@
-package com.xiaojukeji.kafka.manager.web.model.topic;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.springframework.util.StringUtils;
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
import java.util.List;
/**
* @author zengqiao
- * @date 20/1/2
+ * @date 20/7/24
*/
-@ApiModel(value = "AdminExpandTopicModel")
-public class AdminExpandTopicModel {
- @ApiModelProperty(value = "集群ID")
+public class CreateTopicElemConfig {
private Long clusterId;
- @ApiModelProperty(value = "topicName名称")
- private String topicName;
-
- @ApiModelProperty(value = "分区数")
- private Integer partitionNum;
-
- @ApiModelProperty(value = "brokerId列表")
private List brokerIdList;
- @ApiModelProperty(value = "regionId列表")
private List regionIdList;
+ private Integer partitionNum;
+
+ private Integer replicaNum;
+
+ private Integer retentionTimeUnitHour;
+
+ private Long autoExecMaxPeakBytesInUnitB;
+
public Long getClusterId() {
return clusterId;
}
@@ -35,22 +29,6 @@ public class AdminExpandTopicModel {
this.clusterId = clusterId;
}
- 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 List getBrokerIdList() {
return brokerIdList;
}
@@ -67,26 +45,48 @@ public class AdminExpandTopicModel {
this.regionIdList = regionIdList;
}
- @Override
- public String toString() {
- return "AdminExpandTopicModel{" +
- "clusterId=" + clusterId +
- ", topicName='" + topicName + '\'' +
- ", partitionNum=" + partitionNum +
- ", brokerIdList=" + brokerIdList +
- ", regionIdList=" + regionIdList +
- '}';
+ public Integer getReplicaNum() {
+ return replicaNum;
}
- public Boolean legal() {
- if (clusterId == null
- || StringUtils.isEmpty(topicName)
- || partitionNum == null || partitionNum <= 0) {
- return false;
- }
- if ((brokerIdList == null || brokerIdList.isEmpty()) && (regionIdList == null || regionIdList.isEmpty())) {
- return false;
- }
- return true;
+ public void setReplicaNum(Integer replicaNum) {
+ this.replicaNum = replicaNum;
+ }
+
+ public Integer getRetentionTimeUnitHour() {
+ return retentionTimeUnitHour;
+ }
+
+ public void setRetentionTimeUnitHour(Integer retentionTimeUnitHour) {
+ this.retentionTimeUnitHour = retentionTimeUnitHour;
+ }
+
+ public Long getAutoExecMaxPeakBytesInUnitB() {
+ return autoExecMaxPeakBytesInUnitB;
+ }
+
+ public void setAutoExecMaxPeakBytesInUnitB(Long autoExecMaxPeakBytesInUnitB) {
+ this.autoExecMaxPeakBytesInUnitB = autoExecMaxPeakBytesInUnitB;
+ }
+
+ public Integer getPartitionNum() {
+ return partitionNum;
+ }
+
+ public void setPartitionNum(Integer partitionNum) {
+ this.partitionNum = partitionNum;
+ }
+
+ @Override
+ public String toString() {
+ return "CreateTopicElemConfig{" +
+ "clusterId=" + clusterId +
+ ", brokerIdList=" + brokerIdList +
+ ", regionIdList=" + regionIdList +
+ ", partitionNum=" + partitionNum +
+ ", replicaNum=" + replicaNum +
+ ", retentionTimeUnitHour=" + retentionTimeUnitHour +
+ ", autoExecMaxPeakBytesInUnitB=" + autoExecMaxPeakBytesInUnitB +
+ '}';
}
}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/MaxAvgBytesInConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/MaxAvgBytesInConfig.java
new file mode 100644
index 00000000..6a26f955
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/MaxAvgBytesInConfig.java
@@ -0,0 +1,25 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
+
+/**
+ * 峰值均值流入流量配置
+ * @author zengqiao
+ * @date 20/6/9
+ */
+public class MaxAvgBytesInConfig {
+ private Integer duration;
+
+ public Integer getDuration() {
+ return duration;
+ }
+
+ public void setDuration(Integer duration) {
+ this.duration = duration;
+ }
+
+ @Override
+ public String toString() {
+ return "MaxAvgBytesInConfig{" +
+ "duration=" + duration +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/SinkTopicRequestTimeMetricsConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/SinkTopicRequestTimeMetricsConfig.java
new file mode 100644
index 00000000..91faaba1
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/SinkTopicRequestTimeMetricsConfig.java
@@ -0,0 +1,57 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
+
+/**
+ * @author zengqiao
+ * @date 20/9/7
+ */
+public class SinkTopicRequestTimeMetricsConfig {
+ private Long clusterId;
+
+ private String topicName;
+
+ private Long startId;
+
+ private Long step;
+
+ 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 Long getStartId() {
+ return startId;
+ }
+
+ public void setStartId(Long startId) {
+ this.startId = startId;
+ }
+
+ public Long getStep() {
+ return step;
+ }
+
+ public void setStep(Long step) {
+ this.step = step;
+ }
+
+ @Override
+ public String toString() {
+ return "SinkTopicRequestTimeMetricsConfig{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", startId=" + startId +
+ ", step=" + step +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicAnomalyFlowConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicAnomalyFlowConfig.java
new file mode 100644
index 00000000..1797eb6e
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicAnomalyFlowConfig.java
@@ -0,0 +1,57 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
+
+/**
+ * @author zengqiao
+ * @date 20/8/23
+ */
+public class TopicAnomalyFlowConfig {
+ private Long minTopicBytesInUnitB;
+
+ private Double bytesInIncUnitB;
+
+ private Long minTopicProduceQps;
+
+ private Double produceQpsInc;
+
+ public Long getMinTopicBytesInUnitB() {
+ return minTopicBytesInUnitB;
+ }
+
+ public void setMinTopicBytesInUnitB(Long minTopicBytesInUnitB) {
+ this.minTopicBytesInUnitB = minTopicBytesInUnitB;
+ }
+
+ public Double getBytesInIncUnitB() {
+ return bytesInIncUnitB;
+ }
+
+ public void setBytesInIncUnitB(Double bytesInIncUnitB) {
+ this.bytesInIncUnitB = bytesInIncUnitB;
+ }
+
+ public Long getMinTopicProduceQps() {
+ return minTopicProduceQps;
+ }
+
+ public void setMinTopicProduceQps(Long minTopicProduceQps) {
+ this.minTopicProduceQps = minTopicProduceQps;
+ }
+
+ public Double getProduceQpsInc() {
+ return produceQpsInc;
+ }
+
+ public void setProduceQpsInc(Double produceQpsInc) {
+ this.produceQpsInc = produceQpsInc;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicAnomalyFlowConfig{" +
+ "minTopicBytesInUnitB=" + minTopicBytesInUnitB +
+ ", bytesInIncUnitB=" + bytesInIncUnitB +
+ ", minTopicProduceQps=" + minTopicProduceQps +
+ ", produceQpsInc=" + produceQpsInc +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicNameConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicNameConfig.java
new file mode 100644
index 00000000..787bd238
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/TopicNameConfig.java
@@ -0,0 +1,44 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config;
+
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+
+/**
+ * @author zengqiao
+ * @date 20/8/31
+ */
+public class TopicNameConfig {
+ private Long clusterId;
+
+ 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;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicNameConfig{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ public boolean legal() {
+ if (ValidateUtils.isNull(clusterId) || ValidateUtils.isBlank(topicName)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/RegionTopicHotConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/RegionTopicHotConfig.java
new file mode 100644
index 00000000..030a3621
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/RegionTopicHotConfig.java
@@ -0,0 +1,58 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config.expert;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/8/23
+ */
+public class RegionTopicHotConfig {
+ private Long minTopicBytesInUnitB;
+
+ private Integer maxDisPartitionNum;
+
+ private List ignoreClusterIdList;
+
+ public Long getMinTopicBytesInUnitB() {
+ if (minTopicBytesInUnitB == null) {
+ return 3 * 1024 * 1024L;
+ }
+ return minTopicBytesInUnitB;
+ }
+
+ public void setMinTopicBytesInUnitB(Long minTopicBytesInUnitB) {
+ this.minTopicBytesInUnitB = minTopicBytesInUnitB;
+ }
+
+ public Integer getMaxDisPartitionNum() {
+ if (maxDisPartitionNum == null) {
+ return 3;
+ }
+ return maxDisPartitionNum;
+ }
+
+ public void setMaxDisPartitionNum(Integer maxDisPartitionNum) {
+ this.maxDisPartitionNum = maxDisPartitionNum;
+ }
+
+ public List getIgnoreClusterIdList() {
+ if (ignoreClusterIdList == null) {
+ return new ArrayList<>();
+ }
+ return ignoreClusterIdList;
+ }
+
+ public void setIgnoreClusterIdList(List ignoreClusterIdList) {
+ this.ignoreClusterIdList = ignoreClusterIdList;
+ }
+
+ @Override
+ public String toString() {
+ return "RegionTopicHotConfig{" +
+ "minTopicBytesInUnitB=" + minTopicBytesInUnitB +
+ ", maxDisPartitionNum=" + maxDisPartitionNum +
+ ", ignoreClusterIdList=" + ignoreClusterIdList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicExpiredConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicExpiredConfig.java
new file mode 100644
index 00000000..d68dc2ba
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicExpiredConfig.java
@@ -0,0 +1,38 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config.expert;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/9/17
+ */
+public class TopicExpiredConfig {
+ private Integer minExpiredDay = 30;
+
+ private List ignoreClusterIdList = new ArrayList<>();
+
+ public Integer getMinExpiredDay() {
+ return minExpiredDay;
+ }
+
+ public void setMinExpiredDay(Integer minExpiredDay) {
+ this.minExpiredDay = minExpiredDay;
+ }
+
+ public List getIgnoreClusterIdList() {
+ return ignoreClusterIdList;
+ }
+
+ public void setIgnoreClusterIdList(List ignoreClusterIdList) {
+ this.ignoreClusterIdList = ignoreClusterIdList;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicExpiredConfig{" +
+ "minExpiredDay=" + minExpiredDay +
+ ", ignoreClusterIdList=" + ignoreClusterIdList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicInsufficientPartitionConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicInsufficientPartitionConfig.java
new file mode 100644
index 00000000..d954c6d3
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/config/expert/TopicInsufficientPartitionConfig.java
@@ -0,0 +1,50 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.config.expert;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 专家服务-Topic分区不足配置
+ * @author zengqiao
+ * @date 20/8/23
+ */
+public class TopicInsufficientPartitionConfig {
+ private Long maxBytesInPerPartitionUnitB = 3 * 1024 * 1024L;
+
+ private Long minTopicBytesInUnitB = 3 * 1024 * 1024L;
+
+ private List ignoreClusterIdList = new ArrayList<>();
+
+ public Long getMaxBytesInPerPartitionUnitB() {
+ return maxBytesInPerPartitionUnitB;
+ }
+
+ public void setMaxBytesInPerPartitionUnitB(Long maxBytesInPerPartitionUnitB) {
+ this.maxBytesInPerPartitionUnitB = maxBytesInPerPartitionUnitB;
+ }
+
+ public Long getMinTopicBytesInUnitB() {
+ return minTopicBytesInUnitB;
+ }
+
+ public void setMinTopicBytesInUnitB(Long minTopicBytesInUnitB) {
+ this.minTopicBytesInUnitB = minTopicBytesInUnitB;
+ }
+
+ public List getIgnoreClusterIdList() {
+ return ignoreClusterIdList;
+ }
+
+ public void setIgnoreClusterIdList(List ignoreClusterIdList) {
+ this.ignoreClusterIdList = ignoreClusterIdList;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicInsufficientPartitionConfig{" +
+ "maxBytesInPerPartitionUnitB=" + maxBytesInPerPartitionUnitB +
+ ", minTopicBytesInUnitB=" + minTopicBytesInUnitB +
+ ", ignoreClusterIdList=" + ignoreClusterIdList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumeDetailDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumeDetailDTO.java
similarity index 94%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumeDetailDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumeDetailDTO.java
index 66546d84..a40484e4 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumeDetailDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumeDetailDTO.java
@@ -1,4 +1,4 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto.consumer;
+package com.xiaojukeji.kafka.manager.common.entity.ao.consumer;
/**
* @author zengqiao
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerGroupDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumerGroupDTO.java
similarity index 65%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerGroupDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumerGroupDTO.java
index 072672f6..e09f93e8 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerGroupDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/consumer/ConsumerGroupDTO.java
@@ -1,7 +1,8 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto.consumer;
+package com.xiaojukeji.kafka.manager.common.entity.ao.consumer;
-import com.xiaojukeji.kafka.manager.common.constant.OffsetStoreLocation;
+import com.xiaojukeji.kafka.manager.common.bizenum.OffsetLocationEnum;
+import java.util.List;
import java.util.Objects;
/**
@@ -14,11 +15,17 @@ public class ConsumerGroupDTO {
private String consumerGroup;
- private OffsetStoreLocation offsetStoreLocation;
+ private List appIdList;
- public ConsumerGroupDTO(Long clusterId, String consumerGroup, OffsetStoreLocation offsetStoreLocation) {
+ private OffsetLocationEnum offsetStoreLocation;
+
+ public ConsumerGroupDTO(Long clusterId,
+ String consumerGroup,
+ List appIdList,
+ OffsetLocationEnum offsetStoreLocation) {
this.clusterId = clusterId;
this.consumerGroup = consumerGroup;
+ this.appIdList = appIdList;
this.offsetStoreLocation = offsetStoreLocation;
}
@@ -38,14 +45,32 @@ public class ConsumerGroupDTO {
this.consumerGroup = consumerGroup;
}
- public OffsetStoreLocation getOffsetStoreLocation() {
+ public List getAppIdList() {
+ return appIdList;
+ }
+
+ public void setAppIdList(List appIdList) {
+ this.appIdList = appIdList;
+ }
+
+ public OffsetLocationEnum getOffsetStoreLocation() {
return offsetStoreLocation;
}
- public void setOffsetStoreLocation(OffsetStoreLocation offsetStoreLocation) {
+ public void setOffsetStoreLocation(OffsetLocationEnum offsetStoreLocation) {
this.offsetStoreLocation = offsetStoreLocation;
}
+ @Override
+ public String toString() {
+ return "ConsumerGroupDTO{" +
+ "clusterId=" + clusterId +
+ ", consumerGroup='" + consumerGroup + '\'' +
+ ", appIdList=" + appIdList +
+ ", offsetStoreLocation=" + offsetStoreLocation +
+ '}';
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -64,13 +89,4 @@ public class ConsumerGroupDTO {
public int hashCode() {
return Objects.hash(clusterId, consumerGroup, offsetStoreLocation);
}
-
- @Override
- public String toString() {
- return "ConsumerGroupDTO{" +
- "clusterId=" + clusterId +
- ", consumerGroup='" + consumerGroup + '\'' +
- ", offsetStoreLocation=" + offsetStoreLocation +
- '}';
- }
}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicAnomalyFlow.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicAnomalyFlow.java
new file mode 100644
index 00000000..558636d9
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicAnomalyFlow.java
@@ -0,0 +1,90 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.expert;
+
+/**
+ * @author zengqiao
+ * @date 20/3/30
+ */
+public class TopicAnomalyFlow {
+ private Long clusterId;
+
+ private String clusterName;
+
+ private String topicName;
+
+ private Double bytesIn;
+
+ private Double bytesInIncr;
+
+ private Double iops;
+
+ private Double iopsIncr;
+
+ 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 Double getBytesIn() {
+ return bytesIn;
+ }
+
+ public void setBytesIn(Double bytesIn) {
+ this.bytesIn = bytesIn;
+ }
+
+ public Double getBytesInIncr() {
+ return bytesInIncr;
+ }
+
+ public void setBytesInIncr(Double bytesInIncr) {
+ this.bytesInIncr = bytesInIncr;
+ }
+
+ public Double getIops() {
+ return iops;
+ }
+
+ public void setIops(Double iops) {
+ this.iops = iops;
+ }
+
+ public Double getIopsIncr() {
+ return iopsIncr;
+ }
+
+ public void setIopsIncr(Double iopsIncr) {
+ this.iopsIncr = iopsIncr;
+ }
+
+ @Override
+ public String toString() {
+ return "AnomalyFlowTopicDTO{" +
+ "clusterId=" + clusterId +
+ ", clusterName='" + clusterName + '\'' +
+ ", topicName='" + topicName + '\'' +
+ ", bytesIn=" + bytesIn +
+ ", bytesInIncr=" + bytesInIncr +
+ ", iops=" + iops +
+ ", iopsIncr=" + iopsIncr +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicInsufficientPartition.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicInsufficientPartition.java
new file mode 100644
index 00000000..1199d9c2
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicInsufficientPartition.java
@@ -0,0 +1,111 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.expert;
+
+import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/3/30
+ */
+public class TopicInsufficientPartition {
+ private ClusterDO clusterDO;
+
+ private String topicName;
+
+ private Integer presentPartitionNum;
+
+ private Integer suggestedPartitionNum;
+
+ private List maxAvgBytesInList;
+
+ private Double bytesInPerPartition;
+
+ private List brokerIdList;
+
+ public TopicInsufficientPartition(
+ ClusterDO clusterDO,
+ String topicName,
+ Integer presentPartitionNum,
+ Integer suggestedPartitionNum,
+ List maxAvgBytesInList,
+ Double bytesInPerPartition,
+ List brokerIdList) {
+ this.clusterDO = clusterDO;
+ this.topicName = topicName;
+ this.presentPartitionNum = presentPartitionNum;
+ this.suggestedPartitionNum = suggestedPartitionNum;
+ this.maxAvgBytesInList = maxAvgBytesInList;
+ this.bytesInPerPartition = bytesInPerPartition;
+ this.brokerIdList = brokerIdList;
+ }
+
+ public ClusterDO getClusterDO() {
+ return clusterDO;
+ }
+
+ public void setClusterDO(ClusterDO clusterDO) {
+ this.clusterDO = clusterDO;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public Integer getPresentPartitionNum() {
+ return presentPartitionNum;
+ }
+
+ public void setPresentPartitionNum(Integer presentPartitionNum) {
+ this.presentPartitionNum = presentPartitionNum;
+ }
+
+ public Integer getSuggestedPartitionNum() {
+ return suggestedPartitionNum;
+ }
+
+ public void setSuggestedPartitionNum(Integer suggestedPartitionNum) {
+ this.suggestedPartitionNum = suggestedPartitionNum;
+ }
+
+ public List getMaxAvgBytesInList() {
+ return maxAvgBytesInList;
+ }
+
+ public void setMaxAvgBytesInList(List maxAvgBytesInList) {
+ this.maxAvgBytesInList = maxAvgBytesInList;
+ }
+
+ public Double getBytesInPerPartition() {
+ return bytesInPerPartition;
+ }
+
+ public void setBytesInPerPartition(Double bytesInPerPartition) {
+ this.bytesInPerPartition = bytesInPerPartition;
+ }
+
+ public List getBrokerIdList() {
+ return brokerIdList;
+ }
+
+ public void setBrokerIdList(List brokerIdList) {
+ this.brokerIdList = brokerIdList;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicInsufficientPartition{" +
+ "clusterDO=" + clusterDO +
+ ", topicName='" + topicName + '\'' +
+ ", presentPartitionNum=" + presentPartitionNum +
+ ", suggestedPartitionNum=" + suggestedPartitionNum +
+ ", maxAvgBytesInList=" + maxAvgBytesInList +
+ ", bytesInPerPartition=" + bytesInPerPartition +
+ ", brokerIdList=" + brokerIdList +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicRegionHot.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicRegionHot.java
new file mode 100644
index 00000000..17f2f392
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/expert/TopicRegionHot.java
@@ -0,0 +1,70 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.expert;
+
+import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO;
+
+import java.util.Map;
+
+/**
+ * Region内热点Topic
+ * @author zengqiao
+ * @date 20/3/27
+ */
+public class TopicRegionHot {
+ private ClusterDO clusterDO;
+
+ private String topicName;
+
+ private Long retentionTime;
+
+ private Map brokerIdPartitionNumMap;
+
+ public TopicRegionHot(ClusterDO clusterDO, String topicName, Long retentionTime, Map
+ brokerIdPartitionNumMap) {
+ this.clusterDO = clusterDO;
+ this.topicName = topicName;
+ this.retentionTime = retentionTime;
+ this.brokerIdPartitionNumMap = brokerIdPartitionNumMap;
+ }
+
+ public ClusterDO getClusterDO() {
+ return clusterDO;
+ }
+
+ public void setClusterDO(ClusterDO clusterDO) {
+ this.clusterDO = clusterDO;
+ }
+
+ 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 Map getBrokerIdPartitionNumMap() {
+ return brokerIdPartitionNumMap;
+ }
+
+ public void setBrokerIdPartitionNumMap(Map brokerIdPartitionNumMap) {
+ this.brokerIdPartitionNumMap = brokerIdPartitionNumMap;
+ }
+
+ @Override
+ public String toString() {
+ return "ExpertRegionTopicHot{" +
+ "clusterDO=" + clusterDO +
+ ", topicName='" + topicName + '\'' +
+ ", retentionTime=" + retentionTime +
+ ", brokerIdPartitionNumMap=" + brokerIdPartitionNumMap +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/AppRateConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/AppRateConfig.java
new file mode 100644
index 00000000..1ed045e4
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/AppRateConfig.java
@@ -0,0 +1,30 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class AppRateConfig extends BaseGatewayConfig {
+ private Long appRateLimit;
+
+ public AppRateConfig(Long version, Long appRateLimit) {
+ this.version = version;
+ this.appRateLimit = appRateLimit;
+ }
+
+ public Long getAppRateLimit() {
+ return appRateLimit;
+ }
+
+ public void setAppRateLimit(Long appRateLimit) {
+ this.appRateLimit = appRateLimit;
+ }
+
+ @Override
+ public String toString() {
+ return "AppRateConfig{" +
+ "appRateLimit=" + appRateLimit +
+ ", version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/BaseGatewayConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/BaseGatewayConfig.java
new file mode 100644
index 00000000..528eb214
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/BaseGatewayConfig.java
@@ -0,0 +1,24 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class BaseGatewayConfig {
+ protected Long version;
+
+ public Long getVersion() {
+ return version;
+ }
+
+ public void setVersion(Long version) {
+ this.version = version;
+ }
+
+ @Override
+ public String toString() {
+ return "GatewayConfig{" +
+ "version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/IpRateConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/IpRateConfig.java
new file mode 100644
index 00000000..06c6cfbb
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/IpRateConfig.java
@@ -0,0 +1,30 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class IpRateConfig extends BaseGatewayConfig {
+ private Long ipRateLimit;
+
+ public IpRateConfig(Long version, Long ipRateLimit) {
+ this.version = version;
+ this.ipRateLimit = ipRateLimit;
+ }
+
+ public Long getIpRateLimit() {
+ return ipRateLimit;
+ }
+
+ public void setIpRateLimit(Long ipRateLimit) {
+ this.ipRateLimit = ipRateLimit;
+ }
+
+ @Override
+ public String toString() {
+ return "IpRateConfig{" +
+ "ipRateLimit=" + ipRateLimit +
+ ", version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/KafkaBootstrapServerConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/KafkaBootstrapServerConfig.java
new file mode 100644
index 00000000..4b00c893
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/KafkaBootstrapServerConfig.java
@@ -0,0 +1,33 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class KafkaBootstrapServerConfig extends BaseGatewayConfig {
+ private Map> clusterIdBootstrapServersMap;
+
+ public KafkaBootstrapServerConfig(Long version, Map> clusterIdBootstrapServersMap) {
+ this.version = version;
+ this.clusterIdBootstrapServersMap = clusterIdBootstrapServersMap;
+ }
+
+ public Map> getClusterIdBootstrapServersMap() {
+ return clusterIdBootstrapServersMap;
+ }
+
+ public void setClusterIdBootstrapServersMap(Map> clusterIdBootstrapServersMap) {
+ this.clusterIdBootstrapServersMap = clusterIdBootstrapServersMap;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaBootstrapServerConfig{" +
+ "clusterIdBootstrapServersMap=" + clusterIdBootstrapServersMap +
+ ", version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/RequestQueueConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/RequestQueueConfig.java
new file mode 100644
index 00000000..ff2f2184
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/RequestQueueConfig.java
@@ -0,0 +1,30 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class RequestQueueConfig extends BaseGatewayConfig {
+ private Long maxRequestQueueSize;
+
+ public RequestQueueConfig(Long version, Long maxRequestQueueSize) {
+ this.version = version;
+ this.maxRequestQueueSize = maxRequestQueueSize;
+ }
+
+ public Long getMaxRequestQueueSize() {
+ return maxRequestQueueSize;
+ }
+
+ public void setMaxRequestQueueSize(Long maxRequestQueueSize) {
+ this.maxRequestQueueSize = maxRequestQueueSize;
+ }
+
+ @Override
+ public String toString() {
+ return "RequestQueueConfig{" +
+ "maxRequestQueueSize=" + maxRequestQueueSize +
+ ", version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/SpRateConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/SpRateConfig.java
new file mode 100644
index 00000000..15f21cf9
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/SpRateConfig.java
@@ -0,0 +1,32 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+import java.util.Map;
+
+/**
+ * @author zengqiao
+ * @date 20/7/29
+ */
+public class SpRateConfig extends BaseGatewayConfig {
+ private Map spRateMap;
+
+ public SpRateConfig(Long version, Map spRateMap) {
+ this.version = version;
+ this.spRateMap = spRateMap;
+ }
+
+ public Map getSpRateMap() {
+ return spRateMap;
+ }
+
+ public void setSpRateMap(Map spRateMap) {
+ this.spRateMap = spRateMap;
+ }
+
+ @Override
+ public String toString() {
+ return "SpRateConfig{" +
+ "spRateMap=" + spRateMap +
+ ", version=" + version +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/TopicQuota.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/TopicQuota.java
new file mode 100644
index 00000000..7b3bc979
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/gateway/TopicQuota.java
@@ -0,0 +1,68 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
+
+/**
+ * @author zhongyuankai
+ * @date 2020/4/27
+ */
+public class TopicQuota {
+ private String appId;
+
+ private Long clusterId;
+
+ private String topicName;
+
+ private Long produceQuota;
+
+ private Long consumeQuota;
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ 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 Long getProduceQuota() {
+ return produceQuota;
+ }
+
+ public void setProduceQuota(Long produceQuota) {
+ this.produceQuota = produceQuota;
+ }
+
+ public Long getConsumeQuota() {
+ return consumeQuota;
+ }
+
+ public void setConsumeQuota(Long consumeQuota) {
+ this.consumeQuota = consumeQuota;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicQuota{" +
+ "appId='" + appId + '\'' +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", produceQuota=" + produceQuota +
+ ", consumeQuota=" + consumeQuota +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/reassign/ReassignStatus.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/reassign/ReassignStatus.java
new file mode 100644
index 00000000..3e9ec3cb
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/reassign/ReassignStatus.java
@@ -0,0 +1,130 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.reassign;
+
+import com.xiaojukeji.kafka.manager.common.bizenum.TaskStatusReassignEnum;
+import com.xiaojukeji.kafka.manager.common.zookeeper.znode.ReassignmentElemData;
+import kafka.common.TopicAndPartition;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author zengqiao
+ * @date 20/5/14
+ */
+public class ReassignStatus {
+ private Long subTaskId;
+
+ private Long clusterId;
+
+ private String clusterName;
+
+ private String topicName;
+
+ private Integer status;
+
+ private Long realThrottle;
+
+ private Long maxThrottle;
+
+ private Long minThrottle;
+
+ private List reassignList;
+
+ private Map reassignStatusMap;
+
+ public Long getSubTaskId() {
+ return subTaskId;
+ }
+
+ public void setSubTaskId(Long subTaskId) {
+ this.subTaskId = subTaskId;
+ }
+
+ 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 Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ public Long getRealThrottle() {
+ return realThrottle;
+ }
+
+ public void setRealThrottle(Long realThrottle) {
+ this.realThrottle = realThrottle;
+ }
+
+ public Long getMaxThrottle() {
+ return maxThrottle;
+ }
+
+ public void setMaxThrottle(Long maxThrottle) {
+ this.maxThrottle = maxThrottle;
+ }
+
+ public Long getMinThrottle() {
+ return minThrottle;
+ }
+
+ public void setMinThrottle(Long minThrottle) {
+ this.minThrottle = minThrottle;
+ }
+
+ public List getReassignList() {
+ return reassignList;
+ }
+
+ public void setReassignList(List reassignList) {
+ this.reassignList = reassignList;
+ }
+
+ public Map getReassignStatusMap() {
+ return reassignStatusMap;
+ }
+
+ public void setReassignStatusMap(Map reassignStatusMap) {
+ this.reassignStatusMap = reassignStatusMap;
+ }
+
+ @Override
+ public String toString() {
+ return "ReassignStatus{" +
+ "subTaskId=" + subTaskId +
+ ", clusterId=" + clusterId +
+ ", clusterName='" + clusterName + '\'' +
+ ", topicName='" + topicName + '\'' +
+ ", status=" + status +
+ ", realThrottle=" + realThrottle +
+ ", maxThrottle=" + maxThrottle +
+ ", minThrottle=" + minThrottle +
+ ", reassignList=" + reassignList +
+ ", reassignStatusMap=" + reassignStatusMap +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetrics.java
similarity index 51%
rename from common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerDTO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetrics.java
index c96c6496..932cd2a1 100644
--- a/common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/consumer/ConsumerDTO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetrics.java
@@ -1,13 +1,12 @@
-package com.xiaojukeji.kafka.manager.common.entity.dto.consumer;
+package com.xiaojukeji.kafka.manager.common.entity.ao.remote;
-import java.util.Map;
+import java.util.List;
/**
- * Consumer实体类
- * @author tukun
- * @date 2015/11/12
+ * @author zengqiao
+ * @date 20/8/25
*/
-public class ConsumerDTO {
+public class KafkaConsumerMetrics {
private Long clusterId;
private String topicName;
@@ -16,9 +15,11 @@ public class ConsumerDTO {
private String location;
- private Map partitionOffsetMap;
+ private Integer partitionNum;
- private Map consumerOffsetMap;
+ private List consumeDetailList;
+
+ private Long createTime;
public Long getClusterId() {
return clusterId;
@@ -52,31 +53,40 @@ public class ConsumerDTO {
this.location = location;
}
- public Map getPartitionOffsetMap() {
- return partitionOffsetMap;
+ public Integer getPartitionNum() {
+ return partitionNum;
}
- public void setPartitionOffsetMap(Map partitionOffsetMap) {
- this.partitionOffsetMap = partitionOffsetMap;
+ public void setPartitionNum(Integer partitionNum) {
+ this.partitionNum = partitionNum;
}
- public Map getConsumerOffsetMap() {
- return consumerOffsetMap;
+ public List getConsumeDetailList() {
+ return consumeDetailList;
}
- public void setConsumerOffsetMap(Map consumerOffsetMap) {
- this.consumerOffsetMap = consumerOffsetMap;
+ public void setConsumeDetailList(List consumeDetailList) {
+ this.consumeDetailList = consumeDetailList;
+ }
+
+ public Long getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Long createTime) {
+ this.createTime = createTime;
}
@Override
public String toString() {
- return "ConsumerDTO{" +
+ return "KafkaConsumerMetrics{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
", consumerGroup='" + consumerGroup + '\'' +
", location='" + location + '\'' +
- ", partitionOffsetMap=" + partitionOffsetMap +
- ", consumerOffsetMap=" + consumerOffsetMap +
+ ", partitionNum=" + partitionNum +
+ ", consumeDetailList=" + consumeDetailList +
+ ", createTime=" + createTime +
'}';
}
-}
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetricsElem.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetricsElem.java
new file mode 100644
index 00000000..678f995f
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaConsumerMetricsElem.java
@@ -0,0 +1,46 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.remote;
+
+/**
+ * @author zengqiao
+ * @date 20/8/31
+ */
+public class KafkaConsumerMetricsElem {
+ private Integer partitionId;
+
+ private Long partitionOffset;
+
+ private Long consumeOffset;
+
+ public Integer getPartitionId() {
+ return partitionId;
+ }
+
+ public void setPartitionId(Integer partitionId) {
+ this.partitionId = partitionId;
+ }
+
+ public Long getPartitionOffset() {
+ return partitionOffset;
+ }
+
+ public void setPartitionOffset(Long partitionOffset) {
+ this.partitionOffset = partitionOffset;
+ }
+
+ public Long getConsumeOffset() {
+ return consumeOffset;
+ }
+
+ public void setConsumeOffset(Long consumeOffset) {
+ this.consumeOffset = consumeOffset;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaConsumerMetricsElem{" +
+ "partitionId=" + partitionId +
+ ", partitionOffset=" + partitionOffset +
+ ", consumeOffset=" + consumeOffset +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaTopicMetrics.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaTopicMetrics.java
new file mode 100644
index 00000000..599384a4
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/remote/KafkaTopicMetrics.java
@@ -0,0 +1,79 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.remote;
+
+/**
+ * @author zengqiao
+ * @date 20/8/31
+ */
+public class KafkaTopicMetrics {
+ private Long clusterId;
+
+ private String topic;
+
+ private Integer partitionNum;
+
+ private Double messagesInPerSec;
+
+ private Double bytesInPerSec;
+
+ private Long timestamp;
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public String getTopic() {
+ return topic;
+ }
+
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+
+ public Integer getPartitionNum() {
+ return partitionNum;
+ }
+
+ public void setPartitionNum(Integer partitionNum) {
+ this.partitionNum = partitionNum;
+ }
+
+ public Double getMessagesInPerSec() {
+ return messagesInPerSec;
+ }
+
+ public void setMessagesInPerSec(Double messagesInPerSec) {
+ this.messagesInPerSec = messagesInPerSec;
+ }
+
+ public Double getBytesInPerSec() {
+ return bytesInPerSec;
+ }
+
+ public void setBytesInPerSec(Double bytesInPerSec) {
+ this.bytesInPerSec = bytesInPerSec;
+ }
+
+ public Long getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaTopicMetrics{" +
+ "clusterId=" + clusterId +
+ ", topic='" + topic + '\'' +
+ ", partitionNum=" + partitionNum +
+ ", messagesInPerSec=" + messagesInPerSec +
+ ", bytesInPerSec=" + bytesInPerSec +
+ ", timestamp=" + timestamp +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/MineTopicSummary.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/MineTopicSummary.java
new file mode 100644
index 00000000..45fffebd
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/MineTopicSummary.java
@@ -0,0 +1,123 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * @author zengqiao
+ * @date 20/5/12
+ */
+public class MineTopicSummary {
+ private Long logicalClusterId;
+
+ private String logicalClusterName;
+
+ private Long physicalClusterId;
+
+ private String topicName;
+
+ private Object bytesIn;
+
+ private Object bytesOut;
+
+ private String appId;
+
+ private String appName;
+
+ private String appPrincipals;
+
+ private Integer access;
+
+ public Long getLogicalClusterId() {
+ return logicalClusterId;
+ }
+
+ public void setLogicalClusterId(Long logicalClusterId) {
+ this.logicalClusterId = logicalClusterId;
+ }
+
+ public String getLogicalClusterName() {
+ return logicalClusterName;
+ }
+
+ public void setLogicalClusterName(String logicalClusterName) {
+ this.logicalClusterName = logicalClusterName;
+ }
+
+ public Long getPhysicalClusterId() {
+ return physicalClusterId;
+ }
+
+ public void setPhysicalClusterId(Long physicalClusterId) {
+ this.physicalClusterId = physicalClusterId;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public Object getBytesIn() {
+ return bytesIn;
+ }
+
+ public void setBytesIn(Object bytesIn) {
+ this.bytesIn = bytesIn;
+ }
+
+ public Object getBytesOut() {
+ return bytesOut;
+ }
+
+ public void setBytesOut(Object bytesOut) {
+ this.bytesOut = bytesOut;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getAppPrincipals() {
+ return appPrincipals;
+ }
+
+ public void setAppPrincipals(String appPrincipals) {
+ this.appPrincipals = appPrincipals;
+ }
+
+ public Integer getAccess() {
+ return access;
+ }
+
+ public void setAccess(Integer access) {
+ this.access = access;
+ }
+
+ @Override
+ public String toString() {
+ return "MineTopicSummary{" +
+ "logicalClusterId=" + logicalClusterId +
+ ", logicalClusterName='" + logicalClusterName + '\'' +
+ ", physicalClusterId=" + physicalClusterId +
+ ", topicName='" + topicName + '\'' +
+ ", bytesIn=" + bytesIn +
+ ", bytesOut=" + bytesOut +
+ ", appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", appPrincipals='" + appPrincipals + '\'' +
+ ", access=" + access +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicAppData.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicAppData.java
new file mode 100644
index 00000000..a06e9736
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicAppData.java
@@ -0,0 +1,123 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * @author zhongyuankai
+ * @date 2020/6/8
+ */
+public class TopicAppData {
+ private Long clusterId;
+
+ private String topicName;
+
+ private String appId;
+
+ private String appName;
+
+ private String appPrincipals;
+
+ private Long produceQuota;
+
+ private Long consumerQuota;
+
+ private Boolean produceThrottled;
+
+ private Boolean fetchThrottled;
+
+ private Integer access;
+
+ 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 getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getAppPrincipals() {
+ return appPrincipals;
+ }
+
+ public void setAppPrincipals(String appPrincipals) {
+ this.appPrincipals = appPrincipals;
+ }
+
+ public Long getProduceQuota() {
+ return produceQuota;
+ }
+
+ public void setProduceQuota(Long produceQuota) {
+ this.produceQuota = produceQuota;
+ }
+
+ public Long getConsumerQuota() {
+ return consumerQuota;
+ }
+
+ public void setConsumerQuota(Long consumerQuota) {
+ this.consumerQuota = consumerQuota;
+ }
+
+ public Boolean getProduceThrottled() {
+ return produceThrottled;
+ }
+
+ public void setProduceThrottled(Boolean produceThrottled) {
+ this.produceThrottled = produceThrottled;
+ }
+
+ public Boolean getFetchThrottled() {
+ return fetchThrottled;
+ }
+
+ public void setFetchThrottled(Boolean fetchThrottled) {
+ this.fetchThrottled = fetchThrottled;
+ }
+
+ public Integer getAccess() {
+ return access;
+ }
+
+ public void setAccess(Integer access) {
+ this.access = access;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicAppDTO{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", appPrincipals='" + appPrincipals + '\'' +
+ ", produceQuota=" + produceQuota +
+ ", consumerQuota=" + consumerQuota +
+ ", produceThrottled=" + produceThrottled +
+ ", fetchThrottled=" + fetchThrottled +
+ ", access=" + access +
+ '}';
+ }
+}
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicBasicVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBasicDTO.java
similarity index 60%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicBasicVO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBasicDTO.java
index 7fd567d8..9522feee 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicBasicVO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBasicDTO.java
@@ -1,44 +1,71 @@
-package com.xiaojukeji.kafka.manager.web.vo.topic;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
/**
- * Topic的基本信息
- * @author zengqiao
- * @date 19/4/1
+ * @author arthur
+ * @date 2018/09/03
*/
-@ApiModel(value = "Topic基本信息")
-public class TopicBasicVO {
- @ApiModelProperty(value = "Topic名称")
- private String topicName;
+public class TopicBasicDTO {
+ private Long clusterId;
- @ApiModelProperty(value = "分区数")
- private Integer partitionNum;
+ private String appId;
- @ApiModelProperty(value = "副本数")
- private Integer replicaNum;
+ private String appName;
- @ApiModelProperty(value = "占用Broker数")
- private Integer brokerNum;
-
- @ApiModelProperty(value = "保留时间(ms)")
- private Long retentionTime;
-
- @ApiModelProperty(value = "修改时间")
- private Long modifyTime;
-
- @ApiModelProperty(value = "创建时间")
- private Long createTime;
-
- @ApiModelProperty(value = "负责人")
private String principals;
- @ApiModelProperty(value = "备注")
+ private String topicName;
+
private String description;
- @ApiModelProperty(value = "regionNames")
- private String regionNames;
+ private String region;
+
+ private Integer score;
+
+ private String topicCodeC;
+
+ private Integer partitionNum;
+
+ private Integer replicaNum;
+
+ private Integer brokerNum;
+
+ private Long modifyTime;
+
+ private Long createTime;
+
+ private Long retentionTime;
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getPrincipals() {
+ return principals;
+ }
+
+ public void setPrincipals(String principals) {
+ this.principals = principals;
+ }
public String getTopicName() {
return topicName;
@@ -48,6 +75,38 @@ public class TopicBasicVO {
this.topicName = topicName;
}
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ public Integer getScore() {
+ return score;
+ }
+
+ public void setScore(Integer score) {
+ this.score = score;
+ }
+
+ public String getTopicCodeC() {
+ return topicCodeC;
+ }
+
+ public void setTopicCodeC(String topicCodeC) {
+ this.topicCodeC = topicCodeC;
+ }
+
public Integer getPartitionNum() {
return partitionNum;
}
@@ -72,14 +131,6 @@ public class TopicBasicVO {
this.brokerNum = brokerNum;
}
- public Long getRetentionTime() {
- return retentionTime;
- }
-
- public void setRetentionTime(Long retentionTime) {
- this.retentionTime = retentionTime;
- }
-
public Long getModifyTime() {
return modifyTime;
}
@@ -96,43 +147,32 @@ public class TopicBasicVO {
this.createTime = createTime;
}
- public String getPrincipals() {
- return principals;
+ public Long getRetentionTime() {
+ return retentionTime;
}
- public void setPrincipals(String principals) {
- this.principals = principals;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getRegionNames() {
- return regionNames;
- }
-
- public void setRegionNames(String regionNames) {
- this.regionNames = regionNames;
+ public void setRetentionTime(Long retentionTime) {
+ this.retentionTime = retentionTime;
}
@Override
public String toString() {
- return "TopicBasicVO{" +
- "topicName='" + topicName + '\'' +
+ return "TopicBasicDTO{" +
+ "clusterId=" + clusterId +
+ ", appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", principals='" + principals + '\'' +
+ ", topicName='" + topicName + '\'' +
+ ", description='" + description + '\'' +
+ ", region='" + region + '\'' +
+ ", score=" + score +
+ ", topicCodeC='" + topicCodeC + '\'' +
", partitionNum=" + partitionNum +
", replicaNum=" + replicaNum +
", brokerNum=" + brokerNum +
- ", retentionTime=" + retentionTime +
", modifyTime=" + modifyTime +
", createTime=" + createTime +
- ", principals='" + principals + '\'' +
- ", description='" + description + '\'' +
- ", regionNames='" + regionNames + '\'' +
+ ", retentionTime=" + retentionTime +
'}';
}
}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBrokerDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBrokerDTO.java
new file mode 100644
index 00000000..75c4638d
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBrokerDTO.java
@@ -0,0 +1,81 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+import java.util.List;
+
+/**
+ * @author zhongyuankai
+ * @date 20/4/17
+ */
+public class TopicBrokerDTO {
+ private Integer brokerId;
+
+ private String host;
+
+ private Integer partitionNum;
+
+ private List partitionIdList;
+
+ private List leaderPartitionIdList;
+
+ private boolean alive;
+
+ 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 getPartitionNum() {
+ return partitionNum;
+ }
+
+ public void setPartitionNum(Integer partitionNum) {
+ this.partitionNum = partitionNum;
+ }
+
+ public List getPartitionIdList() {
+ return partitionIdList;
+ }
+
+ public void setPartitionIdList(List partitionIdList) {
+ this.partitionIdList = partitionIdList;
+ }
+
+ public List getLeaderPartitionIdList() {
+ return leaderPartitionIdList;
+ }
+
+ public void setLeaderPartitionIdList(List leaderPartitionIdList) {
+ this.leaderPartitionIdList = leaderPartitionIdList;
+ }
+
+ public boolean isAlive() {
+ return alive;
+ }
+
+ public void setAlive(boolean alive) {
+ this.alive = alive;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicBrokerDTO{" +
+ "brokerId=" + brokerId +
+ ", host='" + host + '\'' +
+ ", partitionNum=" + partitionNum +
+ ", partitionIdList=" + partitionIdList +
+ ", leaderPartitionIdList=" + leaderPartitionIdList +
+ ", alive=" + alive +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBusinessInfo.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBusinessInfo.java
new file mode 100644
index 00000000..978550c8
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicBusinessInfo.java
@@ -0,0 +1,68 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * @author zhongyuankai
+ * @date 20/09/08
+ */
+public class TopicBusinessInfo {
+ private String appId;
+
+ private String appName;
+
+ private String principals;
+
+ private Long clusterId;
+
+ private String topicName;
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getPrincipals() {
+ return principals;
+ }
+
+ public void setPrincipals(String principals) {
+ this.principals = principals;
+ }
+
+ 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 "TopicBusinessInfoVO{" +
+ "appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", principals='" + principals + '\'' +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicConnection.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicConnection.java
new file mode 100644
index 00000000..abb40327
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicConnection.java
@@ -0,0 +1,90 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * @author zengqiao
+ * @date 20/4/20
+ */
+public class TopicConnection {
+ private Long clusterId;
+
+ private String topicName;
+
+ private String appId;
+
+ private String ip;
+
+ private String hostname;
+
+ private String clientType;
+
+ private String clientVersion;
+
+ 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 getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getClientType() {
+ return clientType;
+ }
+
+ public void setClientType(String clientType) {
+ this.clientType = clientType;
+ }
+
+ public String getClientVersion() {
+ return clientVersion;
+ }
+
+ public void setClientVersion(String clientVersion) {
+ this.clientVersion = clientVersion;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicConnectionDTO{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", appId='" + appId + '\'' +
+ ", ip='" + ip + '\'' +
+ ", hostname='" + hostname + '\'' +
+ ", clientType='" + clientType + '\'' +
+ ", clientVersion='" + clientVersion + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicDTO.java
new file mode 100644
index 00000000..f64fd49c
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicDTO.java
@@ -0,0 +1,101 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * @author zengqiao
+ * @date 20/5/12
+ */
+public class TopicDTO {
+ private Long logicalClusterId;
+
+ private String logicalClusterName;
+
+ private String topicName;
+
+ private String description;
+
+ private String appId;
+
+ private String appName;
+
+ private String appPrincipals;
+
+ private Boolean needAuth;
+
+ public Long getLogicalClusterId() {
+ return logicalClusterId;
+ }
+
+ public void setLogicalClusterId(Long logicalClusterId) {
+ this.logicalClusterId = logicalClusterId;
+ }
+
+ public String getLogicalClusterName() {
+ return logicalClusterName;
+ }
+
+ public void setLogicalClusterName(String logicalClusterName) {
+ this.logicalClusterName = logicalClusterName;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getAppPrincipals() {
+ return appPrincipals;
+ }
+
+ public void setAppPrincipals(String appPrincipals) {
+ this.appPrincipals = appPrincipals;
+ }
+
+ public Boolean getNeedAuth() {
+ return needAuth;
+ }
+
+ public void setNeedAuth(Boolean needAuth) {
+ this.needAuth = needAuth;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicDTO{" +
+ "logicalClusterId=" + logicalClusterId +
+ ", logicalClusterName='" + logicalClusterName + '\'' +
+ ", topicName='" + topicName + '\'' +
+ ", description='" + description + '\'' +
+ ", appId='" + appId + '\'' +
+ ", appName='" + appName + '\'' +
+ ", appPrincipals='" + appPrincipals + '\'' +
+ ", needAuth=" + needAuth +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicExpiredData.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicExpiredData.java
new file mode 100644
index 00000000..efa4eac6
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicExpiredData.java
@@ -0,0 +1,71 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+import com.xiaojukeji.kafka.manager.common.entity.pojo.LogicalClusterDO;
+import com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.AppDO;
+
+/**
+ * @author zengqiao
+ * @date 20/9/2
+ */
+public class TopicExpiredData {
+ private Long clusterId;
+
+ private String topicName;
+
+ private LogicalClusterDO logicalClusterDO;
+
+ private AppDO appDO;
+
+ private Integer fetchConnectionNum;
+
+ 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 LogicalClusterDO getLogicalClusterDO() {
+ return logicalClusterDO;
+ }
+
+ public void setLogicalClusterDO(LogicalClusterDO logicalClusterDO) {
+ this.logicalClusterDO = logicalClusterDO;
+ }
+
+ public AppDO getAppDO() {
+ return appDO;
+ }
+
+ public void setAppDO(AppDO appDO) {
+ this.appDO = appDO;
+ }
+
+ public Integer getFetchConnectionNum() {
+ return fetchConnectionNum;
+ }
+
+ public void setFetchConnectionNum(Integer fetchConnectionNum) {
+ this.fetchConnectionNum = fetchConnectionNum;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicExpiredData{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", logicalClusterDO=" + logicalClusterDO +
+ ", appDO=" + appDO +
+ ", fetchConnectionNum=" + fetchConnectionNum +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicMetricsDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicMetricsDTO.java
new file mode 100644
index 00000000..c722b4a9
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicMetricsDTO.java
@@ -0,0 +1,147 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/5/11
+ */
+public class TopicMetricsDTO {
+ @ApiModelProperty(value = "每秒流入消息数")
+ private Object messagesInPerSec;
+
+ @ApiModelProperty(value = "每秒流入字节数")
+ private Object bytesInPerSec;
+
+ @ApiModelProperty(value = "每秒流出字节数")
+ private Object bytesOutPerSec;
+
+ @ApiModelProperty(value = "每秒拒绝字节数")
+ private Object bytesRejectedPerSec;
+
+ @ApiModelProperty(value = "每秒请求数")
+ private Object totalProduceRequestsPerSec;
+
+ @ApiModelProperty(value = "appId维度每秒流入消息数")
+ private Object appIdMessagesInPerSec;
+
+ @ApiModelProperty(value = "appId维度每秒流入字节数")
+ private Object appIdBytesInPerSec;
+
+ @ApiModelProperty(value = "appId维度每秒流出字节数")
+ private Object appIdBytesOutPerSec;
+
+ @ApiModelProperty(value = "produce限流")
+ private Boolean produceThrottled;
+
+ @ApiModelProperty(value = "consume限流")
+ private Boolean consumeThrottled;
+
+ @ApiModelProperty(value = "创建时间")
+ private Long gmtCreate;
+
+ public Object getMessagesInPerSec() {
+ return messagesInPerSec;
+ }
+
+ public void setMessagesInPerSec(Object messagesInPerSec) {
+ this.messagesInPerSec = messagesInPerSec;
+ }
+
+ public Object getBytesInPerSec() {
+ return bytesInPerSec;
+ }
+
+ public void setBytesInPerSec(Object bytesInPerSec) {
+ this.bytesInPerSec = bytesInPerSec;
+ }
+
+ public Object getBytesOutPerSec() {
+ return bytesOutPerSec;
+ }
+
+ public void setBytesOutPerSec(Object bytesOutPerSec) {
+ this.bytesOutPerSec = bytesOutPerSec;
+ }
+
+ public Object getBytesRejectedPerSec() {
+ return bytesRejectedPerSec;
+ }
+
+ public void setBytesRejectedPerSec(Object bytesRejectedPerSec) {
+ this.bytesRejectedPerSec = bytesRejectedPerSec;
+ }
+
+ public Object getTotalProduceRequestsPerSec() {
+ return totalProduceRequestsPerSec;
+ }
+
+ public void setTotalProduceRequestsPerSec(Object totalProduceRequestsPerSec) {
+ this.totalProduceRequestsPerSec = totalProduceRequestsPerSec;
+ }
+
+ public Object getAppIdMessagesInPerSec() {
+ return appIdMessagesInPerSec;
+ }
+
+ public void setAppIdMessagesInPerSec(Object appIdMessagesInPerSec) {
+ this.appIdMessagesInPerSec = appIdMessagesInPerSec;
+ }
+
+ public Object getAppIdBytesInPerSec() {
+ return appIdBytesInPerSec;
+ }
+
+ public void setAppIdBytesInPerSec(Object appIdBytesInPerSec) {
+ this.appIdBytesInPerSec = appIdBytesInPerSec;
+ }
+
+ public Object getAppIdBytesOutPerSec() {
+ return appIdBytesOutPerSec;
+ }
+
+ public void setAppIdBytesOutPerSec(Object appIdBytesOutPerSec) {
+ this.appIdBytesOutPerSec = appIdBytesOutPerSec;
+ }
+
+ public Boolean getProduceThrottled() {
+ return produceThrottled;
+ }
+
+ public void setProduceThrottled(Boolean produceThrottled) {
+ this.produceThrottled = produceThrottled;
+ }
+
+ public Boolean getConsumeThrottled() {
+ return consumeThrottled;
+ }
+
+ public void setConsumeThrottled(Boolean consumeThrottled) {
+ this.consumeThrottled = consumeThrottled;
+ }
+
+ public Long getGmtCreate() {
+ return gmtCreate;
+ }
+
+ public void setGmtCreate(Long gmtCreate) {
+ this.gmtCreate = gmtCreate;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicMetricsDTO{" +
+ "messagesInPerSec=" + messagesInPerSec +
+ ", bytesInPerSec=" + bytesInPerSec +
+ ", bytesOutPerSec=" + bytesOutPerSec +
+ ", bytesRejectedPerSec=" + bytesRejectedPerSec +
+ ", totalProduceRequestsPerSec=" + totalProduceRequestsPerSec +
+ ", appIdMessagesInPerSec=" + appIdMessagesInPerSec +
+ ", appIdBytesInPerSec=" + appIdBytesInPerSec +
+ ", appIdBytesOutPerSec=" + appIdBytesOutPerSec +
+ ", produceThrottled=" + produceThrottled +
+ ", consumeThrottled=" + consumeThrottled +
+ ", gmtCreate=" + gmtCreate +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicOverview.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicOverview.java
new file mode 100644
index 00000000..03dd9e37
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicOverview.java
@@ -0,0 +1,146 @@
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
+
+/**
+ * Topic概览信息
+ * @author zengqiao
+ * @date 20/5/14
+ */
+public class TopicOverview {
+ private Long clusterId;
+
+ private String topicName;
+
+ private Integer replicaNum;
+
+ private Integer partitionNum;
+
+ private Long retentionTime;
+
+ private Object byteIn;
+
+ private Object produceRequest;
+
+ private String appName;
+
+ private String appId;
+
+ private String description;
+
+ private Long updateTime;
+
+ private Long logicalClusterId;
+
+ 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 Long getRetentionTime() {
+ return retentionTime;
+ }
+
+ public void setRetentionTime(Long retentionTime) {
+ this.retentionTime = retentionTime;
+ }
+
+ public Object getByteIn() {
+ return byteIn;
+ }
+
+ public void setByteIn(Object byteIn) {
+ this.byteIn = byteIn;
+ }
+
+ public Object getProduceRequest() {
+ return produceRequest;
+ }
+
+ public void setProduceRequest(Object produceRequest) {
+ this.produceRequest = produceRequest;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Long getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Long updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Long getLogicalClusterId() {
+ return logicalClusterId;
+ }
+
+ public void setLogicalClusterId(Long logicalClusterId) {
+ this.logicalClusterId = logicalClusterId;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicOverview{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", replicaNum=" + replicaNum +
+ ", partitionNum=" + partitionNum +
+ ", retentionTime=" + retentionTime +
+ ", byteIn=" + byteIn +
+ ", produceRequest=" + produceRequest +
+ ", appName='" + appName + '\'' +
+ ", appId='" + appId + '\'' +
+ ", description='" + description + '\'' +
+ ", updateTime=" + updateTime +
+ ", logicalClusterId=" + logicalClusterId +
+ '}';
+ }
+}
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicPartitionVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicPartitionDTO.java
similarity index 60%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicPartitionVO.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicPartitionDTO.java
index ec33d36f..96e96e50 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/vo/topic/TopicPartitionVO.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/topic/TopicPartitionDTO.java
@@ -1,7 +1,4 @@
-package com.xiaojukeji.kafka.manager.web.vo.topic;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
import java.util.List;
@@ -9,32 +6,31 @@ import java.util.List;
* @author arthur
* @date 2017/6/6.
*/
-@ApiModel(value = "分区信息")
-public class TopicPartitionVO {
- @ApiModelProperty(value = "分区Id")
+public class TopicPartitionDTO {
private Integer partitionId;
- @ApiModelProperty(value = "offset偏移")
- private Long offset;
+ private Long beginningOffset;
+
+ private Long endOffset;
+
+ private Long msgNum;
- @ApiModelProperty(value = "分区leader所在Broker")
private Integer leaderBrokerId;
- @ApiModelProperty(value = "首选leader的Broker")
private Integer preferredBrokerId;
- @ApiModelProperty(value = "leaderEpoch")
private Integer leaderEpoch;
- @ApiModelProperty(value = "replica")
private List replicaBrokerIdList;
- @ApiModelProperty(value = "ISR")
private List isrBrokerIdList;
- @ApiModelProperty(value = "True:未同步, False:已同步")
private Boolean underReplicated;
+ private Long logSize;
+
+ private String location;
+
public Integer getPartitionId() {
return partitionId;
}
@@ -43,12 +39,28 @@ public class TopicPartitionVO {
this.partitionId = partitionId;
}
- public Long getOffset() {
- return offset;
+ public Long getBeginningOffset() {
+ return beginningOffset;
}
- public void setOffset(Long offset) {
- this.offset = offset;
+ public void setBeginningOffset(Long beginningOffset) {
+ this.beginningOffset = beginningOffset;
+ }
+
+ public Long getEndOffset() {
+ return endOffset;
+ }
+
+ public void setEndOffset(Long endOffset) {
+ this.endOffset = endOffset;
+ }
+
+ public Long getMsgNum() {
+ return msgNum;
+ }
+
+ public void setMsgNum(Long msgNum) {
+ this.msgNum = msgNum;
}
public Integer getLeaderBrokerId() {
@@ -91,25 +103,45 @@ public class TopicPartitionVO {
this.isrBrokerIdList = isrBrokerIdList;
}
- public boolean isUnderReplicated() {
+ public Boolean getUnderReplicated() {
return underReplicated;
}
- public void setUnderReplicated(boolean underReplicated) {
+ public void setUnderReplicated(Boolean underReplicated) {
this.underReplicated = underReplicated;
}
+ public Long getLogSize() {
+ return logSize;
+ }
+
+ public void setLogSize(Long logSize) {
+ this.logSize = logSize;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
@Override
public String toString() {
- return "TopicPartitionVO{" +
+ return "TopicPartitionDTO{" +
"partitionId=" + partitionId +
- ", offset=" + offset +
+ ", beginningOffset=" + beginningOffset +
+ ", endOffset=" + endOffset +
+ ", msgNum=" + msgNum +
", leaderBrokerId=" + leaderBrokerId +
", preferredBrokerId=" + preferredBrokerId +
", leaderEpoch=" + leaderEpoch +
", replicaBrokerIdList=" + replicaBrokerIdList +
", isrBrokerIdList=" + isrBrokerIdList +
", underReplicated=" + underReplicated +
+ ", logSize=" + logSize +
+ ", location='" + location + '\'' +
'}';
}
}
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/TopicFavorite.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/ClusterTopicDTO.java
similarity index 58%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/TopicFavorite.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/ClusterTopicDTO.java
index 066080b0..7a23191d 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/topic/TopicFavorite.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/ClusterTopicDTO.java
@@ -1,21 +1,20 @@
-package com.xiaojukeji.kafka.manager.web.model.topic;
+package com.xiaojukeji.kafka.manager.common.entity.dto;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @author zengqiao
- * @date 19/7/11
+ * @date 20/4/23
*/
-@JsonIgnoreProperties(ignoreUnknown = true)
-@ApiModel(value = "TopicFavorite", description = "Topic收藏,取消收藏")
-public class TopicFavorite {
+@ApiModel(description="Topic信息")
+public class ClusterTopicDTO {
@ApiModelProperty(value = "集群ID")
- private Long clusterId;
+ protected Long clusterId;
@ApiModelProperty(value = "Topic名称")
- private String topicName;
+ protected String topicName;
public Long getClusterId() {
return clusterId;
@@ -35,9 +34,17 @@ public class TopicFavorite {
@Override
public String toString() {
- return "TopicFavorite{" +
+ return "ClusterTopicDTO{" +
"clusterId=" + clusterId +
", topicName='" + topicName + '\'' +
'}';
}
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)) {
+ return false;
+ }
+ return true;
+ }
}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/config/ConfigDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/config/ConfigDTO.java
new file mode 100644
index 00000000..397a8b9a
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/config/ConfigDTO.java
@@ -0,0 +1,65 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.config;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/3/20
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "配置")
+public class ConfigDTO {
+ @ApiModelProperty(value = "配置key")
+ private String configKey;
+
+ @ApiModelProperty(value = "配置value")
+ private String configValue;
+
+ @ApiModelProperty(value = "备注")
+ private String configDescription;
+
+ public String getConfigKey() {
+ return configKey;
+ }
+
+ public void setConfigKey(String configKey) {
+ this.configKey = configKey;
+ }
+
+ public String getConfigValue() {
+ return configValue;
+ }
+
+ public void setConfigValue(String configValue) {
+ this.configValue = configValue;
+ }
+
+ public String getConfigDescription() {
+ return configDescription;
+ }
+
+ public void setConfigDescription(String configDescription) {
+ this.configDescription = configDescription;
+ }
+
+ @Override
+ public String toString() {
+ return "ConfigDTO{" +
+ "configKey='" + configKey + '\'' +
+ ", configValue='" + configValue + '\'' +
+ ", configDescription='" + configDescription + '\'' +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isExistBlank(configKey)
+ || ValidateUtils.isBlank(configValue)
+ || ValidateUtils.isBlank(configDescription)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaAclSearchDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaAclSearchDTO.java
new file mode 100644
index 00000000..8285cb46
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaAclSearchDTO.java
@@ -0,0 +1,61 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.gateway;
+
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/7/7
+ */
+public class KafkaAclSearchDTO {
+ @ApiModelProperty(value = "集群ID")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "开始时间(ms)")
+ private Long start;
+
+ @ApiModelProperty(value = "结束时间(ms)")
+ private Long end;
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public Long getStart() {
+ return start;
+ }
+
+ public void setStart(Long start) {
+ this.start = start;
+ }
+
+ public Long getEnd() {
+ return end;
+ }
+
+ public void setEnd(Long end) {
+ this.end = end;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaAclSearchDTO{" +
+ "clusterId=" + clusterId +
+ ", start=" + start +
+ ", end=" + end +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(start)
+ || ValidateUtils.isNull(end)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaUserSearchDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaUserSearchDTO.java
new file mode 100644
index 00000000..40b9ebb7
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/KafkaUserSearchDTO.java
@@ -0,0 +1,51 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.gateway;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/7/7
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "Kafka用户查询")
+public class KafkaUserSearchDTO {
+ @ApiModelProperty(value = "开始时间(ms)")
+ private Long start;
+
+ @ApiModelProperty(value = "结束时间(ms)")
+ private Long end;
+
+ public Long getStart() {
+ return start;
+ }
+
+ public void setStart(Long start) {
+ this.start = start;
+ }
+
+ public Long getEnd() {
+ return end;
+ }
+
+ public void setEnd(Long end) {
+ this.end = end;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaUserSearchDTO{" +
+ "start=" + start +
+ ", end=" + end +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNullOrLessThanZero(start) || ValidateUtils.isNullOrLessThanZero(end)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/TopicConnectionDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/TopicConnectionDTO.java
new file mode 100644
index 00000000..8e270338
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/gateway/TopicConnectionDTO.java
@@ -0,0 +1,127 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.gateway;
+
+import java.util.Date;
+
+/**
+ * @author zengqiao
+ * @date 20/7/6
+ */
+public class TopicConnectionDTO {
+ private Long id;
+
+ private Long clusterId;
+
+ private String topicName;
+
+ // producer or consumer
+ private String type;
+
+ // appId#ip#clientVersion
+ private String clientInfo;
+
+ private String appId;
+
+ private String ip;
+
+ private String clientVersion;
+
+ private Date gmtCreate;
+
+ private Date gmtModify;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ 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 getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getClientInfo() {
+ return clientInfo;
+ }
+
+ public void setClientInfo(String clientInfo) {
+ this.clientInfo = clientInfo;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getClientVersion() {
+ return clientVersion;
+ }
+
+ public void setClientVersion(String clientVersion) {
+ this.clientVersion = clientVersion;
+ }
+
+ 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 "TopicConnectionDTO{" +
+ "id=" + id +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", type='" + type + '\'' +
+ ", clientInfo='" + clientInfo + '\'' +
+ ", appId='" + appId + '\'' +
+ ", ip='" + ip + '\'' +
+ ", clientVersion='" + clientVersion + '\'' +
+ ", gmtCreate=" + gmtCreate +
+ ", gmtModify=" + gmtModify +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/AppDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/AppDTO.java
new file mode 100644
index 00000000..b35e42d8
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/AppDTO.java
@@ -0,0 +1,76 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/5/4
+ */
+@ApiModel(description="App信息")
+public class AppDTO {
+ @ApiModelProperty(value="AppId, 不可修改")
+ private String appId;
+
+ @ApiModelProperty(value="App名称")
+ private String name;
+
+ @ApiModelProperty(value="App描述")
+ private String description;
+
+ @ApiModelProperty(value="App负责人")
+ private String principals;
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPrincipals() {
+ return principals;
+ }
+
+ public void setPrincipals(String principals) {
+ this.principals = principals;
+ }
+
+ @Override
+ public String toString() {
+ return "AppDTO{" +
+ "appId='" + appId + '\'' +
+ ", name='" + name + '\'' +
+ ", description='" + description + '\'' +
+ ", principals='" + principals + '\'' +
+ '}';
+ }
+
+ public boolean legal() {
+ if (ValidateUtils.isBlank(appId)
+ || ValidateUtils.isBlank(name)
+ || ValidateUtils.isBlank(principals)
+ || ValidateUtils.isBlank(description)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/JmxSwitchDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/JmxSwitchDTO.java
new file mode 100644
index 00000000..ee6986cb
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/JmxSwitchDTO.java
@@ -0,0 +1,126 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/8/21
+ */
+@ApiModel(description = "JmxSwitch开关")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class JmxSwitchDTO {
+ @ApiModelProperty(value = "集群ID")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "是否是物理集群ID, True:是, False:否")
+ private Boolean isPhysicalClusterId;
+
+ @ApiModelProperty(value = "Topic请求你JMX")
+ private String topicName;
+
+ @ApiModelProperty(value = "Topic请求你JMX")
+ private Boolean openTopicRequestMetrics;
+
+ @ApiModelProperty(value = "AppTopicJMX")
+ private Boolean openAppIdTopicMetrics;
+
+ @ApiModelProperty(value = "客户端请求JMX")
+ private Boolean openClientRequestMetrics;
+
+ @ApiModelProperty(value = "磁盘JMX")
+ private Boolean openDiskMetrics;
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public Boolean getPhysicalClusterId() {
+ return isPhysicalClusterId;
+ }
+
+ public void setPhysicalClusterId(Boolean physicalClusterId) {
+ isPhysicalClusterId = physicalClusterId;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public Boolean getOpenTopicRequestMetrics() {
+ return openTopicRequestMetrics;
+ }
+
+ public void setOpenTopicRequestMetrics(Boolean openTopicRequestMetrics) {
+ this.openTopicRequestMetrics = openTopicRequestMetrics;
+ }
+
+ public Boolean getOpenAppIdTopicMetrics() {
+ return openAppIdTopicMetrics;
+ }
+
+ public void setOpenAppIdTopicMetrics(Boolean openAppIdTopicMetrics) {
+ this.openAppIdTopicMetrics = openAppIdTopicMetrics;
+ }
+
+ public Boolean getOpenClientRequestMetrics() {
+ return openClientRequestMetrics;
+ }
+
+ public void setOpenClientRequestMetrics(Boolean openClientRequestMetrics) {
+ this.openClientRequestMetrics = openClientRequestMetrics;
+ }
+
+ public Boolean getOpenDiskMetrics() {
+ return openDiskMetrics;
+ }
+
+ public void setOpenDiskMetrics(Boolean openDiskMetrics) {
+ this.openDiskMetrics = openDiskMetrics;
+ }
+
+ @Override
+ public String toString() {
+ return "JmxSwitchDTO{" +
+ "clusterId=" + clusterId +
+ ", isPhysicalClusterId=" + isPhysicalClusterId +
+ ", topicName='" + topicName + '\'' +
+ ", openTopicRequestMetrics=" + openTopicRequestMetrics +
+ ", openAppIdTopicMetrics=" + openAppIdTopicMetrics +
+ ", openClientRequestMetrics=" + openClientRequestMetrics +
+ ", openDiskMetrics=" + openDiskMetrics +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(isPhysicalClusterId)
+ || ValidateUtils.isNull(topicName)) {
+ return false;
+ }
+
+ if (ValidateUtils.isNull(openTopicRequestMetrics)) {
+ openTopicRequestMetrics = Boolean.FALSE;
+ }
+ if (ValidateUtils.isNull(openAppIdTopicMetrics)) {
+ openAppIdTopicMetrics = Boolean.FALSE;
+ }
+ if (ValidateUtils.isNull(openClientRequestMetrics)) {
+ openClientRequestMetrics = Boolean.FALSE;
+ }
+ if (ValidateUtils.isNull(openDiskMetrics)) {
+ openDiskMetrics = Boolean.FALSE;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/KafkaFileDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/KafkaFileDTO.java
new file mode 100644
index 00000000..b9337661
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/KafkaFileDTO.java
@@ -0,0 +1,143 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.xiaojukeji.kafka.manager.common.bizenum.KafkaFileEnum;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author zengqiao
+ * @date 20/4/29
+ */
+@ApiModel(description = "Kafka文件")
+public class KafkaFileDTO {
+ @ApiModelProperty(value = "ID")
+ private Long id;
+
+ @ApiModelProperty(value = "集群ID, 创建的时候需要, 修改不需要, 如果是包,则传-1")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "文件名, 创建时需要, 修改不需要")
+ private String fileName;
+
+ @ApiModelProperty(value = "文件MD5")
+ private String fileMd5;
+
+ @ApiModelProperty(value = "文件类型, 创建时需要, 修改不需要")
+ private Integer fileType;
+
+ @ApiModelProperty(value = "备注")
+ private String description;
+
+ @ApiModelProperty(value = "上传的文件")
+ private MultipartFile uploadFile;
+
+ @ApiModelProperty(value = "是更新操作")
+ private Boolean modify;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public String getFileMd5() {
+ return fileMd5;
+ }
+
+ public void setFileMd5(String fileMd5) {
+ this.fileMd5 = fileMd5;
+ }
+
+ public Integer getFileType() {
+ return fileType;
+ }
+
+ public void setFileType(Integer fileType) {
+ this.fileType = fileType;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public MultipartFile getUploadFile() {
+ return uploadFile;
+ }
+
+ public void setUploadFile(MultipartFile uploadFile) {
+ this.uploadFile = uploadFile;
+ }
+
+ public Boolean getModify() {
+ return modify;
+ }
+
+ public void setModify(Boolean modify) {
+ this.modify = modify;
+ }
+
+ @Override
+ public String toString() {
+ return "KafkaFileDTO{" +
+ "id=" + id +
+ ", clusterId=" + clusterId +
+ ", fileName='" + fileName + '\'' +
+ ", fileMd5='" + fileMd5 + '\'' +
+ ", fileType=" + fileType +
+ ", description='" + description + '\'' +
+ '}';
+ }
+
+ public boolean createParamLegal() {
+ if (ValidateUtils.isNull(clusterId) ||
+ ValidateUtils.isBlank(fileName) ||
+ ValidateUtils.isNull(fileType) ||
+ ValidateUtils.isNull(fileMd5) ||
+ ValidateUtils.isNull(uploadFile)) {
+ return false;
+ }
+ if (!(fileName.endsWith(KafkaFileEnum.PACKAGE.getSuffix())
+ || fileName.endsWith(KafkaFileEnum.SERVER_CONFIG.getSuffix()))) {
+ // 后缀不对
+ return false;
+ }
+ if (KafkaFileEnum.PACKAGE.getCode().equals(fileType) && clusterId != -1) {
+ // 包不属于任何集群
+ return false;
+ }
+ return true;
+ }
+
+ public boolean modifyParamLegal() {
+ if (ValidateUtils.isBlank(fileName) ||
+ ValidateUtils.isNull(fileMd5) ||
+ ValidateUtils.isNull(uploadFile)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/LoginModel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/LoginDTO.java
similarity index 66%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/LoginModel.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/LoginDTO.java
index 4e4f70ee..0fa5c77c 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/LoginModel.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/LoginDTO.java
@@ -1,20 +1,21 @@
-package com.xiaojukeji.kafka.manager.web.model;
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
-import org.springframework.util.StringUtils;
/**
* @author zengqiao
* @date 19/5/3
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-@ApiModel(value = "LoginModel", description = "登陆")
-public class LoginModel {
+@ApiModel(description = "登陆")
+public class LoginDTO {
private String username;
private String password;
+ private String code;
+
public String getUsername() {
return username;
}
@@ -31,18 +32,20 @@ public class LoginModel {
this.password = password;
}
- @Override
- public String toString() {
- return "LoginModel{" +
- "username='" + username + '\'' +
- ", password='" + password + '\'' +
- '}';
+ public String getCode() {
+ return code;
}
- public boolean legal() {
- if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
- return false;
- }
- return true;
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ @Override
+ public String toString() {
+ return "LoginDTO{" +
+ "username='" + username + '\'' +
+ ", password='" + password + '\'' +
+ ", code='" + code + '\'' +
+ '}';
}
}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicDataSampleDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicDataSampleDTO.java
new file mode 100644
index 00000000..82876522
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicDataSampleDTO.java
@@ -0,0 +1,100 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.constant.TopicSampleConstant;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Topic采样
+ * @author zengqiao
+ * @date 19/4/8
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TopicDataSampleDTO {
+ @ApiModelProperty(value = "分区Id")
+ private Integer partitionId;
+
+ @ApiModelProperty(value = "最大采样条数[必须小于100]")
+ private Integer maxMsgNum;
+
+ @ApiModelProperty(value = "采样超时时间[必须小于10000]")
+ private Integer timeout;
+
+ @ApiModelProperty(value = "采样offset")
+ private Long offset;
+
+ @ApiModelProperty(value = "截断")
+ private Boolean truncate;
+
+ @ApiModelProperty(value = "是否是集群ID, 默认不是")
+ private Boolean isPhysicalClusterId;
+
+ public Integer getPartitionId() {
+ return partitionId;
+ }
+
+ public void setPartitionId(Integer partitionId) {
+ this.partitionId = partitionId;
+ }
+
+ public Integer getMaxMsgNum() {
+ return maxMsgNum;
+ }
+
+ public void setMaxMsgNum(Integer maxMsgNum) {
+ this.maxMsgNum = maxMsgNum;
+ }
+
+ public Integer getTimeout() {
+ return timeout;
+ }
+
+ public void setTimeout(Integer timeout) {
+ this.timeout = timeout;
+ }
+
+ public Long getOffset() {
+ return offset;
+ }
+
+ public void setOffset(Long offset) {
+ this.offset = offset;
+ }
+
+ public Boolean getTruncate() {
+ return truncate;
+ }
+
+ public void setTruncate(Boolean truncate) {
+ this.truncate = truncate;
+ }
+
+ public Boolean getIsPhysicalClusterId() {
+ return isPhysicalClusterId;
+ }
+
+ public void setIsPhysicalClusterId(Boolean isPhysicalClusterId) {
+ this.isPhysicalClusterId = isPhysicalClusterId;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicDataSampleDTO{" +
+ "partitionId=" + partitionId +
+ ", maxMsgNum=" + maxMsgNum +
+ ", timeout=" + timeout +
+ ", offset=" + offset +
+ ", truncate=" + truncate +
+ ", isPhysicalClusterId=" + isPhysicalClusterId +
+ '}';
+ }
+
+ public void adjustConfig() {
+ timeout = Math.min(timeout, TopicSampleConstant.MAX_TIMEOUT_UNIT_MS);
+ maxMsgNum = Math.min(maxMsgNum, TopicSampleConstant.MAX_MSG_NUM);
+ if (ValidateUtils.isNull(isPhysicalClusterId)) {
+ isPhysicalClusterId = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicModifyDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicModifyDTO.java
new file mode 100644
index 00000000..d59b5471
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicModifyDTO.java
@@ -0,0 +1,41 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/8
+ */
+public class TopicModifyDTO extends ClusterTopicDTO {
+ @ApiModelProperty(value = "描述")
+ private String description;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicModifyDTO{" +
+ "description='" + description + '\'' +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ @Override
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isExistBlank(topicName)
+ || ValidateUtils.isNull(description)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicOffsetResetDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicOffsetResetDTO.java
new file mode 100644
index 00000000..0e2aadb0
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicOffsetResetDTO.java
@@ -0,0 +1,139 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.xiaojukeji.kafka.manager.common.bizenum.OffsetLocationEnum;
+import com.xiaojukeji.kafka.manager.common.entity.ao.PartitionOffsetDTO;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * 重置offset
+ * @author zengqiao
+ * @date 19/4/8
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TopicOffsetResetDTO {
+ @ApiModelProperty(value = "集群Id")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "Topic名称")
+ private String topicName;
+
+ @ApiModelProperty(value = "消费组")
+ private String consumerGroup;
+
+ @ApiModelProperty(value = "存储位置")
+ private String location;
+
+ @ApiModelProperty(value = "重置到指定offset")
+ private List offsetList;
+
+ @ApiModelProperty(value = "重置到指定时间")
+ private Long timestamp;
+
+ @ApiModelProperty(value = "是否是物理集群ID")
+ private Boolean isPhysicalClusterId;
+
+ @ApiModelProperty(value = "指定offset的位置(0 不指定,1 最旧的offset,2 最新的offset)")
+ private Integer offsetPos;
+
+ 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 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 List getOffsetList() {
+ return offsetList;
+ }
+
+ public void setOffsetList(List offsetList) {
+ this.offsetList = offsetList;
+ }
+
+ public Long getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public Boolean getIsPhysicalClusterId() {
+ return isPhysicalClusterId;
+ }
+
+ public void setIsPhysicalClusterId(Boolean isPhysicalClusterId) {
+ this.isPhysicalClusterId = isPhysicalClusterId;
+ }
+
+ public Integer getOffsetPos() {
+ return offsetPos;
+ }
+
+ public void setOffsetPos(Integer offsetPos) {
+ this.offsetPos = offsetPos;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicOffsetResetDTO{" +
+ "clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ ", consumerGroup='" + consumerGroup + '\'' +
+ ", location='" + location + '\'' +
+ ", offsetList=" + offsetList +
+ ", timestamp=" + timestamp +
+ ", isPhysicalClusterId=" + isPhysicalClusterId +
+ ", offsetPos=" + offsetPos +
+ '}';
+ }
+
+ public boolean legal() {
+ if (clusterId == null
+ || ValidateUtils.isExistBlank(topicName)
+ || ValidateUtils.isExistBlank(consumerGroup)
+ || OffsetLocationEnum.getOffsetStoreLocation(location) == null) {
+ return false;
+ }
+
+ if (isPhysicalClusterId == null) {
+ isPhysicalClusterId = false;
+ }
+ if (timestamp == null && offsetList == null && ValidateUtils.isNullOrLessThanZero(offsetPos)) {
+ return false;
+ }
+ if (ValidateUtils.isNull(offsetPos)) {
+ offsetPos = 0;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicRetainDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicRetainDTO.java
new file mode 100644
index 00000000..0472a7c0
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/normal/TopicRetainDTO.java
@@ -0,0 +1,44 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.normal;
+
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/8
+ */
+@ApiModel(description = "Topic延长保留")
+public class TopicRetainDTO extends ClusterTopicDTO{
+
+ @ApiModelProperty(value = "延期天数")
+ private Integer retainDays;
+
+ public Integer getRetainDays() {
+ return retainDays;
+ }
+
+ public void setRetainDays(Integer retainDays) {
+ this.retainDays = retainDays;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicRetainDTO{" +
+ "retainDays=" + retainDays +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ @Override
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)
+ || ValidateUtils.isNull(retainDays)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/KafkaPackageDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/KafkaPackageDTO.java
new file mode 100644
index 00000000..86314d8d
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/KafkaPackageDTO.java
@@ -0,0 +1,25 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/26
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description="集群任务")
+public class KafkaPackageDTO {
+ @ApiModelProperty(value="名称")
+ private String name;
+
+ @ApiModelProperty(value="文件类型")
+ private Integer fileType;
+
+ @ApiModelProperty(value="md5")
+ private String md5;
+
+ @ApiModelProperty(value="描述备注")
+ private String description;
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RebalanceModel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/RebalanceDTO.java
similarity index 51%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RebalanceModel.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/RebalanceDTO.java
index c988d3e1..29db6bdc 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RebalanceModel.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/RebalanceDTO.java
@@ -1,27 +1,31 @@
-package com.xiaojukeji.kafka.manager.web.model;
+package com.xiaojukeji.kafka.manager.common.entity.dto.op;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.bizenum.RebalanceDimensionEnum;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
- * rebalance请求参数
* @author zengqiao
* @date 19/7/8
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-@ApiModel(value = "RebalanceModel", description = "rebalance模型")
-public class RebalanceModel {
- @ApiModelProperty(value = "集群Id")
+@ApiModel(description = "优先副本选举")
+public class RebalanceDTO {
+ @ApiModelProperty(value = "clusterId")
private Long clusterId;
+ @ApiModelProperty(value = "RegionId")
+ private Long regionId;
+
@ApiModelProperty(value = "brokerId")
private Integer brokerId;
- @ApiModelProperty(value = "Topic名称")
+ @ApiModelProperty(value = "TopicName")
private String topicName;
- @ApiModelProperty(value = "维度[0: 集群维度, 1: broker维度]")
+ @ApiModelProperty(value = "维度[0: Cluster维度, 1: Region维度, 2:Broker维度, 3:Topic维度]")
private Integer dimension;
public Long getClusterId() {
@@ -32,6 +36,14 @@ public class RebalanceModel {
this.clusterId = clusterId;
}
+ public Long getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(Long regionId) {
+ this.regionId = regionId;
+ }
+
public Integer getBrokerId() {
return brokerId;
}
@@ -58,19 +70,20 @@ public class RebalanceModel {
@Override
public String toString() {
- return "RebalanceModel{" +
+ return "RebalanceDTO{" +
"clusterId=" + clusterId +
+ ", regionId=" + regionId +
", brokerId=" + brokerId +
- ", topicName=" + topicName +
+ ", topicName='" + topicName + '\'' +
", dimension=" + dimension +
'}';
}
- public boolean legal() {
- if (dimension == null || clusterId == null) {
- return false;
- }
- if (dimension.equals(1) && brokerId == null) {
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || RebalanceDimensionEnum.REGION.getCode().equals(dimension) && ValidateUtils.isNull(regionId)
+ || RebalanceDimensionEnum.BROKER.getCode().equals(dimension) && ValidateUtils.isNull(brokerId)
+ || RebalanceDimensionEnum.TOPIC.getCode().equals(dimension) && ValidateUtils.isNull(topicName) ) {
return false;
}
return true;
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecDTO.java
new file mode 100644
index 00000000..74189544
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecDTO.java
@@ -0,0 +1,70 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.reassign;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.bizenum.TopicReassignActionEnum;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao_cn@163.com
+ * @date 19/4/17
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "操作迁移任务")
+public class ReassignExecDTO {
+ @ApiModelProperty(value = "任务ID")
+ private Long taskId;
+
+ @ApiModelProperty(value = "动作[start|modify|cancel]")
+ private String action;
+
+ @ApiModelProperty(value = "开始时间(开始之后不可修改)")
+ private Long beginTime;
+
+ public Long getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(Long taskId) {
+ this.taskId = taskId;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public Long getBeginTime() {
+ return beginTime;
+ }
+
+ public void setBeginTime(Long beginTime) {
+ this.beginTime = beginTime;
+ }
+
+ @Override
+ public String toString() {
+ return "ReassignExecDTO{" +
+ "taskId=" + taskId +
+ ", action='" + action + '\'' +
+ ", beginTime=" + beginTime +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(taskId)
+ || ValidateUtils.isBlank(action)) {
+ return false;
+ }
+
+ if (TopicReassignActionEnum.MODIFY.getAction().equals(action)
+ && ValidateUtils.isNullOrLessThanZero(beginTime)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecSubDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecSubDTO.java
new file mode 100644
index 00000000..52a1d8c9
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignExecSubDTO.java
@@ -0,0 +1,92 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.reassign;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/6/11
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "操作迁移子任务")
+public class ReassignExecSubDTO {
+ @ApiModelProperty(value = "子任务ID")
+ private Long subTaskId;
+
+ @ApiModelProperty(value = "动作[modify]")
+ private String action;
+
+ @ApiModelProperty(value = "当前限流值(B/s), 完成之前可修改")
+ private Long throttle;
+
+ @ApiModelProperty(value = "限流值上限(B/s), 完成之前可修改")
+ private Long maxThrottle;
+
+ @ApiModelProperty(value = "限流值下限(B/s), 完成之前可修改")
+ private Long minThrottle;
+
+ public Long getSubTaskId() {
+ return subTaskId;
+ }
+
+ public void setSubTaskId(Long subTaskId) {
+ this.subTaskId = subTaskId;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public Long getThrottle() {
+ return throttle;
+ }
+
+ public void setThrottle(Long throttle) {
+ this.throttle = throttle;
+ }
+
+ public Long getMaxThrottle() {
+ return maxThrottle;
+ }
+
+ public void setMaxThrottle(Long maxThrottle) {
+ this.maxThrottle = maxThrottle;
+ }
+
+ public Long getMinThrottle() {
+ return minThrottle;
+ }
+
+ public void setMinThrottle(Long minThrottle) {
+ this.minThrottle = minThrottle;
+ }
+
+ @Override
+ public String toString() {
+ return "ReassignExecSubDTO{" +
+ "subTaskId=" + subTaskId +
+ ", action='" + action + '\'' +
+ ", throttle=" + throttle +
+ ", maxThrottle=" + maxThrottle +
+ ", minThrottle=" + minThrottle +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(subTaskId)
+ || ValidateUtils.isBlank(action)
+ || ValidateUtils.isNullOrLessThanZero(throttle)
+ || ValidateUtils.isNullOrLessThanZero(maxThrottle)
+ || ValidateUtils.isNullOrLessThanZero(minThrottle)
+ || maxThrottle < throttle || throttle < minThrottle) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignTopicDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignTopicDTO.java
new file mode 100644
index 00000000..59aa0ae6
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/reassign/ReassignTopicDTO.java
@@ -0,0 +1,172 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.reassign;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * 迁移(Topic迁移/Partition迁移)
+ * @author zengqiao_cn@163.com
+ * @date 19/4/9
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "Topic迁移")
+public class ReassignTopicDTO {
+ @ApiModelProperty(value = "集群ID")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "Topic名称")
+ private String topicName;
+
+ @ApiModelProperty(value = "目标BrokerID列表")
+ private List brokerIdList;
+
+ @ApiModelProperty(value = "目标RegionID")
+ private Long regionId;
+
+ @ApiModelProperty(value = "分区ID")
+ private List partitionIdList;
+
+ @ApiModelProperty(value = "限流值(B/s)")
+ private Long throttle;
+
+ @ApiModelProperty(value = "限流上限(B/s)")
+ private Long maxThrottle;
+
+ @ApiModelProperty(value = "限流下限(B/s)")
+ private Long minThrottle;
+
+ @ApiModelProperty(value = "原本的保存时间(ms)")
+ private Long originalRetentionTime;
+
+ @ApiModelProperty(value = "迁移时的保存时间(ms)")
+ private Long reassignRetentionTime;
+
+ @ApiModelProperty(value = "开始时间(ms, 时间戳)")
+ private Long beginTime;
+
+ @ApiModelProperty(value = "备注")
+ 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 List getBrokerIdList() {
+ return brokerIdList;
+ }
+
+ public void setBrokerIdList(List brokerIdList) {
+ this.brokerIdList = brokerIdList;
+ }
+
+ public Long getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(Long regionId) {
+ this.regionId = regionId;
+ }
+
+ public List getPartitionIdList() {
+ return partitionIdList;
+ }
+
+ public void setPartitionIdList(List partitionIdList) {
+ this.partitionIdList = partitionIdList;
+ }
+
+ public Long getThrottle() {
+ return throttle;
+ }
+
+ public void setThrottle(Long throttle) {
+ this.throttle = throttle;
+ }
+
+ public Long getMaxThrottle() {
+ return maxThrottle;
+ }
+
+ public void setMaxThrottle(Long maxThrottle) {
+ this.maxThrottle = maxThrottle;
+ }
+
+ public Long getMinThrottle() {
+ return minThrottle;
+ }
+
+ public void setMinThrottle(Long minThrottle) {
+ this.minThrottle = minThrottle;
+ }
+
+ public Long getOriginalRetentionTime() {
+ return originalRetentionTime;
+ }
+
+ public void setOriginalRetentionTime(Long originalRetentionTime) {
+ this.originalRetentionTime = originalRetentionTime;
+ }
+
+ public Long getReassignRetentionTime() {
+ return reassignRetentionTime;
+ }
+
+ public void setReassignRetentionTime(Long reassignRetentionTime) {
+ this.reassignRetentionTime = reassignRetentionTime;
+ }
+
+ public Long getBeginTime() {
+ return beginTime;
+ }
+
+ public void setBeginTime(Long beginTime) {
+ this.beginTime = beginTime;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isExistBlank(topicName)
+ || ValidateUtils.isNullOrLessThanZero(throttle)
+ || ValidateUtils.isNullOrLessThanZero(maxThrottle)
+ || ValidateUtils.isNullOrLessThanZero(minThrottle)
+ || maxThrottle < throttle || throttle < minThrottle
+ || ValidateUtils.isNullOrLessThanZero(originalRetentionTime)
+ || ValidateUtils.isNullOrLessThanZero(reassignRetentionTime)
+ || originalRetentionTime < reassignRetentionTime
+ || ValidateUtils.isNullOrLessThanZero(beginTime)) {
+ return false;
+ }
+ if (ValidateUtils.isNull(description)) {
+ description = "";
+ }
+
+ if (ValidateUtils.isEmptyList(brokerIdList) && ValidateUtils.isNull(regionId)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicCreationDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicCreationDTO.java
new file mode 100644
index 00000000..66c26c5b
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicCreationDTO.java
@@ -0,0 +1,138 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.topic;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * @author huangyiminghappy@163.com, zengqiao
+ * @date 2019-04-21
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "Topic创建")
+public class TopicCreationDTO extends ClusterTopicDTO {
+ @ApiModelProperty(value = "AppID")
+ private String appId;
+
+ @ApiModelProperty(value = "分区数")
+ private Integer partitionNum;
+
+ @ApiModelProperty(value = "副本数")
+ private Integer replicaNum;
+
+ @ApiModelProperty(value = "消息保存时间(ms)")
+ private Long retentionTime;
+
+ @ApiModelProperty(value = "brokerId列表")
+ private List brokerIdList;
+
+ @ApiModelProperty(value = "RegionId")
+ private Long regionId;
+
+ @ApiModelProperty(value = "备注")
+ private String description;
+
+ @ApiModelProperty(value = "Topic属性列表")
+ private Properties properties;
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ 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 Long getRetentionTime() {
+ return retentionTime;
+ }
+
+ public void setRetentionTime(Long retentionTime) {
+ this.retentionTime = retentionTime;
+ }
+
+ public List getBrokerIdList() {
+ return brokerIdList;
+ }
+
+ public void setBrokerIdList(List brokerIdList) {
+ this.brokerIdList = brokerIdList;
+ }
+
+ public Long getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(Long regionId) {
+ this.regionId = regionId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties properties) {
+ this.properties = properties;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicCreationDTO{" +
+ "appId='" + appId + '\'' +
+ ", partitionNum=" + partitionNum +
+ ", replicaNum=" + replicaNum +
+ ", retentionTime=" + retentionTime +
+ ", brokerIdList=" + brokerIdList +
+ ", regionId=" + regionId +
+ ", description='" + description + '\'' +
+ ", properties='" + properties + '\'' +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ @Override
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(appId)
+ || ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)
+ || ValidateUtils.isNull(partitionNum) || partitionNum <= 0
+ || ValidateUtils.isNull(replicaNum) || replicaNum <= 0
+ || ValidateUtils.isNull(retentionTime) || retentionTime <= 0) {
+ return false;
+ }
+ if ((ValidateUtils.isNull(brokerIdList) || brokerIdList.isEmpty()) && ValidateUtils.isNull(regionId)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicDeletionDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicDeletionDTO.java
new file mode 100644
index 00000000..735ee857
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicDeletionDTO.java
@@ -0,0 +1,44 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.topic;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/2
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(value = "Topic删除")
+public class TopicDeletionDTO extends ClusterTopicDTO {
+ @ApiModelProperty(value = "不强制")
+ private Boolean unForce;
+
+ public Boolean getUnForce() {
+ return unForce;
+ }
+
+ public void setUnForce(Boolean unForce) {
+ this.unForce = unForce;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicDeletionDTO{" +
+ "unForce=" + unForce +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)
+ || ValidateUtils.isNull(unForce)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicExpansionDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicExpansionDTO.java
new file mode 100644
index 00000000..bb8a5eb8
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicExpansionDTO.java
@@ -0,0 +1,71 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.topic;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/1/2
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(value = "Topic扩分区")
+public class TopicExpansionDTO extends ClusterTopicDTO {
+ @ApiModelProperty(value = "新增分区数")
+ private Integer partitionNum;
+
+ @ApiModelProperty(value = "brokerId列表")
+ private List brokerIdList;
+
+ @ApiModelProperty(value = "regionId")
+ private Long regionId;
+
+ public Integer getPartitionNum() {
+ return partitionNum;
+ }
+
+ public void setPartitionNum(Integer partitionNum) {
+ this.partitionNum = partitionNum;
+ }
+
+ public List getBrokerIdList() {
+ return brokerIdList;
+ }
+
+ public void setBrokerIdList(List brokerIdList) {
+ this.brokerIdList = brokerIdList;
+ }
+
+ public Long getRegionId() {
+ return regionId;
+ }
+
+ public void setRegionId(Long regionId) {
+ this.regionId = regionId;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicExpandDTO{" +
+ ", partitionNum=" + partitionNum +
+ ", brokerIdList=" + brokerIdList +
+ ", regionId=" + regionId +
+ '}';
+ }
+
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)
+ || ValidateUtils.isNull(partitionNum) || partitionNum <= 0) {
+ return false;
+ }
+ if (ValidateUtils.isEmptyList(brokerIdList) && ValidateUtils.isNull(regionId)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicModificationDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicModificationDTO.java
new file mode 100644
index 00000000..5d03264e
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicModificationDTO.java
@@ -0,0 +1,85 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.op.topic;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Properties;
+
+/**
+ * @author zengqiao
+ * @date 20/4/24
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(value = "Topic修改")
+public class TopicModificationDTO extends ClusterTopicDTO {
+ @ApiModelProperty(value = "AppID")
+ private String appId;
+
+ @ApiModelProperty(value = "消息保存时间(ms)")
+ private Long retentionTime;
+
+ @ApiModelProperty(value = "备注")
+ private String description;
+
+ @ApiModelProperty(value = "Topic属性列表")
+ private Properties properties;
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public Long getRetentionTime() {
+ return retentionTime;
+ }
+
+ public void setRetentionTime(Long retentionTime) {
+ this.retentionTime = retentionTime;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties properties) {
+ this.properties = properties;
+ }
+
+ @Override
+ public String toString() {
+ return "TopicModificationDTO{" +
+ "appId='" + appId + '\'' +
+ ", retentionTime=" + retentionTime +
+ ", description='" + description + '\'' +
+ ", properties='" + properties + '\'' +
+ ", clusterId=" + clusterId +
+ ", topicName='" + topicName + '\'' +
+ '}';
+ }
+
+ @Override
+ public boolean paramLegal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(topicName)
+ || ValidateUtils.isNull(appId)
+ || ValidateUtils.isNull(retentionTime)
+ || ValidateUtils.isNull(description)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/AccountModel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/AccountDTO.java
similarity index 51%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/AccountModel.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/AccountDTO.java
index a3ac3bf2..db2b0aff 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/AccountModel.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/AccountDTO.java
@@ -1,25 +1,24 @@
-package com.xiaojukeji.kafka.manager.web.model;
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import org.springframework.util.StringUtils;
/**
* @author zengqiao
* @date 19/5/3
*/
-@ApiModel(value = "AccountModel", description = "用户")
-public class AccountModel {
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "用户")
+public class AccountDTO {
@ApiModelProperty(value = "用户名")
private String username;
- @ApiModelProperty(value = "新密码, 1.创建账号时, 可不传")
+ @ApiModelProperty(value = "密码")
private String password;
- @ApiModelProperty(value = "旧密码")
- private String oldPassword;
-
- @ApiModelProperty(value = "角色[0:普通, 1:运维, 2:管理员]")
+ @ApiModelProperty(value = "角色")
private Integer role;
public String getUsername() {
@@ -30,14 +29,6 @@ public class AccountModel {
this.username = username;
}
- public String getOldPassword() {
- return oldPassword;
- }
-
- public void setOldPassword(String oldPassword) {
- this.oldPassword = oldPassword;
- }
-
public String getPassword() {
return password;
}
@@ -56,27 +47,20 @@ public class AccountModel {
@Override
public String toString() {
- return "AccountModel{" +
+ return "AccountDTO{" +
"username='" + username + '\'' +
- ", oldPassword='" + oldPassword + '\'' +
", password='" + password + '\'' +
", role=" + role +
'}';
}
- public boolean insertLegal() {
- if (StringUtils.isEmpty(username)
- || StringUtils.isEmpty(password)
+ public boolean legal() {
+ if (ValidateUtils.isNull(username)
|| !(role == 0 || role == 1 || role == 2)) {
return false;
}
- return true;
- }
-
- public boolean modifyLegal() {
- if (StringUtils.isEmpty(username)
- || !(role == 0 || role == 1 || role == 2)) {
- return false;
+ if (ValidateUtils.isNull(password)) {
+ password = "";
}
return true;
}
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java
new file mode 100644
index 00000000..666ef6f7
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java
@@ -0,0 +1,128 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @author zengqiao
+ * @date 20/4/23
+ */
+@ApiModel(description = "集群接入&修改")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ClusterDTO {
+ @ApiModelProperty(value="集群Id, 修改时传")
+ private Long clusterId;
+
+ @ApiModelProperty(value="集群名称")
+ private String clusterName;
+
+ @ApiModelProperty(value="ZK地址, 不允许修改")
+ private String zookeeper;
+
+ @ApiModelProperty(value="bootstrap地址")
+ private String bootstrapServers;
+
+ @ApiModelProperty(value="kafka版本")
+ private String kafkaVersion;
+
+ @ApiModelProperty(value="集群类型")
+ private Integer mode;
+
+ @ApiModelProperty(value="数据中心")
+ private String idc;
+
+ @ApiModelProperty(value="安全配置参数")
+ private String securityProperties;
+
+ 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 getZookeeper() {
+ return zookeeper;
+ }
+
+ public void setZookeeper(String zookeeper) {
+ this.zookeeper = zookeeper;
+ }
+
+ public String getBootstrapServers() {
+ return bootstrapServers;
+ }
+
+ public void setBootstrapServers(String bootstrapServers) {
+ this.bootstrapServers = bootstrapServers;
+ }
+
+ public String getKafkaVersion() {
+ return kafkaVersion;
+ }
+
+ public void setKafkaVersion(String kafkaVersion) {
+ this.kafkaVersion = kafkaVersion;
+ }
+
+ public String getIdc() {
+ return idc;
+ }
+
+ public void setIdc(String idc) {
+ this.idc = idc;
+ }
+
+ public Integer getMode() {
+ return mode;
+ }
+
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ public String getSecurityProperties() {
+ return securityProperties;
+ }
+
+ public void setSecurityProperties(String securityProperties) {
+ this.securityProperties = securityProperties;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterDTO{" +
+ "clusterId=" + clusterId +
+ ", clusterName='" + clusterName + '\'' +
+ ", zookeeper='" + zookeeper + '\'' +
+ ", bootstrapServers='" + bootstrapServers + '\'' +
+ ", kafkaVersion='" + kafkaVersion + '\'' +
+ ", idc='" + idc + '\'' +
+ ", mode='" + mode + '\'' +
+ ", securityProperties='" + securityProperties + '\'' +
+ '}';
+ }
+
+ public Boolean legal() {
+ if (ValidateUtils.isNull(clusterName)
+ || ValidateUtils.isNull(zookeeper)
+ || ValidateUtils.isNull(idc)
+ || ValidateUtils.isNull(mode)
+ || ValidateUtils.isNull(bootstrapServers)
+ ) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/CustomScheduledTaskDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/CustomScheduledTaskDTO.java
new file mode 100644
index 00000000..d7fa2d72
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/CustomScheduledTaskDTO.java
@@ -0,0 +1,35 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
+
+/**
+ * @author zengqiao
+ * @date 20/8/11
+ */
+public class CustomScheduledTaskDTO {
+ private String name;
+
+ private String cron;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getCron() {
+ return cron;
+ }
+
+ public void setCron(String cron) {
+ this.cron = cron;
+ }
+
+ @Override
+ public String toString() {
+ return "CustomScheduledTaskDTO{" +
+ "name='" + name + '\'' +
+ ", cron='" + cron + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java
new file mode 100644
index 00000000..c3569774
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java
@@ -0,0 +1,118 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @author zengqiao
+ * @date 20/6/29
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@ApiModel(description = "LogicalClusterDTO")
+public class LogicalClusterDTO {
+ @ApiModelProperty(value = "ID, 更新时必须传")
+ private Long id;
+
+ @ApiModelProperty(value = "名称")
+ private String name;
+
+ @ApiModelProperty(value = "集群模式")
+ private Integer mode;
+
+ @ApiModelProperty(value = "集群ID")
+ private Long clusterId;
+
+ @ApiModelProperty(value = "regionId列表")
+ private List regionIdList;
+
+ @ApiModelProperty(value = "所属应用ID")
+ private String appId;
+
+ @ApiModelProperty(value = "备注")
+ private String description;
+
+ 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 getMode() {
+ return mode;
+ }
+
+ public void setMode(Integer mode) {
+ this.mode = mode;
+ }
+
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ public List getRegionIdList() {
+ return regionIdList;
+ }
+
+ public void setRegionIdList(List regionIdList) {
+ this.regionIdList = regionIdList;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "LogicalClusterDTO{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", mode=" + mode +
+ ", clusterId=" + clusterId +
+ ", regionIdList=" + regionIdList +
+ ", appId='" + appId + '\'' +
+ ", description='" + description + '\'' +
+ '}';
+ }
+
+ public boolean legal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isEmptyList(regionIdList)
+ || ValidateUtils.isNull(appId)
+ || ValidateUtils.isNull(mode)) {
+ return false;
+ }
+ description = ValidateUtils.isNull(description)? "": description;
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/OperateRecordDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/OperateRecordDTO.java
new file mode 100644
index 00000000..1837ecfc
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/OperateRecordDTO.java
@@ -0,0 +1,91 @@
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.bizenum.ModuleEnum;
+import com.xiaojukeji.kafka.manager.common.bizenum.OperateEnum;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+/**
+ * @author zhongyuankai_i
+ * @date 20/09/03
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OperateRecordDTO {
+ @ApiModelProperty("模块ID")
+ private Integer moduleId;
+
+ @ApiModelProperty("操作ID")
+ private Integer operateId;
+
+ @ApiModelProperty("操作人")
+ private String operator;
+
+ @ApiModelProperty("开始时间")
+ private Long startTime;
+
+ @ApiModelProperty("结束时间")
+ private Long endTime;
+
+ public Integer getModuleId() {
+ return moduleId;
+ }
+
+ public void setModuleId(Integer moduleId) {
+ this.moduleId = moduleId;
+ }
+
+ public Integer getOperateId() {
+ return operateId;
+ }
+
+ public void setOperateId(Integer operateId) {
+ this.operateId = operateId;
+ }
+
+ public String getOperator() {
+ return operator;
+ }
+
+ public void setOperator(String operator) {
+ this.operator = operator;
+ }
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Long startTime) {
+ this.startTime = startTime;
+ }
+
+ public Long getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Long endTime) {
+ this.endTime = endTime;
+ }
+
+ @Override
+ public String toString() {
+ return "OperateRecordDTO{" +
+ "moduleId=" + moduleId +
+ ", operateId=" + operateId +
+ ", operator='" + operator + '\'' +
+ ", startTime=" + startTime +
+ ", endTime=" + endTime +
+ '}';
+ }
+
+ public boolean legal() {
+ if (!ModuleEnum.validate(moduleId) ||
+ (!ValidateUtils.isNull(operateId) && OperateEnum.validate(operateId))
+ ) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RegionModel.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/RegionDTO.java
similarity index 53%
rename from web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RegionModel.java
rename to kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/RegionDTO.java
index eddaeba3..708aa3ce 100644
--- a/web/src/main/java/com/xiaojukeji/kafka/manager/web/model/RegionModel.java
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/RegionDTO.java
@@ -1,9 +1,9 @@
-package com.xiaojukeji.kafka.manager.web.model;
+package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang.StringUtils;
import java.util.List;
@@ -13,59 +13,40 @@ import java.util.List;
* @date 19/4/3
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-@ApiModel(value = "RegionModel", description = "创建Region")
-public class RegionModel {
- @ApiModelProperty(value = "RegionId, 更新时必须传")
- private Long regionId;
+@ApiModel(description = "RegionDTO")
+public class RegionDTO {
+ @ApiModelProperty(value = "ID, 更新时必须传")
+ private Long id;
+
+ @ApiModelProperty(value = "名称")
+ private String name;
@ApiModelProperty(value = "集群ID")
private Long clusterId;
- @ApiModelProperty(value = "regionName名称")
- private String regionName;
-
- @ApiModelProperty(value = "重要级别, 0:普通, 1:重要,2:重要")
- private Integer level;
-
- @ApiModelProperty(value = "状态, -1:废弃 0:正常 1:容量已满")
- private Integer status;
-
@ApiModelProperty(value = "brokerId列表")
private List brokerIdList;
@ApiModelProperty(value = "备注")
private String description;
- public Long getRegionId() {
- return regionId;
+ @ApiModelProperty(value = "状态, 0:正常 1:已满")
+ private Integer status;
+
+ public Long getId() {
+ return id;
}
- public void setRegionId(Long regionId) {
- this.regionId = regionId;
+ public void setId(Long id) {
+ this.id = id;
}
- public Long getClusterId() {
- return clusterId;
+ public String getName() {
+ return name;
}
- public void setClusterId(Long clusterId) {
- this.clusterId = clusterId;
- }
-
- public String getRegionName() {
- return regionName;
- }
-
- public void setRegionName(String regionName) {
- this.regionName = regionName;
- }
-
- public Integer getLevel() {
- return level;
- }
-
- public void setLevel(Integer level) {
- this.level = level;
+ public void setName(String name) {
+ this.name = name;
}
public Integer getStatus() {
@@ -76,6 +57,14 @@ public class RegionModel {
this.status = status;
}
+ public Long getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(Long clusterId) {
+ this.clusterId = clusterId;
+ }
+
public List getBrokerIdList() {
return brokerIdList;
}
@@ -92,29 +81,26 @@ public class RegionModel {
this.description = description;
}
- public boolean legal() {
- if (clusterId == null
- || StringUtils.isEmpty(regionName)
- || level == null
- || brokerIdList == null || brokerIdList.isEmpty()) {
- return false;
- }
- if (description == null) {
- description = "";
- }
- return true;
- }
-
@Override
public String toString() {
- return "RegionModel{" +
- "regionId=" + regionId +
+ return "RegionDTO{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
", clusterId=" + clusterId +
- ", regionName='" + regionName + '\'' +
- ", level=" + level +
- ", status=" + status +
", brokerIdList=" + brokerIdList +
", description='" + description + '\'' +
+ ", status=" + status +
'}';
}
+
+ public boolean legal() {
+ if (ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isNull(clusterId)
+ || ValidateUtils.isEmptyList(brokerIdList)
+ || ValidateUtils.isNull(status)) {
+ return false;
+ }
+ description = ValidateUtils.isNull(description)? "": description;
+ return true;
+ }
}
\ No newline at end of file
diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/metrics/BaseMetrics.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/metrics/BaseMetrics.java
new file mode 100644
index 00000000..7752e384
--- /dev/null
+++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/metrics/BaseMetrics.java
@@ -0,0 +1,159 @@
+package com.xiaojukeji.kafka.manager.common.entity.metrics;
+
+import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
+import com.xiaojukeji.kafka.manager.common.utils.jmx.JmxConstant;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author zengqiao
+ * @date 20/6/16
+ */
+public class BaseMetrics {
+ protected Map metricsMap = new HashMap<>();
+
+ public Map getMetricsMap() {
+ return metricsMap;
+ }
+
+ public void setMetricsMap(Map