Skip to content

Commit 132fd00

Browse files
[Improve] update english doc (apache#3028)
Co-authored-by: tomsun28 <[email protected]>
1 parent 12ba2fa commit 132fd00

File tree

6 files changed

+37
-36
lines changed

6 files changed

+37
-36
lines changed

hertzbeat-common/src/main/java/org/apache/hertzbeat/common/constants/AiTypeEnum.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
public enum AiTypeEnum {
2626

2727
/**
28-
* 智普
28+
* ZhiPu
2929
*/
3030
zhiPu,
3131

3232
/**
3333
* sparkDesk
34-
* 科大讯飞
3534
*/
3635
sparkDesk,
3736

hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/RocketmqProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class RocketmqProtocol implements CommonRequestProtocol, Protocol {
5252
private String secretKey;
5353

5454
/**
55-
* jsonpath解析脚本
55+
* jsonpath parsing script
5656
*/
5757
private String parseScript;
5858

hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/scheduler/AssignJobs.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717

1818
package org.apache.hertzbeat.manager.scheduler;
1919

20-
import java.util.Set;
21-
import java.util.concurrent.ConcurrentHashMap;
2220
import lombok.Data;
2321
import lombok.extern.slf4j.Slf4j;
2422

23+
import java.util.Set;
24+
import java.util.concurrent.ConcurrentHashMap;
25+
2526
/**
2627
* List of assigned collection tasks
2728
*/
@@ -33,17 +34,17 @@ public class AssignJobs {
3334
* current assign jobIds
3435
*/
3536
private Set<Long> jobs;
36-
37+
3738
/**
3839
* jobs to be adding
3940
*/
4041
private Set<Long> addingJobs;
41-
42+
4243
/**
4344
* jobs to be removed
4445
*/
4546
private Set<Long> removingJobs;
46-
47+
4748
/**
4849
* jobs has pinned in this collector
4950
*/
@@ -59,15 +60,15 @@ public AssignJobs() {
5960
public void addAssignJob(Long jobId) {
6061
jobs.add(jobId);
6162
}
62-
63+
6364
public void addAddingJob(Long jobId) {
6465
addingJobs.add(jobId);
6566
}
66-
67+
6768
public void addRemovingJob(Long jobId) {
6869
removingJobs.add(jobId);
6970
}
70-
71+
7172
public void addPinnedJob(Long jobId) {
7273
pinnedJobs.add(jobId);
7374
}
@@ -77,19 +78,19 @@ public void addAssignJobs(Set<Long> jobSet) {
7778
jobs.addAll(jobSet);
7879
}
7980
}
80-
81+
8182
public void addAddingJobs(Set<Long> jobSet) {
8283
if (jobSet != null && !jobSet.isEmpty()) {
8384
addingJobs.addAll(jobSet);
8485
}
8586
}
86-
87+
8788
public void addRemovingJobs(Set<Long> jobSet) {
8889
if (jobSet != null && !jobSet.isEmpty()) {
8990
removingJobs.addAll(jobSet);
9091
}
9192
}
92-
93+
9394
public void addPinnedJobs(Set<Long> jobSet) {
9495
if (jobSet != null && !jobSet.isEmpty()) {
9596
pinnedJobs.addAll(jobSet);
@@ -102,14 +103,14 @@ public void removeAssignJobs(Set<Long> jobIds) {
102103
}
103104
jobs.removeAll(jobIds);
104105
}
105-
106+
106107
public void removeAddingJobs(Set<Long> jobIds) {
107108
if (addingJobs == null || jobIds == null || jobIds.isEmpty()) {
108109
return;
109110
}
110111
addingJobs.removeAll(jobIds);
111112
}
112-
113+
113114
public void clearRemovingJobs() {
114115
if (removingJobs == null) {
115116
return;
@@ -118,31 +119,32 @@ public void clearRemovingJobs() {
118119
}
119120

120121
/**
121-
* 判断是否存在对应的jobId
122+
* Check if the corresponding jobId exists
123+
*
122124
* @param jobId jobId
123-
* @return 若存在返回true,并把jobId从assignJobs remove掉
125+
* @return true if exists and removes the jobId from assignJobs
124126
*/
125127
public boolean containAndRemoveJob(Long jobId) {
126128
if (jobs.isEmpty()) {
127129
return false;
128130
}
129131
return jobs.remove(jobId);
130132
}
131-
133+
132134
public void removeAddingJob(Long jobId) {
133135
if (addingJobs == null || jobId == null) {
134136
return;
135137
}
136138
addingJobs.remove(jobId);
137139
}
138-
140+
139141
public void removeRemovingJob(Long jobId) {
140142
if (removingJobs == null || jobId == null) {
141143
return;
142144
}
143145
removingJobs.remove(jobId);
144146
}
145-
147+
146148
public void removePinnedJob(Long jobId) {
147149
if (pinnedJobs == null || jobId == null) {
148150
return;
@@ -151,7 +153,7 @@ public void removePinnedJob(Long jobId) {
151153
}
152154

153155
/**
154-
* 清理数据
156+
* Clean data
155157
*/
156158
public void clear() {
157159
if (!jobs.isEmpty()) {

template-marketplace/hertzbeat-template-hub/src/main/java/org/apache/hertzbeat/templatehub/controller/AccountController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public ResponseEntity<Message<Map<String,String>>> issueCustomToken(@RequestBody
115115
@PostMapping("/register")
116116
@Transactional
117117
public ResponseEntity<Message<String>> accountRegister(@RequestBody @Validated SignUpDto account) {
118-
//此处先让前端传递明文密码,后续改为加密密码
118+
// TODO Let the front-end pass the plaintext password here first, and then change it to an encrypted password later
119119

120120
if (accountService.registerAccount(account)) {
121121
Long authUser = roleService.getRoleIdByCode("role_user");

template-marketplace/hertzbeat-template-hub/src/main/java/org/apache/hertzbeat/templatehub/sureness/SurenessFilterExample.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,38 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
7070
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization, authorization,x-requested-with, *");
7171

7272
try {
73-
//获取过滤器链中的filters属性
73+
// Retrieve the filters attribute from the filter chain
7474
Field filtersField = filterChain.getClass().getDeclaredField("filters");
75-
//反射设置属性可达
75+
// Reflection setting attribute reachable
7676
filtersField.setAccessible(true);
77-
//获取filters属性值
77+
// Get the value of the filters attribute
7878
FilterConfig[] filters = (FilterConfig[]) filtersField.get(filterChain);
79-
//跳过过滤器个数记录
79+
// Skip the record of the number of filters
8080
int k = 0;
81-
//遍历所有过滤器
81+
// Traverse all filters
8282
for (int i = 0; i < filters.length; i++) {
8383
if (filters[i] != null) {
84-
//获取过滤器filterDef属性
84+
// Get the filterDef attribute of the filter
8585
Field filterDefField = filters[i].getClass().getDeclaredField("filterDef");
8686
filterDefField.setAccessible(true);
87-
//获取filter的class
87+
// Get the class of the filter
8888
Field filterClassField = filterDefField.get(filters[i]).getClass().getDeclaredField("filterClass");
8989
filterClassField.setAccessible(true);
9090
String filterClass = (String) filterClassField.get(filterDefField.get(filters[i]));
9191
String FILTER_REFERENCE1 = "com.usthe.sureness.configuration.SurenessJakartaServletFilter";
9292
String FILTER_REFERENCE2 = "org.apache.tomcat.websocket.server.WsFilter";
93-
//跳过指定过滤器处理
93+
// Skip specified filter processing
9494
if (FILTER_REFERENCE1.equals(filterClass)||FILTER_REFERENCE2.equals(filterClass)) {
9595
filters[i] = null;
9696
k++;
9797
break;
9898
}
99-
//属性可达关闭
99+
// Attribute can be disabled
100100
filterClassField.setAccessible(false);
101101
filterDefField.setAccessible(false);
102102
}
103103
}
104-
//过滤器数组重新赋值,调整移除指定过滤器后过滤器数组
104+
// Re assign the filter array and adjust it after removing the specified filter
105105
int index = 0;
106106
for (int i = 0; i < filters.length; i++) {
107107
if (index == 0 && filters[i] == null) {
@@ -113,7 +113,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
113113
index = 0;
114114
}
115115
}
116-
//n值重新赋值
116+
// Reassignment of n value
117117
filtersField.setAccessible(false);
118118
Field n = filterChain.getClass().getDeclaredField("n");
119119
n.setAccessible(true);

template-marketplace/hertzbeat-template-hub/src/main/java/org/apache/hertzbeat/templatehub/sureness/provider/DatabasePathTreeProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public class DatabasePathTreeProvider implements PathTreeProvider {
3939

4040
@Override
4141
public Set<String> providePathData() {
42-
// 从数据库中读取出path信息,取出所有状态为1,即正常的path信息
42+
// Read path information from the database and retrieve all path information with a status of 1, which is normal
4343
Set<String> pathSet = SurenessCommonUtil.attachContextPath(getContextPath(), resourceService.getAllEnableResourcePath());
4444
return pathSet;
4545

4646
}
4747

4848
@Override
4949
public Set<String> provideExcludedResource() {
50-
// 从数据库中读取出path信息,取出所有状态为9,即禁用的path信息
50+
// Read path information from the database and retrieve all path information with a status of 9, which is disabled
5151
Set<String> exlResourceSet = SurenessCommonUtil.attachContextPath(getContextPath(), resourceService.getAllDisableResourcePath());
5252
return exlResourceSet;
5353
}

0 commit comments

Comments
 (0)