diff --git a/.asf.yaml b/.asf.yaml
index fdb990a7..faf433b8 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -34,9 +34,9 @@ github:
- serverless-workflow
- message-bus
enabled_merge_buttons:
- squash: true
- merge: false
- rebase: false
+ squash: true
+ merge: false
+ rebase: false
protected_branches:
main:
required_status_checks:
@@ -47,11 +47,11 @@ github:
dismiss_stale_reviews: true
required_approving_review_count: 0 # Temporary 0 to allow committers to merge themselves PR
notifications:
- commits: commits@eventmesh.apache.org
- # Send all issue emails (new, closed, comments) to issues@
- issues: issues@eventmesh.apache.org
- # Send new/closed PR notifications to dev@
- pullrequests_status: dev@eventmesh.apache.org
- # Send individual PR comments/reviews to issues@
- pullrequests_comment: issues@eventmesh.apache.org
- jira_options: link label worklog
+ commits: commits@eventmesh.apache.org
+ # Send all issue emails (new, closed, comments) to issues@
+ issues: issues@eventmesh.apache.org
+ # Send new/closed PR notifications to dev@
+ pullrequests_status: dev@eventmesh.apache.org
+ # Send individual PR comments/reviews to issues@
+ pullrequests_comment: issues@eventmesh.apache.org
+ jira_options: link label worklog
diff --git a/.github/workflows/config/eventmesh.properties b/.github/workflows/config/eventmesh.properties
index 7f26487c..31ad594c 100644
--- a/.github/workflows/config/eventmesh.properties
+++ b/.github/workflows/config/eventmesh.properties
@@ -43,12 +43,10 @@ eventMesh.server.session.expiredInMills=60000
eventMesh.server.tcp.msgReqnumPerSecond=15000
eventMesh.server.http.msgReqnumPerSecond=15000
eventMesh.server.session.upstreamBufferSize=20
-
# for single event publish, maximum size allowed per event
eventMesh.server.maxEventSize=1000
# for batch event publish, maximum number of events allowed in one batch
eventMesh.server.maxEventBatchSize=10
-
# thread number about global scheduler
eventMesh.server.global.scheduler=5
eventMesh.server.tcp.taskHandleExecutorPoolSize=8
@@ -59,32 +57,26 @@ eventMesh.server.retry.async.pushRetryDelayInMills=500
eventMesh.server.retry.sync.pushRetryDelayInMills=500
eventMesh.server.retry.pushRetryQueueSize=10000
eventMesh.server.retry.plugin.type=default
-
# sleep interval between closing client of different group in server graceful shutdown
eventMesh.server.gracefulShutdown.sleepIntervalInMills=1000
eventMesh.server.rebalanceRedirect.sleepIntervalInMills=200
-
# ip address blacklist
eventMesh.server.blacklist.ipv4=0.0.0.0/8,127.0.0.0/8,169.254.0.0/16,255.255.255.255/32
eventMesh.server.blacklist.ipv6=::/128,::1/128,ff00::/8
-
########################## EventMesh Plugin Configuration ##########################
# storage plugin
eventMesh.storage.plugin.type=rocketmq
-
# security plugin
eventMesh.server.security.enabled=false
eventMesh.security.plugin.type=security
eventMesh.security.validation.type.token=false
eventMesh.security.publickey=
-
# metaStorage plugin
eventMesh.metaStorage.plugin.enabled=true
eventMesh.metaStorage.plugin.type=nacos
eventMesh.metaStorage.plugin.server-addr=127.0.0.1:8848
eventMesh.metaStorage.plugin.username=nacos
eventMesh.metaStorage.plugin.password=nacos
-
# metaStorage plugin: nacos
#eventMesh.metaStorage.nacos.endpoint=
#eventMesh.metaStorage.nacos.accessKey=
@@ -93,16 +85,13 @@ eventMesh.metaStorage.plugin.password=nacos
#eventMesh.metaStorage.nacos.namespace=
# The default value is half of CPU's num
#eventMesh.metaStorage.nacos.namingPollingThreadCount=5
-
# metaStorage plugin: zookeeper
#eventMesh.metaStorage.zookeeper.scheme=
#eventMesh.metaStorage.zookeeper.auth=
#eventMesh.metaStorage.zookeeper.connectionTimeoutMs=
#eventMesh.metaStorage.zookeeper.sessionTimeoutMs=
-
# Fully qualified name of org.apache.curator.RetryPolicy implementation
#eventMesh.metaStorage.zookeeper.retryPolicy.class=
-
# Constructor arguments for different org.apache.curator.RetryPolicy implementations
#eventMesh.metaStorage.zookeeper.retryPolicy.baseSleepTimeMs=
#eventMesh.metaStorage.zookeeper.retryPolicy.maxRetries=
@@ -110,7 +99,6 @@ eventMesh.metaStorage.plugin.password=nacos
#eventMesh.metaStorage.zookeeper.retryPolicy.retryIntervalMs=
#eventMesh.metaStorage.zookeeper.retryPolicy.nTimes=
#eventMesh.metaStorage.zookeeper.retryPolicy.sleepMsBetweenRetries=
-
# The TLS configuration of metaStorage plugin: consul
# keyStoreInstanceType's value can refer to com.ecwid.consul.transport.TLSConfig.KeyStoreInstanceType
#eventMesh.metaStorage.consul.tls.keyStoreInstanceType=
@@ -118,21 +106,18 @@ eventMesh.metaStorage.plugin.password=nacos
#eventMesh.metaStorage.consul.tls.certificatePassword=
#eventMesh.metaStorage.consul.tls.keyStorePath=
#eventMesh.metaStorage.consul.tls.keyStorePassword=
-
# metrics plugin, if you have multiple plugin, you can use ',' to split
eventMesh.metrics.plugin=prometheus
-
# trace plugin
eventMesh.server.trace.enabled=false
eventMesh.trace.plugin=zipkin
-
# webhook
# Start webhook admin service
eventMesh.webHook.admin.start=true
# Webhook event configuration storage mode. Currently, only file and nacos are supported
eventMesh.webHook.operationMode=file
# The file storage path of the file storage mode. If #{eventMeshHome} is written, it is in the EventMesh root directory
-eventMesh.webHook.fileMode.filePath= #{eventMeshHome}/webhook
+eventMesh.webHook.fileMode.filePath=#{eventMeshHome}/webhook
# Nacos storage mode, and the configuration naming rule is EventMesh webHook. nacosMode. {nacos native configuration key} please see the specific configuration [nacos github api](https://github.com/alibaba/nacos/blob/develop/api/src/main/java/com/alibaba/nacos/api/SystemPropertyKeyConst.java)
## Address of Nacos
eventMesh.webHook.nacosMode.serverAddr=127.0.0.1:8848
diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml
index d62e6331..ed1e79e1 100644
--- a/.github/workflows/license.yml
+++ b/.github/workflows/license.yml
@@ -16,7 +16,7 @@
#
name: 'License Check'
-on: [pull_request]
+on: [ pull_request ]
permissions:
contents: read
diff --git a/README.md b/README.md
index 0f3b3708..52807545 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,11 @@
## Introduction
-The EventMesh Dashboard is under development and will support functionalities such as Connection management, cluster health checks, etc. Feel free to reach out to the [EventMesh Assistant](https://github.com/apache/eventmesh?tab=readme-ov-file#community) to contribute.
+The EventMesh Dashboard is under development and will support functionalities such as Connection management, cluster health checks, etc. Feel free to
+reach out to the [EventMesh Assistant](https://github.com/apache/eventmesh?tab=readme-ov-file#community) to contribute.
-The Dashboard for EventMesh, maintained during v1.8.0 ~ v1.10.0, is a pure frontend project located at the [Next.js Dashboard branch](https://github.com/apache/eventmesh-dashboard/tree/nextjs-dashboard).
+The Dashboard for EventMesh, maintained during v1.8.0 ~ v1.10.0, is a pure frontend project located at
+the [Next.js Dashboard branch](https://github.com/apache/eventmesh-dashboard/tree/nextjs-dashboard).
Weekly development meeting documents for EventMesh Dashboard: https://docs.qq.com/doc/DQmhVbklUdGNNWGZi
@@ -67,7 +69,7 @@ cd eventmesh-dashboard
./mvnw clean package
```
->TODO download mysql-connector-j manually
+> TODO download mysql-connector-j manually
```
java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar eventmesh-dashboard-console/target/eventmesh-dashboard-console-0.0.1-SNAPSHOT.jar
@@ -75,7 +77,7 @@ java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSW
### Build and Run with Docker
->To be updated
+> To be updated
```
cd eventmesh-dashboard
diff --git a/README.zh-CN.md b/README.zh-CN.md
index ccb82a83..ea1ae6f0 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -4,9 +4,11 @@
## 介绍
-EventMesh Dashboard 处于开发中,将支持 Connection 管理、集群健康检查等功能。欢迎联系 [EventMesh 小助手](https://github.com/apache/eventmesh?tab=readme-ov-file#community)参与贡献。
+EventMesh Dashboard 处于开发中,将支持 Connection
+管理、集群健康检查等功能。欢迎联系 [EventMesh 小助手](https://github.com/apache/eventmesh?tab=readme-ov-file#community)参与贡献。
-EventMesh 于 v1.8.0 ~ v1.10.0 期间维护的 Dashboard 纯前端项目位于 [Next.js Dashboard 分支](https://github.com/apache/eventmesh-dashboard/tree/nextjs-dashboard)。
+EventMesh 于 v1.8.0 ~ v1.10.0 期间维护的 Dashboard
+纯前端项目位于 [Next.js Dashboard 分支](https://github.com/apache/eventmesh-dashboard/tree/nextjs-dashboard)。
EventMesh Dashboard 每周开发例会文档:https://docs.qq.com/doc/DQmhVbklUdGNNWGZi
@@ -16,18 +18,18 @@ EventMesh Dashboard 每周开发例会文档:https://docs.qq.com/doc/DQmhVbklU
### 环境
-- JDK 8/11
+- JDK 17
- Maven 3.9.x
- Spring Boot 2.7.x
### 模块介绍
-1. eventmesh-dashboard-console 业务模块的代码,调用service接口
-2. eventmesh-dashboard-observe 监控模块的代码
-3. eventmesh-dashboard-core 对EventMesh Runtime, Meta以及相关组件的代码,提供service实现
-4. eventmesh-dashboard-service 公用API接口,对core的抽象
-5. eventmesh-dashboard-common 公共模块的代码
-6. eventmesh-dashboard-view 前端代码
+1. eventmesh-dashboard-console 业务模块的代码,调用service接口
+2. eventmesh-dashboard-observe 监控模块的代码
+3. eventmesh-dashboard-core 对EventMesh Runtime, Meta以及相关组件的代码,提供service实现
+4. eventmesh-dashboard-service 公用API接口,对core的抽象
+5. eventmesh-dashboard-common 公共模块的代码
+6. eventmesh-dashboard-view 前端代码
## 自动部署最新版 EventMesh Dashboard
@@ -67,7 +69,7 @@ cd eventmesh-dashboard
./mvnw clean package
```
->TODO download mysql-connector-j manually
+> TODO download mysql-connector-j manually
```
java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar eventmesh-dashboard-console/target/eventmesh-dashboard-console-0.0.1-SNAPSHOT.jar
@@ -75,7 +77,7 @@ java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSW
### 构建并运行 Docker 镜像
->To be updated
+> To be updated
```
cd eventmesh-dashboard
@@ -88,17 +90,19 @@ docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboa
```
### 开发准备
-1. 配置格式化
- 1. 后端格式文档地址:https://eventmesh.apache.org/zh/community/contribute/contribute/
- 2. 前端使用 eslint
-2. 配置协议头工具 license-eye。
- 1. 检查命令:license-eye header check
- 2. 使用命令:license-eye header fix
- 3. 下载地址: https://skywalking.apache.org/downloads/
+1. 配置格式化
+ 1. 后端格式文档地址:https://eventmesh.apache.org/zh/community/contribute/contribute/
+ 2. 前端使用 eslint
+2. 配置协议头工具 license-eye。
+ 1. 检查命令:license-eye header check
+ 2. 使用命令:license-eye header fix
+ 3. 下载地址: https://skywalking.apache.org/downloads/
### 提交代码前
+
在项目根目录执行下面命令
+
```
license-eye -v info -c .licenserc.yaml header check
./mvnw -B package -DskipTests --file pom.xml
diff --git a/doc/TODO.md b/doc/TODO.md
new file mode 100644
index 00000000..2859363a
--- /dev/null
+++ b/doc/TODO.md
@@ -0,0 +1,107 @@
+## 文档任务
+
+- 整体设计文档
+- metadata 数据 设计文档
+- 部署设计文档
+- Cluster 设计文档
+- 同步设计文档
+- 心跳设计文档
+- SDK 设计文档
+- 远程服务设计文档
+- 日志说明与使用设计文档
+- 采集设计文档
+- 采集数据库设计文档
+- 模拟数据 同步测试文档
+- RocketMQ 同步测试文档
+- 部署测试文档
+- 采集测试文档
+- 增加一个 存储 整个开发流程
+- 增加一个 meta 整个开发流程
+
+## 问题
+
+- 自动化部署之后,如何确定部署是否成功,部署测试如何做?
+- group 与 group memer 是 cluster 级别还是 runtime 级别
+ - 如果是 cluster 级别,rocketmq 需要支持 cluster 级别操作,如果不支持着需要全量删除
+- group 与 group memer 只读,不允许创建
+- config 问题
+ - 不同的 存储 与 runtime 对不同的 metadata 有的支持 config ,有的不支持 config
+ - 需要一个 config 管理模块
+ - 对 runtime(包含 存储)的 metadata 进行标记
+ - 支持 runtime(包含 存储) metadata 双维度
+ - 不同的 存储 与 runtime 对 config 的修改不同
+ - kakfa 支持一个一个 config 的修改
+ - rocketmq 只能对 config 的 主体 进行修改。比如 修改 queue ,那么需要 对 Topic 全量修改
+ - 通过 config 模块 对 config 的行为标记做出不同的处理
+ - 修改 rocketmq 的 metadata 的 config , 需要对 metadata 主体进行标准,然后触发 metadata 对象的 同步操作
+
+## 任务 or issue
+
+- SyncStatus 状态补充
+- LogManage 记录模块
+- 操作记录模块
+ - 优点是:可以进行记录
+- 部署与操作流模块
+- 是否设计运维操作模块
+- rometing service 入参 与 返回 讨论
+- 手动添加 集群 与 节点 信息时的 url 设计
+- kubernetes 部署 RocketMQ 的 IP 问题。client 调用 broker 是 kubernetes node ip,broker 调用 broker 是 kubernetes pod ip
+- TODO 内容整理之后去除
+- 文档与代码整理
+- 讨论:手动添加集群与节点
+- 分析:db 的负载。 维度:业务操作,统计操作,sync and 部署等操作
+- 用户进来,是进入默认组织 首页
+
+1. 通过左上角切换
+2. 组织视图与 cluster 共存,这样是否会出现三级路由
+3. 人员添加,可以从组织添加,也可以从 cluster 里面添加。如果从 cluster 里面添加,是否就属于合格组织一员?
+
+6. 删除 cluster 或则 runtime 之后对应的信息是否全部作废。
+7. 暂停状态数据如何标记,激活 对应的 metadata 之前相关的数据是否启动
+8. 删除 cluster 之前之后校验 关联。如何关联存在是否允许删除
+9. kafka 的查询维度全是 cluster
+10. RocketMQ 大集群查询,是否支持 metadata 数据查询,如何对数据进行展示? 是否现实差异化,是否提示差异字段
+ 1. 那些 topic 有差异?
+ 2. 是否配置 不允许有差异?
+ 3. 如果不允许有差异, console 进行处理的 metadata 是否要进行具体标识
+11. RocketMQ 支持大集群,小集群,runtime 维度的展示
+12. 指标数据表结构,目前不支持表修改。是否需要支持变修改
+13. 是否需要支持 不同的 cluster 使用不同的 指标数据修改
+
+## SyncStatus 状态补充
+
+- 同步表,需要添加 SyncStatus 字段
+- Entity 需要一个 SyncStatus 类
+- 状态转换确认 。 RemotingService(是否独立出来) 里面 成功与失败状态
+- 所有查询 需要过滤 成功状态
+- 操作数据时, 需要修改 SyncStatus
+- 需要一个 SyncStatus 管理类
+
+无法进行确认,支持同类型修改
+
+项目发起人,项目架构师,项目设计师,项目经理,
+交互设计师,半个ui设计
+前端,后台,运维,产品,测试,
+
+## 用户域
+
+### 用户首页
+
+1. 查看 组织
+
+### 组织首页
+
+1. 左边是一级菜单:
+ 1. 工作台
+ 2. eventmesh集群
+ 3.
+2. 集群信息
+ 1. 集群列表
+
+### 日志分类
+
+1. 心跳加载日志
+2. 数据同步日志
+3. 运维操作日志
+4. 数据采集日志
+5. metadata 数据日志
\ No newline at end of file
diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md"
new file mode 100644
index 00000000..ed4976d9
--- /dev/null
+++ "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md"
@@ -0,0 +1,217 @@
+# 前言
+
+# 整体架构设计
+
+## 主因子
+
+
+
+## 架构略图
+
+
+
+## 主流程图
+
+> 主要流程流转图
+>
+
+
+
+
+
+# Console 子系统(独立部署)
+
+> console 子模块是管理系统,负责 构建整体运行态
+>
+
++ 业务模块
++ 自动部署模块
++ 架构关系模块
++ agent 模块
++ function 模块
++ 指标展示模块
++ 生产与消费可视化模块
++ input 模块(目前没有设计)
+
+## 业务模块
+
+## 集群创建
+
++ 已有集群通过 地址 直接创建
++ 通过 自动部署模块创建
+
+## 架构关系模块
+
+> 架构关系是 整个项目双核模块之一。从 主因子 的视图关系,可以看到,不同的组件不同的架构,相同的组件也有不同的架构,组件同时以来多种其他组件,相同依赖类型同时支持多种组件。以及混乱
+> 的 API 行为等等
+>
+> 比如:
+>
+> + Kafka 支持 zookepper 与 Kraft 为注册中心,并且独享注册中心
+> + RocketMQ broker 支持 主从架构 和 ratf 架构
+> + Pulast 支持 zookepper , etcd 等注册中心,共享注册中心
+ >
+- Pulat 集群有 当前集群注册中心,还有一个 跨集群同步 注册中心
+> + 复杂操作如:
+ >
+- 操作当前 集群空间下所有 broker
+> - 操作当前 集群空间下所有 zookeeper 注册中心
+> - 为当前 集群下 kafka,RockeMQ,Palsar 添加一个新 Topic
+> - 等等等等
+>
+> 架构关系是解决 在 **多种架构** 和 **多种多依赖** 的之间 巨大差异,通过统一行为,屏蔽底层细节,对模块进行深度解
+>
+
+
+
+
+
+## 自动部署模块
+
+### 部署模块图
+
+### 部署架构与主流程图
+
+
+
+## 采集查询模块
+
+> 采集查询模块(ReportController)在 console 的 查询模块相对比较简单,所有的逻辑都在 core 的 report 模块里面
+>
+
+
+
+重点:
+
++ 支持多个指标的查询
++ 支持单个子表的查询
+
+## agent模块
+
+> agent功能 主要是为了 支持 Agent 子系统。与 Agent 子系统完成 服务启动前的操作。
+> 确保当前节点启动之前 依赖启动成功
+>
+
+## 消费与生产模块
+
+> 本模块只是为了方便 项目参与人员 测试与 mock 数据。查询指定数据,慢消费批量数据,如果 消息中间件支持链路跟踪,也可以查看相关信息
+>
+
+# core 子系统
+
+> core 子系统是核心模块。有常量与枚举,metadata 等基础模块,以及下列核心功能
+>
+
+
+
+
+
+## SDK 模块
+
+> SDK模块( SDKManage ) 把 SDK 集中到一起,形成高内聚。
+>
+
+
+
+重点:
+
++ SDK 的类型有:admin,ping,生产者,消费者 四个类型 (SDKTypeEnum)
++ client 都对应个 Config 对象
+
+## 远程服务模块
+
+> 设计 console 目前需要调用 组件 对应的能力
+>
+
+## 心跳模块
+
+重点:
+
++ 支持组件节点接的 ping 心跳
++ 支持 broker 级别的 topic 心跳,通知 check 延迟情况。 用于检查 单个broker 节点的生产与消费的健康
++ 心跳任务异步执行
++ 组件心跳异步回调,提高性能与吞吐率
+
+## 同步数据模块
+
+> 数据同步模块是 整个项目的双核之一。负责不同模式下 console metadata 同步到 组件 或则 组件 metadata 同步到 console。
+>
+
+### 架构关系图
+
+同步模块主要四个主逻辑线
+
++ console sync db 创建流程 ( SyncMetadataCreateFactory )
++ 同步行为创建 以及 db 和 组件 同步创建 流程 (MetadataSyncManage.register )
++ sync 行为执行 流程 ( MetadataSyncWrapper.run )
++ SyncManage 管理流程 ( MetadataSyncManage.run )
+
+### console sync db 创建流程
+
+重点:
+
+ - 是 metadata 维度, 负责 同步对应 metadata 对象,有多个metadata 就有多少 SyncMetadataCreateFactory
+ - 负责从 db 读取 与 **批量**写入同步数据 同步数据,
+ - 本逻辑第一次 全量读取 有效 metadata 数据,之后读取增量数据
+ - 在 同步行为创建时,创建 BaseSyncBase(Cluster or Runtime)对应的 db MetadataHandler,其维度是 BaseSyncBase type + BaseSyncBaseId + metadata。
+ * 比如 负责 topic,注册一个 Id为 1的 kafka cluster 。维度是 Topic , Cluster , 1
+
+### SyncManage 管理流程
+
+重点:
+
+ - 负责触发 console sync 读取 与写入 以及 同步行为
+ - 有多个 metadata 以及 大量 组件,所以需要保证 操作的循序性
+ - 提高吞吐量
+
+
+
+### sync 行为执行 流程
+
+
+
+### 模式如下
+
++ 创建时同步
+ - 从 console 同步到 组件。 FirstToWhom.DASHBOARD
+ - 从 组件 同步 console。FirstToWhom.RUNTIME
++ 运行时同步
+ - 以 console 为主,从 console 同步到 组件 ClusterTrusteeshipType.SELF or TRUSTEESHIP
+ - 以 组件的数据为主,即从 组件 同步 console。ClusterTrusteeshipType.TRUSTEESHIP_FIND_REVERSE
+ - 不同步。ClusterTrusteeshipType.NOT or NO_TRUSTEESHIP
++ check(对比双非数据差异性)
+ - 初始化时,check双方数据(MetadataSyncWrapper.initStatus)
+ - 运行时,定时 check 双方数据(MetadataSyncWrapper.checkTime)
+
+### 数据基本操作模块
+
+> 数据基本操作模块负责 复杂场景下 数据的流通
+>
+
+
+
+
+
+### Difference 模块
+
+> Difference 模块负责两个数据集在不同场景下的比较
+>
+
+
+
+# 指标子系统
+
+> 目前还在 集成在 console 子系统里面。后期会独立出来,独立部署,有大量采集情况下,可能会影响 console 子系统的运行。在小规模采集任务情况,也可以集成到
+> console里面,可以有一套简单架构
+>
+
+## 架构关系图
+
+
+
+# agent子系统
+
+# 新增组件流程
+
+
+
diff --git a/eventmesh-dashboard-agent/pom.xml b/eventmesh-dashboard-agent/pom.xml
new file mode 100644
index 00000000..9a82aac6
--- /dev/null
+++ b/eventmesh-dashboard-agent/pom.xml
@@ -0,0 +1,115 @@
+
+
+
+ 4.0.0
+
+ org.apache.eventmesh.dashboard
+ eventmesh-dashboard
+ 0.0.1-SNAPSHOT
+
+
+ eventmesh-dashboard-agent
+ jar
+
+ eventmesh-dashboard-agent
+ http://maven.apache.org
+
+
+ UTF-8
+ 8
+ 8
+ 8
+ 1.5.13
+ 2.0.9
+
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.14
+
+
+ com.alibaba.fastjson2
+ fastjson2
+ 2.0.43
+
+
+ org.slf4j
+ jcl-over-slf4j
+ ${slf4j.version}
+
+
+ ch.qos.logback
+ logback-access
+
+
+
+ ch.qos.logback
+ logback-classic
+ 1.5.13
+
+
+ ch.qos.logback
+ logback-core
+ 1.5.19
+
+
+ org.projectlombok
+ lombok
+
+
+ junit
+ junit
+ 4.13.1
+ test
+
+
+ org.mockito
+ mockito-inline
+ 5.2.0
+ test
+
+
+ com.github.stefanbirkner
+ system-rules
+ 1.19.0
+ test
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.7.0
+
+ 8
+ 8
+ UTF-8
+
+ none
+
+
+
+
+
+
+
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/AgentController.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/AgentController.java
new file mode 100644
index 00000000..596ba121
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/AgentController.java
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent;
+
+import org.apache.eventmesh.dashboard.agent.action.AbstractAgentActionClient;
+import org.apache.eventmesh.dashboard.agent.config.ConfigHandler;
+import org.apache.eventmesh.dashboard.agent.config.ConfigHandlerManage;
+import org.apache.eventmesh.dashboard.agent.model.AgentCheckRuntimeVO;
+import org.apache.eventmesh.dashboard.agent.model.AgentStartActionVO;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+
+import java.io.File;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import com.alibaba.fastjson2.JSON;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class AgentController {
+
+
+ public static String getLocalAddress() {
+ try {
+ // Traversal Network interface to get the first non-loopback and non-private address
+ Enumeration enumeration = NetworkInterface.getNetworkInterfaces();
+ ArrayList ipv4Result = new ArrayList();
+ ArrayList ipv6Result = new ArrayList();
+ while (enumeration.hasMoreElements()) {
+ final NetworkInterface networkInterface = enumeration.nextElement();
+ final Enumeration en = networkInterface.getInetAddresses();
+ while (en.hasMoreElements()) {
+ final InetAddress address = en.nextElement();
+ if (!address.isLoopbackAddress()) {
+ if (address instanceof Inet6Address) {
+ ipv6Result.add(normalizeHostAddress(address));
+ } else {
+ ipv4Result.add(normalizeHostAddress(address));
+ }
+ }
+ }
+ }
+
+ // prefer ipv4
+ if (!ipv4Result.isEmpty()) {
+ for (String ip : ipv4Result) {
+ if (ip.startsWith("127.0") || ip.startsWith("192.168")) {
+ continue;
+ }
+
+ return ip;
+ }
+
+ return ipv4Result.get(ipv4Result.size() - 1);
+ } else if (!ipv6Result.isEmpty()) {
+ return ipv6Result.get(0);
+ }
+ //If failed to find,fall back to localhost
+ final InetAddress localHost = InetAddress.getLocalHost();
+ return normalizeHostAddress(localHost);
+ } catch (Exception e) {
+ //log.error("Failed to obtain local address", e);
+ }
+
+ return null;
+ }
+
+ public static String normalizeHostAddress(final InetAddress localHost) {
+ if (localHost instanceof Inet6Address) {
+ return "[" + localHost.getHostAddress() + "]";
+ } else {
+ return localHost.getHostAddress();
+ }
+ }
+
+
+ private final ConfigHandlerManage configHandlerManage = new ConfigHandlerManage();
+
+ private final List waitTime = new ArrayList<>();
+
+ private final AbstractAgentActionClient agentActionClient = new DefaultAgentActionClient();
+
+ private final Map env = System.getenv();
+
+ private final String localAddress = getLocalAddress();
+
+ {
+ for (int i = 1; i < 4; i++) {
+ waitTime.add(50L);
+ waitTime.add(200L);
+ waitTime.add(500L);
+ waitTime.add(1000L);
+ waitTime.add(3000L);
+ }
+ Collections.sort(waitTime);
+
+ }
+
+ public static void main(String[] args) {
+ AgentController agentController = new AgentController();
+ agentController.start();
+ }
+
+ public void start() {
+
+ String consoleAddress = this.getEnv(Constant.ENV_CONSOLE);
+ if (Objects.isNull(consoleAddress)) {
+ log.error("{} is null", Constant.ENV_CONSOLE);
+ return;
+ }
+ String clusterId = this.getEnv(Constant.ENV_CLUSTER_ID);
+ if (Objects.isNull(clusterId)) {
+ log.error("{} is null", Constant.ENV_CLUSTER_ID);
+ return;
+ }
+
+ String runtimeId = this.getEnv(Constant.ENV_RUNTIME_ID);
+ if (Objects.isNull(runtimeId)) {
+ log.error("{} is null", Constant.ENV_RUNTIME_ID);
+ return;
+ }
+ String runtimeHome = this.getEnv(Constant.ENV_RUNTIME_HOME);
+ if (Objects.isNull(runtimeHome)) {
+ log.error("{} is null", Constant.ENV_RUNTIME_HOME);
+ return;
+ }
+ File file = new File(runtimeHome);
+ if (file.exists() && !file.isDirectory()) {
+ log.error("eventmesh.agent.runtimeHome is not a directory");
+ return;
+ }
+ this.agentActionClient.setBaseUrl(consoleAddress);
+ this.agentActionClient.init();
+
+ Map data = new HashMap<>();
+ data.put("clusterId", clusterId);
+ data.put("runtimeId", runtimeId);
+ data.put("localAddress", this.localAddress);
+ data.put("nodeAddress", this.getEnv("NODE_ID"));
+ AgentStartActionVO agentStartActionVO = agentActionClient.agentStartAction(data);
+
+ // 得到 clusterType 对应的执行对象
+ ConfigHandler configHandler = null;
+ try {
+ configHandler = this.configHandlerManage.getConfigHandler(agentStartActionVO.getClusterType());
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ return;
+ }
+ if (Objects.isNull(configHandler)) {
+ log.error("configHandler is null");
+ return;
+ }
+
+ configHandler.handler();
+
+ if (!agentStartActionVO.isCheck()) {
+ log.info("agentStartActionVO.isCheck is false");
+ log.info("agent ok");
+ return;
+ }
+
+ AtomicBoolean success = new AtomicBoolean(false);
+ // 请求 是否可以启动
+ waitTime.forEach(waitTime -> {
+
+ try {
+ AgentCheckRuntimeVO vo = agentActionClient.agentCheckRuntime(data);
+ if (vo.isSuccess()) {
+ success.set(true);
+ log.info("agentCheckRuntime success time {}", waitTime);
+ return;
+ }
+ Thread.sleep(waitTime);
+ } catch (Exception e) {
+ log.error("agentStartAction error", e);
+ }
+ });
+ if (!success.get()) {
+ log.info("check is fail");
+ }
+
+ }
+
+ public String getEnv(String key) {
+ return env.get(key);
+ }
+
+ private static class DefaultAgentActionClient extends AbstractAgentActionClient {
+
+ private CloseableHttpClient httpClient = HttpClients.createDefault();
+
+
+ @Override
+ public AgentStartActionVO agentStartAction(Map data) {
+ return this.execute(this.agentStartActionFullPath, data, AgentStartActionVO.class);
+ }
+
+ @Override
+ public AgentCheckRuntimeVO agentCheckRuntime(Map data) {
+ return this.execute(this.agentCheckRuntimePath, data, AgentCheckRuntimeVO.class);
+ }
+
+
+ private T execute(String url, Object data, Class clazz) {
+ HttpPost request = new HttpPost(url);
+ HttpEntity httpEntity = new StringEntity(JSON.toJSONString(data), ContentType.APPLICATION_JSON);
+ request.setEntity(httpEntity);
+ try (CloseableHttpResponse response = httpClient.execute(request)) {
+ JSON.parseObject(EntityUtils.toString(response.getEntity()), clazz);
+ return JSON.parseObject(EntityUtils.toString(response.getEntity()), clazz);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/Constant.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/Constant.java
new file mode 100644
index 00000000..5218b613
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/Constant.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent;
+
+public class Constant {
+
+ public static final String ENV_CONSOLE = "eventmesh.agent.console";
+
+ public static final String ENV_CLUSTER_ID = "eventmesh.agent.clusterId";
+
+ public static final String ENV_RUNTIME_ID = "eventmesh.agent.runtimeId";
+
+ public static final String ENV_RUNTIME_HOME = "eventmesh.agent.runtimeHome";
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AbstractAgentActionClient.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AbstractAgentActionClient.java
new file mode 100644
index 00000000..f171126a
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AbstractAgentActionClient.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.action;
+
+import lombok.Setter;
+
+@Setter
+public abstract class AbstractAgentActionClient implements AgentActionClient {
+
+ protected String baseUrl;
+
+ protected String basePath = "/eventmesh/dashboard";
+
+ protected String agentStartActionPath = "/agent/agentStartAction";
+
+ protected String agentCheckRuntimePath = "/agent/agentCheckRuntime";
+
+ protected String agentStartActionFullPath = "/agent/agentCheckAgent";
+
+ protected String agentCheckRuntimeFullPath = "/agent/agentCheckAgent";
+
+ public void init() {
+ this.agentStartActionFullPath = "http://" + this.baseUrl + basePath + agentStartActionPath;
+ this.agentCheckRuntimeFullPath = "http://" + this.baseUrl + basePath + agentCheckRuntimePath;
+ }
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AgentActionClient.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AgentActionClient.java
new file mode 100644
index 00000000..9f4f7e0d
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/action/AgentActionClient.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.action;
+
+import org.apache.eventmesh.dashboard.agent.model.AgentCheckRuntimeVO;
+import org.apache.eventmesh.dashboard.agent.model.AgentStartActionVO;
+
+import java.util.Map;
+
+/**
+ *
+ */
+public interface AgentActionClient {
+
+
+ AgentStartActionVO agentStartAction(Map data);
+
+ AgentCheckRuntimeVO agentCheckRuntime(Map data);
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/AbstractConfigHandler.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/AbstractConfigHandler.java
new file mode 100644
index 00000000..fe7045db
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/AbstractConfigHandler.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.config;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.Map;
+
+import lombok.Setter;
+
+@Setter
+public abstract class AbstractConfigHandler implements ConfigHandler {
+
+ protected String runtimeHome;
+
+
+ protected void readConfigFile(String configFile, String fileType, Map configData) throws IOException {
+ File file = new File(configFile);
+ if (file.exists()) {
+ Path source = Paths.get(configFile);
+ Path target = Paths.get(configFile + ".copy." + System.currentTimeMillis());
+ Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
+ if (!file.delete()) {
+ throw new IOException(String.format("delete file %s failed", file.getAbsolutePath()));
+ }
+ }
+ if (!file.createNewFile()) {
+ throw new RuntimeException("file is exist");
+ }
+ try (FileOutputStream fos = new FileOutputStream(file)) {
+ StringBuffer stringBuffer = new StringBuffer();
+ configData.forEach((k, v) -> {
+ stringBuffer.append(k).append('=').append(v).append(System.lineSeparator());
+ });
+ fos.write(stringBuffer.toString().getBytes());
+ fos.flush();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandler.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandler.java
new file mode 100644
index 00000000..b33cef20
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandler.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.config;
+
+/**
+ *
+ */
+public interface ConfigHandler {
+
+
+ void handler();
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandlerManage.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandlerManage.java
new file mode 100644
index 00000000..22a6ec19
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/ConfigHandlerManage.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.config;
+
+import org.apache.eventmesh.dashboard.agent.config.handler.RocketMQNameServiceConfigHandler;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class ConfigHandlerManage {
+
+ private Map> configHandlerMap = new ConcurrentHashMap<>();
+
+ {
+ this.configHandlerMap.put("", RocketMQNameServiceConfigHandler.class);
+ }
+
+
+ public ConfigHandler getConfigHandler(String clusterType) throws InstantiationException, IllegalAccessException {
+ Class> clazz = configHandlerMap.get(clusterType);
+ return (ConfigHandler) clazz.newInstance();
+ }
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/handler/RocketMQNameServiceConfigHandler.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/handler/RocketMQNameServiceConfigHandler.java
new file mode 100644
index 00000000..91070f6b
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/config/handler/RocketMQNameServiceConfigHandler.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.config.handler;
+
+import org.apache.eventmesh.dashboard.agent.config.AbstractConfigHandler;
+
+public class RocketMQNameServiceConfigHandler extends AbstractConfigHandler {
+
+ @Override
+ public void handler() {
+
+ }
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentCheckRuntimeVO.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentCheckRuntimeVO.java
new file mode 100644
index 00000000..9a39e76e
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentCheckRuntimeVO.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.model;
+
+
+import lombok.Data;
+
+@Data
+public class AgentCheckRuntimeVO {
+
+ private boolean success;
+}
diff --git a/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentStartActionVO.java b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentStartActionVO.java
new file mode 100644
index 00000000..cc2cbe7b
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/java/org/apache/eventmesh/dashboard/agent/model/AgentStartActionVO.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.model;
+
+import java.util.Map;
+
+import lombok.Data;
+
+@Data
+public class AgentStartActionVO {
+
+ private String clusterType;
+
+ private Map configMap;
+
+ private boolean check;
+
+}
diff --git a/eventmesh-dashboard-agent/src/main/resources/logback.xml b/eventmesh-dashboard-agent/src/main/resources/logback.xml
new file mode 100644
index 00000000..880c6948
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/main/resources/logback.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %magenta(%-5level) %green(%logger{60}):%blue(%line) - %msg%n
+
+
+
+
+
+ ${user.home}/logs/eventmesh-dashboard/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log
+
+ 10485760
+
+ 10
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{60}:%line - %msg%n
+ UTF-8
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/AgentControllerTest.java b/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/AgentControllerTest.java
new file mode 100644
index 00000000..32d03010
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/AgentControllerTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class AgentControllerTest {
+
+ private AgentController agentController = new AgentController();
+
+ @Before
+ public void init() throws Throwable {
+ Map environmentVariables = new HashMap<>();
+ environmentVariables.put(Constant.ENV_CONSOLE, "127.0.0.1:9898");
+ environmentVariables.put(Constant.ENV_CLUSTER_ID, "1");
+ environmentVariables.put(Constant.ENV_RUNTIME_ID, "1");
+ environmentVariables.put(Constant.ENV_RUNTIME_HOME, "./test/");
+
+
+ Field envField = agentController.getClass().getDeclaredField("env");
+ envField.setAccessible(true);
+ envField.set(agentController, environmentVariables);
+
+ }
+
+ @Test
+ public void test_request(){
+ agentController.start();
+ }
+
+}
diff --git a/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/config/TestConfigHandler.java b/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/config/TestConfigHandler.java
new file mode 100644
index 00000000..6384bc9c
--- /dev/null
+++ b/eventmesh-dashboard-agent/src/test/java/org/apache/eventmesh/dashboard/agent/config/TestConfigHandler.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.agent.config;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import org.junit.Test;
+
+public class TestConfigHandler {
+
+ AbstractConfigHandler abstractConfigHandler = new AbstractConfigHandler() {
+
+ @Override
+ public void handler() {
+
+ }
+ };
+
+
+ @Test
+ public void test() throws URISyntaxException, IOException {
+ Map map = new HashMap<>();
+
+ for (int i = 0; i < 20; i++) {
+ map.put("key" + i, "value" + i);
+ }
+ URI uri = Objects.requireNonNull(TestConfigHandler.class.getClassLoader().getResource("")).toURI();
+ Path resourcePath = Paths.get(uri);
+ abstractConfigHandler.setRuntimeHome(resourcePath.toFile().getAbsolutePath());
+ String fileName = resourcePath.toFile().getAbsolutePath() + "/config.properties";
+ abstractConfigHandler.readConfigFile(fileName, "", map);
+ }
+
+}
diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml
index 806a2892..00578711 100644
--- a/eventmesh-dashboard-common/pom.xml
+++ b/eventmesh-dashboard-common/pom.xml
@@ -16,8 +16,8 @@
~ limitations under the License.
-->
-
4.0.0
@@ -31,6 +31,8 @@
17
+ 17
+ 17
UTF-8
UTF-8
@@ -49,7 +51,7 @@
org.apache.commons
commons-lang3
- 3.14.0
+ 3.18.0
org.apache.commons
@@ -61,6 +63,11 @@
fastjson2
2.0.51
+
+ com.github.javaparser
+ javaparser-core
+ 3.23.1
+
\ No newline at end of file
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/ClusterTypeMark.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/ClusterTypeMark.java
new file mode 100644
index 00000000..74e04697
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/ClusterTypeMark.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.annotation;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ClusterTypeMark {
+
+ ClusterType clusterType();
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
index 20a278b3..dc32be1a 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMapper.java
@@ -32,6 +32,6 @@
public @interface RemotingServiceMapper {
- ClusterType clusterType();
+ ClusterType[] clusterType();
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
index fb619f6d..e62e29b4 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/annotation/RemotingServiceMethodMapper.java
@@ -27,7 +27,7 @@
import java.lang.annotation.Target;
/**
- *
+ *
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
index b00ea3d1..9394c921 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java
@@ -47,11 +47,11 @@ public class HealthConstant {
public static final String ROCKETMQ_CHECK_CONSUMER_GROUP = "eventmesh-dashboard-healthcheck-rocketmq-consumer-group";
public static final String ROCKETMQ_CHECK_TOPIC = "DO-NOT-USE-THIS-TOPIC-"
- + "eventmesh-dashboard-healthcheck-rocketmq-topic-90a78a5d-b803-447e-8c48-1c87ab0c74d9";
+ + "eventmesh-dashboard-healthcheck-rocketmq-topic-90a78a5d-b803-447e-8c48-1c87ab0c74d9";
public static final String ROCKETMQ_CHECK_TOPIC_MSG = "eventmesh-dashboard-healthcheck-rocketmq-message";
public static final String NACOS_CHECK_DATA_ID = "DO-NOT-USE-THIS-"
- + "eventmesh-dashboard-healthcheck-nacos-data-id-28e2933f-a47b-439d-b14b-7d9970c37042";
+ + "eventmesh-dashboard-healthcheck-nacos-data-id-28e2933f-a47b-439d-b14b-7d9970c37042";
public static final String NACOS_CHECK_GROUP = "EVENTMESH_DASHBOARD_HEALTH_CHECK_GROUP";
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
index 2b6bfafb..175af49a 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/BusinessType.java
@@ -19,8 +19,7 @@
package org.apache.eventmesh.dashboard.common.enums;
/**
- * 业务类型,
- * storage:可选值(rocketmq,pravega,mongodb,pulsar,redis,kafka,knative,rabbitmq),
+ * 业务类型, storage:可选值(rocketmq,pravega,mongodb,pulsar,redis,kafka,knative,rabbitmq),
* sinkConnector:可选值(rocketmq,spring,pravega,wechat,openfunction,file,knative,pulsar,lark,slack,rabbitmq,redis,mongodb,dingtalk)
* sourceConnector:可选值(rocketmq,spring,pravega,openfunction,jdbc,file,http,wecom,knative,pulsar,prometheus,rabbitmq,redis,mongodb)',
*/
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
index 0de7ccb2..41e09290 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterFramework.java
@@ -27,7 +27,7 @@ public enum ClusterFramework {
INDEPENDENCE,
/**
- * AP 架构,的 meta 有控制行为,需要逐一通知
+ * AP 架构,的 meta 有控制行为,需要逐一通知
*/
AP,
@@ -44,6 +44,10 @@ public enum ClusterFramework {
ZK,
;
+ public boolean isIndependence() {
+ return this == ClusterFramework.INDEPENDENCE;
+ }
+
public boolean isAP() {
return Objects.equals(this, AP);
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
index b5deee5c..c4337fd7 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterOwnType.java
@@ -22,12 +22,24 @@ public enum ClusterOwnType {
NOT,
+ /**
+ * 独立
+ */
INDEPENDENCE,
+ /**
+ * 共享
+ */
SHARE,
+ /**
+ * 全局共享
+ */
OVERALL_SHARE,
+ /**
+ * 组织内部共享
+ */
ORGANIZATION_SHARE,
;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java
index 7560b195..dac75f9e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterSyncMetadataEnum.java
@@ -37,10 +37,17 @@ public enum ClusterSyncMetadataEnum {
EVENTMESH_RUNTIME(
ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.INDEPENDENCE).metadataTypeList(ClusterSyncMetadata.STORAGE).build()),
+ EVENTMESH_JVM_CLUSTER(EVENTMESH_RUNTIME),
+
EVENTMESH_META_ETCD(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.RAFT).metadataTypeList(ClusterSyncMetadata.META).build()),
EVENTMESH_META_NACOS(ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.AP).metadataTypeList(ClusterSyncMetadata.META).build()),
+ EVENTMESH_JVM_RUNTIME(EVENTMESH_RUNTIME),
+
+ EVENTMESH_JVM_META(EVENTMESH_META_NACOS),
+
+
STORAGE_ROCKETMQ_NAMESERVER(
ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.AP).metadataTypeList(ClusterSyncMetadata.META).build()),
@@ -59,28 +66,45 @@ public enum ClusterSyncMetadataEnum {
.metadataTypeList(ListWrapper.build().add(ClusterSyncMetadata.STORAGE).add(ClusterSyncMetadata.AUTH).list)
.replicationDimension(ReplicationDimension.TOPIC).build()),
+
+ STORAGE_JVM_META(EVENTMESH_META_NACOS),
+
STORAGE_JVM_BROKER(
ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.MAIN_SLAVE).metadataTypeList(ClusterSyncMetadata.TEST_ONE).build()),
+
+ STORAGE_JVM_CAP_META(STORAGE_KAFKA_ZK),
+
STORAGE_JVM_CAP_BROKER(
ClusterSyncMetadata.builder().clusterFramework(ClusterFramework.CAP).metadataTypeList(ClusterSyncMetadata.STORAGE)
.replicationDimension(ReplicationDimension.TOPIC).build()),
;
private static final Map SYNC_METADATA_CONCURRENT_HASH_MAP = new ConcurrentHashMap<>();
+ @Getter
+ private ClusterSyncMetadata clusterSyncMetadata;
+
+ ClusterSyncMetadataEnum(ClusterSyncMetadata clusterSyncMetadata) {
+ this.clusterSyncMetadata = clusterSyncMetadata;
+ }
+
+ ClusterSyncMetadataEnum(ClusterSyncMetadataEnum clusterSyncMetadataEnum) {
+ this.clusterSyncMetadata = clusterSyncMetadataEnum.clusterSyncMetadata;
+ }
public static ClusterSyncMetadata getClusterSyncMetadata(ClusterType clusterType) {
ClusterSyncMetadata clusterSyncMetadata = SYNC_METADATA_CONCURRENT_HASH_MAP.get(clusterType);
+ if (Objects.nonNull(clusterSyncMetadata)) {
+ return clusterSyncMetadata;
+ }
try {
- if (Objects.isNull(clusterSyncMetadata)) {
- ClusterSyncMetadataEnum clusterSyncMetadataEnum = ClusterSyncMetadataEnum.valueOf(clusterType.toString());
- SYNC_METADATA_CONCURRENT_HASH_MAP.put(clusterType, clusterSyncMetadataEnum.getClusterSyncMetadata());
- clusterSyncMetadata = clusterSyncMetadataEnum.getClusterSyncMetadata();
- }
+ ClusterSyncMetadataEnum clusterSyncMetadataEnum = ClusterSyncMetadataEnum.valueOf(clusterType.toString());
+ clusterSyncMetadata = clusterSyncMetadataEnum.getClusterSyncMetadata();
} catch (Exception e) {
+
clusterSyncMetadata = ClusterSyncMetadata.EMPTY_OBJECT;
- SYNC_METADATA_CONCURRENT_HASH_MAP.put(clusterType, clusterSyncMetadata);
}
+ SYNC_METADATA_CONCURRENT_HASH_MAP.put(clusterType, clusterSyncMetadata);
return clusterSyncMetadata;
}
@@ -90,24 +114,15 @@ public static ClusterFramework getClusterFramework(ClusterType clusterType) {
static class ListWrapper {
+ private final List list = new ArrayList<>();
+
static ListWrapper build() {
return new ListWrapper();
}
- private List list = new ArrayList<>();
-
ListWrapper add(List list) {
- list.addAll(list);
+ this.list.addAll(list);
return this;
}
}
-
- @Getter
- private ClusterSyncMetadata clusterSyncMetadata;
-
- ClusterSyncMetadataEnum(ClusterSyncMetadata clusterSyncMetadata) {
- this.clusterSyncMetadata = clusterSyncMetadata;
- }
-
-
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
index 66daa531..e0c7c2d6 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterTrusteeshipType.java
@@ -54,14 +54,26 @@ public enum ClusterTrusteeshipType {
// 不托管
NO_TRUSTEESHIP("不托管", List.of(ClusterType.CLUSTER, ClusterType.META, ClusterType.RUNTIME, ClusterType.META_AND_RUNTIME));
- private List clusterTypeList;
-
private final String type;
-
+ private List clusterTypeList;
private String name;
private FirstToWhom firstToWhom;
+ ClusterTrusteeshipType(String type, List clusterTypeList) {
+ this.type = type;
+ this.clusterTypeList = clusterTypeList;
+ }
+
+ public boolean isSelf() {
+ return this == ClusterTrusteeshipType.SELF || this == ClusterTrusteeshipType.TRUSTEESHIP;
+ }
+
+ public boolean isReverse() {
+ return this == ClusterTrusteeshipType.TRUSTEESHIP_FIND || this == ClusterTrusteeshipType.TRUSTEESHIP_FIND_REVERSE;
+ }
+
+
public enum FirstToWhom {
NOT,
@@ -85,6 +97,10 @@ public enum FirstToWhom {
*/
UNDER_WAY,
+ NOT_EXECUTED,
+
+ ERROR_ING,
+
FAIL,
;
@@ -121,17 +137,4 @@ public enum TrusteeshipArrangeType {
}
-
- ClusterTrusteeshipType(String type, List clusterTypeList) {
- this.type = type;
- }
-
-
- public boolean isSelf() {
- return this == ClusterTrusteeshipType.SELF || this == ClusterTrusteeshipType.TRUSTEESHIP;
- }
-
- public boolean isReverse() {
- return this == ClusterTrusteeshipType.TRUSTEESHIP_FIND || this == ClusterTrusteeshipType.TRUSTEESHIP_FIND_REVERSE;
- }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
index f8b24519..af16214a 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ClusterType.java
@@ -28,6 +28,9 @@
public enum ClusterType {
+ /**
+ * 只有逻辑集群才会使用 这个枚举。比如 EVENTMESH_CLUSTER,先定义 EVENTMESH_CLUSTER,然后 runtime 与 meta 集群关联上
+ */
DEFINITION(0),
DEFAULT(1),
@@ -35,6 +38,8 @@ public enum ClusterType {
EVENTMESH(20),
+ EVENTMESH_JVM(21),
+
CLUSTER(1),
META(2),
@@ -69,6 +74,8 @@ public enum ClusterType {
CLUSTER_TYPE_STORAGE(1),
+ PROMETHEUS_EXPORTER(1),
+
NODE_BY_COPY_IN_TYPE(2),
NODE_BY_COPY_IN_TYPE_NOT_HAVE(2),
@@ -88,6 +95,8 @@ public enum ClusterType {
META_TYPE_ZK(ClusterType.META.code + 3),
+ META_TYPE_JVM(ClusterType.META.code + 4),
+
META_TYPE_ROCKETMQ_NAMESERVER(ClusterType.META.code + 31),
KUBERNETES_RUNTIME(DEFAULT, DEFAULT, CLUSTER, RUNTIME, RemotingType.KUBERNETES),
@@ -100,6 +109,13 @@ public enum ClusterType {
EVENTMESH_META_NACOS(EVENTMESH, EVENTMESH, META, META_TYPE_NACOS, RemotingType.EVENT_MESH_NACOS),
+ EVENTMESH_JVM_CLUSTER(EVENTMESH, EVENTMESH_JVM, CLUSTER, DEFINITION, RemotingType.EVENT_MESH_RUNTIME),
+
+ EVENTMESH_JVM_RUNTIME(EVENTMESH, EVENTMESH_JVM, RUNTIME, DEFAULT, RemotingType.EVENT_MESH_RUNTIME),
+
+ EVENTMESH_JVM_META(EVENTMESH, EVENTMESH_JVM, META, META_TYPE_JVM, RemotingType.JVM),
+
+
STORAGE_ROCKETMQ(ClusterType.STORAGE.code + 1),
STORAGE_ROCKETMQ_CLUSTER(STORAGE, STORAGE_ROCKETMQ, CLUSTER, DEFINITION, RemotingType.ROCKETMQ),
@@ -143,6 +159,8 @@ public enum ClusterType {
STORAGE_JVM_CAP_CLUSTER(STORAGE, STORAGE_JVM_CAP, CLUSTER, DEFINITION, RemotingType.JVM),
STORAGE_JVM_CAP_BROKER(STORAGE, STORAGE_JVM_CAP, META_AND_RUNTIME, DEFAULT, RemotingType.JVM),
+
+ STORAGE_JVM_CAP_META(STORAGE, STORAGE_JVM_CAP, META, DEFAULT, RemotingType.JVM),
;
@@ -171,22 +189,6 @@ public enum ClusterType {
}
}
- public static List getStorageCluster() {
- return STORAGE_MAIN_CLUSTER_TYPE_LIST;
- }
-
- public static List getStorageMetaCluster() {
- return STORAGE_META_CLUSTER_TYPE_LIST;
- }
-
- public static List getStorageRuntimeCluster() {
- return STORAGE_RUNTIME_CLUSTER_TYPE_LIST;
- }
-
- public static List getStorageMetaRuntimeCluster() {
- return STORAGE_META_RUNTIME_TYPE_LIST;
- }
-
/**
* 集群在 eventmesh 集群内的 节点(集群)类型。meta集群,存储集群,runtime集群
*/
@@ -197,40 +199,33 @@ public static List getStorageMetaRuntimeCluster() {
*/
@Getter
private ClusterType assemblyName;
-
/**
* 这个节点在 具体集群内是什么节点
*/
@Getter
private ClusterType assemblyNodeType;
-
/**
* 厂商是什么类型。比如注册中心。注册中心有 etc,nacos
*/
@Getter
private ClusterType assemblyBusiness;
-
/**
* 远程协议类型
*/
@Getter
private RemotingType remotingType;
-
@Getter
private int code;
-
-
+ private ClusterType higherType;
private List mainClusterType;
-
private List metaClusterType;
-
private List runtimeClusterType;
+
ClusterType(int code) {
this.code = code;
}
-
ClusterType(ClusterType eventmeshNodeType, ClusterType assemblyName, ClusterType assemblyNodeType, ClusterType assemblyBusiness,
RemotingType remotingType) {
this.eventmeshNodeType = eventmeshNodeType;
@@ -240,6 +235,21 @@ public static List getStorageMetaRuntimeCluster() {
this.remotingType = remotingType;
}
+ public static List getStorageCluster() {
+ return STORAGE_MAIN_CLUSTER_TYPE_LIST;
+ }
+
+ public static List getStorageMetaCluster() {
+ return STORAGE_META_CLUSTER_TYPE_LIST;
+ }
+
+ public static List getStorageRuntimeCluster() {
+ return STORAGE_RUNTIME_CLUSTER_TYPE_LIST;
+ }
+
+ public static List getStorageMetaRuntimeCluster() {
+ return STORAGE_META_RUNTIME_TYPE_LIST;
+ }
/**
* 半托管状态需要 如要从
@@ -249,8 +259,12 @@ public boolean isEventMethMeta() {
}
+ public boolean isEventCluster() {
+ return this.eventmeshNodeType.equals(EVENTMESH) && this.assemblyNodeType.equals(CLUSTER);
+ }
+
public boolean isEventMethRuntime() {
- return this == EVENTMESH_RUNTIME;
+ return this == EVENTMESH_RUNTIME || this == EVENTMESH_JVM_RUNTIME;
}
public boolean isMeta() {
@@ -337,6 +351,33 @@ public List getRuntimeClusterType() {
return this.getThisClusterType(RUNTIME, this.runtimeClusterType, "runtimeClusterType");
}
+ /**
+ *
+ */
+ public ClusterType getHigher() {
+ if (Objects.isNull(this.higherType)) {
+ for (ClusterType allClusterType : ClusterType.values()) {
+ if (!Objects.equals(allClusterType.eventmeshNodeType, this.eventmeshNodeType)
+ || !Objects.equals(allClusterType.assemblyName, this.assemblyName)) {
+ continue;
+ }
+ if (!Objects.equals(allClusterType.assemblyNodeType, CLUSTER)) {
+ continue;
+ }
+ if (!Objects.equals(allClusterType.assemblyBusiness, DEFINITION)) {
+ continue;
+ }
+ this.higherType = allClusterType;
+ break;
+ }
+ if (Objects.isNull(this.higherType)) {
+ throw new RuntimeException("higher type is null, current type:" + this);
+ }
+ }
+
+ return this.higherType;
+ }
+
private List getThisClusterType(ClusterType assemblyNodeType, List clusterTypeList, String fieldName) {
if (Objects.equals(assemblyNodeType, this.assemblyNodeType) && !this.isDefinition()) {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/CollectType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/CollectType.java
new file mode 100644
index 00000000..8c66f750
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/CollectType.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.enums;
+
+
+public enum CollectType {
+
+ NONE,
+
+ /**
+ *
+ */
+ PROMETHEUS,
+
+ EVENTMESH;
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java
index 2e8556bb..79c047ee 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/DeployStatusType.java
@@ -18,13 +18,54 @@
package org.apache.eventmesh.dashboard.common.enums;
+import lombok.Getter;
+
+/**
+ * TODO 流程:
+ * runtime: 先 创建数据 -> 绑定关系 -> 在启动
+ * meta : 先 创建数据直接启动
+ * eventmesh 空间是
+ * 创建 eventmesh cluster ->
+ * 创建 eventmesh meta ->
+ * eventmesh cluster 与 meta 绑定关系 ->
+ *
+ * 创建 storage cluster ->
+ * create storage meta 且直接启动 ->
+ * storage cluster 与 meta 绑定关系 ->
+ * create storage runtime ->
+ * storage cluster 与 runtime 绑定关系(绑定关系的时候,是否主动启动 runtime) ->
+ * 启动 runtime ->
+ * eventmesh cluster 与 storage cluster 绑定关系 ->
+ * 启动 eventmesh runtime
+ * 启动操作在:
+ * meta BUILD_SUCCESS(数据构建) 时 创建 服务 , 是否可选
+ * runtime 在 绑定时 , 是否可选
+ * 点击 启动
+ * 有 agent 的存在,就不需要启动循序了
+ */
public enum DeployStatusType {
+ SETTLE,
+
+
+ BUILD_SUCCESS("数据构建", """
+ 在 deploy 的 create handler 里面处理,如果使用 agent 模式,就没有意义,
+ build_success 状态 下一个是 CREATE_WAIT
+ """),
RESOURCE_APPLY,
RESOURCE_APPLY_FAILED,
+ CREATE,
+
+ CREATE_COPY,
+
+ /**
+ * 是不是需要这个状态的检查
+ */
+ CREATE_DATA_ING,
+
CREATE_WAIT,
CREATE_FULL_WAIT,
@@ -53,6 +94,8 @@ public enum DeployStatusType {
CREATE_CAP_UPDATE_SUCCESS,
+ UPDATE,
+
UPDATE_WAIT,
UPDATE_ING,
@@ -69,6 +112,7 @@ public enum DeployStatusType {
UPDATE_FULL_FAIL,
+ PAUSE,
PAUSE_WAIT,
@@ -86,6 +130,8 @@ public enum DeployStatusType {
PAUSE_FULL_FAIL,
+ RESET,
+
RESET_WAIT,
RESET_ING,
@@ -94,6 +140,7 @@ public enum DeployStatusType {
RESET_SUCCESS,
+
UNINSTALL,
UNINSTALL_FAIL,
@@ -104,4 +151,18 @@ public enum DeployStatusType {
UNINSTALL_SUCCESS,
;
+
+ @Getter
+ private String name;
+
+ @Getter
+ private String explanation;
+
+ DeployStatusType() {
+ }
+
+ DeployStatusType(String name, String explanation) {
+ this.name = name;
+ this.explanation = explanation;
+ }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java
index 42ca89d9..31b1e260 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/MetadataType.java
@@ -24,6 +24,7 @@
import org.apache.eventmesh.dashboard.common.model.metadata.ConfigMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.ConnectionMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.ConsumeOffsetMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.GroupMemberMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
@@ -39,20 +40,24 @@ public enum MetadataType {
CONFIG(ConfigMetadata.class),
- RUNTIME(RuntimeMetadata.class),
+ RUNTIME(RuntimeMetadata.class, true),
TOPIC(TopicMetadata.class),
- GROUP(GroupMetadata.class),
+ GROUP(GroupMetadata.class, true),
+ @Deprecated
TOPIC_OFFSET(TopicOffsetMetadata.class, true),
+ @Deprecated
CONSUME_OFFSET(ConsumeOffsetMetadata.class, true),
- SUBSCRIBER(GroupMetadata.class),
+ GROUP_MEMBER(GroupMemberMetadata.class, true),
+ @Deprecated
CLIENT(ClientMetadata.class, true),
+ @Deprecated
NET_CONNECT(ConnectionMetadata.class, true),
USER(ConnectionMetadata.class),
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java
index bfe248db..f53dd3ca 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/OperationRange.java
@@ -33,14 +33,13 @@ public class OperationRange {
private static Map> operationRangeListHashMap = new HashMap<>();
- public static OperationRange getInstance() {
- return operationRange;
- }
-
private OperationRange() {
}
+ public static OperationRange getInstance() {
+ return operationRange;
+ }
private void setOperationRange(ClusterType clusterType, OperationRangeType operationRangeType) {
operationRangeListHashMap.computeIfAbsent(clusterType, k -> new ArrayList<>()).add(operationRangeType);
@@ -50,19 +49,27 @@ public List getOperationRangeTypeList(ClusterType clusterTyp
return operationRangeListHashMap.get(clusterType);
}
+
+ public enum OperationType {
+
+ RUNTIME_CONFIG,
+
+
+ }
+
/**
- * 依据范围查询数据
- * 集群, runtime , topic ,SUBSCRIBER , SUBSCRIBER_QUEUE
+ * 依据范围查询数据 集群, runtime , topic ,SUBSCRIBER , SUBSCRIBER_QUEUE
*/
public enum OperationRangeType {
- ALL(null),
+ ALL(),
+
+ CLUSTER(),
- CLUSTER(null),
+ ALL_RUNTIME(),
- ALL_RUNTIME(null),
+ ONCE_CLUSTER(),
- ONCE_CLUSTER(null),
RANGE_CLUSTER_CAP(CLUSTER),
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
index 67d11afd..61084089 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationDimension.java
@@ -22,7 +22,6 @@ public enum ReplicationDimension {
NOT,
-
/**
* 节点复制 复制,
*/
@@ -31,7 +30,7 @@ public enum ReplicationDimension {
TOPIC,
/**
- * 部分复制
+ * 部分复制
*/
SECTION_REPLICATION,
;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
index 8b29f9e8..b0e3082e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ReplicationType.java
@@ -29,7 +29,6 @@ public enum ReplicationType {
MAIN_SLAVE,
;
-
public boolean isNot() {
return this == NOT;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
index 822e260b..c37e6e5e 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/ResetOffsetMode.java
@@ -23,17 +23,14 @@ public enum ResetOffsetMode {
/**
* 支持维度如下:
*
- * event mesh cluster 。
- * RockerMQ 查出 所有的 存储集群,然后存储存储集群里面,所有子集群,以及子集群里面所有的 broker ,对每个broker 进行一次请求奥做。
- * Kkakfa 查出 所有的 存储集群,然后存储存储集群里面。 只需要对 cluster 进行一次请求操作
+ * event mesh cluster 。 RockerMQ 查出 所有的 存储集群,然后存储存储集群里面,所有子集群,以及子集群里面所有的 broker ,对每个broker 进行一次请求奥做。 Kkakfa 查出 所有的 存储集群,然后存储存储集群里面。 只需要对 cluster
+ * 进行一次请求操作
*
* storage cluster
*
* storage definition cluster
*
* storage runtime cluster
- *
- *
*/
CONSUME_FROM_LAST_OFFSET,
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncStatus.java
new file mode 100644
index 00000000..85b7aefa
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncStatus.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.enums;
+
+public enum SyncStatus {
+
+ ING,
+
+ SUCCESS,
+
+ FAIL,
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncType.java
new file mode 100644
index 00000000..9d7d99bd
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/SyncType.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.enums;
+
+import lombok.Getter;
+import lombok.ToString;
+
+@Getter
+@ToString
+public enum SyncType {
+
+ NOT("NOT", "没命中"),
+
+ READONLY("READONLY", "只读"),
+
+ FIRSTTOWHOM("FIRSTTOWHOM", "第一次同步"),
+
+ INIT("INIT", "初始化"),
+
+ CHECK("CHECK", "检查"),
+
+ TIMINGSYNC("TIMINGSYNC", "定时同步"),
+
+ ;
+
+ private final String name;
+
+ private final String description;
+
+
+ SyncType(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+
+
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
index 34a5891d..32544c08 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckStatus.java
@@ -25,6 +25,8 @@
@AllArgsConstructor
public enum HealthCheckStatus {
+ ING(1L, "ing"),
+
SUCCESS(1L, "success"),
FAILED(0L, "failed"),
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
index 457e65b5..b28854ae 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/health/HealthCheckTypeEnum.java
@@ -25,6 +25,7 @@
@AllArgsConstructor
public enum HealthCheckTypeEnum {
+
UNKNOWN(0, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_UNKNOWN),
PROCESS(0, "检查进场"),
@@ -37,7 +38,7 @@ public enum HealthCheckTypeEnum {
TOPIC(3, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_TOPIC),
- CLUSTER(1, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER),
+ CLUSTER(5, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_CLUSTER),
RUNTIME(2, HealthCheckTypeConstant.HEALTH_CHECK_TYPE_RUNTIME),
@@ -46,6 +47,7 @@ public enum HealthCheckTypeEnum {
@Getter
private final Integer number;
+
@Getter
private final String name;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java
index c58890d3..afdf9bd9 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ClusterSyncMetadata.java
@@ -50,11 +50,11 @@ public class ClusterSyncMetadata {
META.add(MetadataType.RUNTIME);
- STORAGE.add(MetadataType.CONFIG);
+ //STORAGE.add(MetadataType.CONFIG);
STORAGE.add(MetadataType.TOPIC);
- STORAGE.add(MetadataType.GROUP);
- STORAGE.add(MetadataType.NET_CONNECT);
- STORAGE.add(MetadataType.SUBSCRIBER);
+ //STORAGE.add(MetadataType.GROUP);
+ //STORAGE.add(MetadataType.NET_CONNECT);
+ //STORAGE.add(MetadataType.GROUP_MEMBER);
AUTH.add(MetadataType.USER);
AUTH.add(MetadataType.ACL);
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
index b45c9e07..f0402198 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseClusterIdBase.java
@@ -20,6 +20,8 @@
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import java.util.Objects;
+
public abstract class BaseClusterIdBase extends BaseOrganizationBase {
private Long clusterId;
@@ -51,7 +53,7 @@ public boolean isUpdate() {
}
public boolean isInsert() {
- return true;
+ return Objects.equals(this.getUpdateTime(), this.getCreateTime());
}
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseOrganizationBase.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseOrganizationBase.java
index a4c2356c..9cb193c3 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseOrganizationBase.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseOrganizationBase.java
@@ -19,14 +19,34 @@
package org.apache.eventmesh.dashboard.common.model.base;
+import org.apache.eventmesh.dashboard.common.enums.SyncStatus;
+
+import java.time.LocalDateTime;
+import java.util.Objects;
+
+@SuppressWarnings({"LombokGetterMayBeUsed", "LombokSetterMayBeUsed"})
public abstract class BaseOrganizationBase {
+ private String unique;
+
private Long id;
private Long status;
private Long organizationId;
+ private LocalDateTime createTime;
+
+ private Long createUserId;
+
+ private LocalDateTime updateTime;
+
+ private Long updateUserId;
+
+ private Integer isDelete;
+
+ private SyncStatus syncStatus;
+
public Long getId() {
return id;
}
@@ -51,13 +71,66 @@ public void setStatus(Long status) {
this.status = status;
}
+
+ public LocalDateTime getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(LocalDateTime createTime) {
+ this.createTime = createTime;
+ }
+
+ public Long getCreateUserId() {
+ return createUserId;
+ }
+
+ public void setCreateUserId(Long createUserId) {
+ this.createUserId = createUserId;
+ }
+
+ public LocalDateTime getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(LocalDateTime updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Long getUpdateUserId() {
+ return updateUserId;
+ }
+
+ public void setUpdateUserId(Long updateUserId) {
+ this.updateUserId = updateUserId;
+ }
+
+ public Integer getIsDelete() {
+ return isDelete;
+ }
+
+ public void setIsDelete(Integer isDelete) {
+ this.isDelete = isDelete;
+ }
+
public String getUnique() {
- return this.getClass().getSimpleName() + "-" + this.id.toString();
+ if (Objects.isNull(this.unique)) {
+ this.unique = this.getClass().getSimpleName() + "-" + this.id.toString();
+ }
+ return this.unique;
}
/**
- * 主要用于 database 数据 与 节点数据 对比用。这个数据在node的唯一
+ * 主要用于 database 数据 与 节点数据 对比用。这个数据在node的唯一
+ *
* @return
*/
public abstract String nodeUnique();
+
+ public SyncStatus getSyncStatus() {
+ return syncStatus;
+ }
+
+ public void setSyncStatus(SyncStatus syncStatus) {
+ this.syncStatus = syncStatus;
+ }
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseSyncBase.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseSyncBase.java
index a027241c..8933fd31 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseSyncBase.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/base/BaseSyncBase.java
@@ -29,7 +29,7 @@
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
public abstract class BaseSyncBase extends BaseClusterIdBase {
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java
index a45d68c1..9198d8d3 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/ClusterMetadata.java
@@ -47,7 +47,7 @@ public class ClusterMetadata extends BaseSyncBase {
private String regProperties;
- private Integer authType;
+ private String authType;
private Integer runState;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/CollectMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/CollectMetadata.java
new file mode 100644
index 00000000..457514ad
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/CollectMetadata.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.model.metadata;
+
+import org.apache.eventmesh.dashboard.common.enums.CollectType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseClusterIdBase;
+
+public class CollectMetadata extends BaseClusterIdBase {
+
+ private CollectType collectType;
+
+ private Long saveTime;
+
+ private Long collectInterval;
+
+ private Long storageClusterId;
+
+ private Long storageClusterName;
+
+ private Boolean enable;
+
+ private Boolean defaultStorage;
+
+ @Override
+ public String nodeUnique() {
+ return "";
+ }
+
+ public CollectType getCollectType() {
+ return collectType;
+ }
+
+ public void setCollectType(CollectType collectType) {
+ this.collectType = collectType;
+ }
+
+ public Long getSaveTime() {
+ return saveTime;
+ }
+
+ public void setSaveTime(Long saveTime) {
+ this.saveTime = saveTime;
+ }
+
+ public Long getCollectInterval() {
+ return collectInterval;
+ }
+
+ public void setCollectInterval(Long collectInterval) {
+ this.collectInterval = collectInterval;
+ }
+
+ public Long getStorageClusterId() {
+ return storageClusterId;
+ }
+
+ public void setStorageClusterId(Long storageClusterId) {
+ this.storageClusterId = storageClusterId;
+ }
+
+ public Long getStorageClusterName() {
+ return storageClusterName;
+ }
+
+ public void setStorageClusterName(Long storageClusterName) {
+ this.storageClusterName = storageClusterName;
+ }
+
+ public Boolean getEnable() {
+ return enable;
+ }
+
+ public void setEnable(Boolean enable) {
+ this.enable = enable;
+ }
+
+ public Boolean getDefaultStorage() {
+ return defaultStorage;
+ }
+
+ public void setDefaultStorage(Boolean defaultStorage) {
+ this.defaultStorage = defaultStorage;
+ }
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMemberMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMemberMetadata.java
new file mode 100644
index 00000000..cf329d08
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMemberMetadata.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.common.model.metadata;
+
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GroupMemberMetadata extends BaseRuntimeIdBase {
+
+ private Long groupId;
+
+ private String groupName;
+
+ private Long topicId;
+
+ private String topicName;
+
+ @Override
+ public String nodeUnique() {
+ return "";
+ }
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
index e08bf8a9..e4fb4ccd 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/GroupMetadata.java
@@ -36,7 +36,6 @@ public class GroupMetadata extends BaseRuntimeIdBase {
private Integer type;
-
@Override
public String nodeUnique() {
return this.name;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/NetConnectionMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/NetConnectionMetadata.java
new file mode 100644
index 00000000..23be8151
--- /dev/null
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/NetConnectionMetadata.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.eventmesh.dashboard.common.model.metadata;
+
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseRuntimeIdBase;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Config metadata is a piece of config with key and value
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NetConnectionMetadata extends BaseRuntimeIdBase {
+
+ /**
+ * property key
+ */
+ private String configName;
+
+ private String configValue;
+
+ private MetadataType instanceType;
+
+ private Long instanceId;
+
+
+ @Override
+ public String nodeUnique() {
+ return this.configName;
+ }
+}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java
index 9d51ad81..df0b1c23 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/RuntimeMetadata.java
@@ -24,7 +24,7 @@
import lombok.EqualsAndHashCode;
@Data
-@EqualsAndHashCode(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
public class RuntimeMetadata extends BaseSyncBase {
private String host;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java
index d5173cee..e33529b4 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/metadata/TopicMetadata.java
@@ -27,13 +27,18 @@
@EqualsAndHashCode(callSuper = true)
public class TopicMetadata extends BaseRuntimeIdBase {
+ private String topicName;
+ private Integer readQueueNum;
- private String topicName;
+ private Integer writeQueueNum;
- private Long runtimeId;
+ /**
+ * topic 拦截器类型
+ */
+ private String topicFilterType;
- private Long storageId;
+ private Integer order;
private Long retentionMs;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
index 2870a57c..0505858c 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/GlobalResult.java
@@ -23,6 +23,17 @@
import lombok.Data;
import lombok.NoArgsConstructor;
+/**
+ * TODO
+ * 如果定义返回类,
+ * 定义异步返回,的成本太大,需要把所有链路实现异步返回操作
+ * 需要统一异步返回行为。比如单个返回,多个返回。
+ * 异步行为是否需要设计这样
+ * 同步行为是否需要设计这样,是否可以通过异常去做。 直接返回结果,如果有问题 throw 异常,这样代码量很少。
+ * 因为 所有的 远程调用,都在 RemotingService 里面。 在 RemotingService 做好同时支持 GlobalResult 与 直接返回
+ * 对于同步行为
+ * 本来设计成 请求,响应,返回 三件套的,因为完成整体链路的 异步调用,实在太麻烦了。最终
+ */
@Data
@Builder
@NoArgsConstructor
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingServiceException.java
similarity index 80%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingServiceException.java
index 49d740e5..73b9d179 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/RemotingServiceException.java
@@ -15,21 +15,19 @@
* limitations under the License.
*/
-
-package org.apache.eventmesh.dashboard.console.entity;
-
+package org.apache.eventmesh.dashboard.common.model.remoting;
import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import lombok.Getter;
-@NoArgsConstructor
+@Getter
@AllArgsConstructor
-@Data
-@Deprecated
-public class DefaultConfigKey {
+public class RemotingServiceException extends RuntimeException {
+
+ private int code;
+
+
+ private String message;
- private String businessType;
- private String configName;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
index f5a6f34b..10449ba1 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/runtime/GetRuntime2Request.java
@@ -18,14 +18,15 @@
package org.apache.eventmesh.dashboard.common.model.remoting.runtime;
-import org.apache.eventmesh.dashboard.common.model.remoting.Global2Request;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.common.model.remoting.AbstractGlobal2Request;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GetRuntime2Request extends Global2Request {
+public class GetRuntime2Request extends AbstractGlobal2Request {
private String registryAddress;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java
index deecfb44..53dfde77 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/DeleteTopicRequest.java
@@ -20,15 +20,8 @@
import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
+import org.apache.eventmesh.dashboard.common.model.remoting.AbstractGlobal2Request;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+public class DeleteTopicRequest extends AbstractGlobal2Request {
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class DeleteTopicRequest {
-
- TopicMetadata topicMetadata;
}
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopics2Request.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopics2Request.java
index 2178d093..607082ef 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopics2Request.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/remoting/topic/GetTopics2Request.java
@@ -18,14 +18,15 @@
package org.apache.eventmesh.dashboard.common.model.remoting.topic;
-import org.apache.eventmesh.dashboard.common.model.remoting.Global2Request;
+import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
+import org.apache.eventmesh.dashboard.common.model.remoting.AbstractGlobal2Request;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class GetTopics2Request extends Global2Request {
+public class GetTopics2Request extends AbstractGlobal2Request {
private String runtimeHost;
diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java
index 1ab9fc71..d57291b7 100644
--- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java
+++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ClasspathScanner.java
@@ -52,6 +52,8 @@ public class ClasspathScanner {
private Set> interfaceSet;
+ private Set> annotationSet;
+
private String designation;
@@ -71,9 +73,16 @@ public List> getClazz() throws Exception {
if (Modifier.isAbstract(clazz.getModifiers())) {
continue;
}
+ if (Objects.isNull(this.interfaceSet)) {
+ resourcesList.add(clazz);
+ continue;
+ }
+
if (this.includeInterface(clazz)) {
resourcesList.add(clazz);
+ continue;
}
+
Class>[] innerClass = clazz.getDeclaredClasses();
if (ArrayUtils.isEmpty(innerClass)) {
continue;
@@ -88,7 +97,7 @@ public List> getClazz() throws Exception {
}
private boolean excludeTest(Resource resource) throws IOException {
- return resource.getFile().getPath().indexOf("/target/test-classes/") != -1;
+ return resource.getFile().getPath().contains("/target/test-classes/");
}
private Class> createClass(Resource resource) throws IOException, ClassNotFoundException {
diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml
index bfe4dc2f..0ac59e57 100644
--- a/eventmesh-dashboard-console/pom.xml
+++ b/eventmesh-dashboard-console/pom.xml
@@ -17,8 +17,8 @@
-->
-
4.0.0
@@ -32,6 +32,8 @@
17
+ 17
+ 17
UTF-8
UTF-8
@@ -125,6 +127,64 @@
0.1.20
+
+ org.apache.velocity
+ velocity-engine-core
+ 2.4.1
+
+
+ org.apache.iotdb
+ iotdb-session
+ 2.0.3
+
+
+ org.apache.iotdb
+ iotdb-jdbc
+ 2.0.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jakarta.json
+ jakarta.json-api
+ 2.1.3
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.17.1
+
+
+ org.opensearch.client
+ opensearch-rest-client
+ 2.18.0
+
+
+
+ org.opensearch.client
+ opensearch-java
+ 2.15.0
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ 2.7.6
+ runtime
+ true
+
+
org.springframework.boot
@@ -159,16 +219,6 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.13.0
-
- 15
- 15
- UTF-8
-
-
org.springframework.boot
spring-boot-maven-plugin
@@ -199,12 +249,4 @@
-
-
- maven_central
- Maven Central
- https://repo.maven.apache.org/maven2/
-
-
-
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
index d0d6a4f8..7ed6bf1d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java
@@ -20,12 +20,14 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@SpringBootApplication
+@EnableScheduling
@EnableTransactionManagement
public class EventMeshDashboardApplication {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java
deleted file mode 100644
index fed7d4f7..00000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/config/FunctionManagerConfigs.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.eventmesh.dashboard.console.config;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-import lombok.Data;
-
-@Data
-@Component
-@ConfigurationProperties(prefix = "function")
-public class FunctionManagerConfigs {
-
- private HealthCheck healthCheck = new HealthCheck();
- private Sync sync = new Sync();
-
- @Data
- public static class HealthCheck {
-
- private DoCheck doCheck = new DoCheck();
- private UpdateConfig updateConfig = new UpdateConfig();
-
- @Data
- public static class DoCheck {
-
- private int initialDelay = 60;
- private int period = 60;
- }
-
- @Data
- public static class UpdateConfig {
-
- private int initialDelay = 30;
- private int period = 60;
- }
- }
-
- @Data
- public static class Sync {
-
- private boolean enable;
- private ToDb toDb = new ToDb();
-
- private int initialDelay = 120;
- private int period = 60;
-
- @Data
- public static class ToDb {
-
- private Boolean runtime;
- }
- }
-}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbilityService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbilityService.java
new file mode 100644
index 00000000..b0d59261
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbilityService.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.eventmesh.dashboard.console.controller;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import lombok.Getter;
+
+
+@Component
+public class ClusterAbilityService {
+
+
+ @Autowired
+ private ClusterService clusterService;
+
+
+ @Value("${console.controller.data.merge:false}")
+ @Getter
+ private boolean merge = false;
+
+
+ /**
+ * 可以对 topic, group, config ,sub 等做到强制性.offset 无法做到强制一致性
+ */
+ @Value("${console.data.forceConsistent:false}")
+ private boolean forceConsistent = false;
+
+
+ public boolean isCap(ClusterIdDTO clusterIdDTO) {
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity.setId(clusterIdDTO.getClusterId());
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+ return this.isCapByEntity(clusterEntity);
+ }
+
+ public boolean isCapByEntity(BaseClusterIdEntity baseClusterIdEntity) {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(baseClusterIdEntity.getClusterType());
+ return clusterFramework.isCAP();
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java
index 112a8898..4e81e1e0 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ClusterAbitityService.java
@@ -23,7 +23,7 @@
import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
index 7fe42b4f..e8a63de8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java
@@ -20,10 +20,10 @@
import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.AddConnectionDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.CreateConnectionDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.GetConnectionListDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
+import org.apache.eventmesh.dashboard.console.model.dto.connection.AddConnectionDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.connection.CreateConnectionDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.connection.GetConnectionListDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.connection.ConnectionListVO;
import org.apache.eventmesh.dashboard.console.service.cluster.ConnectionDataService;
import java.util.List;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ReportController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ReportController.java
new file mode 100644
index 00000000..a54dd58b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ReportController.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller;
+
+import org.apache.eventmesh.dashboard.console.function.report.ReportHandlerManage;
+import org.apache.eventmesh.dashboard.console.function.report.model.MultiGeneralReportDO;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("report")
+public class ReportController {
+
+
+ @Autowired
+ private ReportHandlerManage reportHandlerManage;
+
+ @RequestMapping("reportByHome")
+ public Map>> reportByHome(@RequestBody MultiGeneralReportDO multiGeneralReportDO) {
+ //
+ List singleGeneralReportDOList = new ArrayList<>();
+ multiGeneralReportDO.getReportNameList().forEach(reportName -> {
+ SingleGeneralReportDO singleGeneralReportDO = new SingleGeneralReportDO();
+ singleGeneralReportDOList.add(singleGeneralReportDO);
+ });
+ return reportHandlerManage.queryResultIsMap(singleGeneralReportDOList);
+
+ }
+
+ @RequestMapping("reportBySingle")
+ public List> reportBySingle(@RequestBody SingleGeneralReportDO singleGeneralReportDO) {
+
+ Map>> data = reportHandlerManage.queryResultIsMap(List.of(singleGeneralReportDO));
+ return data.get(singleGeneralReportDO.getReportName());
+ }
+
+ public void reportByMulti() {
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentActionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentActionController.java
new file mode 100644
index 00000000..eaae3466
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentActionController.java
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.agent;
+
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.model.DO.runtime.QueryRuntimeByBigExpandClusterDO;
+import org.apache.eventmesh.dashboard.console.model.dto.agent.AgentStartActionDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.lamp.decoration.core.result.DecorationResultException;
+
+
+@RestController
+@RequestMapping("/agent/")
+public class AgentActionController {
+
+ @Autowired
+ private ConfigService configService;
+
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @PostMapping("agentStartAction")
+ public AgentStartActionVO agentStartAction(@RequestBody @Valid AgentStartActionDTO data) {
+
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity.setId(data.getClusterId());
+
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+ if (Objects.isNull(clusterEntity)) {
+ DecorationResultException.throwDecorationResultException(41001, "cluster not exist");
+ }
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setId(data.getRuntimeId());
+ runtimeEntity = this.runtimeService.queryRuntimeEntityById(runtimeEntity);
+ if (Objects.isNull(runtimeEntity)) {
+ DecorationResultException.throwDecorationResultException(41002, "runtime not exist");
+ }
+
+ RuntimeEntity updateRuntimeEntity = new RuntimeEntity();
+ updateRuntimeEntity.setId(runtimeEntity.getId());
+ updateRuntimeEntity.setHost(data.getNodeAddress());
+ updateRuntimeEntity.setPodHost(data.getLocalAddress());
+ this.runtimeService.updateAddressByRuntimeId(updateRuntimeEntity);
+ // 识别架构,修改 需要 修改 config 相关配置 , 端口
+
+ // TODO 识别 架构方式,修改 cap 架构配置 ,
+
+ // 依赖组件,在 agentCheckRuntime ,
+
+ // 识别架构, 获得
+
+ AgentStartActionVO agentStartActionVO = new AgentStartActionVO();
+ agentStartActionVO.setClusterType(clusterEntity.getClusterType().toString());
+ agentStartActionVO.setCheck(clusterEntity.getClusterType().isMeta());
+
+ ConfigEntity configEntity = new ConfigEntity();
+ configEntity.setInstanceId(clusterEntity.getId());
+ configEntity.setInstanceType(MetadataType.CLUSTER);
+ List configEntityList = this.configService.queryByInstanceId(configEntity);
+ Map configMap = new HashMap();
+ configEntityList.forEach(config -> {
+ configMap.put(config.getConfigName(), config.getConfigValue());
+ });
+
+ configEntity = new ConfigEntity();
+ configEntity.setInstanceId(runtimeEntity.getId());
+ configEntity.setInstanceType(MetadataType.RUNTIME);
+ this.configService.queryByInstanceId(configEntity);
+ configEntityList.forEach(config -> {
+ configMap.put(config.getConfigName(), config.getConfigValue());
+ });
+
+ agentStartActionVO.setConfigMap(configMap);
+
+ return agentStartActionVO;
+
+ }
+
+
+ @PostMapping("agentCheckRuntime")
+ public AgentCheckRuntimeVO agentCheckRuntime(@RequestBody @Valid AgentStartActionDTO data) {
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity.setId(data.getClusterId());
+ clusterEntity = this.clusterService.queryClusterById(clusterEntity);
+
+ AgentCheckRuntimeVO agentCheckRuntimeVO = new AgentCheckRuntimeVO();
+
+ QueryRuntimeByBigExpandClusterDO queryRuntimeByBigExpandClusterDO =
+ QueryRuntimeByBigExpandClusterDO.builder().followClusterId(clusterEntity.getId())
+ .queryClusterTypeList(clusterEntity.getClusterType().getMetaClusterType()).build();
+
+ List runtimeEntityList = this.runtimeService.queryMetaRuntimeByStorageClusterId(queryRuntimeByBigExpandClusterDO);
+
+ ClusterType clusterType = clusterEntity.getClusterType();
+ if (clusterType.isEventMethRuntime()) {
+ queryRuntimeByBigExpandClusterDO = QueryRuntimeByBigExpandClusterDO.builder().followClusterId(clusterEntity.getId())
+ .storageMetaClusterTypeList(ClusterType.getStorageMetaRuntimeCluster()).build();
+ //如果是 eventmesh 集群,name需要查询 存储集群的 runtime 是否启动
+ // 如果识别 meta 的可用度
+ runtimeEntityList = this.runtimeService.queryRuntimeByBigExpandCluster(queryRuntimeByBigExpandClusterDO);
+ } else {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterType);
+ if (clusterFramework.isCAP() && clusterType.isMeta()) {
+ //
+ } else if (clusterType.isMetaAndRuntime()) {
+ //
+ } else if (clusterType.isRuntime()) {
+ //
+ }
+
+ }
+
+ return agentCheckRuntimeVO;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentCheckRuntimeVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentCheckRuntimeVO.java
new file mode 100644
index 00000000..09fdf5df
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentCheckRuntimeVO.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.agent;
+
+import lombok.Data;
+
+@Data
+public class AgentCheckRuntimeVO {
+
+ private boolean success;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentStartActionVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentStartActionVO.java
new file mode 100644
index 00000000..f0e9dda1
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/agent/AgentStartActionVO.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.agent;
+
+import java.util.Map;
+
+import lombok.Data;
+
+
+@Data
+public class AgentStartActionVO {
+
+
+ private String clusterType;
+
+ private Map configMap;
+
+ private boolean check;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
index dbfe803c..0ccdd2de 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClientDataController.java
@@ -20,7 +20,7 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClientEntity;
-import org.apache.eventmesh.dashboard.console.modle.cluster.client.QueryClientByUserFormDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.client.QueryClientByUserFormDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClientDataService;
import java.util.List;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
index 416d6130..0c5c0c72 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
@@ -19,21 +19,35 @@
package org.apache.eventmesh.dashboard.console.controller.cluster;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClientEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.client.QueryClientByUserFormDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.ClusterDetailsVO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryClusterByOrganizationIdAndTypeDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryRelationClusterByClusterIdAndTypeDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
-import org.apache.eventmesh.dashboard.console.modle.vo.cluster.GetClusterBaseMessageVO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.ClusterAllMetadataDO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.client.QueryClientByUserFormDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.BatchCreateClusterDataDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.ClusterDetailsVO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.CreateClusterByFullAddressDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryClusterByOrganizationIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryRelationClusterByClusterIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryTreeByClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.SimpleCreateClusterDataDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.ClusterTreeVO;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.GetClusterBaseMessageVO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.utils.data.controller.cluster.ClusterControllerUtils;
+import org.apache.commons.lang3.tuple.Pair;
+
+import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import org.springframework.beans.factory.annotation.Autowired;
@@ -49,11 +63,12 @@
@RequestMapping("user/cluster")
public class ClusterController {
+ @Autowired
+ public RuntimeService runtimeService;
@Autowired
private ClusterService clusterService;
-
@Autowired
- public RuntimeService runtimeService;
+ private ClusterAndRuntimeDomain clusterAndRuntimeDomain;
@GetMapping("queryHomeClusterData")
@@ -86,11 +101,27 @@ public List queryClusterByUserForm(QueryClientByUserFormDTO queryC
return null;
}
+
+ /**
+ * TODO 1. 返回全量数据
+ * 2. 构建树
+ * 3. 类型
+ * 1. clusterType
+ * 2. cluster 与 runtime 状态
+ * 1. 默认显示正常,
+ * 2. 是否按照状态排序
+ * 3. eventmesh cluster 与 存储 cluster 是否分开 展示
+ * 4. 提供获得 url 功能,在 后端进行整理,前端处理太麻烦了
+ * 4. cluster 与 关系表内容是否进行关联
+ * 5. cluster runtime 与 关联表 需要整理成 一个 DO,适配前端 前端 tree table
+ */
+ @PostMapping("queryTreeByClusterId")
+ public List queryTreeByClusterId(@RequestBody QueryTreeByClusterIdDTO data) {
+ return this.clusterAndRuntimeDomain.queryClusterTree(ClusterControllerMapper.INSTANCE.queryTreeByClusterId(data));
+ }
+
/**
* 这个接口用户 cluster 对应业务的 首页,方便查询
- *
- * @param dto
- * @return
*/
@PostMapping("queryVisualizationClusterByOrganizationIdAndType")
public List queryVisualizationClusterByOrganizationIdAndType(@RequestBody @Validated QueryClusterByOrganizationIdAndTypeDTO dto) {
@@ -104,9 +135,6 @@ public List queryClusterByOrganizationIdAndType(@RequestBody @Val
/**
* 查询 cluster 的关联集群列表
- *
- * @param dto
- * @return
*/
@PostMapping("queryRelationClusterByClusterIdAndType")
public List queryRelationClusterByClusterIdAndType(@RequestBody @Validated QueryRelationClusterByClusterIdAndTypeDTO dto) {
@@ -115,4 +143,93 @@ public List queryRelationClusterByClusterIdAndType(@RequestBody @
}
+ public void updateClusterNode() {
+
+ }
+
+ /**
+ * TODO
+ * 多端口,怎么处理。
+ * - 设计多端口 url
+ * - 127.0.0.1/tcp=9898&grpc=9899&http=9900;127.0.0.2/tcp=9898&grpc=9899&http=9900
+ * - 127.0.0.1,2,3,4/tcp=9898&grpc=9899&http=9900;
+ * - 127.0.0.1,127.0.0.2,127.0.0.3,127.0.0.4/tcp=9898&grpc=9899&http=9900;
+ * - 需要设计 url 表达式?
+ * - 主动从 runtime 读取 端口信息,是否能读取 meta 信息
+ * -
+ * eventmesh 是否可以从 meta 读取 runtime 信息 or 从 runtime 读取 meta
+ * 其他基础数据,怎么处理。
+ *
+ * 适合 meta 与 runtime 弱关联的 架构。比如 eventmesh
+ */
+ @PostMapping("createClusterByFullAddress")
+ public void createClusterByFullAddress(@RequestBody @Validated CreateClusterByFullAddressDTO data) {
+
+ }
+
+
+ /**
+ * 此方法适合 AP 架构,通过 meta address 获得大量 runtime cluster。比如 RocketMQ 架构
+ *
+ * 先创建 eventmesh 集群,在创建 rocketmq 集群
+ */
+ @PostMapping("createClusterByBachAddress")
+ public void createClusterByBachAddress(@RequestBody BatchCreateClusterDataDTO data) {
+ ClusterEntity mainClusterEntity = ClusterControllerMapper.INSTANCE.toClusterEntity(data);
+ ClusterControllerUtils.clusterEntityDataSupplement(mainClusterEntity);
+
+ List>> list = new ArrayList<>();
+ data.getSimpleCreateClusterDataList().forEach((value) -> {
+ ClusterEntity clusterEntity = ClusterControllerMapper.INSTANCE.toClusterEntity(value);
+ ClusterControllerUtils.clusterEntityDataSupplement(clusterEntity);
+ clusterEntity.setOrganizationId(mainClusterEntity.getOrganizationId());
+ Pair> pair =
+ ClusterControllerUtils.handlerSimpleCreateClusterDataDTO(clusterEntity, value);
+ list.add(pair);
+
+ });
+ this.clusterService.createClusterInfo(mainClusterEntity, list, this.creatingRelation(data.getMainClusterId(), mainClusterEntity));
+ }
+
+ /**
+ * 此方法适合 runtime cap 架构 或则 以 runtime 为主 ,比如 kafka
+ * TODO
+ * kafka 集群 是否支持0.9 版本 到 2.8版本,因为这个版本 metadata 需要从 zookeeper 集群进行操作
+ * 需要进行深度的讨论
+ * 如果需要支持,那么作为 T1级以及 极难标准的任务,发布下去. 接口等模块需要支持 runtime meta 双同步操作
+ */
+ @PostMapping("createClusterByRuntimeAddress")
+ public void createClusterByRuntimeAddress(@RequestBody @Validated SimpleCreateClusterDataDTO data) {
+ ClusterEntity clusterEntity = ClusterControllerMapper.INSTANCE.toClusterEntity(data);
+ ClusterType mainClusterType = clusterEntity.getClusterType().getHigher();
+ ClusterEntity mainClusterEntity = new ClusterEntity();
+ mainClusterEntity.setOrganizationId(clusterEntity.getOrganizationId());
+ mainClusterEntity.setClusterType(mainClusterType);
+ mainClusterEntity.setName(clusterEntity.getName());
+ mainClusterEntity.setTrusteeshipType(ClusterTrusteeshipType.NOT);
+ ClusterControllerUtils.clusterEntityDataSupplement(mainClusterEntity);
+
+ clusterEntity.setName(clusterEntity.getName() + "-broker");
+ Pair> pair =
+ ClusterControllerUtils.handlerSimpleCreateClusterDataDTO(clusterEntity, data);
+ // runtime cap 架构需要 检查节点数量,
+ this.clusterService.createClusterInfo(mainClusterEntity, List.of(pair), this.creatingRelation(data.getMainClusterId(), mainClusterEntity));
+
+ }
+
+ private ClusterRelationshipEntity creatingRelation(Long mainClusterId, ClusterEntity mainClusterEntity) {
+ if (Objects.isNull(mainClusterId)) {
+ return null;
+ }
+ ClusterEntity newClusterEntity = new ClusterEntity();
+ newClusterEntity.setId(mainClusterId);
+ newClusterEntity = this.clusterService.queryClusterById(newClusterEntity);
+ ClusterRelationshipEntity clusterRelationshipEntity = clusterRelationshipEntity = new ClusterRelationshipEntity();
+ clusterRelationshipEntity.setOrganizationId(newClusterEntity.getOrganizationId());
+ clusterRelationshipEntity.setClusterId(newClusterEntity.getId());
+ clusterRelationshipEntity.setClusterType(newClusterEntity.getClusterType());
+ clusterRelationshipEntity.setRelationshipType(mainClusterEntity.getClusterType());
+ return clusterRelationshipEntity;
+ }
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
index ca84a3df..8e9f0ce8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/DetailsController.java
@@ -17,7 +17,7 @@
package org.apache.eventmesh.dashboard.console.controller.cluster;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -54,4 +54,5 @@ public void storageRuntimeDetails(ClusterIdDTO clusterIdDTO) {
}
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java
index 11861dc9..f9570258 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/HomeController.java
@@ -20,15 +20,30 @@
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.message.GroupService;
+import org.apache.eventmesh.dashboard.console.service.message.OffsetService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/home")
public class HomeController {
+ @Autowired
private ClusterService clusterService;
+ @Autowired
+ private GroupService groupService;
+
+
+ @Autowired
+ private OffsetService offsetService;
- public void clusterHome(){
+ public void clusterHome() {
// 运维事件
// runtime 集群 以及
@@ -40,14 +55,16 @@ public void clusterHome(){
// kubernetes 列表。 本集群 没有或则资源不够,找上级集群。如果有多个上级
// 下面的是否需要展示
+
// client
// group 列表 topic 列表。是否需要在 home 展示
// 连接
+
}
- public void runtimeHome(){
+ public void runtimeHome() {
// 在哪个 cluster
// 在哪一个 kubernetes
@@ -65,11 +82,14 @@ public void runtimeHome(){
// 连接 统计数据
// 实例资源统计数据
+
}
- public void groupHome(){
- // cluster
+ public void groupHome() {
+ // group io out
+
+ // topic
// topic
@@ -78,16 +98,46 @@ public void groupHome(){
//
}
- public void topicHome(){
+ public void queueHome() {
+ // out io
+ // offset
+ }
+
+ public void groupSingleHome() {
+ // group all io out
+ // offset
+ //
+ }
+
+ public void topicHome() {
+ // topic io out
+ // topic offset , 消费 offset
+ // topic 数量 报表
+ }
+
+ public void topicSingleHome() {
+ // 运维异常统计
+ // topic offset
+
+ // topic 队列信息
+
+ // topic 关系图
+
+ // 获得 生产与消费数量,以及活跃组,正常组,非正常组。可以从 消费者offset
+ // topic 状态,依据 offset 的变化,在 topic 表里面
+
+ // 获得 client
+
+ // 获得 获得 topic io out
}
- public void clientHome(){
+ public void clientHome() {
}
- public void userHome(){
+ public void userHome() {
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
index 6f7ba10e..5da4555e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
@@ -21,8 +21,8 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.function.health.CheckResultCache;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.RuntimeControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
import java.util.List;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ActiveCreateController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ActiveCreateController.java
new file mode 100644
index 00000000..2d9d6cb8
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ActiveCreateController.java
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterOwnType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.active.ActiveCreateDTOHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ActiveCreateControllerMapper;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateEventMeshSpaceDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateRuntimeDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEntireClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@RequestMapping("organization/activeCreate")
+public class ActiveCreateController {
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+ @Autowired
+ private ClusterService clusterService;
+
+
+ /**
+ * 分 eventmesh 集群创建
+ *
+ */
+ @PostMapping("createEventMeshSpace")
+ public Long createEventMeshSpace(@RequestBody @Validated CreateEventMeshSpaceDTO dto) {
+ ClusterEntity clusterEntity = ActiveCreateControllerMapper.INSTANCE.createEventMeshSpace(dto);
+ clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
+ clusterEntity.setClusterOwnType(ClusterOwnType.NOT);
+ clusterEntity.setAuthType("");
+ clusterEntity.setVersion("");
+ clusterEntity.setRuntimeIndex(0);
+ clusterEntity.setTrusteeshipType(ClusterTrusteeshipType.NOT);
+ clusterEntity.setFirstToWhom(FirstToWhom.NOT);
+ clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
+ clusterEntity.setResourcesConfigId(0L);
+ clusterEntity.setDeployScriptId(0L);
+ clusterEntity.setDeployScriptName("");
+ clusterEntity.setDeployScriptVersion("");
+ clusterService.insertCluster(clusterEntity);
+ return clusterEntity.getId();
+ }
+
+ @PostMapping("createCluster")
+ public Long createCluster(@RequestBody @Validated CreateClusterDTO dto) {
+ ClusterEntity clusterEntity = ActiveCreateControllerMapper.INSTANCE.createCluster(dto);
+ clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
+ clusterEntity.setClusterOwnType(ClusterOwnType.INDEPENDENCE);
+ clusterEntity.setAuthType("");
+ clusterEntity.setVersion("");
+ clusterEntity.setRuntimeIndex(Integer.valueOf(0));
+ clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
+ clusterEntity.setResourcesConfigId(0L);
+ clusterEntity.setDeployScriptId(0L);
+ clusterEntity.setDeployScriptName("");
+ clusterEntity.setDeployScriptVersion("");
+ ClusterRelationshipEntity relationshipEntity = new ClusterRelationshipEntity();
+ clusterService.insertClusterAndRelationship(clusterEntity, relationshipEntity);
+ return clusterEntity.getId();
+ }
+
+ @PostMapping("createRuntime")
+ public void createRuntime(@RequestBody @Validated CreateRuntimeDTO dto) {
+ RuntimeEntity runtimeEntity = ActiveCreateControllerMapper.INSTANCE.createRuntime(dto);
+ runtimeService.insertRuntime(runtimeEntity);
+ }
+
+
+ @PostMapping("createTheEntireCluster")
+ public Long createTheEntireCluster(@RequestBody @Validated CreateTheEntireClusterDTO dto) {
+ ClusterEntity clusterEntity = ActiveCreateControllerMapper.INSTANCE.createCluster(dto.getCreateClusterDTO());
+
+ List runtimeEntityList = ActiveCreateControllerMapper.INSTANCE.createRuntimeList(dto.getCreateRuntimeDTOList());
+
+ ClusterRelationshipEntity relationshipEntity = new ClusterRelationshipEntity();
+ relationshipEntity.setClusterId(clusterEntity.getId());
+ this.clusterService.createTheEntireCluster(clusterEntity, relationshipEntity, runtimeEntityList);
+ return 1L;
+ }
+
+ /**
+ * TODO 先完成 数据 直接录入的实现,
+ * 在完成 通过 API 调用获得 broker config 补充 broker 与 cluster 信息,以及 cluster 组织关系
+ * 保留 两套机制,还是只留下 通过 API 获得信息的机制?
+ *
+ * @param createTheEventClusterDTO
+ * @return
+ */
+ @PostMapping("createTheEventCluster")
+ public Long createTheEventCluster(@RequestBody CreateTheEventClusterDTO createTheEventClusterDTO) {
+ ActiveCreateDTOHandler activeCreateDTOHandler = new ActiveCreateDTOHandler();
+ activeCreateDTOHandler.handler(createTheEventClusterDTO);
+ this.clusterService.createTheEventCluster(activeCreateDTOHandler.getClusterEntityList(),
+ activeCreateDTOHandler.getClusterListRelationshipList(), activeCreateDTOHandler.getClusterAndRuntimeList());
+
+ return activeCreateDTOHandler.getEventSapaceClusterEntity().getId();
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
index 14b28185..2e1c4c99 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CaseController.java
@@ -21,8 +21,8 @@
import org.apache.eventmesh.dashboard.console.entity.cases.CaseEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.deploy.CaseControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.cases.QueryCaseByObjectTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.cases.QueryCaseByObjectTypeDTO;
import java.util.List;
@@ -49,7 +49,7 @@ public List queryCaseByOrganization() {
}
- public void backups(){
+ public void backups() {
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java
index c805861e..619fa106 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ClusterCycleController.java
@@ -18,25 +18,22 @@
package org.apache.eventmesh.dashboard.console.controller.deploy;
-import org.apache.eventmesh.dashboard.common.enums.ClusterOwnType;
-import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
-import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateClusterByCopyHandler;
import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateClusterByDeployScriptHandler;
+import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateClusterByFullMetadataHandler;
import org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateRuntimeByDeployScriptHandler;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
-import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.cluster.VerifyNameDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByDeployScriptDO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByEventMesh;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByDeployScriptDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByOnlyDataDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByCopyDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByDeployScriptDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByFullMetadataDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByServiceAddressDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateRuntimeByDeployScriptDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.VerifyNameDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import java.util.Objects;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@@ -95,6 +92,12 @@ public class ClusterCycleController {
@Autowired
private CreateClusterByDeployScriptHandler createClusterByDeployScriptHandler;
+ @Autowired
+ private CreateClusterByCopyHandler createClusterByCopyHandler;
+
+ @Autowired
+ private CreateClusterByFullMetadataHandler createClusterByFullMetadataHandler;
+
/**
* @param verifyNameDTO
@@ -105,88 +108,52 @@ public String verifyName(VerifyNameDTO verifyNameDTO) {
return "";
}
- @PostMapping("createRuntimeByOnlyDataHandler")
- public void createRuntimeByOnlyDataHandler(@RequestBody @Validated CreateRuntimeByOnlyDataDO createRuntimeByOnlyDataDO) {
- RuntimeEntity runtimeEntity = ClusterCycleControllerMapper.INSTANCE.createRuntimeByOnlyDataHandler(createRuntimeByOnlyDataDO);
- runtimeService.insertRuntime(runtimeEntity);
- }
@PostMapping("createRuntimeByDeployScript")
public void createRuntimeByDeployScript(@RequestBody @Validated CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDTO) {
this.createRuntimeByDeployScriptHandler.handler(createRuntimeByDeployScriptDTO);
}
- @PostMapping("createClusterByDeployScript")
- public void createClusterByDeployScript(@RequestBody @Validated CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
- this.createClusterByDeployScriptHandler.handler(createClusterByDeployScriptDO);
- }
-
/**
- * 分 eventmesh 集群创建
*
- * @param createClusterByEventMesh
*/
- @PostMapping("createEventMeshClusterByOnlyData")
- public Long createEventMeshClusterByOnlyData(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
- ClusterEntity clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByEventMesh(createClusterByEventMesh);
- clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
- clusterEntity.setClusterOwnType(ClusterOwnType.NOT);
- clusterEntity.setAuthType("");
- clusterEntity.setVersion("");
- clusterEntity.setRuntimeIndex(0);
- clusterEntity.setTrusteeshipType(ClusterTrusteeshipType.NOT);
- clusterEntity.setFirstToWhom(FirstToWhom.NOT);
- clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
- clusterEntity.setResourcesConfigId(0L);
- clusterEntity.setDeployScriptId(0L);
- clusterEntity.setDeployScriptName("");
- clusterEntity.setDeployScriptVersion("");
- clusterService.insertCluster(clusterEntity);
- return clusterEntity.getId();
- }
+ @PostMapping("createClusterByServiceAddress")
+ public void createClusterByServiceAddress(CreateClusterByServiceAddressDTO dto) {
- @PostMapping("createClusterByEventMesh")
- public Long createClusterByEventMesh(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
- ClusterEntity clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByEventMesh(createClusterByEventMesh);
- clusterEntity.setClusterType(ClusterType.EVENTMESH_CLUSTER);
- clusterEntity.setClusterOwnType(ClusterOwnType.INDEPENDENCE);
- clusterEntity.setAuthType("");
- clusterEntity.setVersion("");
- clusterEntity.setRuntimeIndex(0);
- clusterEntity.setDeployStatusType(DeployStatusType.CREATE_SUCCESS);
- clusterEntity.setResourcesConfigId(0L);
- clusterEntity.setDeployScriptId(0L);
- clusterEntity.setDeployScriptName("");
- clusterEntity.setDeployScriptVersion("");
- ClusterRelationshipEntity relationshipEntity = new ClusterRelationshipEntity();
- clusterService.insertClusterAndRelationship(clusterEntity, relationshipEntity);
- return clusterEntity.getId();
+ if (Objects.equals(dto.getClusterType(), ClusterType.STORAGE_ROCKETMQ_CLUSTER)) {
+ dto.setClusterType(null);
+ }
}
- @PostMapping("pauseCluster")
- public void pauseCluster(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
- }
+ public void createClusterByFullAddress() {
- @PostMapping("pauseRuntime")
- public void pauseRuntime(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
}
- @PostMapping("relationship")
- public void relationship(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ public void createClusterByMetaAddress() {
+
}
- @PostMapping("unrelationship")
- public void unrelationship(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ public void createClusterByRuntimeAddress() {
+
}
- @PostMapping("uninstallCluster")
- public void uninstallCluster(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ @PostMapping("createClusterByDeployScript")
+ public void createClusterByDeployScript(@RequestBody @Validated CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
+ this.createClusterByDeployScriptHandler.handler(createClusterByDeployScriptDO);
}
- @PostMapping("uninstallRuntime")
- public void uninstallRuntime(@RequestBody @Validated CreateClusterByEventMesh createClusterByEventMesh) {
+ @PostMapping("createClusterByCopy")
+ public void createClusterByCopy(@RequestBody @Validated CreateClusterByCopyDTO dto) {
+ this.createClusterByCopyHandler.handler(dto);
}
+ /**
+ * 这里应该上传一个文件
+ */
+ @PostMapping("createClusterByFullMetadata")
+ public void createClusterByFullMetadata(@RequestBody @Validated CreateClusterByFullMetadataDTO dto) {
+ this.createClusterByFullMetadataHandler.handler(dto);
+ }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java
index 6345dc8f..1dd887d1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/CreateCycleService.java
@@ -29,8 +29,8 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterByCompleteDataDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterBySimpleDataDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.CreateClusterByCompleteDataDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.CreateClusterBySimpleDataDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
@@ -54,6 +54,7 @@
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Component
@Slf4j
+@Deprecated
public class CreateCycleService {
@Autowired
@@ -252,7 +253,6 @@ public void createRuntime() {
//
}
-
// TODO 添加修改绑定解绑 meta 集群,都需要 所有的 runtime集群。是通过事件方式处理还是立即处理?
// IP 管理
// 配置写入,
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
index 5fd79969..d030c509 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/ResourcesConfigController.java
@@ -20,9 +20,9 @@
import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ResourceConfigControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.OrganizationIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.resouce.QueryResourceByObjectTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.OrganizationIdDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.resouce.QueryResourceByObjectTypeDTO;
import java.util.List;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/active/ActiveCreateDTOHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/active/ActiveCreateDTOHandler.java
new file mode 100644
index 00000000..1d477410
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/active/ActiveCreateDTOHandler.java
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.active;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterOwnType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseSyncEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
+import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ActiveCreateControllerMapper;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateRuntimeDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEntireClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO.BaseCreateTheEntireClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO.CreateCapStorageClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO.MainStorageClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateTheEventClusterDTO.RuntimeClusterDTO;
+
+import org.apache.commons.lang3.tuple.Pair;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import lombok.Getter;
+
+@Getter
+public class ActiveCreateDTOHandler {
+
+ private final List clusterEntityList = new ArrayList<>();
+
+ private final List> clusterListRelationshipList = new ArrayList<>();
+
+ private final List>> clusterAndRuntimeList = new ArrayList<>();
+
+ private ClusterEntity eventSapaceClusterEntity;
+
+ private Long organizationId;
+
+ private String organizationName;
+
+ private ClusterEntity createClusterEntity(CreateClusterDTO createClusterDTO) {
+ ClusterEntity clusterEntity = ClusterControllerMapper.INSTANCE.createClusterDTO(createClusterDTO);
+ this.fillBaseSyncEntity(clusterEntity);
+ clusterEntity.setClusterOwnType(ClusterOwnType.NOT);
+ clusterEntity.setConfig("");
+ clusterEntity.setAuthType("none");
+ clusterEntity.setJmxProperties("");
+ clusterEntity.setConfig("");
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
+ if (clusterFramework.isCAP()) {
+ clusterEntity.setReplicationType(ReplicationType.NOT);
+ }
+ this.clusterEntityList.add(clusterEntity);
+ return clusterEntity;
+ }
+
+ private void fillBaseSyncEntity(BaseSyncEntity baseSyncEntity) {
+ if (Objects.isNull(baseSyncEntity.getTrusteeshipType())) {
+ baseSyncEntity.setTrusteeshipType(ClusterTrusteeshipType.NO_TRUSTEESHIP);
+ }
+ if (Objects.isNull(baseSyncEntity.getFirstToWhom())) {
+ baseSyncEntity.setFirstToWhom(FirstToWhom.NOT);
+ }
+ baseSyncEntity.setOrganizationId(organizationId);
+ baseSyncEntity.setVersion("");
+ baseSyncEntity.setReplicationType(ReplicationType.NOT);
+ baseSyncEntity.setDeployStatusType(DeployStatusType.SETTLE);
+ baseSyncEntity.setResourcesConfigId(0L);
+ baseSyncEntity.setDeployScriptId(0L);
+ baseSyncEntity.setDeployScriptName("");
+ baseSyncEntity.setDeployScriptVersion("");
+ }
+
+ private RuntimeEntity createRuntimeEntity(ClusterEntity clusterEntity, CreateRuntimeDTO createRuntimeDTO) {
+ return ActiveCreateControllerMapper.INSTANCE.createRuntime(createRuntimeDTO);
+ }
+
+
+ private void createTheEntireClusterDTO(ClusterEntity superior, CreateTheEntireClusterDTO dto) {
+ ClusterEntity clusterEntity = this.createClusterEntity(dto.getCreateClusterDTO());
+ this.clusterListRelationshipList.add(Pair.of(superior, clusterEntity));
+
+ List runtimeEntityList = new ArrayList<>();
+ dto.getCreateRuntimeDTOList().forEach(runtimeDTO -> {
+ runtimeDTO.setFirstToWhom(clusterEntity.getFirstToWhom());
+ runtimeDTO.setClusterTrusteeshipType(clusterEntity.getTrusteeshipType());
+
+ RuntimeEntity runtimeEntity = this.createRuntimeEntity(clusterEntity, runtimeDTO);
+ runtimeEntity.setOrganizationId(organizationId);
+ runtimeEntity.setClusterType(clusterEntity.getClusterType());
+ runtimeEntity.setVersion(clusterEntity.getVersion());
+ runtimeEntity.setTrusteeshipType(clusterEntity.getTrusteeshipType());
+ runtimeEntity.setFirstToWhom(runtimeDTO.getFirstToWhom());
+ runtimeEntity.setKubernetesClusterId(0L);
+ runtimeEntity.setDeployStatusType(DeployStatusType.SETTLE);
+ runtimeEntity.setResourcesConfigId(0L);
+ runtimeEntity.setDeployScriptId(0L);
+ runtimeEntity.setCreateScriptContent("");
+ runtimeEntity.setAuthType("");
+ runtimeEntity.setJmxPort(1);
+
+ runtimeEntityList.add(runtimeEntity);
+ });
+ this.clusterAndRuntimeList.add(Pair.of(clusterEntity, runtimeEntityList));
+
+ }
+
+ private ClusterEntity baseCreateTheEntireClusterDTO(ClusterEntity superior, BaseCreateTheEntireClusterDTO dto) {
+ ClusterEntity clusterEntity = this.createClusterEntity(dto.getCreateClusterDTO());
+ if (Objects.nonNull(dto.getPrometheusRuntime())) {
+ RuntimeEntity runtimeEntity = this.createRuntimeEntity(clusterEntity, dto.getPrometheusRuntime());
+ this.clusterAndRuntimeList.add(Pair.of(clusterEntity, List.of(runtimeEntity)));
+ }
+
+ return clusterEntity;
+ }
+
+ private void runtimeClusterDTO(ClusterEntity superior, RuntimeClusterDTO runtimeClusterDTO) {
+ if (Objects.isNull(runtimeClusterDTO)) {
+ return;
+ }
+ ClusterEntity clusterEntity = this.baseCreateTheEntireClusterDTO(superior, runtimeClusterDTO);
+ this.clusterListRelationshipList.add(Pair.of(superior, clusterEntity));
+ this.createTheEntireClusterDTO(clusterEntity, runtimeClusterDTO.getMetaClusterList());
+ this.createTheEntireClusterDTO(clusterEntity, runtimeClusterDTO.getBrokerClusterList());
+ }
+
+
+ private void createCapStorageClusterDTO(ClusterEntity superior, CreateCapStorageClusterDTO createCapStorageClusterDTO) {
+ if (Objects.isNull(createCapStorageClusterDTO)) {
+ return;
+ }
+ ClusterEntity clusterEntity = this.baseCreateTheEntireClusterDTO(superior, createCapStorageClusterDTO);
+ this.clusterListRelationshipList.add(Pair.of(superior, clusterEntity));
+ this.createTheEntireClusterDTO(clusterEntity, createCapStorageClusterDTO.getMetaClusterList());
+ this.createTheEntireClusterDTO(clusterEntity, createCapStorageClusterDTO.getBrokerClusterList());
+ }
+
+ private void createMainStorageClusterDTO(ClusterEntity superior, MainStorageClusterDTO mainStorageClusterDTO) {
+ if (Objects.isNull(mainStorageClusterDTO)) {
+ return;
+ }
+ ClusterEntity clusterEntity = this.baseCreateTheEntireClusterDTO(superior, mainStorageClusterDTO);
+ mainStorageClusterDTO.getMetaClusterList().forEach(metaClusterDTO -> {
+ this.createTheEntireClusterDTO(clusterEntity, metaClusterDTO);
+ });
+ mainStorageClusterDTO.getBrokerClusterList().forEach(mainClusterDTO -> {
+ ClusterEntity cluster = this.baseCreateTheEntireClusterDTO(clusterEntity, mainClusterDTO);
+ mainClusterDTO.getClusterList().forEach(clusterDTO -> {
+ this.createTheEntireClusterDTO(cluster, clusterDTO);
+ });
+ });
+ }
+
+ /**
+ * 通過 runtime 信息 得到 meta 信息,然後通過
+ *
+ * @param createTheEventClusterDTO
+ */
+ public void handler(CreateTheEventClusterDTO createTheEventClusterDTO) {
+ this.organizationId = createTheEventClusterDTO.getOrganizationId();
+ this.eventSapaceClusterEntity = this.createClusterEntity(createTheEventClusterDTO.getEventSpace());
+
+ this.runtimeClusterDTO(eventSapaceClusterEntity, createTheEventClusterDTO.getEventClusterList());
+
+ this.runtimeClusterDTO(eventSapaceClusterEntity, createTheEventClusterDTO.getMonomerStorageClusters());
+
+ this.createCapStorageClusterDTO(eventSapaceClusterEntity, createTheEventClusterDTO.getCapStorageClusters());
+
+ this.createMainStorageClusterDTO(eventSapaceClusterEntity, createTheEventClusterDTO.getMainStorageClusters());
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/AbstractUpdateHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/AbstractUpdateHandler.java
new file mode 100644
index 00000000..ee4be9e0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/AbstractUpdateHandler.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.base;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.ClusterAndRuntimeOfRelationshipDO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.service.deploy.DeployService;
+import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
+import org.apache.eventmesh.dashboard.console.service.message.TopicService;
+import org.apache.eventmesh.dashboard.console.spring.support.KubernetesManage;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+public abstract class AbstractUpdateHandler {
+
+ @Autowired
+ protected DeployService deployService;
+
+ @Autowired
+ protected ClusterService clusterService;
+
+ @Autowired
+ protected RuntimeService runtimeService;
+
+ @Autowired
+ protected TopicService topicService;
+
+ @Autowired
+ protected ConfigService configService;
+
+ @Autowired
+ protected ClusterRelationshipService clusterRelationshipService;
+
+ @Autowired
+ protected ClusterAndRuntimeDomain clusterAndRuntimeDomain;
+
+ @Autowired
+ protected KubernetesManage kubernetesManage;
+
+
+ protected void updateDeployStatus(ClusterEntity clusterEntity, DeployStatusType deployStatus) {
+ ClusterAndRuntimeOfRelationshipDO data =
+ this.clusterAndRuntimeDomain.getAllClusterAndRuntimeByCluster(clusterEntity, deployStatus);
+
+ data.getRuntimeEntityList().forEach(runtime -> {
+ runtime.setDeployStatusType(deployStatus);
+ });
+ this.runtimeService.batchUpdateDeployStatusType(data.getRuntimeEntityList(), deployStatus);
+ }
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/DeployBeforeCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/DeployBeforeCheck.java
new file mode 100644
index 00000000..dfb5b824
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/base/DeployBeforeCheck.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.base;
+
+/**
+ *
+ */
+public interface DeployBeforeCheck {
+
+
+ boolean check(T t);
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByCopyHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByCopyHandler.java
new file mode 100644
index 00000000..3ea52fa0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByCopyHandler.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.create;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.base.AbstractUpdateHandler;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.ClusterAndRuntimeOfRelationshipDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByCopyDTO;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class CreateClusterByCopyHandler extends AbstractUpdateHandler implements UpdateHandler {
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(CreateClusterByCopyDTO dto) {
+
+ ClusterEntity clusterEntity = new ClusterEntity();
+ ClusterAndRuntimeOfRelationshipDO data =
+ this.clusterAndRuntimeDomain.getAllClusterAndRuntimeByCluster(clusterEntity, DeployStatusType.CREATE_COPY);
+
+ // 如果是 runtime 类型,那么只需要一个创建一个集群
+ // 一个集群只会在一个 kubernetes 集群里面创建
+ if (data.getClusterEntity().getClusterType().isRuntime()) {
+ this.kubernetesManage.checkResource(data.getClusterResourcesList().get(0).getRight(), dto.getKubernetesClusterId());
+ } else {
+ data.getClusterResourcesList().forEach(pair -> {
+ this.kubernetesManage.checkResource(pair.getRight(), dto.getKubernetesClusterId());
+ });
+ }
+ // Topic
+ data.setTopicMap(new HashMap<>());
+ data.getTopicMap().put(MetadataType.CLUSTER, new HashMap<>());
+ data.getTopicMap().put(MetadataType.RUNTIME, new HashMap<>());
+ Map>> topicMap = data.getTopicMap();
+
+ List topciEntityList = this.topicService.queryByClusterIdList(data.getClusterEntityList());
+ topciEntityList.forEach(topicEntity -> {
+ boolean isRuntime = topicEntity.getRuntimeId() == 0;
+ data.getTopicMap().get(isRuntime ? MetadataType.RUNTIME : MetadataType.CLUSTER)
+ .computeIfAbsent(isRuntime ? topicEntity.getRuntimeId() : topicEntity.getClusterId(), k -> new ArrayList<>()).add(topicEntity);
+ });
+ // config
+ data.setConfigMap(new HashMap<>());
+ Arrays.stream(MetadataType.values()).toList().forEach(metadataType -> {
+ data.getTopicMap().put(metadataType, new HashMap<>());
+ });
+
+ List configEntityList = this.configService.queryByClusterIdList(data.getClusterEntityList());
+
+ configEntityList.forEach(configEntity -> {
+ data.getConfigMap().get(configEntity.getInstanceType()).computeIfAbsent(configEntity.getInstanceId(), k -> new ArrayList<>())
+ .add(configEntity);
+ });
+
+ this.deployService.createDeploy(data);
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java
index 95ef6d0b..237e67d9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByDeployScriptHandler.java
@@ -29,7 +29,7 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByDeployScriptDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByDeployScriptDO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
@@ -49,25 +49,16 @@
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class CreateClusterByDeployScriptHandler implements UpdateHandler {
+ private final List runtimeEntityList = new ArrayList<>();
private ClusterService clusterService;
-
private ConfigService configService;
-
private RuntimeService runtimeService;
-
private ClusterRelationshipService clusterRelationshipService;
-
private ClusterEntity clusterEntity;
-
private ClusterFramework clusterFramework;
-
private ClusterType clusterType;
-
private ReplicationType replicationType;
-
- private final List runtimeEntityList = new ArrayList<>();
-
@Override
public void init() {
@@ -79,6 +70,9 @@ private void handlerMetadata(ClusterEntity clusterEntity) {
this.clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
}
+ /**
+ * 只支持 runtime 与 meta 集群的创建,不支持 集群空间的创建
如何支持 eventmesh space create, script 模式不适合。
+ */
@Override
public void handler(CreateClusterByDeployScriptDO createClusterByDeployScriptDO) {
this.clusterEntity = ClusterCycleControllerMapper.INSTANCE.createClusterByDeployScript(createClusterByDeployScriptDO);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByFullMetadataHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByFullMetadataHandler.java
new file mode 100644
index 00000000..c84b755f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateClusterByFullMetadataHandler.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.create;
+
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByFullMetadataDTO;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * TODO
+ * 实现这个 handler 需要 对 ClusterAndRuntimeDomainImpl GetSyncObjectHandler 的 数据读取 与 数据整理 进行 解耦。
+ * 一个是 db read , 一个 get read
+ * issue Full metadata 创建 create cluster 以及 GetSyncObjectHandler 数据读取与数据操作解耦,支持 db read 与 get read
+ */
+@Component
+public class CreateClusterByFullMetadataHandler implements UpdateHandler {
+
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(CreateClusterByFullMetadataDTO dto) {
+ // 这是所有 新增 cluster runtime 的名字的 后缀
+
+ // 通过 json 进行序列化,得到所有的配置 cluster runtime relationship config topic 等
+
+ // 然后进行关联
+
+ // 调用 cluster service 进行写入
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java
index f0691520..5efbb395 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/create/CreateRuntimeByDeployScriptHandler.java
@@ -26,7 +26,7 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.ClusterControllerMapper;
import org.apache.eventmesh.dashboard.console.mapstruct.deploy.ClusterCycleControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByDeployScriptDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateRuntimeByDeployScriptDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
@@ -39,8 +39,11 @@
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
+import lombok.extern.slf4j.Slf4j;
+
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+@Slf4j
public class CreateRuntimeByDeployScriptHandler implements UpdateHandler {
@@ -55,16 +58,21 @@ public void init() {
}
+ /**
+ * 支持 多 复杂的主从架构
+ */
@Override
public void handler(CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDTO) {
ClusterEntity clusterEntity = ClusterControllerMapper.INSTANCE.toClusterEntity(createRuntimeByDeployScriptDTO);
clusterEntity = this.clusterService.queryClusterById(clusterEntity);
RuntimeEntity runtimeEntity = ClusterCycleControllerMapper.INSTANCE.createRuntimeByDeployScript(createRuntimeByDeployScriptDTO);
if (Objects.isNull(runtimeEntity.getDeployScriptId()) && Objects.isNull(clusterEntity.getDeployScriptId())) {
+ log.error("create runtime by deploy script id is null");
return;
}
if (Objects.isNull(runtimeEntity.getResourcesConfigId()) && Objects.isNull(clusterEntity.getResourcesConfigId())) {
+ log.error("create runtime by deploy script resources config id is null");
return;
}
if (Objects.nonNull(runtimeEntity.getDeployScriptId())) {
@@ -88,9 +96,10 @@ public void handler(CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDT
runtimeEntity.setClusterType(clusterEntity.getClusterType());
runtimeEntity.setTrusteeshipType(ClusterTrusteeshipType.SELF);
runtimeEntity.setReplicationType(replicationType);
- runtimeEntity.setDeployStatusType(DeployStatusType.CREATE_WAIT);
+ runtimeEntity.setDeployStatusType(DeployStatusType.CREATE_DATA_ING);
runtimeEntity.setRuntimeIndex(linkedList.poll());
- this.runtimeService.insertRuntime(runtimeEntity);
+
+ this.runtimeService.insertRuntimeByClusterData(runtimeEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md
index 33a7903b..dd6039e9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/design.md
@@ -1,92 +1,95 @@
+##
-##
1. 存储 remote 服务
- 1. topic 创建在 cluster main runtime
+ 1. topic 创建在 cluster main runtime
2. message
- 1. 发送
- 2. 查看消息
- 3. 发布订阅
- 4. console -> 抽象层 -> broker
- 5. rocketmq 4.0 push(pull) 5.0 pull
+ 1. 发送
+ 2. 查看消息
+ 3. 发布订阅
+ 4. console -> 抽象层 -> broker
+ 5. rocketmq 4.0 push(pull) 5.0 pull
3. offset
-4. k8s
- 1. 集群
- 2. 创建
- 3.
- 2. 节点
- 3. 创建
- 4. 停用
- 5. 删除
- 2. console , docker 执行脚本
- 2. console 与 操作分开
- 3. 6c 16G
- 4. eventmesh
- 5. kafka
- 1. 取舍问题
- 6. rocketmq
- 1. 简单
- 2. 不做难得
- 3. 两个集群
- 1. 单节点
- 2. 一主已从
- 7. pulsuer
- 1. 我有
-5. 数据采集快
- 1. 存储已经支持的采集
- 2. RocketMQ 实现
+4. k8s
+ 1. 集群
+ 2. 创建
+ 3.
+ 2. 节点
+ 3. 创建
+ 4. 停用
+ 5. 删除
+ 2. console , docker 执行脚本
+ 2. console 与 操作分开
+ 3. 6c 16G
+ 4. eventmesh
+ 5. kafka
+ 1. 取舍问题
+ 6. rocketmq
+ 1. 简单
+ 2. 不做难得
+ 3. 两个集群
+ 1. 单节点
+ 2. 一主已从
+ 7. pulsuer
+ 1. 我有
+5. 数据采集快
+ 1. 存储已经支持的采集
+ 2. RocketMQ 实现
6. 前端
7. 认证与权限,介入
- 1. rocketmq 的插件
- 2. acl -> console 同步
- 2. kafka 的 插件
- 3. 修改
+ 1. rocketmq 的插件
+ 2. acl -> console 同步
+ 2. kafka 的 插件
+ 3. 修改
8. 一键部署
9. 巡检
10. 告警
-
## 部署业务模块
->
+
+>
## 难点
- 超级难点一:
- 因消息中间件架构不一样,所以处理不一样。
- Kafka是
- 1. CAP 架构,操作一个节点就可以。
- 2. 单注册中心,meta 集群决定 kafka 集群的 一致性架构
- 3. 操作性行为
- 4. 难点 复制:kafka 基于 topic 复制
- RocketMQ 是
- 1. 多子集群
- 1. 子集群主从架构。且部分功能独立
- 2. 有 raft 架构
- 3. 难点 复制:RocketMQ 是 主从复制
- 2. 多注册中心,使用 AP 架构。broker 集群架构由 broker 集群决定
- pulsar(占时不支持) 是
- 1. 多计算集群多存储集群的计算与存储分离架构
- 2. 存储使用 BookKeeper,只能通过 pulsar broker 进行操作
- 2. 多注册中心。meta 集群决定 pulsar 集群的 一致性架构
- 3. 跨集群复制
- 4. 难点 复制: 基于 BookKeeper 复制
- 集群创建的时候,可以定义集群 一致性 架构
- broker 集群决定一致性架构
+超级难点一:
+因消息中间件架构不一样,所以处理不一样。
+Kafka是
+1. CAP 架构,操作一个节点就可以。
+2. 单注册中心,meta 集群决定 kafka 集群的 一致性架构
+3. 操作性行为
+4. 难点 复制:kafka 基于 topic 复制
+RocketMQ 是
+1. 多子集群
+1. 子集群主从架构。且部分功能独立
+2. 有 raft 架构
+3. 难点 复制:RocketMQ 是 主从复制
+2. 多注册中心,使用 AP 架构。broker 集群架构由 broker 集群决定
+pulsar(占时不支持) 是
+1. 多计算集群多存储集群的计算与存储分离架构
+2. 存储使用 BookKeeper,只能通过 pulsar broker 进行操作
+2. 多注册中心。meta 集群决定 pulsar 集群的 一致性架构
+3. 跨集群复制
+4. 难点 复制: 基于 BookKeeper 复制
+
+集群创建的时候,可以定义集群 一致性 架构
+broker 集群决定一致性架构
重置维度
+
1. 最大
2. 最小
3. 指定 offset
4. 指定 某个时间点
-PS: RocketMQ 的 queue 与 kafka 的 partition 是一个意思。
-超级难点一:
- 因消息中间件架构不一样,所以处理不一样
- kafka 的 offset 操作时 cluster行为
- RocketMQ 操作时 broker 行为
-
+ PS: RocketMQ 的 queue 与 kafka 的 partition 是一个意思。
+ 超级难点一:
+ 因消息中间件架构不一样,所以处理不一样
+ kafka 的 offset 操作时 cluster行为
+ RocketMQ 操作时 broker 行为
+
kafka 只需要 队列id 就行了
- 1. 按照某个维度重置 topic 下面所有 队列
- 2. 按照某个维度重置 topic 下某个队列
-RocketMQ 的重置场景
+
+1. 按照某个维度重置 topic 下面所有 队列
+2. 按照某个维度重置 topic 下某个队列
+ RocketMQ 的重置场景
1. 按照某个维度重置 topic 在集群里面所有的 队列
2. 按照某个维度重置 topic 在集群里面某个主从节点的 队列
3. 按照某个维度重置 topic 在集群里面所有的 下某个队列
@@ -95,63 +98,64 @@ RocketMQ 的重置场景
5. 按照某个维度重置 topic 在某个节点上的所有 队列
6. 按照某个维度重置 topic 在某个节点上的所有 某个队列
-
## 数据关联
+
1. 所有对 eventmesh 的操作,需要再对应的存储集群进行操作
2. 什么状态的集群进行操作【】。读取数据的时候,需要过滤掉,不正常得节点
-##
+##
## 数据创建
+
1. 把导出的数据,导入
- 1. 点击 eventmesh 集群导出 or 备份
- 1. 如果 eventmesh 独立集群直接操作
- 2. 不是,检查 依赖集群是否同时进行了备份
- 1. 没有,提示某某集群
- 2. 点击 runtime 集群
- 3. 点击 meta 集群
- 4. 点击 存储 集群
- 1. 存储集群
+ 1. 点击 eventmesh 集群导出 or 备份
+ 1. 如果 eventmesh 独立集群直接操作
+ 2. 不是,检查 依赖集群是否同时进行了备份
+ 1. 没有,提示某某集群
+ 2. 点击 runtime 集群
+ 3. 点击 meta 集群
+ 4. 点击 存储 集群
+ 1. 存储集群
2. 直接点击 cluster 绑定
- 1. 定时 保存 cluster 信息
- 2. 绑定 集群架构
- 1. eventmesh cluster
- 1. meta cluster 列表
- 1. runtime列表
- 2. 一份 runtime config
- 2. runtime cluster 列表
- 1. runtime
- 1. 每个 runtime config
- 2. runtime 的 acl
- 3. topic 列表
- 4. group
- 3. 存储 cluster 列表
+ 1. 定时 保存 cluster 信息
+ 2. 绑定 集群架构
+ 1. eventmesh cluster
1. meta cluster 列表
- 1. runtime列表
- 2. 一份 runtime config
+ 1. runtime列表
+ 2. 一份 runtime config
2. runtime cluster 列表
- 1. runtime
- 1. 每个 runtime config
- 2. user
- 3. acl
- 4. topic 列表
- 5. group 列表
- 2. 绑定 集群配置
- 3. 绑定 runtime 配置
- 4. 如果没有 resource 信息是不允许绑定的
- 5. 是否可以绑定 topic信息
- 6. 是否绑定 group 信息
- 7. 是否绑定 acl 信息
+ 1. runtime
+ 1. 每个 runtime config
+ 2. runtime 的 acl
+ 3. topic 列表
+ 4. group
+ 3. 存储 cluster 列表
+ 1. meta cluster 列表
+ 1. runtime列表
+ 2. 一份 runtime config
+ 2. runtime cluster 列表
+ 1. runtime
+ 1. 每个 runtime config
+ 2. user
+ 3. acl
+ 4. topic 列表
+ 5. group 列表
+ 2. 绑定 集群配置
+ 3. 绑定 runtime 配置
+ 4. 如果没有 resource 信息是不允许绑定的
+ 5. 是否可以绑定 topic信息
+ 6. 是否绑定 group 信息
+ 7. 是否绑定 acl 信息
3. case 修改就是创建
4. 在 runtime 点击编辑。TODO 不允许在在runtime编辑。
- 1. 只能 添加 resource
+ 1. 只能 添加 resource
5. 在 deploy 模块,添加
-6. deploy
- 1. 部署方案
- 2. 资源配置
- 3. 部署关系
+6. deploy
+ 1. 部署方案
+ 2. 资源配置
+ 3. 部署关系
7. 部署信息
- 1. 每个runtime 的部署 对应一个 资源信息
- 2. cluster 第一次部署对应一个部署信息
- 1. 这次
+ 1. 每个runtime 的部署 对应一个 资源信息
+ 2. cluster 第一次部署对应一个部署信息
+ 1. 这次
8.
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
index 8d137735..84cd684a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/handler/UpdateHandler.java
@@ -18,13 +18,20 @@
package org.apache.eventmesh.dashboard.console.controller.deploy.handler;
+import org.apache.eventmesh.dashboard.console.controller.deploy.base.DeployBeforeCheck;
+
/**
*
*/
-public interface UpdateHandler {
+public interface UpdateHandler extends DeployBeforeCheck {
void init();
void handler(T t);
+
+ @Override
+ default boolean check(T t) {
+ return true;
+ }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java
index cbcd273e..6d49f929 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/pause/PauseCluster.java
@@ -19,92 +19,23 @@
package org.apache.eventmesh.dashboard.console.controller.deploy.pause;
import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.base.AbstractUpdateHandler;
import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterAndRelationshipEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
-import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
-import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
-import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
-import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
-public class PauseCluster implements UpdateHandler {
-
- @Autowired
- private ClusterService clusterService;
-
- @Autowired
- private RuntimeService runtimeService;
-
- @Autowired
- private ClusterRelationshipService clusterRelationshipService;
-
-
- private List selfRuntimeList = new ArrayList<>();
-
- private List notSelfRuntimeList = new ArrayList<>();
-
+public class PauseCluster extends AbstractUpdateHandler implements UpdateHandler {
@Override
public void init() {
}
- /**
- * 关系解除,如果
- *
- * @param clusterEntity
- */
@Override
public void handler(ClusterEntity clusterEntity) {
-
- clusterEntity = this.clusterService.queryClusterById(clusterEntity);
-
- if (clusterEntity.getClusterType().isMeta()) {
- // 检查 meta 集群 是否被关联,如何被关联,就禁止删除
- ClusterRelationshipEntity clusterRelationshipEntity = new ClusterRelationshipEntity();
- clusterRelationshipEntity.setClusterId(clusterEntity.getId());
- List clusterRelationshipEntityList =
- this.clusterRelationshipService.queryClusterAndRelationshipEntityListByClusterId(clusterRelationshipEntity);
- if (!clusterRelationshipEntityList.isEmpty()) {
- // 打印结果
- return;
- }
- }
-
- RuntimeEntity runtimeEntity = new RuntimeEntity();
- runtimeEntity.setClusterId(clusterEntity.getId());
- ClusterAllMetadataDO clusterAllMetadata = this.runtimeService.queryAllByClusterId(runtimeEntity, true, true);
-
- clusterAllMetadata.getRuntimeEntityList().forEach(entity -> {
- // TODO
- if (entity.getTrusteeshipType().isSelf()) {
- entity.setDeployStatusType(DeployStatusType.PAUSE_FULL_WAIT);
- } else {
- entity.setStatus(1L);
- }
- });
-
- clusterAllMetadata.getClusterEntityList().forEach(entity -> {
-
- });
-
- if (clusterEntity.getClusterType().isMeta()) {
- // 得到 所有关联项目
-
- // 获得 所有关联项目的 存储 cluster
-
- //
- }
-
+ this.updateDeployStatus(clusterEntity, DeployStatusType.PAUSE);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java
index 82c66a83..8aa6fb52 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/relationship/RelationshipHandler.java
@@ -19,14 +19,18 @@
package org.apache.eventmesh.dashboard.console.controller.deploy.relationship;
import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.spring.support.register.BuildMetadataManage;
public class RelationshipHandler implements UpdateHandler {
+ private final BuildMetadataManage buildMetadataManage = new BuildMetadataManage();
+
private ClusterService clusterService;
private ClusterRelationshipService clusterRelationshipService;
@@ -39,16 +43,88 @@ public void init() {
}
+ /**
+ * TODO 如果是 替换关联,应该怎么做?
+ * kafka 的集群,接触,在关联上,时两个步骤,那么是两次,可以做到成一次
+ */
@Override
public void handler(ClusterRelationshipEntity clusterRelationshipEntity) {
+ ClusterEntity queryMainClusterEntity = new ClusterEntity();
+ queryMainClusterEntity.setId(clusterRelationshipEntity.getClusterId());
+ ClusterEntity mainClusterEntity = this.clusterService.queryClusterById(queryMainClusterEntity);
+
+ ClusterEntity queryRelationshipClusterEntity = new ClusterEntity();
+ queryRelationshipClusterEntity.setId(clusterRelationshipEntity.getRelationshipId());
+ ClusterEntity relationshipClusterEntity = this.clusterService.queryClusterById(queryRelationshipClusterEntity);
+
// 绑定 meta 集群, 那么下面所有的 runtime 集群,需要更新更新
- // 绑定 runtime 集群, main cluster 依赖的
+ // 绑定 runtime 集群, 这个 runtime 集群 需要获得绑定集群的 meta ,然后重启
+ // 绑定 存储集群
+ clusterRelationshipEntity.setClusterType(mainClusterEntity.getClusterType());
+ clusterRelationshipEntity.setRelationshipType(relationshipClusterEntity.getClusterType());
clusterRelationshipService.addClusterRelationshipEntry(clusterRelationshipEntity);
+ // 如果 relationship runtime 集群 不是 托管类型 不需要处理
+
+ // main cluster 与 relationship cluster 都不是 self 类型就不需要管
+ if (mainClusterEntity.getTrusteeshipType().isReverse() && relationshipClusterEntity.getTrusteeshipType().isReverse()) {
+ return;
+ }
+
+ if (mainClusterEntity.getClusterType().isEventCluster()) {
+ if (relationshipClusterEntity.getClusterType().isStorageCluster()) {
+ // 还要判断 main 集群 是否 支持 API 操作 meta cluster
+ if (mainClusterEntity.getTrusteeshipType().isReverse()) {
+ return;
+ }
+
+ // 查询 relationship 里面的 所有的 meta cluster 的 runtime list
+ // 查询 main cluster 里面 所有 runtime cluster 的 runtime list
+ // 查询 main cluster runtime list 的所有 meta 配置 ,追加配置
+ // 如果 main cluster 支持远程操作配置,等待 sync 模块同步
+ // 如果 main cluster 不支持...... 同时是self 模式,操作 k8s 更新 runtime list
+ return;
+ }
+ if (relationshipClusterEntity.getClusterType().isEventMethMeta()) {
+ // 得到 所有 eventmesh runtime cluster
+ // 得到 所有 eventmesh meta cluster
+ // 组件新的 注册中心地址
+ // 修改 eventmesh runtime 配置
+ // 修改 runtime entity 部署状态,为更新
+ return;
+ }
+ if (relationshipClusterEntity.getClusterType().isEventMethRuntime()) {
+ // 得到 所有 eventmesh meta
+ // 得到 该 runtime list
+ // 修改 runtime list config 的meta 配置
+ // 修改 runtime entity 部署状态,为更新
+ return;
+ }
+ return;
+ }
+
+ /*
+ 如果 main cluster 需要 relationship cluster 的 meta 集群 地址,则 runtime 集群需要重启
+
+ */
if (clusterRelationshipEntity.getRelationshipType().isMeta()) {
+ // 得到 所有 runtime cluster
+ // 得到 所有 meta cluster
+ // 组件新的 注册中心地址
+ // 修改 eventmesh runtime 配置
+ // 修改 runtime entity 部署状态,为更新
RuntimeEntity runtimeEntity = new RuntimeEntity();
runtimeEntity.setClusterId(clusterRelationshipEntity.getClusterId());
//runtimeService.queryOnlyRuntimeByClusterId(runtimeEntity);
+
+ // TODO 如果是 rocketmq 的 meta , 那么被关联的 eventmesh runtime cluster 需要更新 meta 地址
+ }
+ if (clusterRelationshipEntity.getRelationshipType().isRuntime()) {
+ // 查询 main cluster 里面 是否存在 meta cluster , 如果存在则需要更新
+
+ // 如果 没有 meta cluster 不需要查询 runtime 列表
+
+ // TODO 如果是 kafka 的 runtime , 那么被关联的 eventmesh runtime cluster 需要更新 kafka runtime 地址
}
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/start/StartClusterHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/start/StartClusterHandler.java
new file mode 100644
index 00000000..f4e91592
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/start/StartClusterHandler.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.controller.deploy.start;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.base.AbstractUpdateHandler;
+import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
+import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StartClusterHandler extends AbstractUpdateHandler implements UpdateHandler {
+
+ @Autowired
+ private ClusterAndRuntimeDomain clusterAndRuntimeDomain;
+
+ @Override
+ public void init() {
+
+ }
+
+ @Override
+ public void handler(ClusterEntity clusterEntity) {
+ this.updateDeployStatus(clusterEntity, DeployStatusType.CREATE);
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
index c6e8f90e..1b795a8d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallClusterHandler.java
@@ -18,18 +18,28 @@
package org.apache.eventmesh.dashboard.console.controller.deploy.uninstall;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.console.controller.deploy.base.AbstractUpdateHandler;
import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-public class UninstallClusterHandler implements UpdateHandler {
+import org.springframework.stereotype.Component;
+
+@Component
+public class UninstallClusterHandler extends AbstractUpdateHandler implements UpdateHandler {
+
@Override
public void init() {
}
+ /**
+ * 只需要 修改状态,通知删除 容器就行了
+ */
@Override
public void handler(ClusterEntity clusterEntity) {
+ this.updateDeployStatus(clusterEntity, DeployStatusType.UNINSTALL);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
index 987de5ea..6c8bd223 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/deploy/uninstall/UninstallRuntimeHandler.java
@@ -18,11 +18,22 @@
package org.apache.eventmesh.dashboard.console.controller.deploy.uninstall;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
import org.apache.eventmesh.dashboard.console.controller.deploy.handler.UpdateHandler;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
public class UninstallRuntimeHandler implements UpdateHandler {
+ @Autowired
+ private RuntimeService runtimeService;
+
@Override
public void init() {
@@ -30,6 +41,10 @@ public void init() {
@Override
public void handler(RuntimeEntity runtimeEntity) {
+ // 主从 架构 如果有从存在则不能操作主
+ // 直接修改 runtime 状态就行了
+ runtimeEntity.setDeployStatusType(DeployStatusType.UNINSTALL_ING);
+ this.runtimeService.batchUpdateDeployStatusType(List.of(runtimeEntity));
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
index ef38b02e..debbec02 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
@@ -19,51 +19,38 @@
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.DetailConfigsVO;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.UpdateConfigDTO;
+import org.apache.eventmesh.dashboard.console.mapstruct.message.ConfigControllerMapper;
+import org.apache.eventmesh.dashboard.console.model.dto.config.UpdateConfigDTO;
+import org.apache.eventmesh.dashboard.console.model.function.config.QueryByInstanceIdDTO;
import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
-import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
+@RequestMapping(("/user/config"))
public class ConfigController {
+ private static final ConfigControllerMapper INSTANCE = ConfigControllerMapper.INSTANCE;
+
@Autowired
private ConfigService configService;
@PostMapping("/cluster/config/updateConfigs")
public String updateConfigsByTypeAndId(@Validated @RequestBody UpdateConfigDTO updateConfigDTO) {
-
return "success";
}
- @PostMapping("/cluster/config/getInstanceDetailConfigs")
- public List getInstanceDetailConfigs(@Validated @RequestBody GetConfigsListDTO getConfigsListDTO) {
- List configEntityList = configService.selectToFront(getConfigsListDTO.getInstanceId(),
- getConfigsListDTO.getInstanceType(), getConfigsListDTO);
- Map stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType(),
- getConfigsListDTO.getInstanceId(), getConfigsListDTO.getInstanceType());
- ArrayList showDetailConfigsVOS = new ArrayList<>();
- configEntityList.forEach(n -> {
- DetailConfigsVO showDetailConfigsVO = new DetailConfigsVO();
- showDetailConfigsVO.setDefaultValue(stringStringConcurrentHashMap.get(n.getConfigName()));
- showDetailConfigsVO.setIsModify(n.getIsModify());
- showDetailConfigsVO.setConfigName(n.getConfigName());
- showDetailConfigsVO.setConfigValue(n.getConfigValue());
- showDetailConfigsVO.setAlreadyUpdate(n.getAlreadyUpdate());
- showDetailConfigsVOS.add(showDetailConfigsVO);
- });
- return showDetailConfigsVOS;
+ @PostMapping("/queryByInstanceId")
+ public List queryByInstanceId(@Validated @RequestBody QueryByInstanceIdDTO queryByInstanceIdDTO) {
+ return configService.queryByInstanceId(INSTANCE.queryByInstanceId(queryByInstanceIdDTO));
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
index f3d0b5aa..9abec7e9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
@@ -19,7 +19,7 @@
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.HealthCheckResultEntity;
-import org.apache.eventmesh.dashboard.console.modle.vo.health.InstanceLiveProportionVo;
+import org.apache.eventmesh.dashboard.console.model.vo.health.InstanceLiveProportionVo;
import org.apache.eventmesh.dashboard.console.service.function.HealthDataService;
import java.time.LocalDateTime;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
index 525de4fd..e05ee3b8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
@@ -19,7 +19,7 @@
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.log.GetLogListDTO;
import org.apache.eventmesh.dashboard.console.service.function.LogService;
import java.util.List;
@@ -41,4 +41,5 @@ public List getLogLIstToFront(@Validated @RequestBody GetLogListDTO g
return logService.getLogListByCluster(getLogListDTO);
}
+
}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
index 46e49209..f439723e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/OverviewController.java
@@ -20,7 +20,7 @@
package org.apache.eventmesh.dashboard.console.controller.function;
-import org.apache.eventmesh.dashboard.console.modle.function.OverviewDTO;
+import org.apache.eventmesh.dashboard.console.model.function.OverviewDTO;
import org.apache.eventmesh.dashboard.console.service.OverviewService;
import java.util.Map;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
index d1d58026..24045fb2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
@@ -16,14 +16,14 @@
*/
-
package org.apache.eventmesh.dashboard.console.controller.message;
import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
+import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.cluster.GroupControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.RuntimeIdDTO;
import org.apache.eventmesh.dashboard.console.service.message.GroupService;
import java.util.List;
@@ -39,7 +39,7 @@
*
*/
@RestController
-@RequestMapping("group")
+@RequestMapping("/user/group")
public class GroupController {
@@ -51,6 +51,13 @@ public List queryGroupListByClusterId(@RequestBody @Validated Runti
return groupService.getGroupByClusterId(GroupControllerMapper.INSTANCE.queryGroupListByClusterId(runtimeIdDTO));
}
+ @PostMapping("queryGroupListByTopicId")
+ public List queryGroupListByTopicId(@RequestBody @Validated IdDTO idDTO) {
+ TopicEntity topicEntity = new TopicEntity();
+ topicEntity.setId(idDTO.getId());
+ return groupService.queryGroupListByTopicId(topicEntity);
+ }
+
@PostMapping("deleteGroupById")
public Integer deleteGroupById(@RequestBody @Validated IdDTO idDTO) {
return groupService.deleteGroup(GroupControllerMapper.INSTANCE.deleteGroupById(idDTO));
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
index a726dbcf..322bfca6 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupRelationshipController.java
@@ -21,7 +21,7 @@
import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
import java.util.List;
@@ -35,7 +35,6 @@
public class GroupRelationshipController {
-
public List queryTopicByGroupId(@RequestBody @Validated IdDTO idDTO) {
return null;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
index bfdddc44..b7305969 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/OffsetOperateController.java
@@ -20,8 +20,8 @@
import org.apache.eventmesh.dashboard.console.domain.OperationRangeDomain;
-import org.apache.eventmesh.dashboard.console.modle.message.offset.QueryOffsetByMessageMetadataDTO;
-import org.apache.eventmesh.dashboard.console.modle.message.offset.ResetOffsetDTO;
+import org.apache.eventmesh.dashboard.console.model.message.offset.QueryOffsetByMessageMetadataDTO;
+import org.apache.eventmesh.dashboard.console.model.message.offset.ResetOffsetDTO;
import org.apache.eventmesh.dashboard.service.remoting.OffsetRemotingService;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
index 5a63bd12..ad50249b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
@@ -21,16 +21,18 @@
import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
-import org.apache.eventmesh.dashboard.console.controller.ClusterAbitityService;
+import org.apache.eventmesh.dashboard.console.controller.ClusterAbilityService;
+import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterMetadataDomain;
import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterOperationHandler;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
import org.apache.eventmesh.dashboard.console.mapstruct.message.TopicControllerMapper;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.topic.CreateTopicDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.topic.GetTopicListDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.topic.TopicDetailGroupVO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.QueryClusterInSyncDO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.topic.CreateTopicDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.topic.GetTopicListDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.RuntimeIdDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.topic.TopicDetailGroupVO;
import org.apache.eventmesh.dashboard.console.service.message.TopicService;
import java.util.ArrayList;
@@ -44,8 +46,11 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+
@RestController
-@RequestMapping("topic")
+@RequestMapping("/user/topic")
public class TopicController {
@Autowired
@@ -53,93 +58,57 @@ public class TopicController {
@Autowired
- private ClusterAbitityService clusterAbitityService;
+ private ClusterAbilityService clusterAbilityService;
@Autowired
private ClusterMetadataDomain clusterMetadataDomain;
- /**
- * @param getTopicListDTO
- * @return
- */
+ @Autowired
+ private ClusterAndRuntimeDomain clusterAndRuntimeDomain;
+
@PostMapping("/queryTopicListByClusterId")
public List queryTopicListByClusterId(@Validated @RequestBody GetTopicListDTO getTopicListDTO) {
// cap 的直接查询
- if (this.clusterAbitityService.isCAP(getTopicListDTO)) {
- topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
+ Page> page = PageHelper.getLocalPage();
+ PageHelper.clearPage();
+ boolean isCap = this.clusterAbilityService.isCap(getTopicListDTO);
+ PageHelper.startPage(page.getPageNum(), page.getPageSize()).setOrderBy(page.getOrderBy());
+ if (isCap) {
+ return topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
}
// 非 CAP 另外查询
return topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
}
- @PostMapping("queryTopicListById ")
+
+ @PostMapping("queryTopicListById")
public TopicEntity queryTopicById(@Validated @RequestBody RuntimeIdDTO runtimeIdDTO) {
TopicEntity topicEntity = topicService.selectTopicById(TopicControllerMapper.INSTANCE.queryTopicListById(runtimeIdDTO));
- if (this.clusterAbitityService.isCAP(topicEntity)) {
+ if (this.clusterAbilityService.isCapByEntity(topicEntity)) {
return topicEntity;
}
- //
- List queryList = new ArrayList<>();
- // 如果 是 eventmesh 集群。 得到 eventmesh 所有 runtime , 所有存储
- clusterMetadataDomain.operation(topicEntity.getClusterId(), new ClusterOperationHandler() {
-
- @Override
- public void handler(RuntimeMetadata baseSyncBase) {
- TopicEntity topicEntity = new TopicEntity();
- queryList.add(topicEntity);
- topicEntity.setClusterId(baseSyncBase.getClusterId());
- topicEntity.setClusterType(baseSyncBase.getClusterType());
- topicEntity.setRuntimeId(baseSyncBase.getId());
- topicEntity.setTopicName(topicEntity.getTopicName());
- }
-
- @Override
- public void handler(ClusterMetadata clusterDO) {
- TopicEntity topicEntity = new TopicEntity();
- queryList.add(topicEntity);
- topicEntity.setClusterId(clusterDO.getClusterId());
- topicEntity.setClusterType(clusterDO.getClusterType());
- topicEntity.setRuntimeId(clusterDO.getClusterId());
- topicEntity.setTopicName(topicEntity.getTopicName());
- }
- });
-
-
-
- topicService.queryRuntimeByBaseSyncEntity(queryList);
+ topicService.queryRuntimeByBaseSyncEntity(
+ this.clusterAndRuntimeDomain.queryClusterInSync(QueryClusterInSyncDO.create(topicEntity.getClusterId(), () -> {
+ TopicEntity entity = new TopicEntity();
+ entity.setTopicName(topicEntity.getTopicName());
+ return entity;
+ })));
return null;
}
@GetMapping("deleteTopic")
public Integer deleteTopic(@Validated @RequestBody IdDTO idDTO) {
TopicEntity topicEntity = this.topicService.selectTopicById(TopicControllerMapper.INSTANCE.deleteTopic(idDTO));
- if (this.clusterAbitityService.isCAP(topicEntity)) {
+ if (this.clusterAbilityService.isCapByEntity(topicEntity)) {
return this.topicService.deleteTopicById(topicEntity);
}
- // 通过 clusterId,runtime id, topic name 删除
-
- List deleteList = new ArrayList<>();
- // 如果 是 eventmesh 集群。 得到 eventmesh 所有 runtime , 所有存储
- clusterMetadataDomain.operation(topicEntity.getClusterId(), new ClusterOperationHandler() {
-
- @Override
- public void handler(RuntimeMetadata baseSyncBase) {
- TopicEntity topicEntity = new TopicEntity();
- deleteList.add(topicEntity);
- topicEntity.setClusterId(baseSyncBase.getClusterId());
- topicEntity.setClusterType(baseSyncBase.getClusterType());
- topicEntity.setRuntimeId(baseSyncBase.getId());
- }
- @Override
- public void handler(ClusterMetadata clusterDO) {
- TopicEntity topicEntity = new TopicEntity();
- deleteList.add(topicEntity);
- topicEntity.setClusterId(clusterDO.getClusterId());
- topicEntity.setClusterType(clusterDO.getClusterType());
- }
- });
- return topicService.deleteTopicByRuntimeIdAndTopicName(deleteList);
+ return topicService.deleteTopicByRuntimeIdAndTopicName(
+ this.clusterAndRuntimeDomain.queryClusterInSync(QueryClusterInSyncDO.create(topicEntity.getClusterId(), () -> {
+ TopicEntity entity = new TopicEntity();
+ entity.setTopicName(topicEntity.getTopicName());
+ return entity;
+ })));
}
@PostMapping("createTopic")
@@ -169,12 +138,7 @@ public void handler(ClusterMetadata clusterDO) {
this.topicService.batchInsert(createTopicList);
}
- /**
- * TODO delete
- *
- * @param topicId
- * @return
- */
+ @Deprecated
@GetMapping("/cluster/topic/getTopicDetailGroups")
public List getTopicDetailGroups(Long topicId) {
return topicService.getTopicDetailGroups(topicId);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
index 0aa12223..9138fa6a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/ClusterAndRuntimeDomain.java
@@ -19,9 +19,24 @@
package org.apache.eventmesh.dashboard.console.domain;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.ClusterAndRuntimeOfRelationshipDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.GetClusterInSyncReturnDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.QueryClusterInSyncDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.QueryClusterTreeDO;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.ClusterTreeVO;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
+import java.util.function.Supplier;
+
+import com.alibaba.fastjson.JSON;
/**
*
@@ -29,11 +44,66 @@
public interface ClusterAndRuntimeDomain {
+ List getClusterByClusterId(ClusterEntity clusterEntity);
+
+ List queryClusterTree(QueryClusterTreeDO data);
+
+ ClusterAndRuntimeOfRelationshipDO getAllClusterAndRuntimeByCluster(ClusterEntity clusterEntity, DeployStatusType deployStatusType);
+
+ GetClusterInSyncReturnDO queryClusterInSync(ClusterEntity clusterEntity, List syncClusterTypeList);
+
+ default T queryClusterInSync(QueryClusterInSyncDO data) {
+ GetClusterInSyncReturnDO getClusterInSyncReturnDO = this.queryClusterInSync(data.getClusterEntity(), data.getSyncClusterTypeList());
+ if (Objects.isNull(getClusterInSyncReturnDO.getClusterEntityList())
+ && Objects.isNull(getClusterInSyncReturnDO.getRuntimeEntityList())) {
+ throw new RuntimeException("");
+ }
+ /*
+ * 如果 entity 的就直接调用。 是 core 的需要转换一次。
+ * 目前只有 core 的, 没有 entity 的
+ *
+ * 转两次,虽然有性能损失,对于一个运维系统意义不大。
+ */
+ if (Objects.nonNull(data.getClusterOperationHandler())) {
+ getClusterInSyncReturnDO.getRuntimeEntityList().forEach(runtimeEntity -> {
+ RuntimeMetadata runtimeMetadata = new RuntimeMetadata();
+ data.getClusterOperationHandler().handler(runtimeMetadata);
+ });
+ getClusterInSyncReturnDO.getClusterEntityList().forEach(entity -> {
+ ClusterMetadata clusterMetadata = new ClusterMetadata();
+ data.getClusterOperationHandler().handler(clusterMetadata);
+ });
+ return null;
+ }
+ Supplier function =
+ Objects.nonNull(data.getFunction()) ? data.getFunction() : this.createBaseRuntimeIdEntity(data.getObject());
+ List runtimeIdEntityList =
+ new ArrayList<>(getClusterInSyncReturnDO.getClusterEntityList().size() + getClusterInSyncReturnDO.getRuntimeEntityList().size());
- List getClusterByCLusterId(ClusterEntity clusterEntity);
+ getClusterInSyncReturnDO.getClusterEntityList().forEach(clusterEntity -> {
+ BaseRuntimeIdEntity baseRuntimeIdEntity = function.get();
+ runtimeIdEntityList.add(baseRuntimeIdEntity);
+ baseRuntimeIdEntity.setClusterId(clusterEntity.getId());
+ baseRuntimeIdEntity.setClusterType(clusterEntity.getClusterType());
+ baseRuntimeIdEntity.setRuntimeId(clusterEntity.getId());
+ });
+ getClusterInSyncReturnDO.getRuntimeEntityList().forEach(runtimeEntity -> {
+ BaseRuntimeIdEntity baseRuntimeIdEntity = function.get();
+ runtimeIdEntityList.add(baseRuntimeIdEntity);
+ baseRuntimeIdEntity.setClusterId(runtimeEntity.getClusterId());
+ baseRuntimeIdEntity.setClusterType(runtimeEntity.getClusterType());
+ baseRuntimeIdEntity.setRuntimeId(runtimeEntity.getId());
+ });
+ return (T) runtimeIdEntityList;
+ }
+ default Supplier createBaseRuntimeIdEntity(Object object) {
+ String json = JSON.toJSONString(object);
+ Class> clazz = object.getClass();
+ return () -> (BaseRuntimeIdEntity) JSON.parseObject(json, clazz);
+ }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
index 67fa472e..8ff44639 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/Impl/ClusterAndRuntimeDomainImpl.java
@@ -18,16 +18,471 @@
package org.apache.eventmesh.dashboard.console.domain.Impl;
+import org.apache.eventmesh.dashboard.common.enums.ClusterFramework;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
import org.apache.eventmesh.dashboard.console.domain.ClusterAndRuntimeDomain;
+import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.model.entity.ClusterEntityMapstruct;
+import org.apache.eventmesh.dashboard.console.mapstruct.model.entity.RuntimeEntityMapstruct;
+import org.apache.eventmesh.dashboard.console.model.DO.clusterRelationship.QueryListByClusterIdAndTypeDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.ClusterAndRuntimeOfRelationshipDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.GetClusterInSyncReturnDO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.QueryClusterTreeDO;
+import org.apache.eventmesh.dashboard.console.model.QO.cluster.QueryRelationClusterByClusterIdListAndType;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.ClusterTreeVO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterRelationshipService;
+import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
+import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
+import org.apache.eventmesh.dashboard.console.service.connector.ResourcesConfigService;
-import java.util.Collections;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.commons.lang3.tuple.Triple;
+
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import lombok.Setter;
+/**
+ * TODO 1. 这个类提供 cluster 和 runtime 的关系 以及 树结构
+ * 2. 其他 domain , 通过该 domain 获得 操作对象
+ * 3. 这个与 类 其实与 ColonyDO 域冲突了。 两个 domain 功能基本重叠了。
+ * 1. ColonyDO 的 QueueConditionHandler 没有 实现好,没有 SQL 的查询效果好。
+ * 2. 后期加强 QueueConditionHandler
+ * 4. 本域 是否 与 ColonyDO 统一,设计一个统一接口。
+ * TODO
+ * 这个类主要是在主要在一下域使用:
+ * 1. 部署 需要整体关系
+ * 2. 运维 只需要 可操作节点
+ * 3. 关系可视化 需要整体关系
+ */
+@Component
public class ClusterAndRuntimeDomainImpl implements ClusterAndRuntimeDomain {
+ @Autowired
+ private ClusterService clusterService;
+
+ @Autowired
+ private RuntimeService runtimeService;
+
+
+ @Autowired
+ private ClusterRelationshipService clusterRelationshipService;
+
+ @Autowired
+ private ResourcesConfigService resourcesConfigService;
+
+
+ @Override
+ public List getClusterByClusterId(ClusterEntity clusterEntity) {
+ return List.of();
+ }
+
+ @Override
+ public List queryClusterTree(QueryClusterTreeDO data) {
+ GetSyncObjectHandler getSyncObjectHandler = new GetSyncObjectHandler();
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity.setId(data.getClusterId());
+ getSyncObjectHandler.setClusterEntity(clusterEntity);
+ if (Objects.nonNull(data.getDeployStatusType())) {
+ getSyncObjectHandler.setDeployStatusType(data.getDeployStatusType().get(0));
+ }
+ return this.queryClusterTree(getSyncObjectHandler.queryClusterAndRuntime());
+ }
+
+ /**
+ * 这个方法是否放到 controller 层
+ */
+ public List queryClusterTree(ClusterAndRuntimeOfRelationshipDO data) {
+ Map clusterIdMap = data.getClusterEntityList().stream().collect(Collectors.toMap(ClusterEntity::getId,
+ ClusterEntityMapstruct.INSTANCE::toClusterTreeVO));
+
+ Map> runtimeListByClusterIdGroupMap =
+ data.getRuntimeEntityList().stream()
+ .collect(Collectors.groupingBy(RuntimeEntity::getClusterId,
+ Collectors.mapping(RuntimeEntityMapstruct.INSTANCE::toClusterTreeVO,
+ Collectors.toList())));
+
+ Map> clusterRelationshipListByClusterIdGroupMap =
+ data.getClusterRelationshipEntityList().stream().collect(Collectors.groupingBy(ClusterRelationshipEntity::getClusterId,
+ Collectors.mapping(value -> clusterIdMap.get(value.getRelationshipId()), Collectors.toList())
+ ));
+
+ clusterIdMap.forEach((key, value) -> {
+ value.setChildren(runtimeListByClusterIdGroupMap.get(key));
+ List clusterTreeVOList = clusterRelationshipListByClusterIdGroupMap.get(key);
+ if (Objects.nonNull(clusterTreeVOList)) {
+ value.setChildren(clusterTreeVOList);
+ }
+ });
+
+ return clusterRelationshipListByClusterIdGroupMap.get(data.getClusterEntity().getId());
+ }
+
+ /**
+ * 运维操作使用列表:
+ *
+ * 部署操作使用列表:
+ *
+ * @see org.apache.eventmesh.dashboard.console.controller.deploy.uninstall.UninstallClusterHandler
+ * @see org.apache.eventmesh.dashboard.console.controller.deploy.create.CreateClusterByCopyHandler
+ * @see org.apache.eventmesh.dashboard.console.controller.deploy.relationship.RelationshipHandler
+ * @see org.apache.eventmesh.dashboard.console.controller.deploy.relationship.UnRelationshipHandler
+ * @see org.apache.eventmesh.dashboard.console.controller.deploy.pause.PauseCluster
+ */
+ @Override
+ public ClusterAndRuntimeOfRelationshipDO getAllClusterAndRuntimeByCluster(ClusterEntity clusterEntity, DeployStatusType deployStatusType) {
+ GetSyncObjectHandler getSyncObjectHandler = new GetSyncObjectHandler();
+ getSyncObjectHandler.setClusterEntity(clusterEntity);
+ getSyncObjectHandler.setDeployStatusType(deployStatusType);
+ return getSyncObjectHandler.deploy();
+ }
+
+
+ /**
+ * 修改配置只能在一个维度的进行操作 topic 需要对 eventmesh 与 存储同时进行操作, acl 需要多维度操作,还是? offset 的操作 按照具体 offset,只能操作 队列 级别 按照 最大或则最小 和 时间,可以 是 大集群 或则 全域操作 定义操作域
+ */
@Override
- public List getClusterByCLusterId(ClusterEntity clusterEntity) {
- return Collections.emptyList();
+ public GetClusterInSyncReturnDO queryClusterInSync(ClusterEntity clusterEntity, List syncClusterTypeList) {
+ GetSyncObjectHandler getSyncObjectHandler = new GetSyncObjectHandler();
+ getSyncObjectHandler.setClusterEntity(clusterEntity);
+ getSyncObjectHandler.setSyncClusterTypeList(syncClusterTypeList);
+
+ return getSyncObjectHandler.sync();
+ }
+
+ class GetSyncObjectHandler {
+
+ private final List clusterRelationshipEntityList = new ArrayList<>();
+ @Setter
+ private ClusterEntity clusterEntity;
+ @Setter
+ private DeployStatusType deployStatusType;
+ private ClusterType clusterType;
+ /**
+ * 修改 eventmesh 空间下 所有 存储集群
+ */
+ @Setter
+ private List syncClusterTypeList;
+ private List independenceClusterList = new ArrayList<>();
+ private List clusterEntityList = new ArrayList<>();
+
+ private List capClusterList = new ArrayList<>();
+
+ private List runtimeList;
+
+ private void base(boolean isSync) {
+ this.clusterEntity = clusterService.queryClusterById(clusterEntity);
+ this.clusterType = clusterEntity.getClusterType();
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
+ if (clusterFramework.isCAP() && isSync) {
+ return;
+ }
+ if (this.clusterType.isRuntime()) {
+ this.queryRuntimeByClusterId();
+ return;
+ }
+ this.queryClusterRelationship();
+ this.queryClusterByRelationship();
+ }
+
+
+ private ClusterAndRuntimeOfRelationshipDO createClusterAndRuntimeOfRelationshipDO() {
+ ClusterAndRuntimeOfRelationshipDO clusterAndRuntimeOfRelationshipDO = new ClusterAndRuntimeOfRelationshipDO();
+ clusterAndRuntimeOfRelationshipDO.setClusterEntity(this.clusterEntity);
+ clusterAndRuntimeOfRelationshipDO.setClusterEntityList(this.clusterEntityList);
+ clusterAndRuntimeOfRelationshipDO.setRuntimeEntityList(this.runtimeList);
+ clusterAndRuntimeOfRelationshipDO.setClusterRelationshipEntityList(this.clusterRelationshipEntityList);
+ return clusterAndRuntimeOfRelationshipDO;
+ }
+
+
+ public ClusterAndRuntimeOfRelationshipDO queryClusterAndRuntime() {
+ this.base(false);
+ this.queryRuntimeByClusterList();
+ return this.createClusterAndRuntimeOfRelationshipDO();
+ }
+
+
+ public ClusterAndRuntimeOfRelationshipDO deploy() {
+ this.base(false);
+ if (this.clusterType.isRuntime()) {
+ ClusterAndRuntimeOfRelationshipDO clusterAndRuntimeOfRelationshipDO = this.createClusterAndRuntimeOfRelationshipDO();
+ clusterAndRuntimeOfRelationshipDO.getRuntimeEntityPairList().add(Pair.of(this.clusterEntity, this.runtimeList));
+ return clusterAndRuntimeOfRelationshipDO;
+ }
+ this.queryRuntimeByClusterList();
+ // 组织关系
+ return this.structureRelationship();
+ }
+
+
+ public GetClusterInSyncReturnDO sync() {
+ this.base(true);
+ if (this.clusterType.isRuntime()) {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterEntity.getClusterType());
+ if (clusterFramework.isCAP()) {
+ this.capClusterList = List.of(this.clusterEntity);
+ }
+ } else {
+ this.filerSyncObject();
+ this.queryRuntimeByIndependenceClusterList();
+ }
+ GetClusterInSyncReturnDO syncReturnDO = new GetClusterInSyncReturnDO();
+ syncReturnDO.setClusterEntityList(this.capClusterList);
+ syncReturnDO.setRuntimeEntityList(this.runtimeList);
+ return syncReturnDO;
+ }
+
+ private ClusterAndRuntimeOfRelationshipDO structureRelationship() {
+ ClusterAndRuntimeOfRelationshipDO clusterAndRuntimeOfRelationshipDO = this.createClusterAndRuntimeOfRelationshipDO();
+ if (this.deployStatusType != DeployStatusType.CREATE) {
+ return clusterAndRuntimeOfRelationshipDO;
+ }
+ Map clusterEntityMap =
+ this.clusterEntityList.stream().collect(Collectors.toMap(ClusterEntity::getId, Function.identity()));
+
+ Map> runtimeListByClusterIdMap = new HashMap<>();
+ Map> clusterListByClusterIdMap = new HashMap<>();
+ this.clusterRelationshipEntityList.forEach(relation -> {
+ ClusterEntity mainClusterEntity = clusterEntityMap.get(relation.getClusterId());
+ ClusterEntity relationshipClusterEntity = clusterEntityMap.get(relation.getRelationshipId());
+
+ Triple triple =
+ Triple.of(relation, mainClusterEntity, relationshipClusterEntity);
+ clusterAndRuntimeOfRelationshipDO.getClusterRelationshipTripleList().add(triple);
+
+ if (relationshipClusterEntity.getClusterType().isRuntime()) {
+ runtimeListByClusterIdMap.computeIfAbsent(relationshipClusterEntity.getClusterId(), k -> {
+ List runtimeEntityList = new ArrayList<>();
+ clusterAndRuntimeOfRelationshipDO.getRuntimeEntityPairList().add(Pair.of(relationshipClusterEntity, runtimeEntityList));
+ return runtimeEntityList;
+ });
+ }
+ clusterListByClusterIdMap.computeIfAbsent(mainClusterEntity.getClusterId(), k -> {
+ List clusterEntityList = new ArrayList<>();
+ clusterAndRuntimeOfRelationshipDO.getClusterEntityPairleList().add(Pair.of(mainClusterEntity, clusterEntityList));
+ return clusterEntityList;
+ });
+ });
+
+ this.clusterEntityList.forEach(clusterEntity -> {
+ List list = clusterListByClusterIdMap.get(clusterEntity.getId());
+ if (Objects.nonNull(list)) {
+ list.add(clusterEntity);
+ }
+ });
+
+ this.runtimeList.forEach(runtimeEntity -> {
+ List list = runtimeListByClusterIdMap.get(runtimeEntity.getId());
+ if (Objects.nonNull(list)) {
+ list.add(runtimeEntity);
+ }
+ });
+
+ if (Objects.equals(deployStatusType, DeployStatusType.CREATE_COPY)) {
+ this.copy(clusterAndRuntimeOfRelationshipDO);
+ }
+
+ return clusterAndRuntimeOfRelationshipDO;
+ }
+
+ private void copy(ClusterAndRuntimeOfRelationshipDO clusterAndRuntimeOfRelationshipDO) {
+ if (!Objects.equals(deployStatusType, DeployStatusType.CREATE_COPY)) {
+ return;
+ }
+ List resourcesConfigEntityList =
+ resourcesConfigService.queryByRuntimeList(this.runtimeList);
+
+ Map resourcesConfigEntityMap = new HashMap<>();
+ resourcesConfigEntityList.forEach(resourcesConfigEntity -> {
+ resourcesConfigEntityMap.put(resourcesConfigEntity.getId(), resourcesConfigEntity);
+ });
+
+ clusterAndRuntimeOfRelationshipDO.setResourceData(new ArrayList<>());
+ clusterAndRuntimeOfRelationshipDO.setClusterResourcesList(new ArrayList<>());
+ Map>> longPairMap = new HashMap<>();
+ Map> clusterIdAndResourcesMap = new HashMap<>();
+ this.runtimeList.forEach(runtimeEntity -> {
+ Pair pair =
+ Pair.of(runtimeEntity, resourcesConfigEntityMap.get(runtimeEntity.getResourcesConfigId()));
+ longPairMap.computeIfAbsent(runtimeEntity.getClusterId(), k -> new ArrayList<>()).add(pair);
+
+ clusterIdAndResourcesMap.computeIfAbsent(runtimeEntity.getClusterId(), k -> new ArrayList<>())
+ .add(resourcesConfigEntityMap.get(runtimeEntity.getResourcesConfigId()));
+ });
+
+ }
+
+ public void getEventSpace() {
+ /*
+ 查询 eventmesh 集群 里面 eventmesh 相关集群
+ storage 有一份,那么 eventmesh 也要有一份。至于 eventmesh 的是否执行,另外说。
+ TODO 这里需要有一个任务,对比 eventmesh 与 storage 的相关配置是否一样,不一样就补充
+ 这个对比在数据数据的对比,不在 sync 行为进行
+ 比如 新增集群,激活集群,集群上线等造成,会造成 eventmesh 与 storage 数据不一样。
+ 这样需要把 eventmesh 的数据 与 storage 的数据 进行一次对比,保证一样
+ */
+ // 分类集群
+ List oneClusterList = clusterService.queryRelationClusterByClusterIdAndType(clusterEntity);
+ List notDefinitionClusterList = new ArrayList<>(oneClusterList);
+ // 查询 eventmesh 里面 存储集群
+ List clusterEntityList = clusterService.queryStorageClusterByEventMeshId(clusterEntity);
+ }
+
+ public void getDefinition() {
+ // 查询是否存
+ List reationClusterList = clusterService.queryRelationClusterByClusterIdAndType(clusterEntity);
+ List definitionClusterList = new ArrayList<>();
+ reationClusterList.forEach(value -> {
+ ClusterType storageClusterType = value.getClusterType();
+ if (!storageClusterType.isDefinition()) {
+ /*
+ 目前来说 definition 的 storage 集群 只有 rocketmq(还有关系型数据库),
+ 如果认为 definition 即 主从集群,那么认 definition
+ */
+ definitionClusterList.add(value);
+ } else {
+ capClusterList.add(value);
+ }
+ });
+ if (definitionClusterList.isEmpty()) {
+ QueryRelationClusterByClusterIdListAndType queryRelationClusterByClusterIdListAndType =
+ new QueryRelationClusterByClusterIdListAndType();
+ queryRelationClusterByClusterIdListAndType.setClusterEntityList(definitionClusterList);
+ queryRelationClusterByClusterIdListAndType.setClusterTypeList(syncClusterTypeList);
+ List definitionQueryRelustClusternList =
+ clusterService.queryRelationClusterByClusterIdListAndType(queryRelationClusterByClusterIdListAndType);
+ capClusterList.addAll(definitionQueryRelustClusternList);
+ }
+ }
+
+ public void getRuntimeByCluster() {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterEntity.getId());
+ this.runtimeList = runtimeService.queryRuntimeToFrontByClusterId(runtimeEntity);
+ }
+
+ private void filerSyncObject() {
+ this.clusterEntityList.forEach(value -> {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType());
+ if (clusterFramework.isCAP() || clusterFramework.isCP()) {
+ capClusterList.add(value);
+ } else if (clusterFramework.isIndependence()) {
+ independenceClusterList.add(value);
+ }
+ });
+ }
+
+ private void queryRuntimeByClusterId() {
+ RuntimeEntity runtimeEntity = new RuntimeEntity();
+ runtimeEntity.setClusterId(clusterEntity.getId());
+ this.runtimeList = runtimeService.queryRuntimeToFrontByClusterId(runtimeEntity);
+ }
+
+ private void queryRuntimeByIndependenceClusterList() {
+ if (!this.independenceClusterList.isEmpty()) {
+ this.runtimeList = runtimeService.queryRuntimeToFrontByClusterIdList(this.independenceClusterList);
+ }
+ }
+
+ private void queryRuntimeByClusterList() {
+ if (!this.clusterEntityList.isEmpty()) {
+ this.runtimeList = runtimeService.queryRuntimeToFrontByClusterIdList(this.clusterEntityList);
+ }
+ }
+
+
+ private void queryClusterByRelationship() {
+ List clsuterEnttiyList = this.clusterRelationshipEntityList.stream().map(value -> {
+ ClusterEntity entity = new ClusterEntity();
+ entity.setId(value.getRelationshipId());
+ return entity;
+ }).toList();
+ this.clusterEntityList = clusterService.queryClusterListByClusterList(clsuterEnttiyList);
+ }
+
+ private void queryClusterRelationship() {
+ QueryListByClusterIdAndTypeDO queryListByClusterIdAndTypeDO = new QueryListByClusterIdAndTypeDO();
+ queryListByClusterIdAndTypeDO.setClusterId(this.clusterEntity.getId());
+ queryListByClusterIdAndTypeDO.setClusterTypeList(this.syncClusterTypeList);
+
+ /*
+ * TODO 只能通过 代码 过滤需要的 clusterType, 除非 能从 syncClusterTypeList 得到 DEFINITION 与 目标类型
+ * 前端如何操作,
+ */
+ List relationshipEntityList =
+ clusterRelationshipService.queryListByClusterIdAndType(queryListByClusterIdAndTypeDO);
+ this.clusterRelationshipEntityList.addAll(relationshipEntityList);
+ for (; ; ) {
+ List idList = relationshipEntityList.stream().map(ClusterRelationshipEntity::getRelationshipId).toList();
+ queryListByClusterIdAndTypeDO.setClusterIdList(idList);
+ relationshipEntityList = clusterRelationshipService.queryListByClusterIdListAndType(queryListByClusterIdAndTypeDO);
+ if (relationshipEntityList.isEmpty()) {
+ break;
+ }
+ this.clusterRelationshipEntityList.addAll(relationshipEntityList);
+ }
+ }
+
+ /**
+ * TODO for 循环查询 所有 cluster ,不想 怕有 性能 问题,造成 bug。
+ * queryClusterRelationship 可以代替这个 方法
+ */
+ private void queryCluster() {
+ // 构建第一次查询对象
+ QueryRelationClusterByClusterIdListAndType queryRelationClusterByClusterIdListAndType =
+ new QueryRelationClusterByClusterIdListAndType();
+ queryRelationClusterByClusterIdListAndType.setClusterTypeList(syncClusterTypeList);
+ List clusterEntityList = new ArrayList<>();
+ queryRelationClusterByClusterIdListAndType.setClusterEntityList(clusterEntityList);
+ clusterEntityList.add(clusterEntity);
+ /*
+ 循环查询所有 cluster
+ 目前循环四次就行了,
+ 需要去重,应为 有共享集群的存在
+ TODO 如何 识别 目标对象
+ */
+ for (int i = 0; i < 5; i++) {
+ List reationClusterList =
+ clusterService.queryRelationClusterByClusterIdListAndType(queryRelationClusterByClusterIdListAndType);
+
+ List definitionClusterList = new ArrayList<>();
+ reationClusterList.forEach(value -> {
+ ClusterType storageClusterType = value.getClusterType();
+ if (!storageClusterType.isDefinition()) {
+ /*
+ *目前来说 definition 的 storage 集群 只有 rocketmq(还有关系型数据库),
+ *如果认为 definition 即 主从集群,那么认 definition
+ */
+ definitionClusterList.add(value);
+ } else {
+ ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(value.getClusterType());
+ if (clusterFramework.isCAP() || clusterFramework.isCP()) {
+ capClusterList.add(value);
+ } else if (clusterFramework.isIndependence()) {
+ independenceClusterList.add(value);
+ }
+ }
+ });
+ if (definitionClusterList.isEmpty()) {
+ return;
+ }
+ queryRelationClusterByClusterIdListAndType.setClusterEntityList(definitionClusterList);
+ }
+ }
}
-}
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java
index e08c9fae..eb32aabd 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/OperationRangeDomain.java
@@ -25,8 +25,8 @@
import org.apache.eventmesh.dashboard.console.entity.base.BaseSyncEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.modle.deploy.ClusterAllMetadataDO;
-import org.apache.eventmesh.dashboard.console.modle.dto.operation.OperationBaseDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.ClusterAllMetadataDO;
+import org.apache.eventmesh.dashboard.console.model.dto.operation.OperationBaseDTO;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
import org.apache.eventmesh.dashboard.console.service.cluster.RuntimeService;
@@ -43,24 +43,21 @@
/**
* 可以得到返回的数据为两种: 1. 写入数据的 2. 直接请求其他组件
+ * TODO 可能需要会被作废 与 ClusterAndRuntimeDomainImpl 冲突
+ * 等于 又又重构一次..... 浪费两个星期
*/
@Component
+@Deprecated
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class OperationRangeDomain {
+ private final Set clusterTypeSet = new HashSet<>();
@Autowired
private ClusterService clusterService;
-
@Autowired
private RuntimeService runtimeService;
-
-
private OperationBaseDTO operationBaseDTO;
-
private OperationRangeDomainDataHandler rangeDomainDataHandler;
-
- private final Set clusterTypeSet = new HashSet<>();
-
private ClusterType rangeType;
private boolean currentType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java
index 85475d0d..19b9c686 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/domain/metadata/ClusterMetadataDomain.java
@@ -26,8 +26,8 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.modle.domain.ClusterEntityDO;
-import org.apache.eventmesh.dashboard.console.modle.domain.RuntimeEntityDO;
+import org.apache.eventmesh.dashboard.console.model.domain.ClusterEntityDO;
+import org.apache.eventmesh.dashboard.console.model.domain.RuntimeEntityDO;
import org.apache.eventmesh.dashboard.console.spring.support.metadata.convert.ClusterConvertMetaData;
import org.apache.eventmesh.dashboard.console.spring.support.metadata.convert.RuntimeConvertMetaData;
import org.apache.eventmesh.dashboard.core.cluster.ClusterBaseDO;
@@ -50,6 +50,7 @@
import java.util.Map;
import java.util.Objects;
+import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@@ -60,12 +61,13 @@
@Slf4j
public class ClusterMetadataDomain {
+ @Getter
private ColonyDO colonyDO;
private boolean coreModel = true;
- private boolean buildConfig = false;
+ private boolean buildConfig = true;
@Setter
private DataHandler handler;
@@ -230,7 +232,7 @@ private ClusterBaseDO createClusterBaseDO(ClusterEntity clusterEntity) {
ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(clusterType);
if (this.buildConfig && !clusterType.isDefinition() && clusterFramework.isCAP()) {
AbstractMultiCreateSDKConfig config =
- ConfigManage.getInstance().getMultiCreateSDKConfig(clusterEntity.getClusterType(), SDKTypeEnum.ADMIN);
+ ConfigManage.getInstance().getMultiCreateSdkConfig(clusterEntity.getClusterType(), SDKTypeEnum.ADMIN);
config.setKey(clusterEntity.getId().toString());
clusterBaseDO.setMultiCreateSDKConfig(config);
}
@@ -246,7 +248,7 @@ private RuntimeBaseDO createRuntimeDO(RuntimeEntity runtimeEntity) {
ClusterFramework clusterFramework = ClusterSyncMetadataEnum.getClusterFramework(runtimeEntity.getClusterType());
if (!clusterFramework.isCAP()) {
AbstractSimpleCreateSDKConfig config =
- ConfigManage.getInstance().getSimpleCreateSDKConfig(runtimeEntity.getClusterType(), SDKTypeEnum.ADMIN);
+ ConfigManage.getInstance().getSimpleCreateSdkConfig(runtimeEntity.getClusterType(), SDKTypeEnum.ADMIN);
config.setKey(runtimeEntity.getId().toString());
config.setNetAddress(this.createNetAddress(runtimeEntity));
runtimeBaseDO.setCreateSDKConfig(config);
@@ -276,6 +278,7 @@ public void setConfigEntity() {
/**
* TODO @see OperationRangeDomain.
+ *
* @param clusterId
* @param clusterOperationHandler
*/
@@ -351,14 +354,11 @@ public interface DataHandler {
@SuppressWarnings("rawtypes")
private static class QueueConditionHandler {
+ private final List resultData = new ArrayList<>();
private QueueCondition queueCondition;
-
private ColonyDO colonyDO;
-
private Map> currentColonyDOMap;
- private final List resultData = new ArrayList<>();
-
public T handler() {
this.getColonyDOMap();
if (MapUtils.isEmpty(currentColonyDOMap)) {
@@ -399,18 +399,18 @@ public void handlerData(ColonyDO colonyDO) {
public static class QueueCondition {
+ private final ClusterType resultType = ClusterType.CLUSTER;
private Long clusterId;
-
/**
*
*/
private ClusterType clusterType;
-
- private final ClusterType resultType = ClusterType.CLUSTER;
-
private boolean resultId = false;
+ public QueueCondition() {
+ }
+
public QueueCondition clusterId(Long clusterId) {
this.clusterId = clusterId;
return this;
@@ -436,9 +436,6 @@ public QueueCondition runtime() {
return this;
}
- public QueueCondition() {
- }
-
public QueueCondition resultId() {
this.resultId = true;
return this;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java
deleted file mode 100644
index 874a48fd..00000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/BaseEntity.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.eventmesh.dashboard.console.entity;
-
-import org.apache.eventmesh.dashboard.common.enums.ClusterType;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * Base Entity provide some basic fields that every Eventmesh Dashboard Entity would have
- *
- * 12 broker -> 12 queue , 11 queue , 1broker 没有 队列。 副本,随机出现在一个 broker
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Schema(name = "BaseEntity", description = "Base entity")
-@Deprecated
-public class BaseEntity implements Serializable {
-
- private static final long serialVersionUID = -2697805837923579585L;
- /**
- * Primary key
- */
- @Schema(name = "id", description = "primary key")
- protected Long id;
-
- /**
- * 集群id,不是 eventmesh集群id。
- */
- protected Long clusterId;
-
- protected ClusterType clusterType;
-
- protected LocalDateTime createTime;
-
- protected LocalDateTime updateTime;
-
- private Integer status;
-}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
index 0c89a9d5..dcc2468e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseRuntimeIdEntity.java
@@ -25,6 +25,9 @@
@EqualsAndHashCode(callSuper = true)
public class BaseRuntimeIdEntity extends BaseClusterIdEntity {
+ /**
+ * 如果是 runtime 级别的 runtime_id 为零, 比如 topic
+ */
private Long runtimeId;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java
index cf12538a..ad72bb33 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/base/BaseSyncEntity.java
@@ -52,6 +52,8 @@ public abstract class BaseSyncEntity extends BaseClusterIdEntity {
private DeployStatusType deployStatusType;
+ private DeployStatusType createMethod;
+
private Long resourcesConfigId;
private Long deployScriptId;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
index 6b6a233e..1df80f80 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/CaseEntity.java
@@ -31,7 +31,7 @@ public class CaseEntity extends BaseOrganizationEntity {
private String caseType;
/**
- * cluster , runtime
+ * cluster , runtime
*/
private String objectType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
index b5d6b3d7..0b4a050a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cases/ResouceEntity.java
@@ -28,5 +28,4 @@
public class ResouceEntity extends BaseOrganizationEntity {
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
index b300b6d5..517e4b18 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/AclEntity.java
@@ -18,14 +18,16 @@
package org.apache.eventmesh.dashboard.console.entity.cluster;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseIdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
+;
+
@Data
@EqualsAndHashCode(callSuper = true, exclude = "status")
-public class AclEntity extends BaseEntity {
+public class AclEntity extends BaseIdEntity {
private static final long serialVersionUID = 6057071983428111947L;
@@ -47,6 +49,5 @@ public class AclEntity extends BaseEntity {
private Integer patternType;
- private Integer status;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
index c2008142..078f397d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterAndRelationshipEntity.java
@@ -36,5 +36,4 @@ public class ClusterAndRelationshipEntity extends ClusterEntity {
private ClusterType relationshipType;
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
index 2b1baaeb..ea95fa30 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/ClusterRelationshipEntity.java
@@ -43,4 +43,6 @@ public class ClusterRelationshipEntity extends BaseClusterIdEntity {
private LocalDateTime unRelationshipTime;
+ private String bindType;
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/CollectEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/CollectEntity.java
new file mode 100644
index 00000000..a51c8492
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/CollectEntity.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.entity.cluster;
+
+import org.apache.eventmesh.dashboard.common.enums.CollectType;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
+
+/**
+ *
+ */
+public class CollectEntity extends BaseClusterIdEntity {
+
+
+ private CollectType collectType;
+
+ private Long saveTime;
+
+ private Long collectInterval;
+
+ private Long storageClusterId;
+
+ private Long storageClusterName;
+
+ private Boolean enable;
+
+ private Boolean defaultStorage;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
index 3850d0df..e49cf694 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/cluster/RuntimeEntity.java
@@ -32,6 +32,8 @@ public class RuntimeEntity extends BaseSyncEntity {
private String host;
+ private String podHost;
+
/**
* 添加的时候只需要 host 与 post eventmesh runtime 是 admin port。通过 runtime admin 获得所有的配置。 meta 需要 host 与 post store host 与 post jmxPort
*/
@@ -52,5 +54,4 @@ public class RuntimeEntity extends BaseSyncEntity {
private String authType;
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
index e1c23d2c..43bfb031 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigEntity.java
@@ -19,14 +19,14 @@
package org.apache.eventmesh.dashboard.console.entity.function;
import org.apache.eventmesh.dashboard.common.enums.MetadataType;
-import org.apache.eventmesh.dashboard.console.entity.base.BaseClusterIdEntity;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class ConfigEntity extends BaseClusterIdEntity {
+public class ConfigEntity extends BaseRuntimeIdEntity {
private String businessType;
@@ -46,6 +46,10 @@ public class ConfigEntity extends BaseClusterIdEntity {
private String configValue;
+ private String configValueType;
+
+ private String configValueRange;
+
private String startVersion;
private String eventmeshVersion;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigGatherEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigGatherEntity.java
index 3b050285..f1de996c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigGatherEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/ConfigGatherEntity.java
@@ -18,9 +18,10 @@
package org.apache.eventmesh.dashboard.console.entity.function;
-import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
-public class ConfigGatherEntity extends BaseEntity {
+import org.apache.eventmesh.dashboard.console.entity.base.BaseIdEntity;
+
+public class ConfigGatherEntity extends BaseIdEntity {
private String name;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
index 4e22de66..f6b2e447 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
@@ -37,15 +37,13 @@
@Schema(name = "HealthCheckResultEntity", description = "Health check result entity")
public class HealthCheckResultEntity extends BaseRuntimeIdEntity {
- private static final long serialVersionUID = -7350585209577598040L;
-
private ClusterType clusterType;
private String protocol;
- private String interfaces;
+ private String address;
- private HealthCheckTypeEnum healthCheckTypeEnum;
+ private HealthCheckTypeEnum healthCheckType;
private HealthCheckStatus result;
@@ -56,7 +54,6 @@ public class HealthCheckResultEntity extends BaseRuntimeIdEntity {
private LocalDateTime finishTime;
-
@Schema(description = "Type of Health Check;0:Unknown, 1:Cluster, 2:Runtime, 3:Topic, 4:Storage", defaultValue = "0", allowableValues = {"0",
"1", "2", "3", "4"})
private Integer type;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/MetadataSyncResultEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/MetadataSyncResultEntity.java
index 3baa5660..39f21dd9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/MetadataSyncResultEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/MetadataSyncResultEntity.java
@@ -30,7 +30,6 @@
@EqualsAndHashCode(callSuper = true)
public class MetadataSyncResultEntity extends BaseRuntimeIdEntity {
-
private Long syncId;
private MetadataType metadataType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/ConsumeOffsetEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/ConsumeOffsetEntity.java
index e7f3dda4..4c2b8418 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/ConsumeOffsetEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/ConsumeOffsetEntity.java
@@ -17,6 +17,11 @@
package org.apache.eventmesh.dashboard.console.entity.message;
+
+import org.apache.eventmesh.dashboard.common.enums.OperationRange.OperationRangeType;
+
+import java.time.LocalDateTime;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -26,14 +31,20 @@ public class ConsumeOffsetEntity extends TopicOffsetEntity {
private Long subscribeId;
- private Long groupId;
+ private OperationRangeType operationRangeType;
- private String groupName;
+ private Long rangeId;
private Long consumeOffset;
+ private Integer queueIndex;
+
private Integer consumeRate;
private Long delayNum;
+ /**
+ *
+ */
+ private LocalDateTime resetTime;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupEntity.java
index d4ce306c..dc867507 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupEntity.java
@@ -29,10 +29,8 @@ public class GroupEntity extends BaseRuntimeIdEntity {
private String name;
- private Integer memberCount;
-
- private String members;
-
private Integer type;
+ private String ownType;
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/SubscriptionEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupMemberEntity.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/SubscriptionEntity.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupMemberEntity.java
index cfd36cfe..813b43cb 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/SubscriptionEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/GroupMemberEntity.java
@@ -25,7 +25,7 @@
@Data
@EqualsAndHashCode(callSuper = true)
-public class SubscriptionEntity extends BaseRuntimeIdEntity {
+public class GroupMemberEntity extends BaseRuntimeIdEntity {
private String topicName;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/TopicEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/TopicEntity.java
index 699a9700..674cdf64 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/TopicEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/message/TopicEntity.java
@@ -38,7 +38,9 @@ public class TopicEntity extends BaseRuntimeIdEntity {
/**
*
*/
- private Long numQueue;
+ private Integer readQueueNum;
+
+ private Integer writeQueueNum;
/**
* 副本个数
@@ -55,7 +57,7 @@ public class TopicEntity extends BaseRuntimeIdEntity {
*/
private String attributes;
- private String order;
+ private Integer order;
@Schema(description = "time to live in milliseconds, -2 unknown, -1 no limit;", example = "1000")
private Long retentionMs;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/Health2Service.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/Health2Service.java
index 5c938fcb..d1e55215 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/Health2Service.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/Health2Service.java
@@ -18,10 +18,12 @@
package org.apache.eventmesh.dashboard.console.function.health;
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckStatus;
import org.apache.eventmesh.dashboard.common.enums.health.HealthCheckTypeEnum;
import org.apache.eventmesh.dashboard.common.model.base.BaseSyncBase;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
import org.apache.eventmesh.dashboard.common.util.ClasspathScanner;
import org.apache.eventmesh.dashboard.console.entity.function.HealthCheckResultEntity;
import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType;
@@ -31,6 +33,8 @@
import org.apache.eventmesh.dashboard.console.function.health.check.HealthCheckService;
import org.apache.eventmesh.dashboard.console.service.function.HealthDataService;
import org.apache.eventmesh.dashboard.core.function.SDK.SDKManage;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.AbstractCreateSDKConfig;
+import org.apache.eventmesh.dashboard.core.function.SDK.config.AbstractMultiCreateSDKConfig;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -48,6 +52,8 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import javax.annotation.Nullable;
+
import lombok.Data;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@@ -72,47 +78,49 @@ public class Health2Service {
}
}
-
- private static void setClassCache(Class> clazz) {
- HealthCheckType checkType = clazz.getAnnotation(HealthCheckType.class);
- if (Objects.isNull(checkType)) {
- return;
- }
- Map> map =
- Objects.equals(checkType.healthType(), HealthCheckTypeEnum.PING) ? HEALTH_PING_CHECK_CLASS_CACHE : HEALTH_TOPIC_CHECK_CLASS_CACHE;
-
- for (ClusterType clusterType : checkType.clusterType()) {
- map.put(clusterType, clazz);
- }
- }
-
-
private final Map checkServiceMap = new ConcurrentHashMap<>();
-
@Deprecated
private final Map clusterHealthCheckServiceMap = new ConcurrentHashMap<>();
-
-
private final ThreadPoolExecutor threadPoolExecutor =
new ThreadPoolExecutor(32, 32, 5, TimeUnit.SECONDS, new LinkedBlockingDeque<>(), new ThreadFactory() {
final AtomicInteger counter = new AtomicInteger(0);
@Override
- public Thread newThread(Runnable r) {
+ public Thread newThread(@Nullable Runnable r) {
return new Thread(r, "health-manager-" + counter.incrementAndGet());
}
});
-
@Setter
private HealthDataService dataService;
+ private LocalDateTime beginTime = LocalDateTime.now();
+
+ private static void setClassCache(Class> clazz) {
+ HealthCheckType checkType = clazz.getAnnotation(HealthCheckType.class);
+ if (Objects.isNull(checkType)) {
+ return;
+ }
+ Map> map =
+ Objects.equals(checkType.healthType(), HealthCheckTypeEnum.PING) ? HEALTH_PING_CHECK_CLASS_CACHE : HEALTH_TOPIC_CHECK_CLASS_CACHE;
+ for (ClusterType clusterType : checkType.clusterType()) {
+ log.info("cluster type:{} health class name is {}", clusterType, clazz.getSimpleName());
+ map.put(clusterType, clazz);
+ }
+ }
+ @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
public void register(BaseSyncBase baseSyncBase) {
try {
- this.createHealthCheckWrapper(baseSyncBase, HealthCheckTypeEnum.PING);
+ HealthCheckWrapper healthCheckWrapper = this.createHealthCheckWrapper(baseSyncBase, HealthCheckTypeEnum.PING);
if (baseSyncBase.getClusterType().isHealthTopic()) {
this.createHealthCheckWrapper(baseSyncBase, HealthCheckTypeEnum.TOPIC);
}
+ if (log.isDebugEnabled()) {
+ AbstractCreateSDKConfig abstractCreateSDKConfig = (AbstractCreateSDKConfig) healthCheckWrapper.getCheckService().getCreateSdkConfig();
+ log.debug("register health check service for {} , metadata type {} , {} ,{}", baseSyncBase.getClusterType(),
+ baseSyncBase.getClass().getSimpleName(), baseSyncBase.getId(),
+ abstractCreateSDKConfig.getUniqueKey());
+ }
} catch (Exception e) {
log.error(e.getMessage(), e);
}
@@ -126,6 +134,11 @@ public void unRegister(BaseSyncBase baseSyncBase) {
}
this.checkServiceMap.remove(getKey(baseSyncBase, HealthCheckTypeEnum.PING));
this.checkServiceMap.remove(getKey(baseSyncBase, HealthCheckTypeEnum.TOPIC));
+ if (log.isDebugEnabled()) {
+ RuntimeMetadata runtimeMetadata = (RuntimeMetadata) baseSyncBase;
+ log.debug("unRegister health check service for {} , {} ,{},{}", baseSyncBase.getClusterType(), baseSyncBase.getId(),
+ runtimeMetadata.getHost(), runtimeMetadata.getPort());
+ }
}
@Deprecated
@@ -134,7 +147,7 @@ public void unRegisterCluster(Long clusterId) {
}
- void createHealthCheckWrapper(BaseSyncBase baseSyncBase, HealthCheckTypeEnum healthCheckTypeEnum) {
+ private HealthCheckWrapper createHealthCheckWrapper(BaseSyncBase baseSyncBase, HealthCheckTypeEnum healthCheckTypeEnum) {
Map> map =
Objects.equals(healthCheckTypeEnum, HealthCheckTypeEnum.PING) ? HEALTH_PING_CHECK_CLASS_CACHE : HEALTH_TOPIC_CHECK_CLASS_CACHE;
Class> clazz = map.get(baseSyncBase.getClusterType());
@@ -142,6 +155,7 @@ void createHealthCheckWrapper(BaseSyncBase baseSyncBase, HealthCheckTypeEnum hea
HealthCheckWrapper healthCheckWrapper =
this.createHealthCheckWrapper(baseSyncBase, abstractHealthCheckService, healthCheckTypeEnum);
this.checkServiceMap.put(healthCheckWrapper.getKey(), healthCheckWrapper);
+ return healthCheckWrapper;
}
private HealthCheckWrapper createHealthCheckWrapper(BaseSyncBase baseSyncBase,
@@ -158,15 +172,36 @@ private HealthCheckWrapper createHealthCheckWrapper(BaseSyncBase baseSyncBase,
}
public void executeAll() {
+ try {
+ this.doExecuteAll();
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+
+ public void doExecuteAll() {
+ if (checkServiceMap.isEmpty()) {
+ log.info("check service is empty");
+ return;
+ }
long startTime = System.currentTimeMillis();
+ this.beginTime = LocalDateTime.now();
List healthCheckResultEntityList = new ArrayList<>();
CountDownLatch countDownLatch = new CountDownLatch(this.checkServiceMap.size());
this.checkServiceMap.forEach((k, wrapper) -> {
- healthCheckResultEntityList.add(wrapper.createHealthCheckResultEntity());
+
DefaultHealthCheckCallback healthExecutor = new DefaultHealthCheckCallback();
healthExecutor.healthCheckWrapper = wrapper;
healthExecutor.countDownLatch = countDownLatch;
- healthExecutor.healthCheckResultEntity = wrapper.getHealthCheckResultEntity();
+ //
+ if (wrapper.isCap()) {
+ healthExecutor.healthCheckResultEntityMap = wrapper.createHealthCheckResultEntityMap();
+ healthCheckResultEntityList.addAll(healthExecutor.healthCheckResultEntityMap.values());
+ } else {
+ healthCheckResultEntityList.add(wrapper.createHealthCheckResultEntity());
+ healthExecutor.healthCheckResultEntity = wrapper.getHealthCheckResultEntity();
+ }
threadPoolExecutor.execute(() -> {
try {
@@ -183,13 +218,19 @@ public void executeAll() {
}
try {
boolean await = countDownLatch.await(3, TimeUnit.SECONDS);
- log.info("await ia {} downLatch count {}", await, countDownLatch.getCount());
- log.info(" startup cost {} ms", System.currentTimeMillis() - startTime);
+ log.info("await ia {} downLatch count {}, startup cost {} ms", await, countDownLatch.getCount(), System.currentTimeMillis() - startTime);
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
try {
- dataService.batchUpdateCheckResultByClusterIdAndTypeAndTypeId(healthCheckResultEntityList);
+ LocalDateTime endTime = LocalDateTime.now();
+ healthCheckResultEntityList.forEach(healthCheckResultEntity -> {
+ if (healthCheckResultEntity.getResult() == HealthCheckStatus.ING) {
+ healthCheckResultEntity.setResult(HealthCheckStatus.TIMEOUT);
+ healthCheckResultEntity.setFinishTime(endTime);
+ }
+ });
+ dataService.batchInsertHealthCheckResult(healthCheckResultEntityList);
} catch (Exception e) {
log.error("batchUpdateCheckResultByClusterIdAndTypeAndTypeId failed", e);
}
@@ -209,6 +250,8 @@ static class DefaultHealthCheckCallback implements HealthCheckCallback {
private HealthCheckResultEntity healthCheckResultEntity;
+ private Map healthCheckResultEntityMap;
+
@Override
public void onSuccess() {
healthCheckResultEntity.setResult(HealthCheckStatus.SUCCESS);
@@ -220,7 +263,6 @@ public void onSuccess() {
public void onFail(Exception e) {
healthCheckResultEntity.setResult(HealthCheckStatus.FAILED);
healthCheckResultEntity.setResultDesc(e.getMessage());
- healthCheckResultEntity.setFinishTime(LocalDateTime.now());
countDownLatch.countDown();
log.error("healthCheckCallback onFail Id: ", e);
}
@@ -233,6 +275,7 @@ class HealthCheckWrapper {
private AbstractHealthCheckService checkService;
+ private String address;
private HealthCheckResultEntity healthCheckResultEntity = new HealthCheckResultEntity();
@@ -241,20 +284,41 @@ class HealthCheckWrapper {
private HealthCheckResultEntity createHealthCheckResultEntity() {
+ if (Objects.isNull(this.address)) {
+ this.address = ((AbstractCreateSDKConfig) checkService.getCreateSdkConfig()).doUniqueKey();
+ }
+ return this.createHealthCheckResultEntity(this.address);
+ }
+
+ private HealthCheckResultEntity createHealthCheckResultEntity(String address) {
HealthCheckResultEntity healthCheckResultEntity = new HealthCheckResultEntity();
- healthCheckResultEntity.setClusterId(this.baseSyncBase.getClusterId());
- healthCheckResultEntity.setInterfaces(this.baseSyncBase.getId().toString());
- healthCheckResultEntity.setHealthCheckTypeEnum(this.healthCheckTypeEnum);
healthCheckResultEntity.setClusterType(this.baseSyncBase.getClusterType());
- healthCheckResultEntity.setBeginTime(LocalDateTime.now());
+ healthCheckResultEntity.setClusterId(this.baseSyncBase.getClusterId());
+ healthCheckResultEntity.setProtocol("");
+ healthCheckResultEntity.setType(2);
+ healthCheckResultEntity.setTypeId(this.baseSyncBase.getId());
+ healthCheckResultEntity.setAddress(this.address);
+ healthCheckResultEntity.setHealthCheckType(this.healthCheckTypeEnum);
+ healthCheckResultEntity.setResult(HealthCheckStatus.ING);
+ healthCheckResultEntity.setResultDesc("");
+ healthCheckResultEntity.setBeginTime(beginTime);
this.healthCheckResultEntity = healthCheckResultEntity;
return healthCheckResultEntity;
}
+ @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
+ public Map createHealthCheckResultEntityMap() {
+ Map healthCheckResultEntityMap = new HashMap<>();
+ AbstractMultiCreateSDKConfig abstractMultiCreateSDKConfig = (AbstractMultiCreateSDKConfig) this.checkService.getCreateSdkConfig();
+ for (String address : abstractMultiCreateSDKConfig.getNetAddresses()) {
+ healthCheckResultEntityMap.put(address, createHealthCheckResultEntity(address));
+ }
+ return healthCheckResultEntityMap;
+ }
+
@Override
public boolean equals(Object object) {
- if (object instanceof HealthCheckWrapper) {
- HealthCheckWrapper wrapper = (HealthCheckWrapper) object;
+ if (object instanceof HealthCheckWrapper wrapper) {
return this.baseSyncBase.getId().equals(wrapper.getBaseSyncBase().getId()) && this.baseSyncBase.getClusterType()
.equals(wrapper.getBaseSyncBase().getClusterType());
}
@@ -266,6 +330,10 @@ public String getKey() {
return Health2Service.this.getKey(this.baseSyncBase, this.healthCheckTypeEnum);
}
+ public boolean isCap() {
+ return ClusterSyncMetadataEnum.getClusterFramework(this.baseSyncBase.getClusterType()).isCAP();
+ }
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/AbstractHealthCheckService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/AbstractHealthCheckService.java
index 6123866b..16ec58ac 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/AbstractHealthCheckService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/AbstractHealthCheckService.java
@@ -34,7 +34,7 @@ public abstract class AbstractHealthCheckService extends AbstractClientInfo {
@Override
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/design.md b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/design.md
index 29d331a0..fd69571d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/design.md
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/design.md
@@ -1,19 +1,19 @@
-
## health
-> 心跳分为 服务(runtime)心跳,topic心跳
-
+> 心跳分为 服务(runtime)心跳,topic心跳
## topic 心跳
+
> 通过 topic 的读写,确认 存储节点的主功能正常。同时需要验证复制是否正常。验证复制是否监控的同时,可以验证 节点是否可以读写
#### 问题是:每个 存储的topic 方式不一样 ,同时 同步方式也不一样
+
1. RocketMQ 使用主从集群。同时使用 raft 集群
-2. Kafka 集群使用同样节点
+2. Kafka 集群使用同样节点
3. pulusr 使用 book 作为存储,只能检查book
4. redis 会用主从集群。 raft 集群
5. MySQL 主从
-6. eventmesh 是代理。需要每个 runtime 都发送,获得一次吗?
- 1. 只需要从一个节点得到所有数据就行了。如果节点有问题。怎么办?
- 2. 请求所有节点确认所有数据是正确的
+6. eventmesh 是代理。需要每个 runtime 都发送,获得一次吗?
+ 1. 只需要从一个节点得到所有数据就行了。如果节点有问题。怎么办?
+ 2. 请求所有节点确认所有数据是正确的
7.
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/AbstractReportEngine.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/AbstractReportEngine.java
new file mode 100644
index 00000000..353f948b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/AbstractReportEngine.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+import org.apache.eventmesh.dashboard.console.function.report.ReportConfig.ReportEngineConfig;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.AbstractReportMetaHandler;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.SqlSource;
+import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
+import org.apache.ibatis.session.Configuration;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+import org.apache.velocity.runtime.resource.loader.StringResourceLoader;
+import org.apache.velocity.runtime.resource.util.StringResourceRepository;
+import org.apache.velocity.runtime.resource.util.StringResourceRepositoryImpl;
+
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+public abstract class AbstractReportEngine implements ReportEngine {
+
+
+ protected ReportEngineConfig reportEngineConfig;
+ protected XMLLanguageDriver xmlLanguageDriver = new XMLLanguageDriver();
+ private VelocityEngine velocityEngine;
+ private Configuration configuration = new Configuration();
+ private Map> stringSqlSourceMap = new HashMap<>();
+ private Class> reportClass;
+
+ private StringResourceRepository resourceLoader = new StringResourceRepositoryImpl();
+
+ @Getter
+ private Map reportMetaHandlerMap = new HashMap<>();
+
+ private Map> reportSQL = new ConcurrentHashMap<>();
+
+ public void init() {
+ this.createVelocity();
+
+ this.doInit();
+ }
+
+ protected abstract void doInit();
+
+ @Deprecated
+ private void createVelocity() {
+ VelocityEngine velocityEngine = new VelocityEngine();
+ velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, "report");
+ velocityEngine.setProperty("resource.loader.report.class", StringResourceLoader.class.getName());
+ velocityEngine.setProperty("resource.loader.report.repository.name", "report");
+ velocityEngine.setProperty("resource.loader.report.repository.static", false);
+ velocityEngine.setApplicationAttribute("report", resourceLoader);
+ velocityEngine.init();
+ this.velocityEngine = velocityEngine;
+ }
+
+
+ protected String querySentence(SingleGeneralReportDO singleGeneralReportDO) {
+ VelocityContext velocityContext = new VelocityContext();
+ velocityContext.put("data", singleGeneralReportDO);
+ StringWriter stringWriter = new StringWriter();
+ this.velocityEngine.getTemplate("").merge(velocityContext, stringWriter);
+ return stringWriter.toString();
+ }
+
+ @Override
+ public void createReportHandler(ReportMetaData reportMetaData, List fieldList) {
+ AbstractReportMetaHandler abstractReportMetaHandler = this.doCreateReportHandler(reportMetaData, fieldList);
+ abstractReportMetaHandler.setReportMeta(reportMetaData);
+ abstractReportMetaHandler.setFieldList(fieldList);
+ this.reportMetaHandlerMap.put(reportMetaData.getReportName(), abstractReportMetaHandler);
+ }
+
+ protected abstract AbstractReportMetaHandler doCreateReportHandler(ReportMetaData reportMetaData, List fieldList);
+
+ protected String buildSql(String reportName, String type, Object value) {
+ SqlSource sqlSource = this.buildSqlSource(reportName, type);
+ BoundSql boundSql = sqlSource.getBoundSql(value);
+ return boundSql.getSql();
+ }
+
+ protected SqlSource buildSqlSource(String reportName, String type) {
+ Map sourceMap = this.stringSqlSourceMap.computeIfAbsent(reportName, k -> new ConcurrentHashMap<>());
+ return sourceMap.computeIfAbsent(type, (k) -> {
+ String sql = this.createSql(reportName, type);
+ String stringBuilder = "";
+ return this.xmlLanguageDriver.createSqlSource(configuration, stringBuilder, null);
+ });
+ }
+
+ protected String createSql(String reportName, String type) {
+ AbstractReportMetaHandler handler = this.reportMetaHandlerMap.get(reportName);
+
+ String sql;
+ if (Objects.equals("insert", type)) {
+ sql = handler.insert();
+ } else if (Objects.equals(ReportViewType.CREATE_TABLE.getName(), type)) {
+ sql = handler.createTable();
+ } else {
+ sql = handler.query(type);
+ }
+ return sql;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportConfig.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportConfig.java
new file mode 100644
index 00000000..0a8007c0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportConfig.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+import java.util.List;
+
+import lombok.Data;
+
+@Data
+public class ReportConfig {
+
+ private boolean initAllTables = false;
+
+ private ReportEngineConfig defaultConfig;
+
+ private List reportEngineConfigList;
+
+ private String url;
+
+ private String username;
+
+ private String password;
+
+ @Data
+ public static class ReportEngineConfig {
+
+ private String name;
+
+ private String engineType;
+
+ private String engineAddress;
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportEngine.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportEngine.java
new file mode 100644
index 00000000..21c6cc09
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportEngine.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+
+/**
+ *
+ */
+public interface ReportEngine {
+
+ CompletableFuture>> query(SingleGeneralReportDO singleGeneralReportDO);
+
+
+ void createReport(String tableName);
+
+ void batchInsert(String tableName, List data);
+
+
+ default void batchInsert(Map> data) {
+ data.forEach(this::batchInsert);
+ }
+
+ void deleteData();
+
+ void createReportHandler(ReportMetaData reportMetaData, List fieldList);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandler.java
new file mode 100644
index 00000000..3053e6be
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandler.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+/**
+ *
+ */
+public interface ReportHandler {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandlerManage.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandlerManage.java
new file mode 100644
index 00000000..6f172c9a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportHandlerManage.java
@@ -0,0 +1,272 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+import org.apache.eventmesh.dashboard.common.util.ClasspathScanner;
+import org.apache.eventmesh.dashboard.console.function.report.ReportConfig.ReportEngineConfig;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.Aggregation;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.collect.CollectManage;
+import org.apache.eventmesh.dashboard.console.function.report.collect.MetadataDataManage;
+import org.apache.eventmesh.dashboard.console.function.report.iotdb.IotDBReportEngine;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.OrganizationId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.Time;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
+
+import java.lang.reflect.Field;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import com.google.common.base.CaseFormat;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * TODO 功能点
+ * 1. 同时提供总量 与 分组的统计
+ * 2. 同时提供 量与百分比, value 后面自带百分比?
+ * 3. 提供排序
+ * 4. 过滤。默认过滤掉。0。 可以指定过滤掉值的
+ * 1. 比如 topic ,消费组
+ * 2. 给 过滤总量值
+ * 5. 指定维度
+ * 1. message_type
+ * 2. protocol_type
+ * 3. request_code
+ * 4. response_code
+ * 5. invocation_status
+ * 6. name
+ * 6. 时间维度 15秒,分,15分,30分,1小时,3小时,6小时,12小时,天,月,
+ * 7. 分组:时间分组
+ * 2. 按照 id 与。 id 维度是固定的
+ * 3. 按照 类型维度
+ * 4.
+ * 8. 支持批量获得,两个获得
+ * 1. 批量与单个是否共用一个 接口?
+ * 2. 如果同时支持批量与单个,那么 前端需要提供连个
+ */
+@Slf4j
+public class ReportHandlerManage {
+
+ private static final Map> engineClasses = new HashMap<>();
+
+ static {
+ engineClasses.put("iotdb", IotDBReportEngine.class);
+ }
+
+ private final ScheduledExecutorService scheduledExecutorService = new ScheduledThreadPoolExecutor(10);
+ private final Map, String> clazzToTableName = new HashMap<>();
+ private final CollectManage collectManage = new CollectManage();
+ private final MetadataDataManage metadataDataManage = new MetadataDataManage();
+ private Map reportEngineMap = new HashMap<>();
+ @Setter
+ private ReportEngine reportEngine;
+ @Getter
+ private Map reportMetaDataMap = new HashMap<>();
+ @Getter
+ private Map aggregationMetaDataMap = new HashMap<>();
+ @Setter
+ private ReportConfig reportConfig;
+
+ @Setter
+ private boolean enable = true;
+
+ public void init() {
+ this.handlerConfig();
+ ClasspathScanner classpathScanner =
+ ClasspathScanner.builder().base(ReportHandlerManage.class).subPath("/model/**").build();
+ try {
+ List> classList = classpathScanner.getClazz();
+ classList.forEach(this::handler);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ if (!this.enable) {
+ return;
+ }
+
+ this.metadataDataManage.init(this.reportConfig.getUrl(), this.reportConfig.getUsername(), this.reportConfig.getPassword());
+ scheduledExecutorService.scheduleAtFixedRate(this.collectManage::request, 5, 5, TimeUnit.SECONDS);
+
+ scheduledExecutorService.scheduleAtFixedRate(this::handlerData, 5, 5, TimeUnit.SECONDS);
+
+ scheduledExecutorService.scheduleAtFixedRate(this.metadataDataManage::syncData, 5, 100, TimeUnit.MINUTES);
+
+ this.buildDeleteDataTask();
+ this.ddlHandler();
+ }
+
+ private void buildDeleteDataTask() {
+ LocalDate current = LocalDate.now().plusDays(1);
+ LocalDateTime nextTime = LocalDateTime.of(current, LocalTime.of(3, 0));
+ long executeTime = nextTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
+ scheduledExecutorService.scheduleAtFixedRate(this::deleteDataTask, executeTime, 1000 * 60 * 60 * 24, TimeUnit.MINUTES);
+ }
+
+ private void deleteDataTask() {
+ this.reportEngineMap.forEach((k, v) -> {
+ try {
+ long start = System.currentTimeMillis();
+ v.deleteData();
+ long end = System.currentTimeMillis();
+ log.info("{} delete data cost {} ms", k, end - start);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ });
+ }
+
+ private void handlerConfig() {
+ this.reportEngine = this.createEngine(this.reportConfig.getDefaultConfig());
+ if (Objects.isNull(this.reportConfig.getReportEngineConfigList())) {
+ return;
+ }
+ this.reportConfig.getReportEngineConfigList().forEach(this::createEngine);
+ }
+
+ private AbstractReportEngine createEngine(ReportEngineConfig reportEngineConfig) {
+ if (Objects.isNull(reportEngineConfig)) {
+ return null;
+ }
+ Class> clazz = engineClasses.get(reportEngineConfig.getEngineType());
+ try {
+ AbstractReportEngine reportEngine = (AbstractReportEngine) clazz.newInstance();
+ reportEngine.setReportEngineConfig(reportEngineConfig);
+ reportEngineMap.put(reportEngineConfig.getName(), reportEngine);
+ return reportEngine;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void ddlHandler() {
+ if (!this.reportConfig.isInitAllTables()) {
+ return;
+ }
+ this.reportEngineMap.forEach((k, v) -> {
+ v.createReport("*");
+ });
+ }
+
+ /**
+ * 后期再支持多存储与多数据
+ */
+ private void handlerData() {
+ List timeData = this.collectManage.getData();
+ if (CollectionUtils.isEmpty(timeData)) {
+ return;
+ }
+ Map> dataMap = new HashMap<>(timeData.size());
+ timeData.forEach(t -> {
+ metadataDataManage.supplement((OrganizationId) t);
+ List objectList = dataMap.get(t.getClass());
+ if (Objects.isNull(objectList)) {
+ objectList = new ArrayList<>();
+ dataMap.put(this.clazzToTableName.get(t.getClass()), objectList);
+ }
+ objectList.add(t.getTime());
+ });
+ this.reportEngine.batchInsert(dataMap);
+ }
+
+ private void handler(Class> clazz) {
+ ReportMeta reportMeta = clazz.getAnnotation(ReportMeta.class);
+ if (Objects.isNull(reportMeta)) {
+ return;
+ }
+
+ String className = clazz.getSimpleName();
+ String caseName = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, className);
+ ReportMetaData reportMetaData = new ReportMetaData();
+
+ reportMetaData.setReportName(Objects.isNull(reportMeta.reportName()) ? caseName : reportMeta.reportName());
+ reportMetaData.setClusterType(reportMeta.clusterType());
+ reportMetaData.setReportViewType(reportMeta.defaultViewType());
+ reportMetaData.setReportViewTypes(List.of(reportMeta.reportViewTypes()));
+ reportMetaData.setTableName(Objects.isNull(reportMeta.tableName()) ? caseName : reportMeta.tableName());
+ reportMetaData.setComment(reportMeta.comment());
+ reportMetaData.setAlias(Set.of(reportMeta.alias()));
+ if (StringUtils.isEmpty(reportMetaData.getTableName())) {
+ reportMetaData.setTableName(reportMeta.reportName());
+ }
+ reportMetaData.setValueType(clazz.getSimpleName().contains("Long") ? "Long" : "Float");
+ Aggregation[] aggregationArrays = clazz.getAnnotationsByType(Aggregation.class);
+ if (ArrayUtils.isNotEmpty(aggregationArrays)) {
+ Map aggregationFieldMap = new HashMap<>(aggregationArrays.length);
+ Arrays.stream(aggregationArrays).forEach(aggregation -> {
+ Field field = aggregationFieldMap.get(aggregation.fieldName());
+ field.setAccessible(true);
+ aggregationFieldMap.put(aggregation.reportName(), field);
+ this.aggregationMetaDataMap.put(aggregation.reportName(), reportMetaData);
+
+ });
+ reportMetaData.setAggregationFieldMap(aggregationFieldMap);
+ }
+
+ List list = new ArrayList<>(FieldUtils.getAllFieldsList(clazz));
+ Collections.reverse(list);
+ reportMetaData.setFieldList(list);
+ reportMetaData.setClazz(clazz);
+ this.reportEngine.createReportHandler(reportMetaData, list);
+ this.reportMetaDataMap.put(reportMetaData.getReportName(), reportMetaData);
+ this.clazzToTableName.put(clazz, reportMetaData.getTableName());
+ }
+
+ public Map>> queryResultIsMap(List singleGeneralReportDOList) {
+ Map>>> completableFutures = new HashMap<>(singleGeneralReportDOList.size());
+ singleGeneralReportDOList.forEach(reportDO -> {
+ CompletableFuture>> completableFuture = reportEngine.query(reportDO);
+ completableFutures.put(reportDO.getReportType(), completableFuture);
+ });
+ Map>> resultMap = new HashMap<>(singleGeneralReportDOList.size());
+ completableFutures.forEach((key, completableFuture) -> {
+ try {
+ List> singleData = completableFuture.get();
+ resultMap.put(key, singleData);
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ return resultMap;
+ }
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportViewType.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportViewType.java
new file mode 100644
index 00000000..cbeceb77
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/ReportViewType.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report;
+
+public enum ReportViewType {
+
+
+ INSERT("insert"),
+
+ CREATE_TABLE("create_table"),
+
+ COUNTER("counter"),
+
+ GAUGE("gauge"),
+
+ HISTOGRAM("histogram"),
+
+ HISTOGRAM_COUNTER("histogram_counter"),
+
+ SUMMARY("summary"),
+
+ ;
+
+
+ private String name;
+
+
+ ReportViewType(String name) {
+ this.name = name;
+ }
+
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/AbstractReportMetaHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/AbstractReportMetaHandler.java
new file mode 100644
index 00000000..2e716b81
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/AbstractReportMetaHandler.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.annotation;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+import lombok.Setter;
+
+@Setter
+public abstract class AbstractReportMetaHandler {
+
+ public static String line = "\r\n";
+
+ public static String tabString = " ";
+
+ public static String lineAndTabString = line + tabString;
+
+ public static String tabAndLineString = tabString + line;
+
+
+ protected ReportMetaData reportMeta;
+
+ protected List fieldList;
+
+
+ public abstract String insert();
+
+ public abstract String query(String type);
+
+ public abstract String createTable();
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/Aggregation.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/Aggregation.java
new file mode 100644
index 00000000..1638879c
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/Aggregation.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.FIELD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Aggregation {
+
+
+ String reportName();
+
+ String fieldName();
+
+ String value();
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMeta.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMeta.java
new file mode 100644
index 00000000..1ffe41d3
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMeta.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.annotation;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * id 为 tag time 为 time value 开头为 数据
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ReportMeta {
+
+ ClusterType clusterType();
+
+ String reportName() default "";
+
+ ReportViewType defaultViewType();
+
+ ReportViewType[] reportViewTypes() default {};
+
+ String tableName() default "";
+
+ String comment();
+
+ String[] alias() default {};
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMetaData.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMetaData.java
new file mode 100644
index 00000000..5a500c16
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/annotation/ReportMetaData.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.annotation;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import lombok.Data;
+
+
+/**
+ * 组件类型,report名,数据类型,类名(因为采集模块),表名,默认展示类型,可以展示类型,
+ */
+@Data
+public class ReportMetaData {
+
+
+ private ClusterType clusterType;
+
+ /**
+ *
+ */
+ private String reportName;
+
+
+ private String dataType;
+
+
+ private Class> clazz;
+
+
+ private String tableName;
+
+ private String comment;
+
+ /**
+ * counter histogram gauge
+ */
+ private ReportViewType reportViewType;
+
+
+ private List reportViewTypes;
+
+
+ private Set alias;
+
+
+ private String valueType;
+
+
+ private boolean aggregation = false;
+
+
+ private Map aggregationClasses;
+
+
+ private List fieldList;
+
+ private Map aggregationFieldMap;
+
+
+ @Data
+ public static class AggregationClass {
+
+ private String alias;
+
+ private Field field;
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/Collect.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/Collect.java
new file mode 100644
index 00000000..3be4c780
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/Collect.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect;
+
+/**
+ * TODO 设计一个 兼容 metadata list 与 全量 collect
+ * 纠结,
+ * 一个metadata,一个 collect,还是 一个类型的 metadata list 一个 collect?,全量 collect
+ * 一个 metadata 在抽象度就非常高,代码就非常简单. 一个 topic 一个 collect
+ * 一个 metadata list 需要进行组织,优点是 性能好。 topic 类型 一个 collect
+ * 全量 collect ,比如 rocketmq exporter 代码复制过来。优点是无任何 metadata 依赖
+ * 问题(痛苦): rocketmq 目前大部分只支持 一个一个 metadata 请求,
+ * 一个个请求性能比较低
+ * kafka 大部分支持 全量请求
+ * TODO ?
+ * 大集群情况下, exporter 独立出来。如何处理。
+ * 需要实现一套独立的 SDKManage 管理对象
+ * 小量情况下, exporter 不独立
+ * topic 10个 group, 1000个 client,
+ * 10个 group, 3万个 client,
+ * 1000 topic, 2000个, 1万个, kafka,24个节点,48c,128G
+ * rocketmq-exporter
+ * eventmesh -> exporter -> broker -> client 3
+ * eventmesh
+ * eventmesh -> broker -> client 2
+ * client -> eventmesh 1 还可以压缩
+ * 1s 5s 感知快
+ *
+ * 消息挤压,kubernetes,授权我帮他扩容
+ *
+ *
+ * TODO OK
+ * 普罗米修斯 ,
+ * 如果 一个meta,一个broker, 一个 普罗米修斯, 没有
+ * 如果 两个meta 被 多个broker 共享,一个 普罗米修斯 没有问题,不要控制
+ * 如果 两个meta 被 多个broker 共享, 多个普罗米修斯 就有问题,会采集重复数据
+ * 一个 collect 是对应 meta cluster ,还是 main cluster
+ *
+ * TODO OK
+ * meta 数据是否放到 ectd 里面。1 到 5 同步
+ */
+public interface Collect {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/CollectManage.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/CollectManage.java
new file mode 100644
index 00000000..209d61ea
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/CollectManage.java
@@ -0,0 +1,262 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect;
+
+import org.apache.eventmesh.dashboard.common.annotation.ClusterTypeMark;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.CollectType;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.CollectMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.common.util.ClasspathScanner;
+import org.apache.eventmesh.dashboard.console.function.report.ReportHandlerManage;
+import org.apache.eventmesh.dashboard.console.function.report.collect.active.AbstractMetadataCollect;
+import org.apache.eventmesh.dashboard.console.function.report.collect.exporter.CollectExporter;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.Time;
+
+import org.apache.tomcat.util.threads.ThreadPoolExecutor;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import com.alibaba.druid.pool.DruidDataSource;
+
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+
+/**
+ * 一个集群只允许一个模式,因为 PROMETHEUS是集群采集. 因为 prometheus 有两个模式 1. rocketmq 是多注册中心,可以采集多集群 。只能绑定到一个集群里面。
1. TODO 如果多个集群共享 多个注册中心 然后有多个
+ * prometheus,会出现重复采集问题。
所以共享 meta 集群不允许 使用 PROMETHEUS 模式。只允许使用 EVENTMESH
2. meta 集群 创建的时候可以默认创建 PROMETHEUS
3. meta 集群节点发生更新的时候,也需要更新
+ * PROMETHEUS
4. 提供重启功能
5. 只允许手动 与 私有 meta 集群被差集
2. kafka 单注册单集群,可以绑定 kafka 集群上面
3. 查询 collect 表信息,创建 cluster 的时候,会默认有 collect 配置
+ *
4. 定时同步 collect , runtime 信息。 collect 用于触发 collect 行为,
runtime信息 用于触发 runtime 差集
+ */
+@Slf4j
+public class CollectManage {
+
+ private static Map CLUSTER_TYPE_URL = new HashMap<>();
+
+ private static Map> CLUSTER_TYPE_CLASS = new HashMap<>();
+
+ static {
+ ClasspathScanner classpathScanner =
+ ClasspathScanner.builder().base(CollectManage.class).subPath("/active/**").annotationSet(Set.of(ClusterTypeMark.class)).build();
+ try {
+ List> classList = classpathScanner.getClazz();
+ classList.forEach(CollectManage::handler);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ private DruidDataSource dataSource;
+
+ private ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(20, 100, 5, TimeUnit.HOURS, new LinkedBlockingQueue<>());
+
+ private Map collectExporterMap = new ConcurrentHashMap<>();
+
+ private Map collectMap = new ConcurrentHashMap<>();
+
+ private Map> collectCacheMap = new ConcurrentHashMap<>();
+
+ private Map> collectExecuteMap = new ConcurrentHashMap<>();
+
+
+ @Setter
+ private ReportHandlerManage reportHandlerManage;
+
+ private static void handler(Class> clazz) {
+ CLUSTER_TYPE_CLASS.put(clazz.getAnnotation(ClusterTypeMark.class).clusterType(), clazz);
+ }
+
+ public void request() {
+ this.collectExporterMap.forEach((clusterId, exporter) -> {
+ this.threadPoolExecutor.execute(exporter::request);
+ });
+ }
+
+
+ public List getData() {
+ List timeList = new ArrayList<>();
+ this.collectExporterMap.forEach((clusterId, exporter) -> {
+ timeList.addAll(exporter.collect());
+ });
+ return timeList;
+ }
+
+ public void register(String url, ClusterMetadata clusterMetadata) {
+ CollectExporter collectExporter = new CollectExporter();
+ collectExporter.setUrl(url);
+ collectExporter.setClusterMetadata(clusterMetadata);
+ collectExporter.setReportMetaDataMap(this.reportHandlerManage.getReportMetaDataMap());
+ collectExporter.setAggregationMetaDataMap(this.reportHandlerManage.getAggregationMetaDataMap());
+ collectExporter.init();
+ collectExporterMap.put(clusterMetadata.getId(), collectExporter);
+
+ }
+
+
+ public void unregister(String url, ClusterMetadata clusterMetadata) {
+ this.collectExporterMap.remove(clusterMetadata.getId());
+ }
+
+
+ private class SyncAndHandlerData {
+
+ private LocalDateTime localDateTime = LocalDateTime.of(2000, 1, 1, 0, 0);
+
+ private List clusterMetadataList = new ArrayList<>();
+
+ private List runtimeMetadataList = new ArrayList<>();
+
+ private List collectMetadataList = new ArrayList<>();
+
+ private Map> runtimeMetadataMap = new ConcurrentHashMap<>();
+
+ private Map clusterMetadataMap = new ConcurrentHashMap<>();
+
+ public void syncData() {
+ LocalDateTime localDateTime = LocalDateTime.now();
+
+ try (Connection connection = dataSource.getConnection()) {
+ this.readCluster(connection);
+ this.readRuntime(connection);
+ this.readCollect(connection);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ this.localDateTime = localDateTime;
+ this.handlerData();
+ this.clusterMetadataList.clear();
+ this.runtimeMetadataList.clear();
+ this.collectMetadataList.clear();
+ try (Connection connection = dataSource.getConnection()) {
+ connection.isReadOnly();
+ } catch (SQLException e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ /**
+ *
+ */
+ public void handlerData() {
+ this.clusterMetadataList.forEach((clusterMetadata) -> {
+ if (clusterMetadata.isDelete()) {
+ collectCacheMap.remove(clusterMetadata.getId());
+ collectExecuteMap.remove(clusterMetadata.getId());
+ clusterMetadataMap.remove(clusterMetadata.getId());
+ collectExporterMap.remove(clusterMetadata.getId());
+ return;
+ }
+ clusterMetadataMap.put(clusterMetadata.getId(), clusterMetadata);
+ });
+ // clusterId , runtimeMetadata list
+ // 需要全部缓存,因为 collect 可以从 普罗米修斯修改成 eventmesh
+ this.runtimeMetadataList.forEach(runtimeMetadata -> {
+ if (Objects.equals(runtimeMetadata.getClusterType(), ClusterType.PROMETHEUS_EXPORTER)) {
+ if (runtimeMetadata.isInsert() || runtimeMetadata.isUpdate()) {
+ String url = runtimeMetadata.getHost() + ":" + runtimeMetadata.getPort();
+ register(url, clusterMetadataMap.get(runtimeMetadata.getClusterId()));
+ } else if (runtimeMetadata.isDelete()) {
+ collectExporterMap.remove(runtimeMetadata.getClusterId());
+ }
+ return;
+ }
+ AbstractMetadataCollect abstractMetadataCollect = collectCacheMap.get(runtimeMetadata.getClusterId());
+ Map runtimeMetadataHashMap =
+ runtimeMetadataMap.computeIfAbsent(runtimeMetadata.getClusterId(), k -> new HashMap<>());
+ if (runtimeMetadata.isInsert() || runtimeMetadata.isUpdate()) {
+ runtimeMetadataHashMap.put(runtimeMetadata.getId(), runtimeMetadata);
+ } else if (runtimeMetadata.isDelete()) {
+ runtimeMetadataHashMap.remove(runtimeMetadata.getId());
+ }
+ abstractMetadataCollect.setRuntimeMetadataList(new ArrayList<>(runtimeMetadataHashMap.values()));
+ });
+
+ this.collectMetadataList.forEach(collectMetadata -> {
+ if (Objects.equals(CollectType.EVENTMESH, collectMetadata.getCollectType())) {
+ collectExecuteMap.put(collectMetadata.getClusterId(), collectCacheMap.get(collectMetadata.getClusterId()));
+ } else if (Objects.equals(CollectType.PROMETHEUS, collectMetadata.getCollectType())
+ || Objects.equals(CollectType.NONE, collectMetadata.getCollectType())) {
+ collectExecuteMap.remove(collectMetadata.getClusterId());
+ }
+ });
+ }
+
+ public void readCluster(Connection connection) {
+ String sql = "select * from cluster where update_time >= ? ";
+ try (PreparedStatement p = connection.prepareStatement(sql)) {
+ p.setObject(1, localDateTime);
+ try (ResultSet rs = p.executeQuery()) {
+ while (rs.next()) {
+ ClusterMetadata clusterMetadata = new ClusterMetadata();
+ this.clusterMetadataList.add(clusterMetadata);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ public void readRuntime(Connection connection) {
+ String sql = "select * from runtime where update_time >= ? ";
+ try (PreparedStatement p = connection.prepareStatement(sql)) {
+ p.setObject(1, localDateTime);
+ try (ResultSet rs = p.executeQuery()) {
+ rs.getMetaData();
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ public void readCollect(Connection connection) {
+ String sql = "select * from collect where update_time >= ? ";
+ try (PreparedStatement p = connection.prepareStatement(sql)) {
+ p.setObject(1, localDateTime);
+ try (ResultSet rs = p.executeQuery()) {
+ rs.getMetaData();
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/MetadataDataManage.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/MetadataDataManage.java
new file mode 100644
index 00000000..9acf7a6f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/MetadataDataManage.java
@@ -0,0 +1,299 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect;
+
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.common.model.base.BaseClusterIdBase;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.ClusterId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.OrganizationId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.cap.CapModel;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.cap.CapSubscribeId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.cap.CapTopicId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.cap.GapGroupId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.GroupId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.TopicId;
+import org.apache.eventmesh.dashboard.core.metadata.DataMetadataHandler;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.slf4j.helpers.MessageFormatter;
+
+import com.alibaba.druid.pool.DruidDataSource;
+
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class MetadataDataManage {
+
+ private final List nameAndIdList = new ArrayList<>();
+ private final Map nameAndIdMap = new ConcurrentHashMap<>();
+ private final NameAndId nameAndId = new NameAndId();
+ private String sql;
+ private DruidDataSource dataSource;
+ private LocalDateTime localDateTime = LocalDateTime.of(2000, 1, 1, 0, 0);
+ private int selectObjectCount = 0;
+
+
+ public void supplement(OrganizationId organizationId) {
+ if (organizationId instanceof CapModel) {
+ this.capSupplement(organizationId);
+ } else {
+ this.notSupplement(organizationId);
+ }
+ }
+
+ public void notSupplement(OrganizationId organizationId) {
+ Long superId = organizationId.getOrganizationId();
+ if (organizationId instanceof ClusterId clusterId) {
+ superId = this.getId(MetadataType.CLUSTER, organizationId.getOrganizationId(), clusterId.getClustersName());
+ clusterId.setClustersId(superId);
+ }
+ if (organizationId instanceof RuntimeId runtimeId) {
+ String runtimeName = runtimeId.getRuntimeName();
+ if (runtimeName.indexOf(':') > 1) {
+ //TODO
+ superId = this.getId(MetadataType.RUNTIME, runtimeId.getClustersId(), runtimeId.getRuntimeName());
+ } else {
+ superId = this.getId(MetadataType.RUNTIME, runtimeId.getClustersId(), runtimeId.getRuntimeName());
+ }
+ runtimeId.setRuntimeId(superId);
+ }
+ if (organizationId instanceof TopicId topicId) {
+ Long topic = this.getId(MetadataType.TOPIC, superId, topicId.getTopicName());
+ topicId.setTopicId(topic);
+ } else if (organizationId instanceof GroupId groupId) {
+ Long group = this.getId(MetadataType.GROUP, superId, groupId.getGroupName());
+ groupId.setGroupId(group);
+ } else if (organizationId instanceof SubscribeId subscribeId) {
+ Long topic = this.getId(MetadataType.TOPIC, superId, subscribeId.getTopicName());
+ subscribeId.setTopicId(topic);
+ Long group = this.getId(MetadataType.GROUP, superId, subscribeId.getGroupName());
+ subscribeId.setGroupId(group);
+ }
+ }
+
+ public void capSupplement(OrganizationId organizationId) {
+ if (organizationId instanceof RuntimeId runtimeId) {
+ Long id = this.getId(MetadataType.RUNTIME, runtimeId.getClustersId(), runtimeId.getRuntimeName());
+ runtimeId.setRuntimeId(id);
+ }
+ if (organizationId instanceof CapTopicId topicId) {
+ Long id = this.getId(MetadataType.TOPIC, topicId.getClustersId(), topicId.getTopicName());
+ topicId.setTopicId(id);
+ }
+ if (organizationId instanceof GapGroupId gapGroupId) {
+ Long id = this.getId(MetadataType.GROUP, gapGroupId.getClustersId(), gapGroupId.getGroupName());
+ gapGroupId.setGroupId(id);
+ }
+ if (organizationId instanceof CapSubscribeId capSubscribeId) {
+ Long id = this.getId(MetadataType.TOPIC, capSubscribeId.getClustersId(), capSubscribeId.getTopicName());
+ capSubscribeId.setTopicId(id);
+
+ id = this.getId(MetadataType.GROUP, capSubscribeId.getClustersId(), capSubscribeId.getGroupName());
+ capSubscribeId.setGroupId(id);
+ }
+ }
+
+ public void init(String url, String user, String password) {
+ try {
+ this.dataSource = this.createSource(url, user, password);
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ this.createSql();
+ this.createConnection(url, user, password);
+ }
+
+ public DruidDataSource createSource(String url, String user, String password) throws SQLException {
+ DruidDataSource dataSource = new DruidDataSource();
+ dataSource.setUrl(url);
+ dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
+ dataSource.setUsername(user);
+ dataSource.setPassword(password);
+ dataSource.setMaxActive(200);
+ dataSource.setInitialSize(50);
+ dataSource.setMaxWait(1000 * 60 * 60 * 24);
+ dataSource.init();
+ return dataSource;
+ }
+
+ public void syncData() {
+ this.executeSql();
+ this.handlerMetadata();
+ }
+
+ private void executeSql() {
+ try (Connection connection = dataSource.getConnection()) {
+ PreparedStatement preparedStatement = connection.prepareStatement(this.sql);
+ for (int i = 1; i <= selectObjectCount; i++) {
+ preparedStatement.setObject(i, localDateTime);
+ }
+
+ this.localDateTime = LocalDateTime.now();
+ try (ResultSet re = preparedStatement.executeQuery()) {
+ if (re.next()) {
+ NameAndId nameAndId = new NameAndId();
+ nameAndId.setId(re.getLong("id"));
+ nameAndId.setName(re.getString("name"));
+ nameAndId.setSuperId(re.getLong("super_id"));
+ nameAndId.setIsDelete(re.getInt("is_delete"));
+ nameAndId.setStatus(re.getLong("status"));
+ nameAndId.setCreateTime(Instant.ofEpochMilli(re.getLong("create_time")).atZone(ZoneId.systemDefault()).toLocalDateTime());
+ nameAndId.setUpdateTime(Instant.ofEpochMilli(re.getLong("update_time")).atZone(ZoneId.systemDefault()).toLocalDateTime());
+ this.nameAndIdList.add(nameAndId);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ public void handlerMetadata() {
+ this.nameAndIdList.forEach((value) -> {
+ if (value.isDelete()) {
+ nameAndIdMap.remove(value);
+ } else if (Objects.equals(value.getStatus(), 1L)) {
+ nameAndIdMap.remove(value);
+ } else if (Objects.equals(value.getCreateTime(), value.getUpdateTime())) {
+ nameAndIdMap.put(value, value);
+ } else {
+ nameAndIdMap.put(value, value);
+ }
+ });
+ }
+
+
+ private void createConnection(String url, String user, String password) {
+ try (DruidDataSource dataSource = new DruidDataSource()) {
+ dataSource.setUrl(url);
+ dataSource.setUsername(user);
+ dataSource.setPassword(password);
+ dataSource.setInitialSize(5);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * TODO 需要重构,因为 普罗米修斯 与 eventmesh 的 采集架构冲突了
+ * 保留,
+ * 1. 两个之间不重提,
+ * 2. 没时间 ,
+ * 3. 不确定,两者时间是否兼容
+ * 4. 没有多少性能损伤
+ */
+ private void createSql() {
+ StringBuilder stringBuilder = new StringBuilder();
+ String sql;
+ sql = this.createSql(MetadataType.CLUSTER, "cluster", "organization_id", "name");
+ stringBuilder.append(sql).append("\r\n union all \r\n");
+ sql = this.createSql(MetadataType.RUNTIME, "runtime", "cluster_id", "name");
+ stringBuilder.append(sql).append("\r\n union all \r\n");
+ sql = this.createSql(MetadataType.RUNTIME, "runtime", "cluster_id", "host");
+ stringBuilder.append(sql).append("\r\n union all \r\n");
+ sql = this.createSql(MetadataType.GROUP, "`group`", "cluster_id", "name");
+ stringBuilder.append(sql).append("\r\n union all \r\n");
+ sql = this.createSql(MetadataType.TOPIC, "topic", "runtime_id", "topicName");
+ stringBuilder.append(sql);
+
+ this.sql = stringBuilder.toString();
+ }
+
+
+ public String createSql(MetadataType metadataType, String table, String superId, String name) {
+ this.selectObjectCount++;
+ String sql = """
+ select '{}' , id , {} , update_time,create_time,is_delete,status from {} where update_time > ?
+ """;
+ return MessageFormatter.arrayFormat(sql, List.of(metadataType, superId, table, name).toArray()).getMessage();
+ }
+
+ public DataMetadataHandler createDataMetadataHandler(MetadataType metadataType) {
+ return new DataMetadataHandler() {
+
+ @Override
+ public List getData() {
+ return List.of();
+ }
+
+ @Override
+ public void handleAll(Collection allData, List addData, List updateData,
+ List deleteData) {
+
+ }
+ };
+ }
+
+ public Long getId(MetadataType metadataType, Long superId, String name) {
+ nameAndId.setMetadataType(metadataType);
+ nameAndId.setSuperId(superId);
+ nameAndId.setName(name);
+ NameAndId nameAndId = this.nameAndIdMap.get(this.nameAndId);
+ return Objects.isNull(nameAndId) ? null : nameAndId.getId();
+ }
+
+
+ @Data
+ private class NameAndId extends BaseClusterIdBase {
+
+ private MetadataType metadataType;
+
+ private Long superId;
+
+ private String name;
+
+ @Override
+ public int hashCode() {
+ return metadataType.hashCode() + superId.hashCode() + name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof NameAndId nameAndId) {
+ return Objects.equals(metadataType, nameAndId.metadataType)
+ && Objects.equals(superId, nameAndId.superId)
+ && Objects.equals(name, nameAndId.name);
+ }
+ return false;
+ }
+
+ @Override
+ public String nodeUnique() {
+ return "";
+ }
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractCollect.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractCollect.java
new file mode 100644
index 00000000..0479cee6
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractCollect.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect.active;
+
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.RuntimeMetadata;
+import org.apache.eventmesh.dashboard.console.function.report.collect.Collect;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.Time;
+import org.apache.eventmesh.dashboard.core.function.SDK.AbstractClientInfo;
+import org.apache.eventmesh.dashboard.core.function.SDK.SDKTypeEnum;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import lombok.Setter;
+
+public abstract class AbstractCollect extends AbstractClientInfo implements Collect {
+
+ protected List times = new ArrayList<>();
+
+ protected List standby = new ArrayList<>();
+
+
+ @Override
+ protected SDKTypeEnum getSdkTypeEnum() {
+ return SDKTypeEnum.ADMIN;
+ }
+
+ public List collect() {
+ List list;
+ this.standby.clear();
+ synchronized (this) {
+ list = this.times;
+ this.times = this.standby;
+ this.standby = list;
+ }
+ return list;
+ }
+
+
+ @Setter
+ public abstract static class AbstractClusterCollect extends AbstractClientInfo {
+
+ private ClusterMetadata clusterMetadata;
+
+ }
+
+ @Setter
+ public abstract static class AbstractRuntimeCollect extends AbstractClusterCollect {
+
+ private List runtimeMetadataList;
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractMetadataCollect.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractMetadataCollect.java
new file mode 100644
index 00000000..d5c47592
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/active/AbstractMetadataCollect.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect.active;
+
+import org.apache.eventmesh.dashboard.common.model.metadata.GroupMetadata;
+import org.apache.eventmesh.dashboard.common.model.metadata.TopicMetadata;
+import org.apache.eventmesh.dashboard.console.function.report.collect.active.AbstractCollect.AbstractRuntimeCollect;
+
+import java.util.List;
+
+public abstract class AbstractMetadataCollect extends AbstractRuntimeCollect {
+
+
+ private List topicMetadataList;
+
+ private List groupMetadataList;
+
+
+ public synchronized List getTopicMetadataList() {
+ return topicMetadataList;
+ }
+
+ public synchronized void setTopicMetadataList(List topicMetadataList) {
+ this.topicMetadataList = topicMetadataList;
+ }
+
+ public synchronized List getGroupMetadataList() {
+ return groupMetadataList;
+ }
+
+ public synchronized void setGroupMetadataList(List groupMetadataList) {
+ this.groupMetadataList = groupMetadataList;
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/exporter/CollectExporter.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/exporter/CollectExporter.java
new file mode 100644
index 00000000..72c2b7cf
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/collect/exporter/CollectExporter.java
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.collect.exporter;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterSyncMetadataEnum;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.model.metadata.ClusterMetadata;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData.AggregationClass;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.ClusterId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.OrganizationId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.Time;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.net.http.HttpResponse.BodyHandlers;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import com.alibaba.fastjson.JSONObject;
+
+import lombok.Data;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+@Setter
+@Slf4j
+public class CollectExporter {
+
+
+ protected ClusterType clusterType;
+ protected ClusterMetadata clusterMetadata;
+ protected List times = new ArrayList<>();
+ protected List standby = new ArrayList<>();
+ private Map reportMetaDataMap = new HashMap<>();
+ private Map aggregationMetaDataMap = new HashMap<>();
+ private Map aggregationWrapperMap = new HashMap<>();
+ private Map fieldMapper = new HashMap<>();
+
+ private Map> objectFieldMapper = new HashMap<>();
+
+ private HttpClient client = HttpClient.newHttpClient();
+
+ private ClusterSyncMetadataEnum clusterSyncMetadataEnum;
+
+ @Setter
+ private String url;
+
+ public static LocalDateTime millisToLocalDateTime(long millis) {
+ return Instant.ofEpochMilli(millis)
+ .atZone(ZoneId.systemDefault())
+ .toLocalDateTime();
+ }
+
+ public void init() {
+ reportMetaDataMap.forEach((clusterMetadata, reportMetaData) -> {
+ if (!reportMetaData.isAggregation()) {
+ return;
+ }
+ AggregationWrapper aggregationWrapper = new AggregationWrapper();
+ aggregationWrapper.setReportMetaData(reportMetaData);
+ aggregationWrapper.setName(clusterMetadata);
+ this.aggregationWrapperMap.put(clusterMetadata, aggregationWrapper);
+
+ reportMetaData.getAggregationClasses().forEach((key, value) -> {
+ this.aggregationWrapperMap.put(key, aggregationWrapper);
+ });
+ });
+ this.aggregationMetaDataMap.forEach((reportMetaName, reportMetaData) -> {
+ this.aggregationWrapperMap.computeIfAbsent(reportMetaData.getReportName(), (k) -> {
+ AggregationWrapper aggregationWrapper = new AggregationWrapper();
+ aggregationWrapper.setReportMetaData(reportMetaData);
+ aggregationWrapper.setName(reportMetaData.getReportName());
+ return aggregationWrapper;
+ });
+ });
+ this.clusterSyncMetadataEnum = ClusterSyncMetadataEnum.valueOf(this.clusterMetadata.getClusterType().name());
+ }
+
+ public List collect() {
+ List list;
+ this.standby.clear();
+ synchronized (this) {
+ list = this.times;
+ this.times = this.standby;
+ this.standby = list;
+ }
+ return list;
+ }
+
+ public void request() {
+ try {
+ this.aggregationWrapperMap.values().forEach(aggregationWrapper -> {
+ aggregationWrapper.organization = null;
+ });
+ String data = this.exporterRequest();
+ for (String data1 : StringUtils.split(data, (char) 10)) {
+ if (data1.startsWith("#")) {
+ continue;
+ }
+ this.handler(data1);
+ }
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+
+
+ }
+
+ public String exporterRequest() throws IOException, InterruptedException {
+ HttpRequest request = HttpRequest.newBuilder().uri(URI.create(this.url)).build();
+ HttpResponse response = client.send(request, BodyHandlers.ofString());
+ return response.body();
+ }
+
+ public void handler(String data) {
+ String[] datas = StringUtils.split(data, (char) 32);
+ int index = 0;
+
+ String data1 = datas[index++];
+ String key;
+ JSONObject jsonObject = null;
+ if (data1.indexOf(123) > -1) {
+ key = data1.substring(0, data1.indexOf(123));
+ final JSONObject finalJsonObject = new JSONObject();
+ String metaDataString = data1.substring(data1.indexOf(123) + 1, data1.length() - 1);
+ List.of(StringUtils.split(metaDataString, ',')).forEach((value) -> {
+ String newValue = value.trim();
+ if (Objects.equals(newValue, ",")) {
+ return;
+ }
+ int stringIndex = newValue.indexOf("=");
+ if (stringIndex == -1) {
+ return;
+ }
+ finalJsonObject.put(newValue.substring(0, stringIndex).trim(), newValue.substring(stringIndex + 1).trim());
+ });
+ jsonObject = finalJsonObject;
+ } else {
+ key = data1;
+ }
+ String value = datas[index++];
+ LocalDateTime time = datas.length == 2 ? LocalDateTime.now() : millisToLocalDateTime(Long.parseLong(datas[index++]));
+ // 通过 ClusterType , key 得到 object
+ //
+ OrganizationId object = this.buildObject(key, jsonObject, value, time);
+ if (Objects.isNull(object)) {
+ return;
+ }
+ this.times.add(object);
+
+ }
+
+ public ClusterId buildObject(String key, JSONObject jsonObject, String value, LocalDateTime time) {
+ ReportMetaData reportMetaData = this.reportMetaDataMap.get(key);
+
+ try {
+ AggregationWrapper aggregationWrapper = null;
+ if (Objects.isNull(reportMetaData)) {
+ aggregationWrapper = this.aggregationWrapperMap.get(key);
+ if (Objects.isNull(aggregationWrapper)) {
+ log.error("reportMetaData does not exist。 key:{},value:{},time:{}", key, value, time);
+ return null;
+ }
+ if (Objects.nonNull(aggregationWrapper.getOrganization())) {
+ Field field = aggregationWrapper.getReportMetaData().getAggregationFieldMap().get(key);
+ field.set(aggregationWrapper.getOrganization(), value);
+ return null;
+ }
+ }
+
+ Map stringFieldMapper = this.createStringFieldMapper(reportMetaData);
+
+ ClusterId object = this.createObject(stringFieldMapper, reportMetaData, time, jsonObject);
+ if (Objects.nonNull(aggregationWrapper)) {
+ aggregationWrapper.organization = object;
+ }
+ return object;
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ return null;
+ }
+
+ }
+
+ private ClusterId createObject(Map stringFieldMapper, ReportMetaData reportMetaData, LocalDateTime time, JSONObject jsonObject)
+ throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+ Class> clazz = reportMetaData.getClazz();
+ ClusterId object = (ClusterId) clazz.getDeclaredConstructor().newInstance();
+ object.setOrganizationId(this.clusterMetadata.getOrganizationId());
+ /*
+ TODO 目前只有 rocketmq 架构 的 普罗米修斯 采集 多 cluster 信息
+ 无法通过架构去决定 普罗米修斯 exporter 是采集单集群,还是多集群
+ 硬编码
+ 硬编码
+ */
+ if (Objects.equals(this.clusterMetadata.getClusterType(), ClusterType.STORAGE_ROCKETMQ_CLUSTER)
+ || Objects.equals(this.clusterMetadata.getClusterType(), ClusterType.STORAGE_ROCKETMQ_BROKER_MAIN_SLAVE)
+ || Objects.equals(this.clusterMetadata.getClusterType(), ClusterType.STORAGE_ROCKETMQ_BROKER_RAFT)
+ || Objects.equals(this.clusterMetadata.getClusterType(), ClusterType.STORAGE_ROCKETMQ_NAMESERVER)
+ ) {
+ object.setClustersName(jsonObject.getString("cluster"));
+ if (object instanceof RuntimeId runtimeId) {
+ if (jsonObject.containsKey("broker")) {
+ runtimeId.setRuntimeName(jsonObject.getString("broker"));
+ } else if (jsonObject.containsKey("brokerIP")) {
+ runtimeId.setRuntimeName(jsonObject.getString("brokerIP"));
+ }
+ }
+ } else {
+ object.setClustersId(this.clusterMetadata.getClusterId());
+ object.setClustersName(this.clusterMetadata.getClusterName());
+ }
+ object.setTime(time);
+ stringFieldMapper.forEach((fieldName, field) -> {
+ String fieldValue = jsonObject.getString(fieldName);
+ if (Objects.isNull(fieldValue)) {
+ return;
+ }
+ try {
+ field.set(object, fieldValue);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ return object;
+ }
+
+ private Map createStringFieldMapper(ReportMetaData reportMetaData) {
+ Map stringFieldMapper = this.objectFieldMapper.get(reportMetaData.getReportName());
+ if (Objects.isNull(stringFieldMapper)) {
+ stringFieldMapper = new HashMap<>();
+ this.objectFieldMapper.put(reportMetaData.getReportName(), stringFieldMapper);
+ Map finalStringFieldMapper = stringFieldMapper;
+ reportMetaData.getFieldList().forEach(field -> {
+ field.setAccessible(true);
+ String fieldKey = this.fieldMapper.get(field.getName());
+ if (Objects.isNull(fieldKey)) {
+ finalStringFieldMapper.put(field.getName(), field);
+ } else {
+ finalStringFieldMapper.put(fieldKey, field);
+ }
+ });
+ }
+ return stringFieldMapper;
+ }
+
+ @Data
+ static class AggregationWrapper {
+
+ private String name;
+
+ private ReportMetaData reportMetaData;
+
+ private Map aggregationClassMap;
+
+ private Map fieldMap;
+
+ private OrganizationId organization;
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/ElasticsearchReportEngine.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/ElasticsearchReportEngine.java
new file mode 100644
index 00000000..dabd2073
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/ElasticsearchReportEngine.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.elasticsearch;
+
+
+import org.apache.eventmesh.dashboard.console.function.report.AbstractReportEngine;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.AbstractReportMetaHandler;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+public class ElasticsearchReportEngine extends AbstractReportEngine {
+
+ @Override
+ protected void doInit() {
+
+ }
+
+ @Override
+ protected AbstractReportMetaHandler doCreateReportHandler(ReportMetaData reportMetaData, List fieldList) {
+ return null;
+ }
+
+ @Override
+ public CompletableFuture>> query(SingleGeneralReportDO singleGeneralReportDO) {
+ return null;
+ }
+
+ @Override
+ public void createReport(String tableName) {
+
+ }
+
+ @Override
+ public void batchInsert(String tableName, List data) {
+
+ }
+
+ @Override
+ public void deleteData() {
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/SearchScriptMeta.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/SearchScriptMeta.java
new file mode 100644
index 00000000..e3b3eda2
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/SearchScriptMeta.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.elasticsearch;
+
+/**
+ *
+ */
+public interface SearchScriptMeta {
+
+
+ String type();
+
+ String script();
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/script/GeneralSearchScriptMeta.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/script/GeneralSearchScriptMeta.java
new file mode 100644
index 00000000..a7f2d566
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/elasticsearch/script/GeneralSearchScriptMeta.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.elasticsearch.script;
+
+import org.apache.eventmesh.dashboard.console.function.report.elasticsearch.SearchScriptMeta;
+
+public class GeneralSearchScriptMeta implements SearchScriptMeta {
+
+ @Override
+ public String type() {
+ return "";
+ }
+
+ @Override
+ public String script() {
+ return """
+ {
+ "size": 0,
+ "query": {
+ "bool": {
+ "must": [
+ { "term": { "clusterPhyId": { "value": %d }}},
+ { "range": { "timestamp": { "gte": %d, "lte": %d } } }
+ ]
+ }
+ },
+ "aggs": {
+ "hist": {
+ "terms": {
+ "field": "brokerId",
+ "collect_mode": "breadth_first"
+ },
+ "aggs": {
+ "hist": {
+ "date_histogram": {
+ "field": "timestamp",
+ "fixed_interval": "%s",
+ "time_zone": "Asia/Shanghai",
+ "min_doc_count": 0
+ },
+ "aggs": {
+ %s
+ }
+ }
+ }
+ }
+ }
+ }
+ """;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportEngine.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportEngine.java
new file mode 100644
index 00000000..6c6dbd13
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportEngine.java
@@ -0,0 +1,358 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.iotdb;
+
+import org.apache.eventmesh.dashboard.console.function.report.AbstractReportEngine;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.AbstractReportMetaHandler;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.reflect.Field;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+import com.alibaba.druid.pool.DruidDataSource;
+
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 组件类型,report名,数据类型,类名(因为采集模块),表名,默认展示类型,可以展示类型,
+ */
+@SuppressWarnings("SqlSourceToSinkFlow")
+@Slf4j
+public class IotDBReportEngine extends AbstractReportEngine {
+
+ /**
+ *
+ */
+ @Getter
+ private final String sql = """
+ select
+
+
+ organization_id,
+
+
+ cluster_id
+
+
+ runtime_id,
+
+
+ topic_id,
+
+
+ group_id,
+
+
+ queue_id,
+
+
+ subscription_id,
+
+
+
+
+ ${fun}( value )
+
+
+ value
+
+
+
+
+ ${fun}( value )
+
+
+ value
+
+
+
+
+ ${fun}( value )
+
+
+ value
+
+
+
+
+
+
+
+
+ from ${table}
+ where
+
+ organization_id = ${organizationId} and
+
+
+ cluster_id = ${clusterId} and
+
+
+ runtime_id = ${runtimeId} and
+
+
+ topic_id = ${topicId} and
+
+
+ group_id = ${groupId} and
+
+
+ queue_id = ${queueId} and
+
+
+ subscription_id = ${subscriptionId} and
+
+ re >= ${startTime} and re < ${endTime}
+
+ group by ([${startTime}, ${endTime}), ${interval})
+
+
+ , organization_id
+
+
+ , cluster_id
+
+
+ , runtime_id
+
+
+ , topic_id
+
+
+ , group_id
+
+
+ , queue_id
+
+
+ , subscription_id
+
+
+ """;
+ private DruidDataSource dataSource;
+ private boolean isBatch = false;
+
+ @Override
+ protected void doInit() {
+ try {
+ this.initDatabase();
+ this.dataSource =
+ this.createDataSource("jdbc:iotdb://" + this.reportEngineConfig.getEngineAddress() + "/eventmesh_dashboard?sql_dialect=table");
+ } catch (Exception e) {
+ if (this.dataSource != null) {
+ this.dataSource.close();
+ }
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void initDatabase() throws SQLException {
+ try (DruidDataSource dataSource = this.createDataSource(
+ "jdbc:iotdb://" + this.reportEngineConfig.getEngineAddress() + "/?sql_dialect=table")) {
+ try (Connection connection = dataSource.getConnection()) {
+ String sql = """
+ create database if not exists eventmesh_dashboard with(TTL=31536000000)
+ """;
+ connection.setAutoCommit(true);
+ connection.createStatement().execute(sql);
+ }
+ }
+ }
+
+
+ private DruidDataSource createDataSource(String url) throws SQLException {
+ DruidDataSource dataSource = new DruidDataSource();
+ dataSource.setUrl(url);
+ dataSource.setDriverClassName("org.apache.iotdb.jdbc.IoTDBDriver");
+ dataSource.setUsername("root");
+ dataSource.setPassword("root");
+ dataSource.setMaxActive(200);
+ dataSource.setInitialSize(50);
+ dataSource.setMaxWait(1000 * 60 * 60 * 24);
+ dataSource.init();
+ return dataSource;
+ }
+
+ @Override
+ protected AbstractReportMetaHandler doCreateReportHandler(ReportMetaData reportMetaData, List fieldList) {
+ return new IotDBReportMetaHandler();
+ }
+
+ @Override
+ public CompletableFuture>> query(SingleGeneralReportDO singleGeneralReportDO) {
+ return CompletableFuture.supplyAsync(() -> {
+ String sql = this.buildSql(singleGeneralReportDO.getReportName(), singleGeneralReportDO.getReportType(), singleGeneralReportDO);
+ try (Connection connection = this.dataSource.getConnection();
+ PreparedStatement ps = connection.prepareStatement(sql)) {
+ connection.isReadOnly();
+ try (ResultSet rs = ps.executeQuery()) {
+ List> list = new ArrayList<>();
+ ResultSetMetaData metaData = rs.getMetaData();
+ int columnCount = metaData.getColumnCount();
+ while (rs.next()) {
+ Map row = new HashMap<>();
+ for (int i = 1; i <= columnCount; i++) {
+ row.put(metaData.getColumnName(i), rs.getObject(i));
+ }
+ list.add(row);
+ }
+ return list;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+
+ }
+
+ @Override
+ public void createReport(String tableName) {
+ String sql;
+ if (Objects.equals(tableName, "*")) {
+ sql = this.getCreateTableSql();
+ if (StringUtils.isEmpty(sql)) {
+ return;
+ }
+ } else {
+ sql = this.buildSql(tableName, ReportViewType.CREATE_TABLE.getName(), null);
+ }
+ this.execute(sql);
+ }
+
+ @Override
+ public void batchInsert(String tableName, List data) {
+ String sql = this.buildSql(tableName, ReportViewType.INSERT.getName(), (Object) data);
+ this.execute(sql);
+ }
+
+ @Override
+ public void batchInsert(Map> data) {
+ StringBuilder sb = new StringBuilder();
+ List sqlList = new ArrayList<>();
+ int count = 5000;
+ for (Entry> entry : data.entrySet()) {
+ String sql = this.buildSql(entry.getKey(), ReportViewType.INSERT.getName(), entry.getValue());
+ count = count - entry.getValue().size();
+ sb.append(sql);
+ if (count < 0) {
+ count = 5000;
+ sqlList.add(sb.toString());
+ sb.delete(0, sb.length());
+ }
+ }
+ if (!sb.isEmpty()) {
+ sqlList.add(sb.toString());
+ }
+ this.execute(sqlList);
+ }
+
+ /**
+ * 创建 表时,可以直接定义数据存储时间。字段是: TLL
+ */
+ @Override
+ public void deleteData() {
+
+ }
+
+
+ public String getCreateTableSql() {
+ StringBuilder stringBuilder = new StringBuilder();
+ Set tableNameSet = new HashSet<>();
+ String showTablesSql = " show tables";
+ this.executeQuery(showTablesSql, (rs) -> {
+ try {
+ while (rs.next()) {
+ tableNameSet.add(rs.getString("TableName"));
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ });
+ this.getReportMetaHandlerMap().keySet().forEach(key -> {
+ if (!tableNameSet.contains(key)) {
+ String sql = this.buildSql(key, ReportViewType.CREATE_TABLE.getName(), null);
+ if (this.isBatch) {
+ stringBuilder.append(sql).append("\r\nwith \r\n");
+ } else {
+ this.execute(sql);
+ }
+ }
+ });
+ String sql = stringBuilder.toString();
+ return StringUtils.isEmpty(sql) ? sql : sql.substring(0, sql.length() - 9);
+ }
+
+
+ public void execute(String sql) {
+ try (Connection conn = this.dataSource.getConnection();
+ Statement statement = conn.createStatement()) {
+ statement.execute(sql);
+ } catch (SQLException e) {
+ throw new RuntimeException(sql, e);
+ }
+ }
+
+ public void execute(List sql) {
+ sql.forEach(this::execute);
+ }
+
+ public void executeQuery(String sql, Consumer consumer) {
+ this.executeQuery(sql, null, consumer);
+ }
+
+ public void executeQuery(String sql, List objectList, Consumer consumer) {
+ try (Connection conn = this.dataSource.getConnection();
+ PreparedStatement ps = conn.prepareStatement(sql)) {
+ if (CollectionUtils.isNotEmpty(objectList)) {
+ for (int i = 0; i < objectList.size(); i++) {
+ ps.setObject(i, objectList.get(i));
+ }
+ }
+ try (ResultSet rs = ps.executeQuery()) {
+ consumer.accept(rs);
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportMetaHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportMetaHandler.java
new file mode 100644
index 00000000..358d1bbf
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/iotdb/IotDBReportMetaHandler.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.iotdb;
+
+import org.apache.eventmesh.dashboard.console.function.report.annotation.AbstractReportMetaHandler;
+
+import java.lang.reflect.Field;
+import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.google.common.base.CaseFormat;
+
+public class IotDBReportMetaHandler extends AbstractReportMetaHandler {
+
+
+ @Override
+ public String insert() {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("insert into ");
+ stringBuilder.append(this.reportMeta.getTableName());
+ stringBuilder.append(" (");
+ this.fieldList.forEach(field -> {
+ String key = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, field.getName());
+ stringBuilder.append(key).append(",");
+ });
+ stringBuilder.deleteCharAt(stringBuilder.length() - 1).append(" ) values \r\n");
+ stringBuilder.append(" \r\n (");
+ this.fieldList.forEach(field -> {
+ if (field.getName().endsWith("Id") || !(Number.class.isAssignableFrom(field.getType()))) {
+ stringBuilder.append("'${item.").append(field.getName()).append("}'");
+ } else {
+ stringBuilder.append("${item.").append(field.getName()).append("}");
+ }
+
+ stringBuilder.append(",");
+ });
+ stringBuilder.deleteCharAt(stringBuilder.length() - 1).append(")\r\n").append(" ");
+ return stringBuilder.toString();
+ }
+
+ @Override
+ public String query(String type) {
+ Map map = new HashMap<>();
+ this.fieldList.forEach(field -> {
+ map.put(field.getName(), field);
+ });
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("select ")
+ .append("\r\n date_bin(${_parameter.interval}, time) as time , ")
+ .append("\r\n time , ");
+ stringBuilder.append("\r\n ");
+ this.fieldList.forEach(field -> {
+ String filedName = field.getName();
+ if (Objects.equals(filedName, "time")) {
+ return;
+ }
+ String key = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, filedName);
+ if (filedName.startsWith("value")) {
+ stringBuilder.append("\r\n ,").append(key).append(" ")
+ .append("\r\n ,${_parameter.selectFun}(").append(key).append(") ");
+ } else if (key.endsWith("_id")) {
+ stringBuilder.append("\r\n ");
+ stringBuilder.append(" ,")
+ .append(key).append(',');
+ String typeField = filedName.replace("Id", "Type");
+ if (map.containsKey(typeField)) {
+ stringBuilder.append(",").append(key.replace("id", "type"));
+ }
+ String nameField = filedName.replace("Id", "Name");
+ if (map.containsKey(nameField)) {
+ // last_by 函数可以解决 attribute类型字段 必须 与 group by 保持一致的问题
+ stringBuilder.append(",")
+ .append("last_by(").append(key.replace("id", "name"))
+ .append(")").append(",");
+ }
+ stringBuilder.append(" ");
+ }
+ });
+ stringBuilder.append("\r\n ");
+ stringBuilder.append("\r\nfrom ").append(this.reportMeta.getTableName()).append("\r\n where \r\n")
+ .append(" time > ${startTime} and time < ${endTime} \r\n");
+ this.fieldList.forEach(field -> {
+ String filedName = field.getName();
+ if (filedName.endsWith("Id")) {
+ String key = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, filedName);
+ stringBuilder.append("\r\n ")
+ .append(" and ")
+ .append(key)
+ .append("='${_parameter.")
+ .append(field.getName())
+ .append("}' ");
+ }
+ });
+ stringBuilder.append("\r\n ");
+ stringBuilder.append("\r\n group by time, \r\n ");
+ this.fieldList.forEach(field -> {
+ String filedName = field.getName();
+ String key = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, filedName);
+ if (filedName.endsWith("Id")) {
+ stringBuilder.append(AbstractReportMetaHandler.lineAndTabString);
+ stringBuilder.append(",")
+ .append(key).append(" , ");
+ stringBuilder.append(" ");
+ }
+ });
+ stringBuilder.append("\r\n ").append("\r\n ");
+ return stringBuilder.toString();
+ }
+
+ @Override
+ public String createTable() {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("create table if not exists ");
+ stringBuilder.append(this.reportMeta.getTableName());
+ stringBuilder.append(" (\r\n ");
+ AtomicInteger num = new AtomicInteger(this.fieldList.size());
+ this.fieldList.forEach(field -> {
+ String filedName = field.getName();
+ String key = CaseFormat.LOWER_CAMEL.to(com.google.common.base.CaseFormat.LOWER_UNDERSCORE, filedName);
+ stringBuilder.append(key);
+ Class> type = field.getType();
+ if (type == long.class
+ || type == Long.class
+ || type == int.class
+ || type == Integer.class
+ ) {
+ stringBuilder.append(key.endsWith("_id") ? " string " : " int64 ");
+ } else if (type == float.class || type == Float.class) {
+ stringBuilder.append(" float ");
+ } else if (type == String.class) {
+ stringBuilder.append(" string ");
+ } else if (type == LocalDateTime.class) {
+ stringBuilder.append(" timestamp ");
+ }
+
+ if (Objects.equals(filedName, "time")) {
+ stringBuilder.append(" time");
+ } else if (filedName.endsWith("Id")) {
+ stringBuilder.append(" tag");
+ } else if (filedName.startsWith("value") || field.getDeclaringClass() == this.reportMeta.getClazz()) {
+ stringBuilder.append(" field");
+
+ } else {
+ stringBuilder.append(" attribute");
+ }
+ if (num.decrementAndGet() != 0) {
+ stringBuilder.append(",");
+ stringBuilder.append(lineAndTabString);
+ }
+ });
+ stringBuilder.append("\r\n)comment ' ").append(reportMeta.getComment()).append("'");
+ return stringBuilder.toString();
+ }
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/GeneralReportDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/GeneralReportDO.java
new file mode 100644
index 00000000..0ac4e204
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/GeneralReportDO.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+
+@Data
+public class GeneralReportDO {
+
+ private Long organizationId;
+
+ private Long clustersId;
+
+ private String reportName;
+
+ private String reportType;
+
+ private Long runtimeId;
+
+ private String runtimeType;
+
+ private Long topicId;
+
+ private Long groupId;
+
+ /**
+ * 查询条件 与 分组条件
+ */
+ private LocalDateTime startTime;
+
+ /**
+ * 查询条件 与 分组条件
+ */
+ private LocalDateTime endTime;
+
+ /**
+ * 分组的时间间隔
+ */
+ private String interval;
+
+ private String selectFun;
+
+ /**
+ *
+ */
+ private String orderFun;
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtimeCycle/CreateRuntimeDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/MultiGeneralReportDO.java
similarity index 80%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtimeCycle/CreateRuntimeDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/MultiGeneralReportDO.java
index ee981f7a..08424924 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtimeCycle/CreateRuntimeDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/MultiGeneralReportDO.java
@@ -15,18 +15,19 @@
* limitations under the License.
*/
+package org.apache.eventmesh.dashboard.console.function.report.model;
-package org.apache.eventmesh.dashboard.console.modle.cluster.runtimeCycle;
-
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-public class CreateRuntimeDTO extends ClusterIdDTO {
+public class MultiGeneralReportDO extends GeneralReportDO {
+
+
+ private List reportNameList;
- private int runtimeNum;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/SingleGeneralReportDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/SingleGeneralReportDO.java
new file mode 100644
index 00000000..4381e99e
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/SingleGeneralReportDO.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SingleGeneralReportDO extends GeneralReportDO {
+
+ /**
+ * 二级维度,是在原有的数据上进行整理。 对 order 与 分页,不关系
+ */
+ private String twoLevelGroup;
+
+ private String order;
+
+ private Integer limit;
+
+ private Integer offset;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/ClusterId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/ClusterId.java
new file mode 100644
index 00000000..87d5b67e
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/ClusterId.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ClusterId extends OrganizationId {
+
+
+ private Long clustersId;
+
+ private String clustersName;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/OrganizationId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/OrganizationId.java
new file mode 100644
index 00000000..22ec247a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/OrganizationId.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrganizationId extends Time {
+
+ private Long organizationId;
+
+ private String organizationName;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Query.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Query.java
new file mode 100644
index 00000000..72f6fd3a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Query.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base;
+
+import java.time.LocalDateTime;
+
+public class Query {
+
+ private String reportName;
+
+ private LocalDateTime startTime;
+
+ private LocalDateTime endTime;
+
+ private String interval;
+
+ private String selectFun;
+
+ private String orderBy;
+
+ private boolean asc;
+
+ private String limit;
+
+ private String offset;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/RuntimeId.java
similarity index 64%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/RuntimeId.java
index a8046f83..d024377c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/StoreEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/RuntimeId.java
@@ -15,38 +15,35 @@
* limitations under the License.
*/
-
-package org.apache.eventmesh.dashboard.console.entity;
-
+package org.apache.eventmesh.dashboard.console.function.report.model.base;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
-@Deprecated
-public class StoreEntity extends BaseEntity {
+public class RuntimeId extends ClusterId {
- private Long clusterId;
+ private Long runtimeId;
- /**
- * @see org.apache.eventmesh.dashboard.common.enums.StoreType
- */
- private Integer storeType;
+ private String runtimeName;
- private String host;
+ private String runtimeType;
- private String topicList;
- private Short diffType;
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class RuntimeLongValue extends RuntimeId {
- private Integer port;
+ private Long value;
- private Integer jmxPort;
+ }
- private String rack;
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class RuntimeFloatValue extends RuntimeId {
- private String endpointMap;
+ private Float value;
- private Long startTimestamp;
+ }
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Time.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Time.java
new file mode 100644
index 00000000..47747702
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/Time.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+
+/**
+ * TODO
+ * 统计基类
+ * 有两个体系: CAP 体系 与 NOT 体系
+ * CAP 体系从 cluster 开始, NOT 体系从 runtime 开始
+ * 但是因为:RocketMQ 普罗米修斯 的行为卡在 CAP 与 NOT 体系之间,需要特殊处理
+ * 所以还有一个体系。
+ * Kafka 不管用 普罗米修斯 还是 console 写 都是一套体系
+ */
+@Data
+public class Time {
+
+ private LocalDateTime time;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapModel.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapModel.java
new file mode 100644
index 00000000..8230ae16
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapModel.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.cap;
+
+/**
+ *
+ */
+public interface CapModel {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapQueueIndex.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapQueueIndex.java
new file mode 100644
index 00000000..402d0d10
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapQueueIndex.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.cap;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.TopicId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CapQueueIndex extends TopicId implements CapModel {
+
+ private Integer queueName;
+
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class LongValue extends CapQueueIndex {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class FloatValue extends CapQueueIndex {
+
+ private Float value;
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapSubscribeId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapSubscribeId.java
new file mode 100644
index 00000000..72e9c2f8
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapSubscribeId.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.cap;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.ClusterId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CapSubscribeId extends ClusterId implements CapModel {
+
+ private Long topicId;
+
+ private String topicName;
+
+ private Long groupId;
+
+ private String groupName;
+
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class LongValue extends CapSubscribeId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class FloatValue extends CapSubscribeId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapTopicId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapTopicId.java
new file mode 100644
index 00000000..c2c79ed6
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/CapTopicId.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.cap;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.ClusterId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CapTopicId extends ClusterId implements CapModel {
+
+
+ private Long topicId;
+
+ private String topicName;
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class TopicLongValue extends CapTopicId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class TopicFloatValue extends CapTopicId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/GapGroupId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/GapGroupId.java
new file mode 100644
index 00000000..6dd7358f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/cap/GapGroupId.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.cap;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GapGroupId extends RuntimeId implements CapModel {
+
+
+ private Long groupId;
+
+ private String groupName;
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class GroupLongValue extends GapGroupId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class GroupFloatValue extends GapGroupId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/GroupId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/GroupId.java
new file mode 100644
index 00000000..093e5a54
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/GroupId.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.not;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GroupId extends RuntimeId {
+
+
+ private Long groupId;
+
+ private String groupName;
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class GroupLongValue extends GroupId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class GroupFloatValue extends GroupId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/QueueIndex.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/QueueIndex.java
new file mode 100644
index 00000000..87795376
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/QueueIndex.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.not;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class QueueIndex extends TopicId {
+
+ private Integer queueName;
+
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class LongValue extends QueueIndex {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class FloatValue extends QueueIndex {
+
+ private Float value;
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/SubscribeId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/SubscribeId.java
new file mode 100644
index 00000000..e188215b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/SubscribeId.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.not;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SubscribeId extends RuntimeId {
+
+ private Long topicId;
+
+ private String topicName;
+
+ private Long groupId;
+
+ private String groupName;
+
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class LongValue extends SubscribeId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class FloatValue extends SubscribeId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/TopicId.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/TopicId.java
new file mode 100644
index 00000000..6f5420b4
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/base/not/TopicId.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.base.not;
+
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+public class TopicId extends RuntimeId {
+
+
+ private Long topicId;
+
+ private String topicName;
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class TopicLongValue extends TopicId {
+
+ private Long value;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class TopicFloatValue extends TopicId {
+
+ private Float value;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/AbstractMetricsDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/AbstractMetricsDO.java
new file mode 100644
index 00000000..410f0ef5
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/AbstractMetricsDO.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.metrics;
+
+import org.apache.eventmesh.dashboard.console.model.vo.RuntimeIdDTO;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AbstractMetricsDO extends RuntimeIdDTO {
+
+ private String clusterName;
+
+ private String runtimeName;
+
+ private String runtimeType;
+
+ private Long groupId;
+
+ private String groupName;
+
+ private Long subscribeId;
+
+ private Long topicId;
+
+ private String topicName;
+
+ private String topicType;
+
+ private LocalDateTime recordTime;
+
+ private Long value;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/InputMetricsDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/InputMetricsDO.java
new file mode 100644
index 00000000..f350de2e
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/metrics/InputMetricsDO.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.metrics;
+
+import java.time.LocalDateTime;
+
+public class InputMetricsDO {
+
+ private Long organizationId;
+
+ private Long clusterId;
+
+ private String clusterName;
+
+ private Long runtimeId;
+
+ private String runtimeName;
+
+ private String runtimeType;
+
+ private Long groupId;
+
+ private String groupName;
+
+ private Long subscribeId;
+
+ private Long topicId;
+
+ private String topicName;
+
+ private String topicType;
+
+ private LocalDateTime recordTime;
+
+ private Long value;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/Rocketmq2ProducerOffset.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/Rocketmq2ProducerOffset.java
new file mode 100644
index 00000000..d89fcb60
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/Rocketmq2ProducerOffset.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_producer_offset",
+ defaultViewType = ReportViewType.HISTOGRAM, tableName = "rocketmq_producer_offset",
+ comment = "topic offset")
+public class Rocketmq2ProducerOffset extends RuntimeLongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupCreateExecutionTime.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupCreateExecutionTime.java
new file mode 100644
index 00000000..891ee835
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupCreateExecutionTime.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_group_create_execution_time",
+ defaultViewType = ReportViewType.HISTOGRAM, tableName = "rocketmq_consumer_group_create_execution_time",
+ comment = "创建消费者组执行耗时")
+public class RocketmqConsumerGroupCreateExecutionTime extends RuntimeId {
+
+ private String invocationStatus;
+
+ private Long valueLe10ms;
+
+ private Long valueLe100ms;
+
+ private Long valueLe1s;
+
+ private Long valueLe3s;
+
+ private Long valueLe5s;
+
+ private Long valueLeOverflow;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupNumber.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupNumber.java
new file mode 100644
index 00000000..7f2a2f1f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerGroupNumber.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_group_number",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_consumer_group_number",
+ comment = "消费者组数量")
+public class RocketmqConsumerGroupNumber extends RuntimeLongValue {
+
+}
+
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerInflightMessages.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerInflightMessages.java
new file mode 100644
index 00000000..0d6fa4fe
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerInflightMessages.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_inflight_messages",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_consumer_inflight_messages",
+ comment = "处理中消息量")
+public class RocketmqConsumerInflightMessages extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerLagLatency.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerLagLatency.java
new file mode 100644
index 00000000..4f0c9f5b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerLagLatency.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_lag_latency",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_consumer_lag_latency",
+ comment = "消费处理延迟时间")
+public class RocketmqConsumerLagLatency extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerQueueingLatency.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerQueueingLatency.java
new file mode 100644
index 00000000..143f3446
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerQueueingLatency.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_queueing_latency",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_consumer_queueing_latency",
+ comment = "已就绪消息排队延迟时间")
+public class RocketmqConsumerQueueingLatency extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerReadyMessages.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerReadyMessages.java
new file mode 100644
index 00000000..f16817d1
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqConsumerReadyMessages.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_consumer_ready_messages",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_consumer_ready_messages",
+ comment = "已就绪消息量")
+public class RocketmqConsumerReadyMessages extends SubscribeId {
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqGroupGetLatency.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqGroupGetLatency.java
new file mode 100644
index 00000000..1b7aa170
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqGroupGetLatency.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.FloatValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_group_get_latency",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_group_get_latency",
+ comment = "Consumer latency on some topic for one queueConsumer latency on some topic for one queue ")
+public class RocketmqGroupGetLatency extends FloatValue {
+
+
+ private String queueId;
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessageSize.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessageSize.java
new file mode 100644
index 00000000..22f94fad
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessageSize.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.TopicId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_message_size",
+ defaultViewType = ReportViewType.HISTOGRAM, tableName = "rocketmq_message_size",
+ comment = "消息大小的分布情况,发送成功时统计")
+public class RocketmqMessageSize extends TopicId {
+
+ private String messageType;
+
+ private Float le1kb;
+
+ private Float le4kb;
+
+ private Float le512kb;
+
+ private Float le1mb;
+
+ private Float le2mb;
+
+ private Float le4mb;
+
+ private Float leOverflow;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesInTotal.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesInTotal.java
new file mode 100644
index 00000000..43d32a80
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesInTotal.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.TopicId.TopicLongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_messages_in_total",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_messages_in_total",
+ comment = "消息生产数量")
+public class RocketmqMessagesInTotal extends TopicLongValue {
+
+ private String messageType;
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesOutTotal.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesOutTotal.java
new file mode 100644
index 00000000..8b9c0b2d
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqMessagesOutTotal.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_messages_out_total",
+ defaultViewType = ReportViewType.COUNTER, tableName = "rocketmq_messages_out_total",
+ comment = "已就绪消息量")
+public class RocketmqMessagesOutTotal extends SubscribeId {
+
+ private Long topicNum;
+
+ private Long minOffset;
+
+ private Long maxOffset;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqRpcLatency.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqRpcLatency.java
new file mode 100644
index 00000000..739c50a7
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqRpcLatency.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_rpc_latency",
+ defaultViewType = ReportViewType.HISTOGRAM, tableName = "rocketmq_rpc_latency",
+ comment = "rpc 调用耗时")
+public class RocketmqRpcLatency extends LongValue {
+
+
+ private String protocolType;
+
+ private String requestCode;
+
+ private String responseCode;
+
+ private Long le1ms;
+
+ private Long le3ms;
+
+ private Long le5ms;
+
+ private Long le10ms;
+
+ private Long le100ms;
+
+ private Long le1s;
+
+ private Long le3s;
+
+ private Long leOverflow;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqSendToDlqMessagesTotal.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqSendToDlqMessagesTotal.java
new file mode 100644
index 00000000..d867e68f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqSendToDlqMessagesTotal.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_send_to_dlq_messages_total",
+ defaultViewType = ReportViewType.COUNTER, tableName = "rocketmq_send_to_dlq_messages_total",
+ comment = "处理中消息量")
+public class RocketmqSendToDlqMessagesTotal extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageDispatchBehindBytes.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageDispatchBehindBytes.java
new file mode 100644
index 00000000..14d29561
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageDispatchBehindBytes.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_storage_dispatch_behind_bytes",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_storage_dispatch_behind_bytes",
+ comment = "dispatch 落后大小")
+public class RocketmqStorageDispatchBehindBytes extends RuntimeLongValue {
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageFlushBehindBytes.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageFlushBehindBytes.java
new file mode 100644
index 00000000..e6d410c4
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageFlushBehindBytes.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_storage_flush_behind_bytes",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_storage_flush_behind_bytes",
+ comment = "刷盘落后大小")
+public class RocketmqStorageFlushBehindBytes extends RuntimeLongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageMessageReserveTime.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageMessageReserveTime.java
new file mode 100644
index 00000000..ddd5547f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqStorageMessageReserveTime.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_storage_message_reserve_time",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_storage_message_reserve_time",
+ comment = "储存层消息保存时间")
+public class RocketmqStorageMessageReserveTime extends RuntimeId {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThreadPoolWartermark.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThreadPoolWartermark.java
new file mode 100644
index 00000000..0f0df097
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThreadPoolWartermark.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_thread_pool_wartermark",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_thread_pool_wartermark",
+ comment = "线程池排队数")
+public class RocketmqThreadPoolWartermark extends RuntimeLongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputInTotal.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputInTotal.java
new file mode 100644
index 00000000..25e0ea33
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputInTotal.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_throughput_in_total",
+ defaultViewType = ReportViewType.COUNTER, tableName = "rocketmq_throughput_in_total",
+ comment = "消息生产流入服务端的吞吐量")
+public class RocketmqThroughputInTotal extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputOutTotal.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputOutTotal.java
new file mode 100644
index 00000000..2854442f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqThroughputOutTotal.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.not.SubscribeId.LongValue;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_throughput_out_total",
+ defaultViewType = ReportViewType.COUNTER, tableName = "rocketmq_throughput_out_total",
+ comment = "消息消费从服务端流出的吞吐量")
+public class RocketmqThroughputOutTotal extends LongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicCreateExecutionTime.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicCreateExecutionTime.java
new file mode 100644
index 00000000..0b14a660
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicCreateExecutionTime.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_topic_create_execution_time",
+ defaultViewType = ReportViewType.HISTOGRAM, tableName = "rocketmq_topic_create_execution_time",
+ comment = "创建主题执行耗时")
+public class RocketmqTopicCreateExecutionTime extends RuntimeId {
+
+ private String invocationStatus;
+
+ private int isSystem;
+
+ private Long valueLe10ms;
+
+ private Long valueLe100ms;
+
+ private Long valueLe1s;
+
+ private Long valueLe3s;
+
+ private Long valueLe5s;
+
+ private Long valueLeOverflow;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicNumber.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicNumber.java
new file mode 100644
index 00000000..968b43c8
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/model/rocketmq/RocketmqTopicNumber.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.model.rocketmq;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.function.report.ReportViewType;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMeta;
+import org.apache.eventmesh.dashboard.console.function.report.model.base.RuntimeId.RuntimeLongValue;
+
+@ReportMeta(clusterType = ClusterType.STORAGE_ROCKETMQ, reportName = "rocketmq_topic_number",
+ defaultViewType = ReportViewType.GAUGE, tableName = "rocketmq_topic_number",
+ comment = "主题数量")
+public class RocketmqTopicNumber extends RuntimeLongValue {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/opensearch/OpenSearchReportEngine.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/opensearch/OpenSearchReportEngine.java
new file mode 100644
index 00000000..3f5485f9
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/report/opensearch/OpenSearchReportEngine.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.function.report.opensearch;
+
+
+import org.apache.eventmesh.dashboard.console.function.report.AbstractReportEngine;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.AbstractReportMetaHandler;
+import org.apache.eventmesh.dashboard.console.function.report.annotation.ReportMetaData;
+import org.apache.eventmesh.dashboard.console.function.report.model.SingleGeneralReportDO;
+
+import org.apache.http.Header;
+import org.apache.http.HttpHost;
+import org.apache.http.message.BasicHeader;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+import java.util.concurrent.CompletableFuture;
+
+import org.opensearch.client.RestClient;
+import org.opensearch.client.json.jackson.JacksonJsonpMapper;
+import org.opensearch.client.opensearch.OpenSearchClient;
+import org.opensearch.client.opensearch._types.Script;
+import org.opensearch.client.opensearch.core.BulkRequest;
+import org.opensearch.client.opensearch.core.ScriptsPainlessExecuteRequest;
+import org.opensearch.client.transport.OpenSearchTransport;
+import org.opensearch.client.transport.rest_client.RestClientTransport;
+
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+
+/**
+ *
+ */
+public class OpenSearchReportEngine extends AbstractReportEngine {
+
+ private OpenSearchClient client;
+
+
+ public void handler() throws IOException {
+ ScriptsPainlessExecuteRequest.Builder builder = new ScriptsPainlessExecuteRequest.Builder();
+ Script.Builder script = new Script.Builder();
+
+ //script.source(scriptSourceBuilder.build());
+ //builder.script(script.build());
+
+ //client.scriptsPainlessExecute(builder.build());
+ }
+
+ @Override
+ protected void doInit() {
+ try {
+ URL url = new URL(this.reportEngineConfig.getEngineAddress());
+ HttpHost httpHost = new HttpHost(url.getHost(), url.getPort(), url.getProtocol());
+ RestClient restClient = RestClient.builder(httpHost)
+ .setDefaultHeaders(new Header[] {
+ new BasicHeader("Accept", "application/json"),
+ new BasicHeader("Content-Type", "application/json")
+ }).build();
+ final OpenSearchTransport transport = new RestClientTransport(restClient, this.createMapper());
+ client = new OpenSearchClient(transport);
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ protected AbstractReportMetaHandler doCreateReportHandler(ReportMetaData reportMetaData, List fieldList) {
+ return null;
+ }
+
+ public JacksonJsonpMapper createMapper() {
+ JacksonJsonpMapper jacksonJsonpMapper = new JacksonJsonpMapper();
+ // 注册Java8时间模块
+ JavaTimeModule module = new JavaTimeModule();
+ // 配置序列化格式
+ module.addSerializer(LocalDateTime.class,
+ new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+ module.addDeserializer(LocalDateTime.class,
+ new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+ jacksonJsonpMapper.objectMapper().registerModule(module);
+
+ // 禁用时间戳格式
+ jacksonJsonpMapper.objectMapper().disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ // 设置时区
+ jacksonJsonpMapper.objectMapper().setTimeZone(TimeZone.getTimeZone("GMT+8"));
+ return jacksonJsonpMapper;
+ }
+
+ @Override
+ public CompletableFuture>> query(SingleGeneralReportDO singleGeneralReportDO) {
+ return null;
+ }
+
+ @Override
+ public void createReport(String tableName) {
+
+ }
+
+ @Override
+ public void batchInsert(String tableName, List data) {
+ BulkRequest.Builder bulkRequestBuilder = new BulkRequest.Builder();
+ }
+
+ @Override
+ public void deleteData() {
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
index dedbc2d6..113e662e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
@@ -38,11 +38,10 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.Ordered;
-import org.springframework.stereotype.Service;
import org.springframework.util.ClassUtils;
@Aspect
-@Service
+//@Service
public class OprLog implements Ordered, ApplicationContextAware {
private int order = LOWEST_PRECEDENCE - 1000; // Specify the order of execution
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
index 2a4cc923..3ef6721d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
@@ -34,21 +34,21 @@
@Mapper
public interface AclMapper {
- @Insert({
- ""})
+ @Insert({"""
+
+ """})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List aclEntities);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert("INSERT INTO acl (cluster_id, pattern, operation, permission_type, host, resource_type, resource_name, pattern_type)"
- + "VALUE (#{clusterId}, #{pattern}, #{operation}, #{permissionType}, #{host}, #{resourceType}, #{resourceName}, #{patternType})")
+ + "VALUE (#{clusterId}, #{pattern}, #{operation}, #{permissionType}, #{host}, #{resourceType}, #{resourceName}, #{patternType})")
void insert(AclEntity aclEntity);
@Update("UPDATE acl SET status=0 WHERE id=#{id}")
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
index 7011ba4e..6af147f9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
@@ -20,7 +20,7 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClientEntity;
import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
-import org.apache.eventmesh.dashboard.console.modle.cluster.client.QueryClientByUserFormDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.client.QueryClientByUserFormDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
@@ -35,7 +35,7 @@
* Mybatis Mapper for the table of client.
*/
@Mapper
-public interface ClientMapper extends SyncDataHandlerMapper {
+public interface ClientMapper extends SyncDataHandlerMapper {
@Select({
@@ -67,7 +67,7 @@ public interface ClientMapper extends SyncDataHandlerMapper {
and status = #{status}
- """})
+ """})
List queryClientByUserForm(QueryClientByUserFormDTO queryClientByUserFormDTO);
@Select("SELECT * FROM `client` WHERE `host` = #{host} AND `port` = #{port} AND status = 1")
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
index 76ee9728..048b557d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
@@ -19,12 +19,12 @@
package org.apache.eventmesh.dashboard.console.mapper.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.QO.cluster.QueryRelationClusterByClusterIdListAndType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
-import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
@@ -41,6 +41,16 @@ public interface ClusterMapper {
ClusterEntity queryByClusterId(ClusterEntity cluster);
+ @Select("""
+
+ """)
+ List queryClusterListByClusterList(List clusterEntityList);
+
@Select("""
select * from cluster where organization_id =#{organizationId} and cluster_type=#{clusterType}
""")
@@ -50,20 +60,48 @@ public interface ClusterMapper {
@Select("""
""")
List queryRelationClusterByClusterIdAndType(ClusterEntity clusterEntity);
+ @Select("""
+
+ """)
+ List queryRelationClusterByClusterIdListAndType(
+ QueryRelationClusterByClusterIdListAndType queryRelationClusterByClusterIdListAndType);
+
@Select("""
+ """)
+ List queryStorageClusterByEventMeshId(ClusterEntity clusterEntity);
+
+
+ @Select("""
+
+ """)
+ List queryListByClusterIdListAndType(QueryListByClusterIdAndTypeDO data);
+
+
@Select({
"
+ """
+ )
+ List queryRuntimeToFrontByClusterIdList(List clusterEntityList);
+
@Select("""
+ """)
+ void batchUpdateDeployStatusTypeByList(List runtimeEntities);
+
+ @Update("""
+
+ """)
+ void batchUpdateDeployStatusTypeByListAndType(@Param("list") List runtimeEntities,
+ @Param("deployStatusType") DeployStatusType deployStatusType);
+
+
@Update("UPDATE runtime SET port=#{port} ,jmx_port=#{jmxPort} ,status=#{status} where cluster_id=#{clusterId} AND status=1")
void updateRuntimeByCluster(RuntimeEntity runtimeEntity);
@@ -149,7 +183,7 @@ insert into runtime( organization_id , cluster_id , name , cluster_type ,versi
values
(
- #{item.organizationId}, #{item.clusterId}, #{item.name}, #{item.clusterType},#{item.version},#{item.host},
+ #{item.organizationId}, #{item.clusterId}, #{item.name}, #{item.clusterType},#{item.version},INET_ATON(#{item.host}),
#{item.port},#{item.trusteeshipType},#{item.firstToWhom},#{item.replicationType},#{item.kubernetesClusterId},
#{item.deployStatusType}, #{item.resourcesConfigId},#{item.deployScriptId},'',#{item.authType},#{item.jmxPort}
)
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
index 3ae4011a..06e2bcf4 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
@@ -48,8 +48,8 @@ public interface ConnectorMapper {
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert("INSERT INTO connector (cluster_id,name, class_name, type, status, pod_state, config_ids, host, port) "
- + "VALUES (#{clusterId}, #{name}, #{className}, #{type}, #{status}, #{podState}, #{configIds}, #{host}, #{port})"
- + "ON DUPLICATE KEY UPDATE status = 1, pod_state = #{podState}, config_ids = #{configIds}, host = #{host}, port = #{port}")
+ + "VALUES (#{clusterId}, #{name}, #{className}, #{type}, #{status}, #{podState}, #{configIds}, #{host}, #{port})"
+ + "ON DUPLICATE KEY UPDATE status = 1, pod_state = #{podState}, config_ids = #{configIds}, host = #{host}, port = #{port}")
Long insert(ConnectorEntity connectorEntity);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ResourcesConfigMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ResourcesConfigMapper.java
new file mode 100644
index 00000000..917e8149
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ResourcesConfigMapper.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapper.connector;
+
+
+import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ *
+ */
+@Mapper
+public interface ResourcesConfigMapper {
+
+
+ @Select("""
+
+ """)
+ List queryByRuntimeList(List runtimeEntityList);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/deploy/PortMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/deploy/PortMapper.java
index 50fe1758..1634a8c1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/deploy/PortMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/deploy/PortMapper.java
@@ -26,7 +26,7 @@
import org.apache.ibatis.annotations.Update;
/**
- *
+ *
*/
@Mapper
public interface PortMapper {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
index ce1542d6..b96bb8c0 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
@@ -18,6 +18,8 @@
package org.apache.eventmesh.dashboard.console.mapper.function;
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
@@ -36,47 +38,98 @@
@Mapper
public interface ConfigMapper extends SyncDataHandlerMapper {
- @Select({
- ""})
- List getConfigsToFrontWithDynamic(ConfigEntity configEntity);
-
- @Select("SELECT * FROM config WHERE business_type=#{businessType} AND is_default=1")
- List selectConnectorConfigsByBusinessType(ConfigEntity configEntity);
- @Select("SELECT DISTINCT business_type FROM config WHERE instance_type=2 AND is_default=1 AND business_type LIKE CONCAT('%',#{businessType},'%')")
- List selectConnectorBusinessType(ConfigEntity configEntity);
+ @Select("""
+ select * from config where cluster_id
+
+ #{item.id}
+
+ and status = 1
+ """)
+ List queryByClusterIdList(List clusterConfigEntityList);
+
+ @Select("""
+
+ """)
+ List queryByRuntimeIdAndConfigName(List configEntityLists);
+
+ @Select("""
+ select * from config where instance_id
+
+ #{item.id}
+
+ and instance_type = #{instanceType}
+ and status = 1
+ """)
+ List queryByInstanceIdList(List configEntityList, MetadataType metadataType);
+
+ @Select("""
+
+ """)
+ List getConfigsToFrontWithDynamic(ConfigEntity configEntity);
@Select("SELECT * FROM config WHERE status=1 AND is_default=0")
List selectAll();
- @Select("SELECT * FROM config WHERE instance_type=#{instanceType} AND instance_id=#{instanceId}")
+ @Select("select * from config where instance_type=#{instanceType} and instance_id=#{instanceId}")
List selectConfigsByInstance(ConfigEntity configEntity);
- @Insert({
- ""})
+
+ @Update("""
+
+ """)
+ Integer updateValueByConfigList(List configEntityList);
+
+ @Insert("""
+
+ """)
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List configEntityList);
@@ -113,11 +166,19 @@ public interface ConfigMapper extends SyncDataHandlerMapper {
+ "AND instance_id=#{instanceId} AND config_name=#{configName} AND status=1")
ConfigEntity selectByUnique(ConfigEntity configEntity);
+ @Override
void syncInsert(List entityList);
+ @Override
void syncUpdate(List entityList);
+ @Override
void syncDelete(List entityList);
+
+ @Override
+ @Select("""
+ select * from config where update_time >= #{updateTime} and status != 0
+ """)
List syncGet(ConfigEntity topicEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
index f955fee6..35ceee84 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
@@ -57,24 +57,29 @@ List selectByClusterIdAndCreateTimeRange(@Param("cluste
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("INSERT INTO health_check_result(type,type_id, cluster_id, state,result_desc)"
- + " VALUES( #{type}, #{typeId}, #{clusterId}, #{state}, #{resultDesc})")
+ + " VALUES( #{type}, #{typeId}, #{clusterId}, #{state}, #{resultDesc})")
void insert(HealthCheckResultEntity healthCheckResultEntity);
- @Insert({
- ""
- })
+ @Insert("""
+
+ """)
void batchInsert(List healthCheckResultEntityList);
@Insert({
@@ -116,6 +121,7 @@ List selectByClusterIdAndCreateTimeRange(@Param("cluste
" ORDER BY create_time DESC",
""
})
+ @Deprecated
List getIdsNeedToBeUpdateByClusterIdAndTypeAndTypeId(List healthCheckResultEntityList);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
index 0779e317..53aa4fd5 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
@@ -53,7 +53,7 @@ public interface OprLogMapper {
List getLogList(LogEntity logEntity);
@Insert("INSERT INTO operation_log ( cluster_id, operation_type,target_type, content,operation_user,result)"
- + "VALUE (#{clusterId},#{operationType},#{targetType},#{content},#{operationUser},#{result})")
+ + "VALUE (#{clusterId},#{operationType},#{targetType},#{content},#{operationUser},#{result})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
Long addLog(LogEntity logEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMapper.java
index 8b6130d0..ad71f8a2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMapper.java
@@ -19,6 +19,7 @@
package org.apache.eventmesh.dashboard.console.mapper.message;
import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
+import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
import org.apache.ibatis.annotations.Insert;
@@ -35,6 +36,33 @@
@Mapper
public interface GroupMapper extends SyncDataHandlerMapper {
+
+ @Select("""
+ select * from `group` where name in(
+ select group_name from group_member where topic_name = (
+ select topic.topic_name from topic where id=#{id}
+ )
+ )
+ """)
+ List queryGroupListByTopicId(TopicEntity topicEntity);
+
+ @Select("""
+
+ """)
+ List queryClusterOrRuntimeGroupByClusterId(TopicEntity topicEntity);
+
+
@Select("SELECT * FROM `group` WHERE cluster_id=#{clusterId} AND name=#{name} AND type=0 ")
GroupEntity selectGroupByNameAndClusterId(GroupEntity groupEntity);
@@ -77,19 +105,24 @@ public interface GroupMapper extends SyncDataHandlerMapper {
List selectGroup(GroupEntity groupEntity);
- @Insert({
- ""})
+ @Insert("""
+
+ """)
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List groupEntities);
- @Insert("INSERT INTO `group` (cluster_id, name, member_count, members, type, state)"
- + "VALUE (#{clusterId},#{name},#{memberCount},#{members},#{type},#{state}) "
- + "ON DUPLICATE KEY UPDATE status=1")
+ @Insert("""
+
+ """)
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void addGroup(GroupEntity groupEntity);
@@ -104,5 +137,8 @@ public interface GroupMapper extends SyncDataHandlerMapper {
void syncDelete(List entityList);
@Override
+ @Select("""
+ select * from group where update_time >= #{updateTime} and status != 0
+ """)
List syncGet(GroupEntity topicEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMemberMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMemberMapper.java
new file mode 100644
index 00000000..6a96ccec
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/GroupMemberMapper.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.eventmesh.dashboard.console.mapper.message;
+
+
+import org.apache.eventmesh.dashboard.console.entity.message.GroupMemberEntity;
+import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
+
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * operate GroupMember mapper
+ **/
+
+@Mapper
+public interface GroupMemberMapper extends SyncDataHandlerMapper {
+
+
+ @Select("""
+
+ """)
+ List selectMember(GroupMemberEntity groupMemberEntity);
+
+
+ @Select("select * from group_member where id=#{id} and status=1")
+ GroupMemberEntity selectGroupMemberById(GroupMemberEntity groupMemberEntity);
+
+ @Update("UPDATE group_member SET state=#{state} where id=#{id}")
+ void updateGroupMember(GroupMemberEntity groupMemberEntity);
+
+
+ @Update("UPDATE group_member SET status=0 where id=#{id} ")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ GroupMemberEntity deleteGroupMember(GroupMemberEntity groupMemberEntity);
+
+ @Insert("""
+
+ """)
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void batchInsert(List groupMemberEntities);
+
+
+ @Insert("""
+ insert into
+ group_member (organization_id , cluster_id, topic_name, group_name, eventmesh_user)
+ values (#{organizationId},#{clusterId},#{topicName},#{groupName},#{eventMeshUser})
+ on duplicate key update status=0
+ """)
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void addGroupMember(GroupMemberEntity groupMemberEntity);
+
+
+}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OffsetMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OffsetMapper.java
new file mode 100644
index 00000000..680c346a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OffsetMapper.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapper.message;
+
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ *
+ */
+@Mapper
+public interface OffsetMapper {
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java
deleted file mode 100644
index 0e81b136..00000000
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.eventmesh.dashboard.console.mapper.message;
-
-
-import org.apache.eventmesh.dashboard.console.entity.message.SubscriptionEntity;
-
-import org.apache.ibatis.annotations.Insert;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Options;
-import org.apache.ibatis.annotations.Select;
-import org.apache.ibatis.annotations.Update;
-
-import java.util.List;
-
-/**
- * operate GroupMember mapper
- **/
-
-@Mapper
-public interface OprGroupMemberMapper {
-
-
- @Deprecated
- @Select("select topic_name from group_member where cluster_id=#{clusterId} and group_name=#{groupName}")
- List selectTopicsByGroupNameAndClusterId(SubscriptionEntity subscriptionEntity);
-
- @Deprecated
- @Select("select DISTINCT (group_name) from group_member where cluster_id=#{clusterId} and topic_name=#{topicName}")
- List selectGroupNameByTopicName(SubscriptionEntity subscriptionEntity);
-
- @Select("select * from group_member where status=1")
- List selectAll();
-
-
- @Deprecated
- @Select("select * from group_member where cluster_id=#{clusterId} and status=1")
- List getGroupByClusterId(SubscriptionEntity subscriptionEntity);
-
-
- @Deprecated
- @Select("select * from group_member where cluster_id=#{clusterId} and group_name=#{groupName} and topic_name=#{topicName} and status=1")
- SubscriptionEntity selectGroupMemberByUnique(SubscriptionEntity subscriptionEntity);
-
- @Select("""
-
- """)
- List selectMember(SubscriptionEntity subscriptionEntity);
-
-
- @Select("select * from group_member where id=#{id} and status=1")
- SubscriptionEntity selectGroupMemberById(SubscriptionEntity subscriptionEntity);
-
- @Update("UPDATE group_member SET state=#{state} where id=#{id}")
- void updateGroupMember(SubscriptionEntity subscriptionEntity);
-
- @Deprecated
- @Update("UPDATE group_member SET state=#{state} where topic_name=#{topicName}")
- void updateMemberByTopic(SubscriptionEntity subscriptionEntity);
-
-
- @Update("UPDATE group_member SET status=0 where id=#{id} ")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- SubscriptionEntity deleteGroupMember(SubscriptionEntity subscriptionEntity);
-
- @Insert({
- ""})
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List groupMemberEntities);
-
-
- @Insert("insert into group_member (cluster_id, topic_name, group_name, eventmesh_user,state)"
- + " values (#{clusterId},#{topicName},#{groupName},#{eventMeshUser},#{state})"
- + "ON DUPLICATE KEY UPDATE status=0")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addGroupMember(SubscriptionEntity subscriptionEntity);
-
-
-}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
index 50703e74..9df077c3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
@@ -19,6 +19,7 @@
package org.apache.eventmesh.dashboard.console.mapper.message;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
@@ -38,19 +39,29 @@
public interface TopicMapper extends SyncDataHandlerMapper {
+ @Select("""
+
+ """)
+ List queryByClusterIdList(List topicEntityList);
+
+
@Select("SELECT count(*) FROM topic WHERE cluster_id=#{clusterId} AND status=1")
Integer selectTopicNumByCluster(TopicEntity topicEntity);
- @Select({
- ""})
+ @Select("""
+
+ """)
List queryTopicsToFrontByClusterId(@Param("topicEntity") TopicEntity topicEntity);
@@ -88,10 +99,21 @@ public interface TopicMapper extends SyncDataHandlerMapper {
@Insert("""
""")
@@ -99,8 +121,10 @@ insert into topic (cluster_id, topic_name, retention_ms, topic_type, description
void batchInsert(List topicEntities);
@Insert("""
- insert into topic (cluster_id , topic_name , retention_ms , topic_type , description, create_progress)
- values (#{clusterId} ,#{topicName},#{retentionMs},#{topicType},#{description},#{createProgress})
+ insert into topic (cluster_id,runtime_id,topic_name,topic_type, read_queue_num, write_queue_num, replication_factor,
+ `order` , description, create_progress,retention_ms)
+ values (#{clusterId},#{runtimeId},#{topicName},#{topicType},#{readQueueNum},#{writeQueueNum},#{replicationFactor}
+ ,#{order},#{description},#{createProgress},#{retentionMs})
on duplicate key update status = 1
""")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@@ -113,10 +137,14 @@ insert into topic (cluster_id , topic_name , retention_ms , topic_type , des
@Override
void syncUpdate(List entityList);
+
@Override
void syncDelete(List entityList);
@Override
+ @Select("""
+ select * from topic where update_time >= #{updateTime} and status != 0
+ """)
List syncGet(TopicEntity topicEntity);
}
\ No newline at end of file
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicOffsetMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicOffsetMapper.java
index 915813e2..dc10f6d1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicOffsetMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicOffsetMapper.java
@@ -21,6 +21,7 @@
import org.apache.eventmesh.dashboard.console.mapper.SyncDataHandlerMapper;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
import java.util.List;
@@ -37,5 +38,9 @@ public interface TopicOffsetMapper extends SyncDataHandlerMapper entityList);
+ @Override
+ @Select("""
+ select * from topic where update_time >= #{updateTime} and status != 0
+ """)
List syncGet(TopicOffsetEntity topicOffsetEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/agent/AgentActionControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/agent/AgentActionControllerMapper.java
new file mode 100644
index 00000000..acc21102
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/agent/AgentActionControllerMapper.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapstruct.agent;
+
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *
+ */
+@Mapper
+public interface AgentActionControllerMapper {
+
+ AgentActionControllerMapper INSTANCE = Mappers.getMapper(AgentActionControllerMapper.class);
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClientDataControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClientDataControllerMapper.java
index b1594887..ee07accb 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClientDataControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClientDataControllerMapper.java
@@ -28,5 +28,4 @@ public interface ClientDataControllerMapper {
ClientDataControllerMapper INSTANCE = Mappers.getMapper(ClientDataControllerMapper.class);
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClusterControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClusterControllerMapper.java
index 82d59894..a2483af3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClusterControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/ClusterControllerMapper.java
@@ -19,10 +19,17 @@
package org.apache.eventmesh.dashboard.console.mapstruct.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.CreateClusterBySimpleDataDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryClusterByOrganizationIdAndTypeDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.cluster.QueryRelationClusterByClusterIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain.QueryClusterTreeDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.CreateClusterBySimpleDataDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.BatchCreateClusterDataDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryClusterByOrganizationIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryRelationClusterByClusterIdAndTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.QueryTreeByClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.cluster.cluster.SimpleCreateClusterDataDTO;
+
+import java.util.List;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@@ -36,6 +43,8 @@ public interface ClusterControllerMapper {
ClusterControllerMapper INSTANCE = Mappers.getMapper(ClusterControllerMapper.class);
+ QueryClusterTreeDO queryTreeByClusterId(QueryTreeByClusterIdDTO data);
+
ClusterEntity queryClusterByOrganizationIdAndType(QueryClusterByOrganizationIdAndTypeDTO dto);
ClusterEntity queryRelationClusterByClusterIdAndType(QueryRelationClusterByClusterIdAndTypeDTO dto);
@@ -44,4 +53,12 @@ public interface ClusterControllerMapper {
ClusterEntity toClusterEntity(ClusterIdDTO clusterIdDTO);
+ ClusterEntity toClusterEntity(SimpleCreateClusterDataDTO data);
+
+ ClusterEntity toClusterEntity(BatchCreateClusterDataDTO data);
+
+ ClusterEntity createClusterDTO(CreateClusterDTO createClusterDTO);
+
+ List simpleCreateClusterDataToClusterEntity(List data);
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/GroupControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/GroupControllerMapper.java
index 402692bf..c261fd9b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/GroupControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/GroupControllerMapper.java
@@ -19,14 +19,16 @@
package org.apache.eventmesh.dashboard.console.mapstruct.cluster;
import org.apache.eventmesh.dashboard.console.entity.message.GroupEntity;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.RuntimeIdDTO;
+import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
*
*/
+@Mapper
public interface GroupControllerMapper {
GroupControllerMapper INSTANCE = Mappers.getMapper(GroupControllerMapper.class);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/RuntimeControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/RuntimeControllerMapper.java
index 731fb6bd..db0c8550 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/RuntimeControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/cluster/RuntimeControllerMapper.java
@@ -19,9 +19,8 @@
package org.apache.eventmesh.dashboard.console.mapstruct.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.cluster.runtime.CreateRuntimeDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@@ -39,7 +38,5 @@ public interface RuntimeControllerMapper {
RuntimeEntity queryRuntimeListById(IdDTO idDTO);
- RuntimeEntity crateRuntime(CreateRuntimeDTO crateRuntimeDTO);
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ActiveCreateControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ActiveCreateControllerMapper.java
new file mode 100644
index 00000000..6732db6c
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ActiveCreateControllerMapper.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapstruct.deploy;
+
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateClusterDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateEventMeshSpaceDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.active.CreateRuntimeDTO;
+
+import java.util.List;
+
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *
+ */
+@Mapper
+public interface ActiveCreateControllerMapper {
+
+ ActiveCreateControllerMapper INSTANCE = Mappers.getMapper(ActiveCreateControllerMapper.class);
+
+
+ ClusterEntity createEventMeshSpace(CreateEventMeshSpaceDTO createEventMeshSpaceDTO);
+
+
+ ClusterEntity createCluster(CreateClusterDTO dto);
+
+
+ RuntimeEntity createRuntime(CreateRuntimeDTO dto);
+
+
+ List createRuntimeList(List dtoList);
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/CaseControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/CaseControllerMapper.java
index bda96014..00e09851 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/CaseControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/CaseControllerMapper.java
@@ -19,7 +19,7 @@
package org.apache.eventmesh.dashboard.console.mapstruct.deploy;
import org.apache.eventmesh.dashboard.console.entity.cases.CaseEntity;
-import org.apache.eventmesh.dashboard.console.modle.deploy.cases.QueryCaseByObjectTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.cases.QueryCaseByObjectTypeDTO;
import org.mapstruct.factory.Mappers;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ClusterCycleControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ClusterCycleControllerMapper.java
index b78bfd70..264ca5ea 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ClusterCycleControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ClusterCycleControllerMapper.java
@@ -20,10 +20,9 @@
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByDeployScriptDO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateClusterByEventMesh;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByDeployScriptDTO;
-import org.apache.eventmesh.dashboard.console.modle.deploy.create.CreateRuntimeByOnlyDataDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateClusterByDeployScriptDO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateRuntimeByDeployScriptDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.create.CreateRuntimeByOnlyDataDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@@ -40,9 +39,6 @@ public interface ClusterCycleControllerMapper {
RuntimeEntity createRuntimeByOnlyDataHandler(CreateRuntimeByOnlyDataDO createRuntimeByOnlyDataDO);
- ClusterEntity createClusterByEventMesh(CreateClusterByEventMesh createClusterByEventMesh);
-
-
ClusterEntity createClusterByDeployScript(CreateClusterByDeployScriptDO createClusterByDeployScriptDO);
RuntimeEntity createRuntimeByDeployScript(CreateRuntimeByDeployScriptDTO createRuntimeByDeployScriptDTO);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ResourceConfigControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ResourceConfigControllerMapper.java
index 037806af..93ac7e06 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ResourceConfigControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/deploy/ResourceConfigControllerMapper.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-
package org.apache.eventmesh.dashboard.console.mapstruct.deploy;
import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.deploy.resouce.QueryResourceByObjectTypeDTO;
+import org.apache.eventmesh.dashboard.console.model.deploy.resouce.QueryResourceByObjectTypeDTO;
import org.mapstruct.factory.Mappers;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/ConfigControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/ConfigControllerMapper.java
new file mode 100644
index 00000000..da0e1bb1
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/ConfigControllerMapper.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapstruct.message;
+
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.model.function.config.QueryByInstanceIdDTO;
+
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *
+ */
+@Mapper
+public interface ConfigControllerMapper {
+
+ ConfigControllerMapper INSTANCE = Mappers.getMapper(ConfigControllerMapper.class);
+
+
+ ConfigEntity queryByInstanceId(QueryByInstanceIdDTO queryByInstanceIdDTO);
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/TopicControllerMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/TopicControllerMapper.java
index 19bfd5bf..59ad1bc3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/TopicControllerMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/message/TopicControllerMapper.java
@@ -19,16 +19,18 @@
package org.apache.eventmesh.dashboard.console.mapstruct.message;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
-import org.apache.eventmesh.dashboard.console.modle.IdDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.topic.CreateTopicDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.topic.GetTopicListDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.RuntimeIdDTO;
+import org.apache.eventmesh.dashboard.console.model.IdDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.topic.CreateTopicDTO;
+import org.apache.eventmesh.dashboard.console.model.dto.topic.GetTopicListDTO;
+import org.apache.eventmesh.dashboard.console.model.vo.RuntimeIdDTO;
+import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
*
*/
+@Mapper
public interface TopicControllerMapper {
TopicControllerMapper INSTANCE = Mappers.getMapper(TopicControllerMapper.class);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/ClusterEntityMapstruct.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/ClusterEntityMapstruct.java
new file mode 100644
index 00000000..f42c2152
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/ClusterEntityMapstruct.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapstruct.model.entity;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.model.entity.ClusterEntityMapstruct.ClusterMapstructCustomize;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.ClusterTreeVO;
+
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Named;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *
+ */
+@Mapper(uses = ClusterMapstructCustomize.class)
+public interface ClusterEntityMapstruct {
+
+ ClusterEntityMapstruct INSTANCE = Mappers.getMapper(ClusterEntityMapstruct.class);
+
+
+ @Mapping(source = "clusterType", target = "nodeType", qualifiedByName = "clusterTreeInNodeType")
+ ClusterTreeVO toClusterTreeVO(ClusterEntity clusterEntity);
+
+
+ class ClusterMapstructCustomize {
+
+ @Named("clusterTreeInNodeType")
+ public static ClusterType clusterTreeInNodeType(ClusterType clusterType) {
+ return ClusterType.CLUSTER;
+ }
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/RuntimeEntityMapstruct.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/RuntimeEntityMapstruct.java
new file mode 100644
index 00000000..c471d82b
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/model/entity/RuntimeEntityMapstruct.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.mapstruct.model.entity;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.model.entity.RuntimeEntityMapstruct.RuntimeMapstructCustomize;
+import org.apache.eventmesh.dashboard.console.model.vo.cluster.ClusterTreeVO;
+
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Named;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *
+ */
+@Mapper(uses = RuntimeMapstructCustomize.class)
+public interface RuntimeEntityMapstruct {
+
+ RuntimeEntityMapstruct INSTANCE = Mappers.getMapper(RuntimeEntityMapstruct.class);
+
+
+ RuntimeEntity byClusterEntity(ClusterEntity clusterEntity);
+
+
+ @Mapping(source = "clusterType", target = "nodeType", qualifiedByName = "clusterTreeInNodeType")
+ ClusterTreeVO toClusterTreeVO(RuntimeEntity runtimeEntity);
+
+
+ class RuntimeMapstructCustomize {
+
+ @Named("clusterTreeInNodeType")
+ public static ClusterType clusterTreeInNodeType(ClusterType clusterType) {
+ return ClusterType.RUNTIME;
+ }
+
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/ClusterIdDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/ClusterIdDTO.java
similarity index 87%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/ClusterIdDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/ClusterIdDTO.java
index 760561d5..d6a4642a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/ClusterIdDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/ClusterIdDTO.java
@@ -16,7 +16,9 @@
*/
-package org.apache.eventmesh.dashboard.console.modle;
+package org.apache.eventmesh.dashboard.console.model;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
import javax.validation.constraints.NotNull;
@@ -30,6 +32,7 @@ public class ClusterIdDTO extends OrganizationIdDTO {
@NotNull
private Long clusterId;
+ private ClusterType clusterType;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/CreateTheEventClusterDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/CreateTheEventClusterDO.java
new file mode 100644
index 00000000..d5e33a5f
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/CreateTheEventClusterDO.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.DO;
+
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import lombok.Data;
+
+@Data
+@Deprecated
+public class CreateTheEventClusterDO {
+
+
+ private ClusterEntity eventSpace;
+
+ private MainStorageClusterDO eventCluster;
+
+ private CreateCapStorageClusterDO capStorageClusters;
+
+ private List mainStorageClusters;
+
+
+ @Data
+ public static class CreateCapStorageClusterDO {
+
+ private ClusterEntity brokerCluster;
+
+ private CreateTheEntireClusterDO runtimeCluster;
+
+ private CreateTheEntireClusterDO metaCluster;
+
+ private RuntimeEntity prometheusRuntime;
+ }
+
+ @Data
+ public static class MainStorageClusterDO {
+
+ private ClusterEntity cluster;
+
+ private CreateTheEntireClusterDO metaClusterList;
+
+ private CreateTheEntireClusterDO brokerClusterList;
+
+ private RuntimeEntity prometheusRuntime;
+ }
+
+ @Data
+ public static class CreateTheEntireClusterDO {
+
+ @Valid
+ private ClusterEntity createClusterDTO;
+
+ @Valid
+ private List createRuntimeDTOList;
+
+ }
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java
similarity index 95%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java
index 37e179e0..5af938ae 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/QueryRuntimeByClusterIdAndClusterTypeDO.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.DO;
+package org.apache.eventmesh.dashboard.console.model.DO;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java
similarity index 92%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java
index 794861e2..192e8779 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/clusterRelationship/QueryListByClusterIdAndTypeDO.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.DO.clusterRelationship;
+package org.apache.eventmesh.dashboard.console.model.DO.clusterRelationship;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
@@ -34,8 +34,10 @@ public class QueryListByClusterIdAndTypeDO {
private Long clusterId;
+ private List clusterIdList;
+
private List clusterTypeList;
-
+
private List relationshipTypeList;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/ClusterAndRuntimeOfRelationshipDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/ClusterAndRuntimeOfRelationshipDO.java
new file mode 100644
index 00000000..4d20802c
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/ClusterAndRuntimeOfRelationshipDO.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain;
+
+import org.apache.eventmesh.dashboard.common.enums.MetadataType;
+import org.apache.eventmesh.dashboard.console.entity.cases.ResourcesConfigEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.commons.lang3.tuple.Triple;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import lombok.Data;
+
+@Data
+public class ClusterAndRuntimeOfRelationshipDO {
+
+ private ClusterEntity clusterEntity;
+
+ private List clusterEntityList;
+
+ private List runtimeEntityList;
+
+ private List clusterRelationshipEntityList;
+
+ private List> clusterRelationshipTripleList = new ArrayList<>();
+
+ private List>> clusterEntityPairleList = new ArrayList<>();
+
+ private List>> runtimeEntityPairList = new ArrayList<>();
+
+ private Map>> configMap;
+
+ private Map>> topicMap;
+
+ private List> resourcesConfigEntityList;
+
+ private List>> clusterResourcesList;
+
+ private List>> resourceData;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/GetClusterInSyncReturnDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/GetClusterInSyncReturnDO.java
new file mode 100644
index 00000000..0c88fef6
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/GetClusterInSyncReturnDO.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain;
+
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
+
+import java.util.List;
+
+import lombok.Data;
+
+@Data
+public class GetClusterInSyncReturnDO {
+
+ private List clusterEntityList;
+
+ private List runtimeEntityList;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterInSyncDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterInSyncDO.java
new file mode 100644
index 00000000..f0078802
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterInSyncDO.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.domain.metadata.ClusterOperationHandler;
+import org.apache.eventmesh.dashboard.console.entity.base.BaseRuntimeIdEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+
+import java.util.List;
+import java.util.function.Supplier;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class QueryClusterInSyncDO {
+
+ private ClusterEntity clusterEntity;
+ private List syncClusterTypeList;
+ private Object object;
+ /**
+ * clusterEntity and runtimeEntity 转换 操作 entity
+ */
+ private Supplier function;
+ private ClusterOperationHandler clusterOperationHandler;
+
+ public static QueryClusterInSyncDO create(Long id, Supplier function) {
+ return create(id, null, function);
+ }
+
+ public static QueryClusterInSyncDO create(Long id, Object object) {
+ return create(id, object, null);
+ }
+
+ private static QueryClusterInSyncDO create(Long id, Object object, Supplier function) {
+ QueryClusterInSyncDO data = new QueryClusterInSyncDO();
+ data.setObject(object);
+ data.setFunction(function);
+ ClusterEntity clusterEntity = new ClusterEntity();
+ clusterEntity.setId(id);
+ data.setClusterEntity(data.getClusterEntity());
+ return data;
+ }
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterTreeDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterTreeDO.java
new file mode 100644
index 00000000..b8f441e9
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/domain/clusterAndRuntimeDomain/QueryClusterTreeDO.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.DO.domain.clusterAndRuntimeDomain;
+
+import org.apache.eventmesh.dashboard.common.enums.DeployStatusType;
+
+import java.util.List;
+
+import lombok.Data;
+
+@Data
+public class QueryClusterTreeDO {
+
+ private Long clusterId;
+
+ private List deployStatusType;
+
+ private boolean storage;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/runtime/QueryRuntimeByBigExpandClusterDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/runtime/QueryRuntimeByBigExpandClusterDO.java
similarity index 95%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/runtime/QueryRuntimeByBigExpandClusterDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/runtime/QueryRuntimeByBigExpandClusterDO.java
index 6104ffb7..8ad631dd 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/DO/runtime/QueryRuntimeByBigExpandClusterDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/DO/runtime/QueryRuntimeByBigExpandClusterDO.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.DO.runtime;
+package org.apache.eventmesh.dashboard.console.model.DO.runtime;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/IdDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/IdDTO.java
similarity index 88%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/IdDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/IdDTO.java
index a6e38089..b18b0214 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/IdDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/IdDTO.java
@@ -16,12 +16,15 @@
*/
-package org.apache.eventmesh.dashboard.console.modle;
+package org.apache.eventmesh.dashboard.console.model;
+
+import javax.validation.constraints.NotNull;
import lombok.Data;
@Data
public class IdDTO {
+ @NotNull
private Long id;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OperateDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OperateDTO.java
similarity index 95%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OperateDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OperateDTO.java
index 77d86fc4..4f01df17 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OperateDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OperateDTO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle;
+package org.apache.eventmesh.dashboard.console.model;
import org.apache.eventmesh.dashboard.common.enums.ClusterType;
import org.apache.eventmesh.dashboard.common.enums.OperationRange.OperationRangeType;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OrganizationIdDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OrganizationIdDTO.java
similarity index 90%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OrganizationIdDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OrganizationIdDTO.java
index 7d03e62e..23272dfe 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/OrganizationIdDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/OrganizationIdDTO.java
@@ -16,12 +16,12 @@
*/
-package org.apache.eventmesh.dashboard.console.modle;
+package org.apache.eventmesh.dashboard.console.model;
import lombok.Data;
@Data
public class OrganizationIdDTO {
- private String organizationId;
+ private Long organizationId;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/QO/cluster/QueryRelationClusterByClusterIdListAndType.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/QO/cluster/QueryRelationClusterByClusterIdListAndType.java
new file mode 100644
index 00000000..b94361c1
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/QO/cluster/QueryRelationClusterByClusterIdListAndType.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.QO.cluster;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
+
+import java.util.List;
+
+import lombok.Data;
+
+@Data
+public class QueryRelationClusterByClusterIdListAndType {
+
+ private List clusterTypeList;
+
+ private List clusterEntityList;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseConifgDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseConifgDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseConifgDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseConifgDO.java
index 55859729..e5df945b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseConifgDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseConifgDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
@@ -31,6 +31,4 @@ public class BaseConifgDO {
private List configList;
-
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseDeployDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseDeployDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseDeployDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseDeployDO.java
index 009a2827..350ce2ef 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/BaseDeployDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/BaseDeployDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cases.ResouceEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/ClusterAllMetadataDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/ClusterAllMetadataDO.java
similarity index 95%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/ClusterAllMetadataDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/ClusterAllMetadataDO.java
index 5e8573e2..9195431f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/ClusterAllMetadataDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/ClusterAllMetadataDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployClusterDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployClusterDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployClusterDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployClusterDO.java
index a93eccff..456f46b3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployClusterDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployClusterDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployFullDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployFullDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployFullDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployFullDO.java
index b94ba0d6..7b5efccb 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployFullDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployFullDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cases.DeployScriptEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployGroupDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployGroupDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployGroupDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployGroupDO.java
index 4f0cec47..31ddca60 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployGroupDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployGroupDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import lombok.Data;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployMetadataDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployMetadataDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployMetadataDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployMetadataDO.java
index b62784c3..f6e23a30 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployMetadataDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployMetadataDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterRelationshipEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployRuntimeDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployRuntimeDO.java
similarity index 93%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployRuntimeDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployRuntimeDO.java
index 444c2d92..8208276a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployRuntimeDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployRuntimeDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.cluster.RuntimeEntity;
@@ -25,6 +25,4 @@ public class DeployRuntimeDO extends BaseDeployDO {
private RuntimeEntity runtime;
-
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployTopicDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployTopicDO.java
similarity index 94%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployTopicDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployTopicDO.java
index e0f8f091..315b646c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/DeployTopicDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/DeployTopicDO.java
@@ -16,7 +16,7 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
import org.apache.eventmesh.dashboard.console.entity.message.TopicEntity;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/GetPortsDO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/GetPortsDO.java
similarity index 89%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/GetPortsDO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/GetPortsDO.java
index fb1af802..741f3b79 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/GetPortsDO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/GetPortsDO.java
@@ -16,9 +16,9 @@
*/
-package org.apache.eventmesh.dashboard.console.modle.deploy;
+package org.apache.eventmesh.dashboard.console.model.deploy;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/BaseCreateClusterDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/BaseCreateClusterDTO.java
new file mode 100644
index 00000000..968295c0
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/BaseCreateClusterDTO.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
+
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+
+import javax.validation.Valid;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BaseCreateClusterDTO extends ClusterIdDTO {
+
+ @Valid
+ private CreateClusterDTO createClusterDTO;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateClusterDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateClusterDTO.java
new file mode 100644
index 00000000..1b67e98e
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateClusterDTO.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CreateClusterDTO extends ClusterIdDTO {
+
+ @NotNull
+ private ClusterType clusterType;
+
+ @NotNull
+ private String name;
+
+ @NotNull
+ private String version;
+
+ @NotNull
+ private String description;
+
+ private FirstToWhom firstToWhom = FirstToWhom.DASHBOARD;
+
+ private ClusterTrusteeshipType trusteeshipArrangeType = ClusterTrusteeshipType.NOT;
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/create/CreateClusterByEventMesh.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateEventMeshSpaceDTO.java
similarity index 84%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/create/CreateClusterByEventMesh.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateEventMeshSpaceDTO.java
index cf891f34..72fbe7d6 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/deploy/create/CreateClusterByEventMesh.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateEventMeshSpaceDTO.java
@@ -15,19 +15,19 @@
* limitations under the License.
*/
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
-package org.apache.eventmesh.dashboard.console.modle.deploy.create;
-
-import org.apache.eventmesh.dashboard.console.modle.OrganizationIdDTO;
+import org.apache.eventmesh.dashboard.console.model.OrganizationIdDTO;
import javax.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
+
@Data
@EqualsAndHashCode(callSuper = true)
-public class CreateClusterByEventMesh extends OrganizationIdDTO {
+public class CreateEventMeshSpaceDTO extends OrganizationIdDTO {
@NotNull
private String name;
@@ -36,6 +36,4 @@ public class CreateClusterByEventMesh extends OrganizationIdDTO {
@NotNull
private String description;
-
-
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateRuntimeDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateRuntimeDTO.java
new file mode 100644
index 00000000..86a61830
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateRuntimeDTO.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
+
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType;
+import org.apache.eventmesh.dashboard.common.enums.ClusterTrusteeshipType.FirstToWhom;
+import org.apache.eventmesh.dashboard.common.enums.ClusterType;
+import org.apache.eventmesh.dashboard.common.enums.ReplicationType;
+import org.apache.eventmesh.dashboard.console.model.ClusterIdDTO;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CreateRuntimeDTO extends ClusterIdDTO {
+
+ private String name;
+
+ private String host;
+
+ private Integer port;
+
+ private Integer jmxPort;
+
+ private String rack = "";
+
+ private String endpointMap;
+
+ private FirstToWhom firstToWhom = FirstToWhom.DASHBOARD;
+
+ private ClusterTrusteeshipType clusterTrusteeshipType;
+
+ private ReplicationType replicationType;
+
+ private ClusterType trusteeshipArrangeType = ClusterType.RUNTIME;
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEntireClusterDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEntireClusterDTO.java
new file mode 100644
index 00000000..d4fe8877
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEntireClusterDTO.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CreateTheEntireClusterDTO extends BaseCreateClusterDTO {
+
+ @Valid
+ private List<@Valid CreateRuntimeDTO> createRuntimeDTOList;
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEventClusterDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEventClusterDTO.java
new file mode 100644
index 00000000..7c805e6d
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/model/deploy/active/CreateTheEventClusterDTO.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.dashboard.console.model.deploy.active;
+
+import org.apache.eventmesh.dashboard.console.model.OrganizationIdDTO;
+
+import java.util.List;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CreateTheEventClusterDTO extends OrganizationIdDTO {
+
+
+ private CreateClusterDTO eventSpace;
+
+ private RuntimeClusterDTO eventClusterList;
+
+ private CreateCapStorageClusterDTO capStorageClusters;
+
+ private RuntimeClusterDTO monomerStorageClusters;
+
+ private MainStorageClusterDTO mainStorageClusters;
+
+ private List prometheusRuntime;
+
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class BaseCreateTheEntireClusterDTO extends BaseCreateClusterDTO {
+
+ private CreateRuntimeDTO prometheusRuntime;
+
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ public static class MainClusterDTO extends BaseCreateTheEntireClusterDTO {
+
+ private List