Skip to content

Commit d3ffcb5

Browse files
githublaohulaohu
andauthored
Refactor RemotingService and SyncFrom... interfaces (#146)
* fix(*)1. 完成项目设计 2. 完成项目与模块搭建 * fix(core):1. 重构 同步模块 2. 重构 remote 模块 * fix(*):1. 格式化代码 。2. 第一次整理代码 * 1. 解决冲突 * 1. 解决冲突 * fix(*):1. 删除多余的代码 * 1. 解决冲突 * fix(ci): 1. 关闭 ci 的 test,重构完在打开 * fix(*):1. 完成控制的重构 * fix(*):1. 解决冲突 * fix(*):1. 解决冲突 * fix(*):1. 解决冲突 * fix(*):1. 解决冲突 --------- Co-authored-by: laohu <[email protected]>
1 parent 5092504 commit d3ffcb5

File tree

302 files changed

+5562
-5457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+5562
-5457
lines changed

.mvn/wrapper/maven-wrapper.jar

61.1 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ docker build -t yourname/eventmesh-dashboard -f docker/Dockerfile .
8585

8686
```
8787
docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboard
88-
```
88+
```

README.zh-CN.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,12 @@ docker build -t yourname/eventmesh-dashboard -f docker/Dockerfile .
8686
```
8787
docker run -d --name eventmesh-dashboard -p 8080:8080 yourname/eventmesh-dashboard
8888
```
89+
90+
### 开发准备
91+
1. 配置格式化
92+
1. 后端格式文档地址:https://eventmesh.apache.org/zh/community/contribute/contribute/
93+
2. 前端使用 eslint
94+
2. 配置协议头工具 license-eye。
95+
1. 检查命令:license-eye header check
96+
2. 使用命令:license-eye header fix
97+
3. 下载地址: https://skywalking.apache.org/downloads/

eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ApiPrefix.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.eventmesh.dashboard.common.constant;
1919

2020
public class ApiPrefix {
21+
2122
public static final String API_PREFIX = "/eventmesh-dashboard/";
2223

2324
public static final String API_V1_PREFIX = API_PREFIX + "v1/";

eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.eventmesh.dashboard.common.constant;
1919

2020
public class StoreTypeConstant {
21+
2122
public static final String STORE_TYPE_TYPE_UNKNOWN = "unknown";
2223
public static final String STORE_TYPE_STANDALONE = "standalone";
2324
public static final String STORE_TYPE_REDIS = "redis";

eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.eventmesh.dashboard.common.constant.health;
1919

2020
public class HealthConstant {
21+
2122
public static final String NEW_LINE_ENDING = "\n";
2223

2324
public static final String RUNTIME_CHECK_TOPIC = "eventmesh-dashboard-healthcheck-topic";

eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ public static <T> Result<T> success(T data) {
7070
}
7171

7272
/**
73-
* The request is valid and the result is returned in {@link ResponseEntity}.
74-
* Logic issues should use 422 Unprocessable Entity instead of 200 OK.
73+
* The request is valid and the result is returned in {@link ResponseEntity}. Logic issues should use 422 Unprocessable Entity instead of 200 OK.
7574
*/
7675
public static <T> ResponseEntity<Result<T>> ok() {
7776
return ResponseEntity.ok(new Result<>(new StatusMessage(Status.SUCCESS)));
@@ -126,8 +125,7 @@ public StatusMessage(BaseException e) {
126125
}
127126

128127
/**
129-
* Only recommended for returning successful results,
130-
* the stack trace cannot be displayed when returning unsuccessful results.
128+
* Only recommended for returning successful results, the stack trace cannot be displayed when returning unsuccessful results.
131129
*/
132130
public StatusMessage(Status status) {
133131
this.status = status.name();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.eventmesh.dashboard.common.enums;
19+
20+
/**
21+
* 业务类型,
22+
* storage:可选值(rocketmq,pravega,mongodb,pulsar,redis,kafka,knative,rabbitmq),
23+
* sinkConnector:可选值(rocketmq,spring,pravega,wechat,openfunction,file,knative,pulsar,lark,slack,rabbitmq,redis,mongodb,dingtalk)
24+
* sourceConnector:可选值(rocketmq,spring,pravega,openfunction,jdbc,file,http,wecom,knative,pulsar,prometheus,rabbitmq,redis,mongodb)',
25+
*/
26+
public enum BusinessType {
27+
28+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.eventmesh.dashboard.common.enums;
19+
20+
public enum ClusterTrusteeshipType {
21+
22+
FIRE_AND_FORGET_TRUSTEESHIP,
23+
24+
TRUSTEESHIP,
25+
26+
REVERSE,
27+
28+
NO_TRUSTEESHIP;
29+
30+
}
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.eventmesh.dashboard.common.enums;
19+
20+
import java.util.ArrayList;
21+
import java.util.List;
22+
import java.util.Objects;
23+
24+
import lombok.Getter;
25+
26+
public enum ClusterType {
27+
28+
DEFAULT(1),
29+
30+
EVENTMESH(20),
31+
32+
STORAGE(21),
33+
34+
DEFAULT_TYPE_NAME(1),
35+
36+
CLUSTER(1),
37+
38+
META(2),
39+
40+
RUNTIME(3),
41+
42+
43+
RUNTIME_EVENT_RUNTIME(ClusterType.META.code + 1),
44+
45+
RUNTIME_ROCKETMQ_BROKER(ClusterType.META.code + 31),
46+
47+
META_TYPE_ETCD(ClusterType.META.code + 1),
48+
49+
META_TYPE_NACOS(ClusterType.META.code + 2),
50+
51+
META_TYPE_ROCKETMQ_NAMESERVER(ClusterType.META.code + 31),
52+
53+
54+
EVENTMESH_CLUSTER(EVENTMESH, EVENTMESH, CLUSTER, DEFAULT, RemotingType.EVENT_MESH_RUNTIME),
55+
56+
EVENTMESH_RUNTIME(EVENTMESH, EVENTMESH, RUNTIME, DEFAULT, RemotingType.EVENT_MESH_RUNTIME),
57+
58+
EVENTMESH_META_ETCD(EVENTMESH, EVENTMESH, META, META_TYPE_ETCD, RemotingType.EVENT_MESH_ETCD),
59+
60+
EVENTMESH_META_NACOS(EVENTMESH, EVENTMESH, META, META_TYPE_NACOS, RemotingType.EVENT_MESH_NACOS),
61+
62+
STORAGE_ROCKETMQ(ClusterType.STORAGE.code + 1),
63+
64+
STORAGE_ROCKETMQ_CLUSTER(STORAGE, STORAGE_ROCKETMQ, CLUSTER, DEFAULT, RemotingType.ROCKETMQ),
65+
66+
STORAGE_ROCKETMQ_NAMESERVER(STORAGE, STORAGE_ROCKETMQ, META, DEFAULT, RemotingType.ROCKETMQ_NAMESERVER),
67+
68+
STORAGE_ROCKETMQ_BROKER(STORAGE, STORAGE_ROCKETMQ, RUNTIME, DEFAULT, RemotingType.ROCKETMQ);
69+
70+
71+
public static final List<ClusterType> STORAGE_TYPES = getStorage();
72+
@Getter
73+
private ClusterType eventmeshNodeType;
74+
@Getter
75+
private ClusterType assemblyName;
76+
@Getter
77+
private ClusterType assemblyNodeType;
78+
@Getter
79+
private ClusterType assemblyBusiness;
80+
@Getter
81+
private RemotingType remotingType;
82+
@Getter
83+
private int code;
84+
85+
ClusterType(int code) {
86+
this.code = code;
87+
}
88+
89+
90+
ClusterType(ClusterType eventmeshNodeType, ClusterType assemblyName, ClusterType assemblyNodeType, ClusterType assemblyBusiness,
91+
RemotingType remotingType) {
92+
this.eventmeshNodeType = eventmeshNodeType;
93+
this.assemblyName = assemblyName;
94+
this.assemblyNodeType = assemblyNodeType;
95+
this.assemblyBusiness = assemblyBusiness;
96+
this.remotingType = remotingType;
97+
}
98+
99+
private static List<ClusterType> getStorage() {
100+
List<ClusterType> list = new ArrayList<>();
101+
for (ClusterType clusterType : ClusterType.values()) {
102+
if (Objects.equals(clusterType.eventmeshNodeType, ClusterType.STORAGE) && Objects.equals(clusterType.assemblyNodeType,
103+
ClusterType.CLUSTER)) {
104+
list.add(clusterType);
105+
}
106+
}
107+
return list;
108+
}
109+
110+
public boolean isMainCluster() {
111+
return Objects.equals(this, ClusterType.EVENTMESH_CLUSTER) || Objects.equals(this.assemblyNodeType, ClusterType.CLUSTER);
112+
}
113+
114+
public boolean isFirstLayer() {
115+
return Objects.equals(this, ClusterType.EVENTMESH_META_NACOS) || Objects.equals(this, ClusterType.EVENTMESH_META_ETCD) || Objects.equals(this,
116+
ClusterType.EVENTMESH_RUNTIME) || Objects.equals(this.getAssemblyNodeType(), ClusterType.CLUSTER);
117+
}
118+
119+
public boolean isSecondFloor() {
120+
return Objects.equals(eventmeshNodeType, ClusterType.STORAGE) ? (Objects.equals(assemblyNodeType, ClusterType.RUNTIME) || Objects.equals(
121+
assemblyNodeType, ClusterType.META)) : false;
122+
}
123+
124+
}

0 commit comments

Comments
 (0)