This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new d6ce092cd [doc] translate common moudle code chinese to english (#1766)
d6ce092cd is described below
commit d6ce092cd46de774c7befccc6e1a719c06774bf7
Author: 风如歌 <[email protected]>
AuthorDate: Thu Apr 18 10:20:55 2024 +0800
[doc] translate common moudle code chinese to english (#1766)
Co-authored-by: tomsun28 <[email protected]>
---
common/pom.xml | 6 +--
.../common/config/AviatorConfiguration.java | 18 +++----
.../hertzbeat/common/config/CommonProperties.java | 12 ++---
.../common/constants/CommonConstants.java | 56 +++++-----------------
.../hertzbeat/common/entity/alerter/Alert.java | 38 +++++++++------
.../common/entity/alerter/AlertConverge.java | 17 ++++---
.../common/entity/alerter/AlertDefine.java | 13 ++---
.../common/entity/alerter/AlertSilence.java | 25 +++++-----
.../hertzbeat/common/entity/dto/AlertReport.java | 27 ++++++++---
.../hertzbeat/common/entity/job/Configmap.java | 6 +--
.../apache/hertzbeat/common/entity/job/Job.java | 31 ++++--------
.../hertzbeat/common/entity/job/Metrics.java | 38 ++-------------
.../common/entity/job/protocol/FtpProtocol.java | 12 ++---
.../common/entity/job/protocol/HttpProtocol.java | 40 ++++++++--------
.../common/entity/job/protocol/JmxProtocol.java | 7 ---
.../common/entity/job/protocol/NginxProtocol.java | 2 +-
.../common/entity/job/protocol/SnmpProtocol.java | 5 +-
.../hertzbeat/common/entity/manager/Collector.java | 2 +-
.../entity/manager/CollectorMonitorBind.java | 2 +-
.../common/entity/manager/GeneralConfig.java | 6 +--
.../hertzbeat/common/entity/manager/Monitor.java | 31 ++++++------
.../common/entity/manager/NoticeReceiver.java | 53 ++++++++++----------
.../common/entity/manager/NoticeRule.java | 30 ++++++------
.../common/entity/manager/NoticeTemplate.java | 15 +++---
.../hertzbeat/common/entity/manager/Param.java | 18 +++----
.../common/entity/manager/ParamDefine.java | 56 ++++++++--------------
.../common/entity/manager/StatusPageOrg.java | 3 +-
.../hertzbeat/common/entity/manager/Tag.java | 15 +++---
.../common/entity/manager/TagMonitorBind.java | 6 +--
.../common/entity/message/ClusterMsg.java | 4 +-
.../hertzbeat/common/entity/warehouse/History.java | 4 +-
.../common/queue/impl/KafkaCommonDataQueue.java | 6 ++-
.../hertzbeat/common/service/TencentSmsClient.java | 4 +-
.../org/apache/hertzbeat/common/util/AesUtil.java | 6 ++-
.../apache/hertzbeat/common/util/CommonUtil.java | 6 +--
.../common/util/IntervalExpressionUtil.java | 3 +-
.../apache/hertzbeat/common/util/LruHashMap.java | 2 +-
.../hertzbeat/common/util/SnowFlakeIdWorker.java | 32 ++++---------
.../apache/hertzbeat/common/util/StrBuffer.java | 40 ++++++++--------
.../common/util/prometheus/PrometheusUtil.java | 7 ++-
.../common/util/SnowFlakeIdGeneratorTest.java | 4 +-
41 files changed, 321 insertions(+), 387 deletions(-)
diff --git a/common/pom.xml b/common/pom.xml
index dde1a652e..e7327529f 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -69,12 +69,12 @@
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<scope>provided</scope>
</dependency>
- <!-- 表达式计算 -->
+ <!-- Expression evaluation -->
<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
</dependency>
- <!-- 工具依赖 -->
+ <!-- Tool dependencies -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -87,7 +87,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
</dependency>
- <!-- 使用apache.http.conn.util代替sun.net.util -->
+ <!-- Use apache.http.conn.util instead of sun.net.util -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/config/AviatorConfiguration.java
b/common/src/main/java/org/apache/hertzbeat/common/config/AviatorConfiguration.java
index de2d789b1..c0815a6fa 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/config/AviatorConfiguration.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/config/AviatorConfiguration.java
@@ -50,22 +50,22 @@ public class AviatorConfiguration {
public AviatorEvaluatorInstance configAviatorEvaluator() {
AviatorEvaluatorInstance instance = AviatorEvaluator.getInstance();
- // 配置AviatorEvaluator使用LRU缓存编译后的表达式
+ // Configure AviatorEvaluator to cache compiled expressions using LRU
instance
.useLRUExpressionCache(AVIATOR_LRU_CACHE_SIZE)
.addFunction(new StrEqualFunction());
- // limit loop 限制循环次数
+ // limit loop Limit the number of loops
instance.setOption(Options.MAX_LOOP_COUNT, 10);
- // 启用部分Aviator语法特性集合
+ // Enables a partial Aviator syntax feature collection
instance.setOption(Options.FEATURE_SET,
Feature.asSet(Feature.If,
Feature.Assignment,
Feature.Let,
Feature.StringInterpolation));
- // 配置自定义aviator函数
+ // Configure the custom aviator function
instance.addOpFunction(OperatorType.BIT_OR, new AbstractFunction() {
@Override
public AviatorObject call(final Map<String, Object> env, final
AviatorObject arg1,
@@ -98,7 +98,7 @@ public class AviatorConfiguration {
}
/**
- * 自定义aviator判断字符串是否相等函数
+ * Define a custom aviator string equality function
*/
private static class StrEqualFunction extends AbstractFunction {
@Override
@@ -123,7 +123,7 @@ public class AviatorConfiguration {
}
/**
- * 自定义aviator判断字符串1是否包含字符串2 (case-insensitive)
+ * Custom aviator determines whether string 1 contains string 2
(case-insensitive)
*/
private static class StrContainsFunction extends AbstractFunction {
@Override
@@ -148,7 +148,7 @@ public class AviatorConfiguration {
}
/**
- * 自定义aviator判断环境中此对象是否存在值
+ * Custom aviator determines if a value exists for this object in the
environment
*/
private static class ObjectExistsFunction extends AbstractFunction {
@Override
@@ -172,8 +172,8 @@ public class AviatorConfiguration {
}
/**
- * 自定义aviator判断字符串是否匹配regex
- * - regex需要加上""或者''
+ * Custom aviator determines if a string matches a regex
+ * - regex You need to add "" or ''
*/
private static class StrMatchesFunction extends AbstractFunction {
@Override
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/config/CommonProperties.java
b/common/src/main/java/org/apache/hertzbeat/common/config/CommonProperties.java
index 8ac112dba..594254689 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/config/CommonProperties.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/config/CommonProperties.java
@@ -109,7 +109,7 @@ public class CommonProperties {
*/
public static class KafkaProperties {
/**
- * kafka的连接服务器url
+ * kafka's connection server url
*/
private String servers;
/**
@@ -167,27 +167,27 @@ public class CommonProperties {
public static class TencentSmsProperties {
/**
- * 腾讯云账户访问密钥id
+ * Tencent cloud account secret id
*/
private String secretId;
/**
- * 腾讯云账户访问密钥key
+ * Tencent cloud account secret key
*/
private String secretKey;
/**
- * SMS短信应用app id
+ * SMS app id
*/
private String appId;
/**
- * 短信签名
+ * SMS signature
*/
private String signName;
/**
- * 短信模版ID
+ * SMS template ID
*/
private String templateId;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
b/common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
index 0c268f960..034bd5357 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/constants/CommonConstants.java
@@ -24,140 +24,117 @@ public interface CommonConstants {
/**
* Response status code: generic success
- * 响应状态码: 通用成功
*/
byte SUCCESS_CODE = 0x00;
/**
* Response status code: generic failure
- * 响应状态码: 通用失败
*/
byte FAIL_CODE = 0x0F;
/**
* Response status code: Parameter verification failed
- * 响应状态码: 参数校验失败
*/
byte PARAM_INVALID_CODE = 0x01;
/**
* Response Status Code: Probe Failed
- * 响应状态码: 探测失败
*/
byte DETECT_FAILED_CODE = 0x02;
/**
* Response status code: monitoring does not exist
- * 响应状态码: 监控不存在
*/
byte MONITOR_NOT_EXIST_CODE = 0x03;
/**
* Response Status Code: Monitor Service Conflict
- * 响应状态码: 监控服务冲突
*/
byte MONITOR_CONFLICT_CODE = 0x04;
/**
* Response status code: Incorrect login account password
- * 响应状态码: 登录账户密码错误
*/
byte MONITOR_LOGIN_FAILED_CODE = 0x05;
/**
* Response status code: Registration failed exception
- * 响应状态码: 注册失败异常
*/
byte MONITOR_REGISTER_FAILED_CODE = 0x06;
/**
* Monitoring Status Code: Unmonitored
- * 任务状态码: 未监控
*/
byte UN_MANAGE_CODE = 0x00;
/**
* Monitoring Status Code: Available
- * 任务状态码: 可用
*/
byte AVAILABLE_CODE = 0x01;
/**
* Monitoring Status Code: Not Available
- * 任务状态码: 不可用
*/
byte UN_AVAILABLE_CODE = 0x02;
/**
* Alarm status: 0 - normal alarm (to be processed)
- * 告警状态: 0-正常告警(待处理)
*/
byte ALERT_STATUS_CODE_PENDING = 0x00;
/**
* Alarm Status: 1 - Threshold triggered but not reached the number of
alarms
- * 告警状态: 1-阈值触发但未达到告警次数
*/
byte ALERT_STATUS_CODE_NOT_REACH = 0x01;
/**
* Alarm Status: 2-Restore Alarm
- * 告警状态: 2-恢复告警
*/
byte ALERT_STATUS_CODE_RESTORED = 0x02;
/**
* Alert Status: 3-Handled
- * 告警状态: 3-已处理
*/
byte ALERT_STATUS_CODE_SOLVED = 0x03;
/**
* Alarm level: 0: high-emergency-emergency-red
- * 告警级别: 0:高-emergency-紧急告警-红色
*/
byte ALERT_PRIORITY_CODE_EMERGENCY = 0x00;
/**
* Alarm severity: 1: medium-critical-critical alarm-orange
- * 告警级别: 1:中-critical-严重告警-橙色
*/
byte ALERT_PRIORITY_CODE_CRITICAL = 0x01;
/**
* Warning level: 2: low-warning-warning warning-yellow
- * 告警级别: 2:低-warning-警告告警-黄色
*/
byte ALERT_PRIORITY_CODE_WARNING = 0x02;
/**
* Field parameter type: number
- * 字段参数类型: 数字
*/
byte TYPE_NUMBER = 0;
/**
* Field parameter type: String
- * 字段参数类型: 字符串
*/
byte TYPE_STRING = 1;
/**
* Field parameter type: encrypted string
- * 字段参数类型: 加密字符串
*/
byte TYPE_SECRET = 2;
/**
* Field parameter type: time
- * 字段参数类型: 时间
*/
byte TYPE_TIME = 3;
/**
* Collection metric value: null placeholder for empty value
- * 采集指标值:null空值占位符
*/
String NULL_VALUE = " ";
@@ -172,25 +149,22 @@ public interface CommonConstants {
String PROM_VALUE = "value";
/**
- * Availability 监控总可用性指标
+ * Monitor total availability metrics
*/
String AVAILABILITY = "availability";
/**
* Parameter Type Number
- * 参数类型 数字
*/
byte PARAM_TYPE_NUMBER = 0;
/**
* Parameter Type String
- * 参数类型 字符串
*/
byte PARAM_TYPE_STRING = 1;
/**
* Parameter Type Password
- * 参数类型 密码
*/
byte PARAM_TYPE_PASSWORD = 2;
@@ -206,75 +180,71 @@ public interface CommonConstants {
/**
* Authentication type Account password
- * 认证类型 账户密码
*/
byte AUTH_TYPE_PASSWORD = 1;
/**
- * Authentication type GITHUB three-party login
- * 认证类型 GITHUB三方登录
+ * Authentication type GitHub three-party login
*/
byte AUTH_TYPE_GITHUB = 2;
/**
* Authentication type WeChat three-party login
- * 认证类型 微信三方登录
*/
byte AUTH_TYPE_WEIXIN = 3;
/**
* Authentication type GITEE three-party login
- * 认证类型 GITEE三方登录
*/
byte AUTH_TYPE_GITEE = 5;
/**
- * 内有标签: monitorId 监控任务ID
+ * Inside the tag: monitorId Monitor task ID
*/
String TAG_MONITOR_ID = "monitorId";
/**
- * 内有标签: monitorName 任务名称
+ * Inside the tag: monitorName Task name
*/
String TAG_MONITOR_NAME = "monitorName";
/**
- * 内有标签: monitorHost 任务主机
+ * Inside the tag: monitorHost Task host
*/
String TAG_MONITOR_HOST = "monitorHost";
/**
- * 内有标签: policyId 告警阈值规则ID
+ * Inside the tag: policyId Alarm threshold rule ID
*/
String TAG_THRESHOLD_ID = "thresholdId";
/**
- * 内有标签: app 监控类型
+ * Inside the tag: app Type of monitoring
*/
String TAG_MONITOR_APP = "app";
/**
- * 内有标签: metrics
+ * Inside the tag: metrics
*/
String TAG_METRICS = "metrics";
/**
- * 内有标签: metric
+ * Inside the tag: metric
*/
String TAG_METRIC = "metric";
/**
- * 内有标签: code
+ * Inside the tag: code
*/
String TAG_CODE = "code";
/**
- * notice_period type 类型字段, 每日类型
+ * notice_period type Type field, daily type
*/
int NOTICE_PERIOD_DAILY = 0;
/**
- * key为receiver.id, value为noticePeriod的缓存key前缀
+ * key is receiver.id, value is noticePeriod cache key prefix
*/
String RECEIVER_NOTICE_PERIOD_CACHE_PREFIX = "receiver_notice_period:";
@@ -315,7 +285,7 @@ public interface CommonConstants {
/**
* ignore label
- * 处理未配置恢复告警,但需要使用恢复告警变更任务状态的情况
+ * Handle situations where recovery alarms are not configured, but need to
be used to change task state
*/
String IGNORE = "ignore";
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/Alert.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/Alert.java
index 632393bd3..daf389f2e 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/Alert.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/Alert.java
@@ -50,26 +50,27 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Alarm record entity | 告警记录实体")
+@Schema(description = "Alarm record entity")
@EntityListeners(AuditingEntityListener.class)
public class Alert {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY, generator =
"snow-flake-id")
- @GenericGenerator(name = "snow-flake-id", strategy =
"org.apache.hertzbeat.common.util.SnowFlakeIdGenerator")
+ @GenericGenerator(name = "snow-flake-id",
+ strategy = "org.apache.hertzbeat.common.util.SnowFlakeIdGenerator")
@Schema(title = "Alarm record entity primary key index ID",
- description = "告警记录实体主键索引ID",
+ description = "Alarm record entity primary key index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "Alert target object: monitor availability-available
metrics-app.metrics.field",
- description = "告警目标对象: 监控可用性-available 指标-app.metrics.field",
+ description = "Alert target object: monitor availability-available
metrics-app.metrics.field",
example = "1", accessMode = READ_WRITE)
@Length(max = 255)
private String target;
@Schema(title = "Alarm definition ID associated with the alarm",
- description = "告警关联的告警定义ID",
+ description = "Alarm definition ID associated with the alarm",
example = "8743267443543", accessMode = READ_WRITE)
private Long alertDefineId;
@@ -80,41 +81,50 @@ public class Alert {
private byte priority;
@Schema(title = "The actual content of the alarm notification",
- description = "告警通知实际内容",
+ description = "The actual content of the alarm notification",
example = "linux_192.134.32.1: 534543534 cpu usage high",
accessMode = READ_WRITE)
@Column(length = 4096)
private String content;
- @Schema(title = "Alarm status: 0-normal alarm (to be processed)
1-threshold triggered but not reached the number of alarms 2-recovered alarm
3-processed",
- description = "告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理",
+ @Schema(title = "Alarm status: " +
+ "0-normal alarm (to be processed) " +
+ "1-threshold triggered but not reached the number of alarms " +
+ "2-recovered alarm " +
+ "3-processed",
+ description = "Alarm status: " +
+ "0-normal alarm (to be processed) " +
+ "1-threshold triggered but not reached the number of
alarms " +
+ "2-recovered alarm " +
+ "3-processed",
example = "1", accessMode = READ_WRITE)
@Min(0)
@Max(3)
private byte status;
@Schema(title = "Alarm times",
- description = "告警次数",
+ description = "Alarm times",
example = "3", accessMode = READ_WRITE)
private Integer times;
@Schema(title = "Alarm trigger time (timestamp in milliseconds)",
- description = "首次告警时间(毫秒时间戳)",
+ description = "Alarm trigger time (timestamp in milliseconds)",
example = "1612198922000", accessMode = READ_ONLY)
private Long firstAlarmTime;
@Schema(title = "Alarm trigger time (timestamp in milliseconds)",
- description = "最近告警时间(毫秒时间戳)",
+ description = "Alarm trigger time (timestamp in milliseconds)",
example = "1612198922000", accessMode = READ_ONLY)
private Long lastAlarmTime;
@Schema(title = "Alarm threshold trigger times",
- description = "告警阈值触发次数",
+ description = "Alarm threshold trigger times",
example = "3", accessMode = READ_WRITE)
@Transient
private Integer triggerTimes;
- @Schema(description = "告警信息标签(monitorId:xxx,monitorName:xxx)", example =
"{key1:value1}", accessMode = READ_WRITE)
+ @Schema(description = "Alarm information
label(monitorId:xxx,monitorName:xxx)",
+ example = "{key1:value1}", accessMode = READ_WRITE)
@Convert(converter = JsonMapAttributeConverter.class)
@SuppressWarnings("JpaAttributeTypeInspection")
@Column(length = 2048)
@@ -129,7 +139,7 @@ public class Alert {
private String modifier;
@Schema(title = "Record the latest creation time (timestamp in
milliseconds)",
- description = "记录最新创建时间(毫秒时间戳)",
+ description = "Record the latest creation time (timestamp in
milliseconds)",
example = "1612198922000", accessMode = READ_ONLY)
@CreatedDate
private LocalDateTime gmtCreate;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertConverge.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertConverge.java
index d1eb0d792..5c8df4139 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertConverge.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertConverge.java
@@ -50,37 +50,40 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Alert Converge Policy Entity | 告警收敛策略实体")
+@Schema(description = "Alert Converge Policy Entity")
@EntityListeners(AuditingEntityListener.class)
public class AlertConverge {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(title = "Alert Converge Policy Entity Primary Key Index ID",
- description = "告警收敛策略实体主键索引ID",
+ description = "Alert Converge Policy Entity Primary Key Index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
- @Schema(title = "Policy name", description = "策略名称",
+ @Schema(title = "Policy name", description = "Policy name",
example = "converge-1", accessMode = READ_WRITE)
@Length(max = 100)
@NotNull
private String name;
- @Schema(title = "Whether to enable this policy", description = "是否启用此策略",
+ @Schema(title = "Whether to enable this policy", description = "Whether to
enable this policy",
example = "true", accessMode = READ_WRITE)
private boolean enable = true;
- @Schema(title = "Whether to match all", description = "是否应用匹配所有",
+ @Schema(title = "Whether to match all", description = "Whether to match
all",
example = "true", accessMode = READ_WRITE)
private boolean matchAll = true;
- @Schema(title = "Alarm Level 0:High-Emergency-Critical Alarm
1:Medium-Critical-Critical Alarm 2:Low-Warning-Warning",
+ @Schema(title = "Alarm Level " +
+ "0:High-Emergency-Critical Alarm " +
+ "1:Medium-Critical-Critical Alarm " +
+ "2:Low-Warning-Warning",
example = "[1]", accessMode = READ_WRITE)
@Convert(converter = JsonByteListAttributeConverter.class)
private List<Byte> priorities;
- @Schema(description = "匹配告警信息标签(monitorId:xxx,monitorName:xxx)", example =
"{name: key1, value: value1}",
+ @Schema(description = "Match the alarm information
label(monitorId:xxx,monitorName:xxx)", example = "{name: key1, value: value1}",
accessMode = READ_WRITE)
@Convert(converter = JsonTagListAttributeConverter.class)
@Column(length = 2048)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
index 8145f3675..41417272f 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java
@@ -53,7 +53,7 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Alarm Threshold Entity | 告警阈值实体")
+@Schema(description = "Alarm Threshold Entity")
@EntityListeners(AuditingEntityListener.class)
public class AlertDefine {
@@ -76,10 +76,10 @@ public class AlertDefine {
@Length(max = 100)
private String field;
- @Schema(title = "Is Apply All Default | 是否是全局默认告警", example = "false",
accessMode = READ_WRITE)
+ @Schema(title = "Is Apply All Default", example = "false", accessMode =
READ_WRITE)
private boolean preset;
- @Schema(title = "Alarm Threshold Expr | 告警阈值触发条件表达式", example =
"usage>90", accessMode = READ_WRITE)
+ @Schema(title = "Alarm Threshold Expr", example = "usage>90", accessMode =
READ_WRITE)
@Length(max = 2048)
@Column(length = 2048)
private String expr;
@@ -90,7 +90,8 @@ public class AlertDefine {
@Max(2)
private byte priority;
- @Schema(title = "Alarm Trigger Times | 阈值触发次数,即达到次数要求后才触发告警", example =
"3", accessMode = READ_WRITE)
+ @Schema(title = "Alarm Trigger Times.The alarm is triggered only after the
required number of times is reached",
+ example = "3", accessMode = READ_WRITE)
@Min(0)
@Max(10)
private Integer times;
@@ -104,11 +105,11 @@ public class AlertDefine {
@Schema(title = "Is Enable", example = "true", accessMode = READ_WRITE)
private boolean enable = true;
- @Schema(title = "Is Send Alarm Recover Notice | 是否发送告警恢复通知", example =
"false", accessMode = READ_WRITE)
+ @Schema(title = "Is Send Alarm Recover Notice", example = "false",
accessMode = READ_WRITE)
@Column(columnDefinition = "boolean default false")
private boolean recoverNotice = false;
- @Schema(title = "Alarm Template | 告警通知内容模版", example = "linux
{monitor_name}: {monitor_id} cpu usage high",
+ @Schema(title = "Alarm Template", example = "linux {monitor_name}:
{monitor_id} cpu usage high",
accessMode = READ_WRITE)
@Length(max = 2048)
@Column(length = 2048)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertSilence.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertSilence.java
index 16b51354d..2e6e7409b 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertSilence.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertSilence.java
@@ -50,41 +50,41 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Alert Silence Policy Entity | 告警静默策略实体")
+@Schema(description = "Alert Silence Policy Entity")
@EntityListeners(AuditingEntityListener.class)
public class AlertSilence {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(title = "Alert Silence Policy Entity Primary Key Index ID",
- description = "告警静默策略实体主键索引ID",
+ description = "Alert Silence Policy Entity Primary Key Index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "Policy name",
- description = "策略名称",
+ description = "Policy name",
example = "silence-1", accessMode = READ_WRITE)
@Length(max = 100)
@NotNull
private String name;
@Schema(title = "Whether to enable this policy",
- description = "是否启用此策略",
+ description = "Whether to enable this policy",
example = "true", accessMode = READ_WRITE)
private boolean enable = true;
@Schema(title = "Whether to match all",
- description = "是否应用匹配所有",
+ description = "Whether to match all",
example = "true", accessMode = READ_WRITE)
private boolean matchAll = true;
@Schema(title = "Silence type 0: once, 1:cyc",
- description = "静默类型 0:一次性静默 1:周期性静默", accessMode = READ_WRITE)
+ description = "Silence type 0: once, 1:cyc", accessMode =
READ_WRITE)
@NotNull
private Byte type;
@Schema(title = "Silenced alerts num",
- description = "已静默告警次数", accessMode = READ_WRITE)
+ description = "Silenced alerts num", accessMode = READ_WRITE)
private Integer times;
@Schema(title = "Alarm Level 0:High-Emergency-Critical Alarm
1:Medium-Critical-Critical Alarm 2:Low-Warning-Warning",
@@ -92,20 +92,23 @@ public class AlertSilence {
@Convert(converter = JsonByteListAttributeConverter.class)
private List<Byte> priorities;
- @Schema(description = "匹配告警信息标签(monitorId:xxx,monitorName:xxx)", example =
"{name: key1, value: value1}",
+ @Schema(description = "Match the alarm information
label(monitorId:xxx,monitorName:xxx)",
+ example = "{name: key1, value: value1}",
accessMode = READ_WRITE)
@Convert(converter = JsonTagListAttributeConverter.class)
@Column(length = 2048)
private List<TagItem> tags;
- @Schema(title = "周期性静默时有效 星期几,多选,全选或空则为每天 7:周日 1:周一 2:周二 3:周三 4:周四 5:周五
6:周六", example = "[0,1]", accessMode = READ_WRITE)
+ @Schema(title = "The day of the WEEK is valid in periodic silence,
multiple," +
+ " all or empty is daily 7: Sunday 1: Monday 2: Tuesday 3:
Wednesday 4: Thursday 5: Friday 6: Saturday",
+ example = "[0,1]", accessMode = READ_WRITE)
@Convert(converter = JsonByteListAttributeConverter.class)
private List<Byte> days;
- @Schema(title = "限制时间段起始", example = "00:00:00", accessMode = READ_WRITE)
+ @Schema(title = "Limit time period start", example = "00:00:00",
accessMode = READ_WRITE)
private ZonedDateTime periodStart;
- @Schema(title = "限制时间段截止", example = "23:59:59", accessMode = READ_WRITE)
+ @Schema(title = "Restricted time period end", example = "23:59:59",
accessMode = READ_WRITE)
private ZonedDateTime periodEnd;
@Schema(title = "The creator of this record", example = "tom", accessMode
= READ_ONLY)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/dto/AlertReport.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/dto/AlertReport.java
index 372c8d59b..bef2f1296 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/dto/AlertReport.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/dto/AlertReport.java
@@ -47,28 +47,41 @@ public class AlertReport {
@Schema(title = "Alarm evaluation interval")
private Integer alertDuration;
- @Schema(title = "Time when the log service receives the alarm message",
description = "日志服务接收到告警消息的时间",
+ @Schema(title = "Time when the log service receives the alarm message",
+ description = "Time when the log service receives the alarm
message",
example = "1694589491000", accessMode = READ_WRITE)
private long alertTime;
- @Schema(title = "Alarm priority. 0: high emergency alarm red 1: medium
critical serious alarm Orange 2: low warning warning alarm yellow",
- description = "告警严重度。0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色
2:低-warning-警告告警-黄色",
+ @Schema(title = "Alarm priority. " +
+ "0: high emergency alarm red " +
+ "1: medium critical serious alarm Orange " +
+ "2: low warning warning alarm yellow",
+ description = "Alarm priority. 0: high emergency alarm red " +
+ "1: medium critical serious alarm Orange " +
+ "2: low warning warning alarm yellow",
example = "1", accessMode = READ_WRITE)
private Integer priority;
@Schema(title = "Alarm type. 0: the default 1 is business system exception
reporting",
- description = "告警类型。0:内部告警 1:外部系统上报", example = "0", accessMode =
READ_WRITE)
+ description = "Alarm type. 0: the default 1 is business system
exception reporting",
+ example = "0", accessMode = READ_WRITE)
private Integer reportType;
- @Schema(title = "Alarm tag information", description =
"告警标签信息((monitorId:xxx,monitorName:xxx))",
+ @Schema(title = "Alarm tag information",
+ description = "Alarm label
information((monitorId:xxx,monitorName:xxx))",
example = "{\"key1\":\"value1\"}", accessMode = READ_WRITE)
private Map<String, String> labels;
- @Schema(title = " Alarm marking (monitorId:xxx,monitorName:xxx)",
description = "告警标注", example ="{\"key1\":\"value1\"}"
+ @Schema(title = " Alarm marking (monitorId:xxx,monitorName:xxx)",
+ description = "Alarm labeling",
+ example ="{\"key1\":\"value1\"}"
, accessMode = READ_WRITE)
private Map<String, String> annotations;
- @Schema(title = " Alarm content", description = "告警内容", example =
"对外报警内容", accessMode = READ_WRITE)
+ @Schema(title = " Alarm content",
+ description = "Content of alarm",
+ example = "External alarm content",
+ accessMode = READ_WRITE)
private String content;
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Configmap.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Configmap.java
index 675e08679..f5aacd4d0 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Configmap.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Configmap.java
@@ -36,7 +36,6 @@ public class Configmap {
/**
* Parameter key, replace the content with the identifier ^^_key_^^ in the
protocol
* configuration parameter with the real value in the configuration
parameter
- * 参数key,将协议配置参数里面的标识符为^^_key_^^的内容替换为配置参数里的真实值
*/
private String key;
@@ -46,10 +45,9 @@ public class Configmap {
private Object value;
/**
- * Parameter type 0: number 1: string 2: encrypted string 3: json string
mapped by map
- * 参数类型 0:数字 1:字符串 2:加密串 3:map映射的json串 4:arrays string
+ * Parameter type
+ * 0: number 1: string 2: encrypted string 3: json string mapped by map
* number,string,secret
- * 数字,非加密字符串,加密字符串
*/
private byte type = 1;
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Job.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Job.java
index 9987b0543..c1da761bf 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Job.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Job.java
@@ -59,7 +59,8 @@ public class Job {
private boolean hide = true;
/**
* Large categories of monitoring
- * service-application service monitoring db-database monitoring
custom-custom monitoring os-operating system monitoring...
+ * service-application service monitoring db-database
+ * monitoring custom-custom monitoring os-operating system monitoring...
*/
private String category;
/**
@@ -67,15 +68,14 @@ public class Job {
*/
private String app;
/**
- * The internationalized name of the monitoring type
- * zh-CN: PING连通性
- * en-US: PING CONNECT
+ * The internationalized name of the monitoring type
+ * PING CONNECT
*/
private Map<String, String> name;
/**
* The description and help of the monitoring type
- * zh-CN: PING连通性 - 支持您使用在线配置对端服务的IP或域名地址,监控本机网络与对端网络的PING可连通性。
- * en-US: PING CONNECT - You can use the IP address or domain address of
the peer service to monitor the PING connectivity between the local network and
the peer network.
+ * PING CONNECT - You can use the IP address or
+ * domain address of the peer service to monitor the PING connectivity
between the local network and the peer network.
*/
private Map<String, String> help;
/**
@@ -84,17 +84,14 @@ public class Job {
private Map<String, String> helpLink;
/**
* Task dispatch start timestamp
- * 任务派发开始时间戳
*/
private long timestamp;
/**
* Task collection time interval (unit: second) eg: 30,60,600
- * 任务采集时间间隔(单位秒) eg: 30,60,600
*/
private long interval = 600L;
/**
* Whether it is a recurring periodic task true is yes, false is no
- * 是否是循环周期性任务 true为是,false为否
*/
private boolean isCyclic = false;
/**
@@ -108,20 +105,17 @@ public class Job {
private List<Metrics> metrics;
/**
* Monitoring configuration parameter properties and values eg: username
password timeout host
- * 监控配置参数属性及值 eg: username password timeout host
*/
private List<Configmap> configmap;
/**
* the collect data response metrics as env configmap for other collect
use. ^o^xxx^o^
- * 优先级高的采集响应单行指标可以作为后续优先级采集配置的环境变量 ^o^xxx^o^
*/
@JsonIgnore
private Map<String, Configmap> envConfigmaps;
/**
* collector use - timestamp when the task was scheduled by the time wheel
- * 任务被时间轮开始调度的时间戳
*/
@JsonIgnore
private transient long dispatchTime;
@@ -141,32 +135,27 @@ public class Job {
/**
* collector use - Temporarily store one-time task metrics response data
- * collector使用 - 临时存储一次性任务响应数据
*/
@JsonIgnore
private transient List<CollectRep.MetricsData> responseDataTemp;
/**
* collector use - construct to initialize metrics execution view
- * collector使用 - 构造初始化指标执行视图
*/
public synchronized void constructPriorMetrics() {
Map<Byte, List<Metrics>> map = metrics.stream()
.peek(metric -> {
// Determine whether to configure aliasFields If not,
configure the default
- // 判断是否配置aliasFields 没有则配置默认
if ((metric.getAliasFields() == null ||
metric.getAliasFields().isEmpty()) && metric.getFields() != null) {
metric.setAliasFields(metric.getFields().stream().map(Metrics.Field::getField).collect(Collectors.toList()));
}
// Set the default metrics execution priority, if not
filled, the default last priority
- // 设置默认执行优先级,不填则默认最后优先级
if (metric.getPriority() == null) {
metric.setPriority(Byte.MAX_VALUE);
}
})
.collect(Collectors.groupingBy(Metrics::getPriority));
// Construct a linked list of task execution order of the metrics
- // 构造采集任务执行顺序链表
priorMetrics = new LinkedList<>();
map.values().forEach(metric -> {
Set<Metrics> metricsSet = Collections.synchronizedSet(new
HashSet<>(metric));
@@ -185,18 +174,16 @@ public class Job {
/**
* collector use - to get the next set of priority metric group tasks
- * collector使用 - 获取下一组优先级的采集任务
*
* @param metrics Current Metrics
* @param first Is it the first time to get
* @return Metrics Tasks
* Returning null means: the job has been completed, and the collection of
all metrics has ended
- * 返回null表示:job已完成,所有采集任务结束
* Returning the empty set metrics that there are still metrics collection
tasks at the current
* level that have not been completed,and the next level metrics task
collection cannot be performed.
- * 返回empty的集合表示:当前级别下还有指标采集任务未结束,无法进行下一级别的任务采集
+ * The set returned empty means that there are still indicator collection
tasks unfinished at the current level,
+ * and the task collection at the next level cannot be carried out
* Returns a set of data representation: get the next set of priority
index collcet tasks
- * 返回有数据集合表示:获取到下一组优先级的采集任务
*/
public synchronized Set<Metrics> getNextCollectMetrics(Metrics metrics,
boolean first) {
if (priorMetrics == null || priorMetrics.isEmpty()) {
@@ -250,7 +237,7 @@ public class Job {
@Override
public Job clone() {
- // deep clone 深度克隆
+ // deep clone
return JsonUtil.fromJson(JsonUtil.toJson(this), getClass());
}
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java
index 1f78e7919..530d1d5d0 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java
@@ -63,9 +63,6 @@ public class Metrics {
* The collection task of the next priority metrics will be scheduled only
after the scheduled collection with the higher priority is completed.
* The default priority of the availability metrics is 0, and the range of
other common metrics is 1-127, that is,
* the subsequent metrics tasks will only be scheduled after the
availability is collected successfully.
- * 范围(0-127)调度优先级,数值越小优先级越高
- * 优先级高的调度采集完成后才会调度下一优先级的采集任务
- *
可用性指标(availability)默认优先级为0,其它普通指标采集范围为1-127,即需要等availability采集成功后才会调度后面的任务
*/
private Byte priority;
/**
@@ -75,17 +72,15 @@ public class Metrics {
private boolean visible = true;
/**
* Public attribute - collection and monitoring final result attribute set
eg: speed | times | size
- * 公共属性-采集监控的最终结果属性集合 eg: speed | times | size
*/
private List<Field> fields;
/**
* Public attribute - collection and monitoring pre-query attribute set
eg: size1 | size2 | speedSize
- * 公共属性-采集监控的前置查询属性集合 eg: size1 | size2 | speedSize
*/
private List<String> aliasFields;
/**
- * Public attribute - expression calculation, map the pre-query attribute
(pre Fields) with the final attribute (fields), and calculate the final
attribute (fields) value
- * 公共属性-表达式计算,将前置查询属性(preFields)与最终属性(fields)映射,计算出最终属性(fields)值
+ * Public attribute - expression calculation, map the pre-query attribute
(pre Fields)
+ * with the final attribute (fields), and calculate the final attribute
(fields) value
* eg: size = size1 + size2, speed = speedSize
* <a
href="https://www.yuque.com/boyan-avfmj/aviatorscript/ban32m">www.yuque.com/boyan-avfmj/aviatorscript/ban32m</a>
*/
@@ -101,90 +96,74 @@ public class Metrics {
private List<String> units;
/**
* Monitoring configuration information using the http protocol
- * 使用http协议的监控配置信息
*/
private HttpProtocol http;
/**
* Monitoring configuration information for ping using the icmp protocol
- * 使用icmp协议进行ping的监控配置信息
*/
private IcmpProtocol icmp;
/**
* Monitoring configuration information using the telnet protocol
- * 使用telnet协议的监控配置信息
*/
private TelnetProtocol telnet;
/**
* Monitoring configuration information using the public smtp protocol
- * 使用smtp协议的监控配置信息
*/
private SmtpProtocol smtp;
/**
* Monitoring configuration information using the public ntp protocol
- * 使用ntp协议的监控配置信息
*/
private NtpProtocol ntp;
/**
* Monitoring configuration information using the websocket protocol
- * 使用websocket的监控配置信息
*/
private WebsocketProtocol websocket;
/**
* Monitoring configuration information using the memcached protocol
- * 使用memcached的监控配置信息
*/
private MemcachedProtocol memcached;
/**
* Monitoring configuration information using the nebulaGraph protocol
- * 使用nebulaGraph的监控配置信息
*/
private NebulaGraphProtocol nebulaGraph;
/**
* Use udp implemented by socket for service port detection configuration
information
- * 使用socket实现的udp进行服务端口探测配置信息
*/
private UdpProtocol udp;
/**
* Database configuration information implemented using the public jdbc
specification
- * 使用公共的jdbc规范实现的数据库配置信息
*/
private JdbcProtocol jdbc;
/**
* Monitoring configuration information using the public ssh protocol
- * 使用公共的ssh协议的监控配置信息
*/
private SshProtocol ssh;
/**
* Monitoring configuration information using the public redis protocol
- * 使用公共的redis协议的监控配置信息
*/
private RedisProtocol redis;
/**
* Monitoring configuration information using the public mongodb protocol
- * 使用公共的mongodb协议的监控配置信息
*/
private MongodbProtocol mongodb;
/**
* Get monitoring configuration information using public JMX protocol
- * 使用公共JMX协议获取监控配置信息
*/
private JmxProtocol jmx;
/**
* Monitoring configuration information using the public snmp protocol
- * 使用公共的snmp协议的监控配置信息
*/
private SnmpProtocol snmp;
/**
* Monitoring configuration information using the public ftp protocol
- * 使用公共的ftp协议的监控配置信息
*/
private FtpProtocol ftp;
/**
- * Monitoring configuration information using the public rocketmq protocol
使用公共的rocketmq协议的监控配置信息
+ * Monitoring configuration information using the public rocketmq protocol
*/
private RocketmqProtocol rocketmq;
/**
- * Monitoring configuration information using push style 使用push方式推送的监控配置信息
+ * Monitoring configuration information using push style
*/
private PushProtocol push;
/**
@@ -210,21 +189,18 @@ public class Metrics {
/**
* collector use - Temporarily store subTask metrics response data
- * collector使用 - 临时存储分级任务指标响应数据
*/
@JsonIgnore
private transient AtomicReference<CollectRep.MetricsData> subTaskDataRef;
/**
* collector use - Temporarily store subTask running num
- * collector使用 - 分级任务正在运行中的数量
*/
@JsonIgnore
private transient AtomicInteger subTaskNum;
/**
* collector use - Temporarily store subTask id
- * collector使用 - 分级采集任务ID
*/
@JsonIgnore
private transient Integer subTaskId;
@@ -296,19 +272,15 @@ public class Metrics {
public static class Field {
/**
* Metric name
- * 指标名称
*/
private String field;
/**
* metric field name's i18n value
- * 指标的国际化名称
- * zh-CN: CPU 版本号
- * en-US: CPU Version
+ * CPU Version
*/
private Map<String, String> i18n;
/**
* Metric type 0-number: number 1-string: string
- * 指标类型 0-number:数字 1-string:字符串
*/
private byte type = 1;
/**
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/FtpProtocol.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/FtpProtocol.java
index 66ccf9036..593fc8592 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/FtpProtocol.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/FtpProtocol.java
@@ -31,32 +31,32 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class FtpProtocol {
/**
- * 对端主机ip或域名
+ * Peer host ip or domain name
*/
private String host;
/**
- * 端口号
+ * port number
*/
private String port;
/**
- * Redis用户名(可选)
+ * Redis Username (optional)
*/
private String username;
/**
- * Redis密码(可选)
+ * Redis password(optional)
*/
private String password;
/**
- * 文件目录
+ * file catalog
*/
private String direction;
/**
- * 超时
+ * Timeout
*/
private String timeout;
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/HttpProtocol.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/HttpProtocol.java
index 86102c824..96c5cbc21 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/HttpProtocol.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/HttpProtocol.java
@@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
/**
- * http 协议配置
+ * http protocol configuration
*/
@Data
@Builder
@@ -34,59 +34,59 @@ import java.util.Map;
@NoArgsConstructor
public class HttpProtocol {
/**
- * 对端主机ip或域名
+ * Peer host ip or domain name
*/
private String host;
/**
- * 对端主机端口
+ * port number
*/
private String port;
/**
- * http/https 请求访问的url链接
+ * http/https The url link to which the request was made
*/
private String url;
/**
- * 超时时间
+ * timeout
*/
private String timeout;
/**
- * http是否使用链路加密ssl/tls,即是http还是https
+ * Whether http uses link encryption ssl/tls, i.e. http or https
*/
private String ssl = "false";
/**
- * http请求方法: get, post, put, delete, patch
+ * http request methods: get, post, put, delete, patch
*/
private String method;
/**
- * http请求携带头 eg: Content-Type = application/json
+ * http requests carry headers eg: Content-Type = application/json
*/
private Map<String, String> headers;
/**
- * http请求携带查询参数 eg: localhost:80/api?paramKey=value
+ * http requests carry query parameters eg: localhost:80/api?
paramKey=value
*/
private Map<String, String> params;
/**
- * http请求携带的请求体
+ * The body carried by an http request
*/
private String payload;
/**
- * 认证信息
+ * authentication information
*/
private Authorization authorization;
/**
- * 响应数据解析方式
- * default - 自有的数据解析规则
- * json_path 自定义jsonPath脚本 <a href="https://www.jsonpath.cn/">...</a>
- * xml_path 自定义xmlPath脚本
- * prometheus Prometheus数据规则
+ * How response data is parsed
+ * default - Own rules for parsing data
+ * json_path Custom jsonPath scripts <a
href="https://www.jsonpath.cn/">...</a>
+ * xml_path Custom xmlPath scripts
+ * prometheus Prometheus Data Rules
*/
private String parseType;
/**
- * 数据解析脚本 当解析方式为 jsonPath or xmlPath时存在
+ * Data parsing scripts exist when parsed as jsonPath or xmlPath
*/
private String parseScript;
/**
- * 内容关键字
+ * Content keywords
*/
private String keyword;
@@ -97,14 +97,14 @@ public class HttpProtocol {
private List<String> successCodes;
/**
- * 认证信息
+ * authentication information
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Authorization {
/**
- * 认证类型:Bearer Token, Basic Auth, Digest Auth
+ * certification type:Bearer Token, Basic Auth, Digest Auth
*/
private String type;
/**
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/JmxProtocol.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/JmxProtocol.java
index 0087bfe41..3ad5db432 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/JmxProtocol.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/JmxProtocol.java
@@ -32,43 +32,36 @@ import lombok.NoArgsConstructor;
public class JmxProtocol {
/**
* JMX host ip or domain name
- * JMX主机ip或域名
*/
private String host;
/**
* The port number
- * 端口号
*/
private String port;
/**
- * 是否使用链路加密ssl/tls
* enable ssl?
*/
private String ssl = "false";
/**
* Jmx username (optional)
- * Jmx用户名(可选)
*/
private String username;
/**
* Jmx password (optional)
- * Jmx密码(可选)
*/
private String password;
/**
* jmx protocol custom collection metric address
- * jmx协议自定义收集指标地址
*/
private String url;
/**
* The name of the type where the outer layer of the jmx metric is located
- * jmx指标外层所在类型名称
*/
private String objectName;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/NginxProtocol.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/NginxProtocol.java
index d26511b9c..96f834123 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/NginxProtocol.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/NginxProtocol.java
@@ -52,7 +52,7 @@ public class NginxProtocol {
private String url;
/**
- * 校验相关参数
+ * Validates the relevant parameters
* @return is invalid true or false
*/
public boolean isInValid() {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SnmpProtocol.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SnmpProtocol.java
index 15ef62b82..15b348e1d 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SnmpProtocol.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/SnmpProtocol.java
@@ -53,7 +53,6 @@ public class SnmpProtocol {
private String version;
/**
* community name for v1 v2
- * 团体字 v1 v2 版本需要
*/
private String community;
/**
@@ -84,13 +83,13 @@ public class SnmpProtocol {
/**
* authPasswordEncryption
- * v3 需要
+ * v3 requires
*/
private String authPasswordEncryption;
/**
* privPasswordEncryption
- * v3 需要
+ * v3 requires
*/
private String privPasswordEncryption;
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java
index 7e14b37c8..3e0cd89ff 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java
@@ -48,7 +48,7 @@ import java.time.LocalDateTime;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "slave collector entity | 注册采集器实体")
+@Schema(description = "slave collector entity")
@EntityListeners(AuditingEntityListener.class)
public class Collector {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/CollectorMonitorBind.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/CollectorMonitorBind.java
index 4da786487..e182911aa 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/CollectorMonitorBind.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/CollectorMonitorBind.java
@@ -50,7 +50,7 @@ import java.time.LocalDateTime;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "slave collector monitor bind entity | 采集器与监控关联实体")
+@Schema(description = "slave collector monitor bind entity")
@EntityListeners(AuditingEntityListener.class)
public class CollectorMonitorBind {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/GeneralConfig.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/GeneralConfig.java
index 7cbbb8991..29850ab22 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/GeneralConfig.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/GeneralConfig.java
@@ -45,17 +45,17 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Common server config entity | 公共服务端配置实体")
+@Schema(description = "Common server config entity")
@EntityListeners(AuditingEntityListener.class)
public class GeneralConfig {
@Id
- @Schema(title = "Config type: email sms, primary key ", description =
"配置类型: email sms, 主键",
+ @Schema(title = "Config type: email sms, primary key ", description =
"Config type: email sms, primary key ",
accessMode = READ_WRITE)
@NotNull
private String type;
- @Schema(title = "Config content", description = "配置内容,格式为json", accessMode
= READ_WRITE)
+ @Schema(title = "Config content", description = "Config
content,formatjson", accessMode = READ_WRITE)
@Column(length = 8192)
private String content;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Monitor.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Monitor.java
index fe9d5ca3d..d40d17495 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Monitor.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Monitor.java
@@ -51,7 +51,7 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Monitor Entity | 监控实体")
+@Schema(description = "Monitor Entity")
@EntityListeners(AuditingEntityListener.class)
public class Monitor {
@@ -59,19 +59,19 @@ public class Monitor {
* Monitor ID
*/
@Id
- @Schema(title = "监控任务ID", example = "87584674384", accessMode = READ_ONLY)
+ @Schema(title = "Monitor task ID", example = "87584674384", accessMode =
READ_ONLY)
private Long id;
/**
* Job ID
*/
- @Schema(title = "采集任务ID", example = "43243543543", accessMode = READ_ONLY)
+ @Schema(title = "Collect task ID", example = "43243543543", accessMode =
READ_ONLY)
private Long jobId;
/**
* Monitor Name
*/
- @Schema(title = "任务名称", example = "Api-TanCloud.cn", accessMode =
READ_WRITE)
+ @Schema(title = "task name", example = "Api-TanCloud.cn", accessMode =
READ_WRITE)
@Length(max = 100)
private String name;
@@ -79,7 +79,7 @@ public class Monitor {
* Type of monitoring: linux, mysql, jvm...
* 监控的类型:linux,mysql,jvm...
*/
- @Schema(title = "监控类型", example = "TanCloud", accessMode = READ_WRITE)
+ @Schema(title = "Type of monitoring", example = "TanCloud", accessMode =
READ_WRITE)
@Length(max = 100)
private String app;
@@ -87,7 +87,7 @@ public class Monitor {
* Monitored peer host: ipv4, ipv6, domain name
* 监控的对端host:ipv4,ipv6,域名
*/
- @Schema(title = "监控的对端host", example = "192.167.25.11", accessMode =
READ_WRITE)
+ @Schema(title = "The host to monitor", example = "192.167.25.11",
accessMode = READ_WRITE)
@Length(max = 100)
@HostValid
private String host;
@@ -96,7 +96,7 @@ public class Monitor {
* Monitoring collection interval time, in seconds
* 监控的采集间隔时间,单位秒
*/
- @Schema(title = "监控的采集间隔时间,单位秒", example = "600", accessMode = READ_WRITE)
+ @Schema(title = "Monitoring of the acquisition interval time in seconds",
example = "600", accessMode = READ_WRITE)
@Min(10)
private Integer intervals;
@@ -104,7 +104,7 @@ public class Monitor {
* Monitoring status 0: Unmonitored, 1: Available, 2: Unavailable
* 任务状态 0:未监控,1:可用,2:不可用
*/
- @Schema(title = "任务状态 0:未监控,1:可用,2:不可用", accessMode = READ_WRITE)
+ @Schema(title = "Task status 0: not monitored,1: available,2:
unavailable", accessMode = READ_WRITE)
@Min(0)
@Max(4)
private byte status;
@@ -113,7 +113,7 @@ public class Monitor {
* Monitoring note description
* 监控备注描述
*/
- @Schema(title = "监控备注描述", example = "对SAAS网站TanCloud的可用性监控", accessMode =
READ_WRITE)
+ @Schema(title = "Monitor note description", example = "Availability
monitoring of the SAAS website TanCloud", accessMode = READ_WRITE)
@Length(max = 255)
private String description;
@@ -146,12 +146,13 @@ public class Monitor {
private LocalDateTime gmtUpdate;
/**
- * 多对多关联中,需设置第三张关联中间表JoinTable
- * JoinTable name 为关联关系中间表名称
- * joinColumns:中间表的外键字段关联当前实体类所对应表的主键字段
- * inverseJoinColumn:中间表的外键字段关联对方表的主键字段
- * JoinColumn name 中间表的关联字段名称
- * referencedColumnName 关联表的映射字段名称
+ * For a many-to-many join, you need to set up a third join intermediate
table, JoinTable
+ * JoinTable name is the intermediate table name of the association
relationship
+ * joinColumns: The foreign key fields of the intermediate table
relate the primary key fields of the table corresponding
+ * to the current entity class
+ * inverseJoinColumn:The foreign key fields of the intermediate
table relate to the primary key fields of the other table
+ * JoinColumn name The associated field name of the
intermediate table
+ * referencedColumnName The mapping field name of
the association table
*/
@ManyToMany(targetEntity = Tag.class, cascade = CascadeType.MERGE, fetch =
FetchType.EAGER)
@JoinTable(name = "hzb_tag_monitor_bind",
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java
index cf40b2d70..5cb2513cf 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java
@@ -40,7 +40,6 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
/**
* Message notification recipient entity
- * 消息通知接收人实体
*/
@Entity
@Table(name = "hzb_notice_receiver")
@@ -48,17 +47,17 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Message notification recipient entity | 消息通知接收人实体")
+@Schema(description = "Message notification recipient entity")
@EntityListeners(AuditingEntityListener.class)
public class NoticeReceiver {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
- @Schema(title = "Recipient entity primary key index ID", description =
"接收人实体主键索引ID",
+ @Schema(title = "Recipient entity primary key index ID", description =
"Recipient entity primary key index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
- @Schema(title = "Recipient name", description = "接收人名称",
+ @Schema(title = "Recipient name", description = "Recipient name",
example = "tom", accessMode = READ_WRITE)
@Length(max = 100)
@NotNull
@@ -66,135 +65,139 @@ public class NoticeReceiver {
@Schema(title = "Notification information method: 0-SMS 1-Email 2-webhook
3-WeChat Official Account 4-Enterprise WeChat Robot " +
"5-DingTalk Robot 6-FeiShu Robot 7-Telegram Bot 8-SlackWebHook
9-Discord Bot 10-Enterprise WeChat app message",
- description = "通知信息方式: 0-手机短信 1-邮箱 2-webhook 3-微信公众号 4-企业微信机器人
5-钉钉机器人 6-飞书机器人 7-Telegram机器人 8-SlackWebHook 9-Discord机器人 10-企业微信-应用消息",
+ description = "Notification information method: " +
+ "0-SMS 1-Email 2-webhook 3-WeChat Official Account " +
+ "4-Enterprise WeChat Robot 5-DingTalk Robot 6-FeiShu Robot
" +
+ "7-Telegram Bot 8-SlackWebHook 9-Discord Bot 10-Enterprise
" +
+ "WeChat app message",
accessMode = READ_WRITE)
@Min(0)
@NotNull
private Byte type;
@Schema(title = "Mobile number: Valid when the notification method is SMS",
- description = "手机号 : 通知方式为手机短信时有效",
+ description = "Mobile number: Valid when the notification method
is SMS",
example = "18923435643", accessMode = READ_WRITE)
@Length(max = 100)
private String phone;
@Schema(title = "Email account: Valid when the notification method is
email",
- description = "邮箱账号 : 通知方式为邮箱时有效",
+ description = "Email account: Valid when the notification method
is email",
example = "[email protected]", accessMode = READ_WRITE)
@Length(max = 100)
private String email;
@Schema(title = "URL address: The notification method is valid for
webhook",
- description = "URL地址 : 通知方式为webhook有效",
+ description = "URL address: The notification method is valid for
webhook",
example = "https://www.tancloud.cn", accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String hookUrl;
@Schema(title = "openId : The notification method is valid for WeChat
official account, enterprise WeChat robot or FlyBook robot",
- description = "openId : 通知方式为微信公众号,企业微信机器人或飞书机器人有效",
+ description = "openId : The notification method is valid for
WeChat official account, enterprise WeChat robot or FlyBook robot",
example = "343432", accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String wechatId;
@Schema(title = "Access token : The notification method is valid for
DingTalk robot",
- description = "访问token : 通知方式为钉钉机器人有效",
+ description = "Access token : The notification method is valid for
DingTalk robot",
example = "34823984635647", accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String accessToken;
@Schema(title = "Telegram bot token : The notification method is valid for
Telegram Bot",
- description = "Telegram bot token : 通知方式为Telegram机器人有效",
+ description = "Telegram bot token : The notification method is
valid for Telegram Bot",
example = "1499012345:AAEOB_wEYS-DZyPM3h5NzI8voJMXXXXXX",
accessMode = READ_WRITE)
private String tgBotToken;
@Schema(title = "Telegram user id: The notification method is valid for
Telegram Bot",
- description = "Telegram user id : 通知方式为Telegram机器人有效",
+ description = "Telegram user id: The notification method is valid
for Telegram Bot",
example = "779294123", accessMode = READ_WRITE)
private String tgUserId;
@Schema(title = "URL address: The notification method is valid for Slack",
- description = "URL地址 : 通知方式为Slack有效",
+ description = "URL address: The notification method is valid for
Slack",
example = "https://hooks.slack.com/services/XXXX/XXXX/XXXX",
accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String slackWebHookUrl;
@Schema(title = "Enterprise weChat message: The notification method is
valid for Enterprise WeChat app message",
- description = "企业信息 : 通知方式为Enterprise WeChat app message有效",
+ description = "Enterprise weChat message: The notification method
is valid for Enterprise WeChat app message",
example = "ww1a603432123d0dc1", accessMode = READ_WRITE)
private String corpId;
@Schema(title = "Enterprise weChat appId: The notification method is valid
for Enterprise WeChat app message",
- description = "企业微信应用id : 通知方式为Enterprise WeChat app message有效",
+ description = "Enterprise weChat appId: The notification method is
valid for Enterprise WeChat app message",
example = "1000001", accessMode = READ_WRITE)
private Integer agentId;
@Schema(title = "Enterprise weChat secret: The notification method is
valid for Enterprise WeChat app message",
- description = "企业微信应用secret : 通知方式为Enterprise WeChat app
message有效",
+ description = "Enterprise weChat secret: The notification method
is valid for Enterprise WeChat app message",
example = "oUydwn92ey0lnuY02MixNa57eNK-20dJn5NEOG-u2uE",
accessMode = READ_WRITE)
private String appSecret;
@Schema(title = "Discord channel id: The notification method is valid for
Discord",
- description = "Discord 频道id: 通知方式为Discord有效",
+ description = "Discord channel id: The notification method is
valid for Discord",
example = "1065303416030642266", accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String discordChannelId;
@Schema(title = "Discord bot token: The notification method is valid for
Discord",
- description = "Discord 机器人Token: 通知方式为Discord有效",
+ description = "Discord bot token: The notification method is valid
for Discord",
example = "MTA2NTMwMzU0ODY4Mzg4MjUzNw.xxxxx.xxxxxxx", accessMode =
READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String discordBotToken;
@Schema(title = "huawei cloud SMN ak: If the notification method is valid
for huawei cloud SMN",
- description = "华为云SMN ak: 通知方式为华为云SMN有效",
+ description = "huawei cloud SMN ak: If the notification method is
valid for huawei cloud SMN",
example = "NCVBODJOEYHSW3VNXXXX", accessMode = READ_WRITE)
@Length(max = 22)
@Column(length = 22)
private String smnAk;
@Schema(title = "huawei cloud SMN sk: If the notification method is valid
for huawei cloud SMN",
- description = "华为云SMN sk: 通知方式为华为云SMN有效",
+ description = "huawei cloud SMN sk: If the notification method is
valid for huawei cloud SMN",
example = "nmSNhUJN9MlpPl8lfCsgdA0KvHCL9JXXXX", accessMode =
READ_WRITE)
@Length(max = 42)
@Column(length = 42)
private String smnSk;
@Schema(title = "huawei cloud SMN projectId: If the notification method is
valid for huawei cloud SMN",
- description = "华为云SMN projectId: 通知方式为华为云SMN有效",
+ description = "huawei cloud SMN projectId: If the notification
method is valid for huawei cloud SMN",
example = "320c2fb11edb47a481c299c1XXXXXX", accessMode =
READ_WRITE)
@Length(max = 32)
@Column(length = 32)
private String smnProjectId;
@Schema(title = "huawei cloud SMN region: If the notification method is
valid for huawei cloud SMN",
- description = "华为云SMN region: 通知方式为华为云SMN有效",
+ description = "huawei cloud SMN region: If the notification method
is valid for huawei cloud SMN",
example = "cn-east-3", accessMode = READ_WRITE)
@Length(max = 32)
@Column(length = 32)
private String smnRegion;
@Schema(title = "huawei cloud SMN TopicUrn: If the notification method is
valid for huawei cloud SMN",
- description = "华为云SMN TopicUrn: 通知方式为华为云SMN有效",
+ description = "huawei cloud SMN TopicUrn: If the notification
method is valid for huawei cloud SMN",
example = "urn:smn:cn-east-3:xxx:hertzbeat_test", accessMode =
READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String smnTopicUrn;
@Schema(title = "serverChanToken : The notification method is valid for
ServerChan",
- description = "访问token : 通知方式为Server酱有效",
+ description = "serverChanToken : The notification method is valid
for ServerChan",
example = "SCT193569TSNm6xIabdjqeZPtOGOWcvU1e", accessMode =
READ_WRITE)
@Length(max = 300)
@Column(length = 300)
private String serverChanToken;
@Schema(title = "Gotify token : The notification method is valid for
Gotify",
- description = "访问token : 通知方式为Gotify有效",
+ description = "Gotify token : The notification method is valid for
Gotify",
example = "A845h__ZMqDxZlO", accessMode = READ_WRITE)
@Length(max = 300)
@Column(length = 300)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeRule.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeRule.java
index aa7dba9c2..d5b35d174 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeRule.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeRule.java
@@ -47,77 +47,79 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Notify Policy Entity | 通知策略实体")
+@Schema(description = "Notify Policy Entity")
@EntityListeners(AuditingEntityListener.class)
public class NoticeRule {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(title = "Notification Policy Entity Primary Key Index ID",
- description = "通知策略实体主键索引ID",
+ description = "Notification Policy Entity Primary Key Index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "Policy name",
- description = "策略名称",
+ description = "Policy name",
example = "dispatch-1", accessMode = READ_WRITE)
@Length(max = 100)
@NotNull
private String name;
@Schema(title = "Recipient ID",
- description = "接收人ID",
+ description = "Recipient ID",
example = "4324324", accessMode = READ_WRITE)
@NotNull
@Convert(converter = JsonLongListAttributeConverter.class)
private List<Long> receiverId;
@Schema(title = "Recipient identification",
- description = "接收人标识",
+ description = "Recipient identification",
example = "tom", accessMode = READ_WRITE)
@Convert(converter = JsonStringListAttributeConverter.class)
private List<String> receiverName;
@Schema(title = "Template ID",
- description = "模板ID",
+ description = "Template ID",
example = "4324324", accessMode = READ_WRITE)
private Long templateId;
@Schema(title = "Template identification",
- description = "通知模板标识",
+ description = "Template identification",
example = "demo", accessMode = READ_WRITE)
@Length(max = 100)
private String templateName;
@Schema(title = "Whether to enable this policy",
- description = "是否启用此策略",
+ description = "Whether to enable this policy",
example = "true", accessMode = READ_WRITE)
private boolean enable = true;
@Schema(title = "Whether to forward all",
- description = "是否转发所有",
+ description = "Whether to forward all",
example = "false", accessMode = READ_WRITE)
private boolean filterAll = true;
- @Schema(title = "过滤匹配告警级别,空为全部告警级别 0:高-emergency-紧急告警-红色
1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色",
+ @Schema(title = "Filter the matching alarm level, empty is all alarm level
" +
+ "0: high -emergency- Urgent alarm - red 1: Medium -critical-
Serious alarm - orange 2: Low -warning- Warning alarm - yellow",
example = "[1]", accessMode = READ_WRITE)
@Convert(converter = JsonByteListAttributeConverter.class)
private List<Byte> priorities;
- @Schema(description = "告警信息标签(monitorId:xxx,monitorName:xxx)", example =
"{name: key1, value: value1}",
+ @Schema(description = "Alarm information
label(monitorId:xxx,monitorName:xxx)", example = "{name: key1, value: value1}",
accessMode = READ_WRITE)
@Convert(converter = JsonTagListAttributeConverter.class)
@Column(length = 2048)
private List<TagItem> tags;
- @Schema(title = "星期几,多选,全选或空则为每天 7:周日 1:周一 2:周二 3:周三 4:周四 5:周五 6:周六",
example = "[0,1]", accessMode = READ_WRITE)
+ @Schema(title = "Day of the week, multiple, all or empty is daily 7:
Sunday 1: Monday 2: Tuesday 3: Wednesday 4: Thursday 5: Friday 6: Saturday",
+ example = "[0,1]", accessMode = READ_WRITE)
@Convert(converter = JsonByteListAttributeConverter.class)
private List<Byte> days;
- @Schema(title = "限制时间段起始", example = "00:00:00", accessMode = READ_WRITE)
+ @Schema(title = "Limit time period start", example = "00:00:00",
accessMode = READ_WRITE)
private ZonedDateTime periodStart;
- @Schema(title = "限制时间段截止", example = "23:59:59", accessMode = READ_WRITE)
+ @Schema(title = "Restricted time period end", example = "23:59:59",
accessMode = READ_WRITE)
private ZonedDateTime periodEnd;
@Schema(title = "The creator of this record", example = "tom", accessMode
= READ_ONLY)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeTemplate.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeTemplate.java
index 3f38727b2..1b3fcb2b3 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeTemplate.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeTemplate.java
@@ -48,19 +48,19 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Notify Policy Template | 通知模板实体")
+@Schema(description = "Notify Policy Template")
@EntityListeners(AuditingEntityListener.class)
public class NoticeTemplate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(title = "Notification Template Entity Primary Key Index ID",
- description = "通知模板实体主键索引ID",
+ description = "Notification Template Entity Primary Key Index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "Template name",
- description = "模板名称",
+ description = "Template name",
example = "dispatch-1", accessMode = READ_WRITE)
@Length(max = 100)
@NotBlank
@@ -68,20 +68,23 @@ public class NoticeTemplate {
@Schema(title = "Notification information method: 0-SMS 1-Email 2-webhook
3-WeChat Official Account 4-Enterprise WeChat Robot " +
"5-DingTalk Robot 6-FeiShu Robot 7-Telegram Bot 8-SlackWebHook
9-Discord Bot 10-Enterprise WeChat app message",
- description = "通知信息方式: 0-手机短信 1-邮箱 2-webhook 3-微信公众号 4-企业微信机器人
5-钉钉机器人 6-飞书机器人 7-Telegram机器人 8-SlackWebHook 9-Discord机器人 10-企业微信-应用消息",
+ description = "Notification information method: " +
+ "0-SMS 1-Email 2-webhook 3-WeChat Official Account " +
+ "4-Enterprise WeChat Robot 5-DingTalk Robot 6-FeiShu Robot
" +
+ "7-Telegram Bot 8-SlackWebHook 9-Discord Bot 10-Enterprise
WeChat app message",
accessMode = READ_WRITE)
@Min(0)
@NotNull
private Byte type;
@Schema(title = "Is it a preset template: true- preset template false-
custom template.",
- description = "是否为预设模板: true-预设模板 false-自定义模板",
+ description = "Is it a preset template: true- preset template
false- custom template.",
accessMode = READ_WRITE)
@Column(columnDefinition = "boolean default false")
private boolean preset = false;
@Schema(title = "Template content",
- description = "模板内容",
+ description = "Template content",
example = "[${title}]\n" +
"${targetLabel} : ${target}\n" +
"<#if (monitorId??)>${monitorIdLabel} : ${monitorId}
</#if>\n" +
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Param.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Param.java
index 5f6853dae..1b4e46cc0 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Param.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Param.java
@@ -38,7 +38,6 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
/**
* Monitor parameter values
- * 监控参数值
*/
@Entity
@Table(name = "hzb_param", indexes = { @Index(columnList = "monitorId") },
@@ -47,7 +46,7 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Parameter Entity | 参数实体")
+@Schema(description = "Parameter Entity")
@EntityListeners(AuditingEntityListener.class)
public class Param {
@@ -56,39 +55,36 @@ public class Param {
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
- @Schema(title = "参数主键索引ID", example = "87584674384", accessMode =
READ_ONLY)
+ @Schema(title = "Parameter primary key index ID", example = "87584674384",
accessMode = READ_ONLY)
private Long id;
/**
* Monitor ID
- * 监控任务ID
*/
- @Schema(title = "监控任务ID", example = "875846754543", accessMode =
READ_WRITE)
+ @Schema(title = "Monitor task ID", example = "875846754543", accessMode =
READ_WRITE)
private Long monitorId;
/**
* Parameter Field Identifier
- * 参数字段标识符
*/
- @Schema(title = "参数标识符字段", example = "port", accessMode = READ_WRITE)
+ @Schema(title = "Parameter identifier field", example = "port", accessMode
= READ_WRITE)
@Length(max = 100)
@NotNull
private String field;
/**
* Param Value
- * 参数值
*/
- @Schema(title = "参数值", example = "8080", accessMode = READ_WRITE)
+ @Schema(title = "parameter values", example = "8080", accessMode =
READ_WRITE)
@Length(max = 8126)
@Column(name = "`value`", length = 8126)
private String value;
/**
* Parameter type 0: number 1: string 2: encrypted string 3: json string
mapped by map
- * 参数类型 0:数字 1:字符串 2:加密串 3:map映射的json串
*/
- @Schema(title = "参数类型 0:数字 1:字符串 2:加密串 3:map映射的json串 4:arrays string",
accessMode = READ_WRITE)
+ @Schema(title = "Parameter types 0: number 1: string 2: encrypted string
3:map mapped json string 4:arrays string",
+ accessMode = READ_WRITE)
@Min(0)
private byte type;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/ParamDefine.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/ParamDefine.java
index 6bfe4ad5a..8a3772885 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/ParamDefine.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/ParamDefine.java
@@ -39,7 +39,6 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
/**
* Monitoring parameter definitions
- * 监控参数定义
*/
@Entity
@Table(name = "hzb_param_define")
@@ -47,7 +46,7 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Parameter structure definition entity | 参数结构定义实体")
+@Schema(description = "Parameter structure definition entity")
@EntityListeners(AuditingEntityListener.class)
public class ParamDefine {
@@ -56,23 +55,21 @@ public class ParamDefine {
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
- @Schema(title = "参数结构ID", example = "87584674384", accessMode = READ_ONLY)
+ @Schema(title = "Parameter structure ID", example = "87584674384",
accessMode = READ_ONLY)
private Long id;
/**
* Monitoring application type name
- * 监控应用类型名称
*/
- @Schema(title = "监控类型", example = "TanCloud", accessMode = READ_WRITE)
+ @Schema(title = "Type of monitoring", example = "TanCloud", accessMode =
READ_WRITE)
private String app;
/**
* Parameter field external display name
- * zh-CN: 端口
- * en-US: Port
- * 参数字段对外显示名称
+ * Port
*/
- @Schema(description = "参数字段显示国际化名称", example = "{zh-CN: '端口'}", accessMode
= READ_WRITE)
+ @Schema(description = "The parameter field displays the internationalized
name", example = "{zh-CN: '端口'}",
+ accessMode = READ_WRITE)
@Convert(converter = JsonMapAttributeConverter.class)
@SuppressWarnings("JpaAttributeTypeInspection")
@Column(length = 2048)
@@ -80,89 +77,80 @@ public class ParamDefine {
/**
* Parameter Field Identifier
- * 参数字段标识符
*/
- @Schema(title = "参数字段标识符", example = "port", accessMode = READ_WRITE)
+ @Schema(title = "Parameter field identifier", example = "port", accessMode
= READ_WRITE)
private String field;
/**
* Field type, style (mostly map the input tag type attribute)
- * 字段类型,样式(大部分映射input标签type属性)
*/
- @Schema(title = "字段类型,样式(大部分映射input标签type属性)", example = "number",
accessMode = READ_WRITE)
+ @Schema(title = "Field type, style (mostly map the input tag type
attribute)", example = "number", accessMode = READ_WRITE)
private String type;
/**
* Is it mandatory true-required false-optional
- * 是否是必输项 true-必填 false-可选
*/
- @Schema(title = "是否是必输项 true-必填 false-可选", example = "true", accessMode =
READ_WRITE)
+ @Schema(title = "Is it mandatory true-required false-optional", example =
"true", accessMode = READ_WRITE)
private boolean required = false;
/**
* Parameter Default Value
- * 参数默认值
*/
- @Schema(title = "参数默认值", example = "12", accessMode = READ_WRITE)
+ @Schema(title = "Parameter default values", example = "12", accessMode =
READ_WRITE)
private String defaultValue;
/**
* Parameter input box prompt information
- * 参数输入框提示信息
*/
- @Schema(title = "参数输入框提示信息", example = "请输入密码", accessMode = READ_WRITE)
+ @Schema(title = "Parameter input field prompt information", example =
"enter your password", accessMode = READ_WRITE)
private String placeholder;
/**
* When type is number, use range to represent the range eg: 0-233
- * 当type为number时,用range表示范围 eg: 0-233
*/
- @Schema(title = "当type为number时,用range区间表示范围", example = "[0,233]",
accessMode = READ_WRITE)
+ @Schema(title = "When type is number, the range is represented by the
range interval", example = "[0,233]", accessMode = READ_WRITE)
@Column(name = "param_range")
private String range;
/**
* When type is text, use limit to indicate the limit size of the string.
The maximum is 255
- * 当type为text时,用limit表示字符串限制大小.最大255
*/
- @Schema(title = "当type为text时,用limit表示字符串限制大小.最大255", example = "30",
accessMode = READ_WRITE)
+ @Schema(title = "When type is text, use limit to indicate the limit size
of the string. The maximum is 255",
+ example = "30", accessMode = READ_WRITE)
@Column(name = "param_limit")
private Short limit;
/**
* When the type is radio radio box, checkbox checkbox, options represents
a list of optional values
- * 当type为radio单选框,checkbox复选框时,options表示可选项值列表
* eg: {
* "key1":"value1",
* "key2":"value2"
* }
- * key-值显示标签
- * value-真正值
+ * key-Value display label
+ * value-True value
*/
- @Schema(description = "当type为radio单选框,checkbox复选框时,option表示可选项值列表",
example = "{key1,value1}", accessMode = READ_WRITE)
+ @Schema(description = "When the type is radio radio box, checkbox
checkbox, options represents a list of optional values",
+ example = "{key1,value1}", accessMode = READ_WRITE)
@Column(name = "param_options", length = 2048)
@Convert(converter = JsonOptionListAttributeConverter.class)
private List<Option> options;
/**
* Valid when type is key-value, indicating the alias description of the
key
- * 当type为key-value时有效,表示key的别名描述
*/
- @Schema(title = "当type为key-value时有效,表示key的别名描述", example = "Name",
accessMode = READ_WRITE)
+ @Schema(title = "Valid when type is key-value, indicating the alias
description of the key", example = "Name", accessMode = READ_WRITE)
private String keyAlias;
/**
* Valid when type is key-value, indicating the alias description of value
type
- * 当type为key-value时有效,表示value的别名描述
*/
- @Schema(title = "当type为key-value时有效,表示value的别名描述", example = "Value",
accessMode = READ_WRITE)
+ @Schema(title = "Valid when type is key-value, indicating the alias
description of value type", example = "Value", accessMode = READ_WRITE)
private String valueAlias;
/**
* Is it an advanced hidden parameter true-yes false-no
- * 是否是高级隐藏参数 true-是 false-否
*/
- @Schema(title = "是否是高级隐藏参数 true-是 false-否", example = "true", accessMode =
READ_WRITE)
+ @Schema(title = "Is it an advanced hidden parameter true-yes false-no",
example = "true", accessMode = READ_WRITE)
private boolean hide = false;
/**
@@ -202,12 +190,10 @@ public class ParamDefine {
public static final class Option {
/**
* value display label
- * 值显示标签
*/
private String label;
/**
* optional value
- * 可选值
*/
private String value;
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/StatusPageOrg.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/StatusPageOrg.java
index 8b998c847..8f8b09e7d 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/StatusPageOrg.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/StatusPageOrg.java
@@ -73,7 +73,8 @@ public class StatusPageOrg {
@Schema(title = "org theme background color", example = "#ffffff")
private String color;
- @Schema(title = "org current state: 0-All Systems Operational 1-Some
Systems Abnormal 2-All Systems Abnormal ", example = "0")
+ @Schema(title = "org current state: 0-All Systems Operational 1-Some
Systems Abnormal 2-All Systems Abnormal ",
+ example = "0")
private byte state;
@Schema(title = "The creator of this record", example = "tom")
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Tag.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Tag.java
index 465ce4916..19c5fee5d 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Tag.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Tag.java
@@ -46,30 +46,31 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Tag Entity | 标签实体")
+@Schema(description = "Tag Entity")
@EntityListeners(AuditingEntityListener.class)
public class Tag {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
- @Schema(title = "Tag主键索引ID", example = "87584674384", accessMode =
READ_ONLY)
+ @Schema(title = "Tag Primary key index ID", example = "87584674384",
accessMode = READ_ONLY)
private Long id;
- @Schema(title = "Tag Field | 标签名称", example = "app", accessMode =
READ_WRITE)
+ @Schema(title = "Tag Field", example = "app", accessMode = READ_WRITE)
@NotNull
private String name;
- @Schema(title = "Tag Value | 标签值", example = "23", accessMode = READ_WRITE)
+ @Schema(title = "Tag Value", example = "23", accessMode = READ_WRITE)
@Column(name = "`value`", length = 2048)
private String value;
- @Schema(title = "Tag Color | 标签颜色", example = "#ffff", accessMode =
READ_WRITE)
+ @Schema(title = "Tag Color", example = "#ffff", accessMode = READ_WRITE)
private String color;
- @Schema(title = "Tag Color | 标签描述", example = "用于监控mysql", accessMode =
READ_WRITE)
+ @Schema(title = "Tag Color", example = "Used for monitoring mysql",
accessMode = READ_WRITE)
private String description;
- @Schema(title = "标记类型 0:监控自动生成(monitorId,monitorName) 1: 用户生成 2: 系统预置",
accessMode = READ_WRITE)
+ @Schema(title = "Tag type 0: Auto-generated monitor
(monitorId,monitorName) 1: user-generated 2: system preset",
+ accessMode = READ_WRITE)
@Min(0)
@Max(3)
private byte type;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/TagMonitorBind.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/TagMonitorBind.java
index 21ff9474b..f2cc1a7a2 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/TagMonitorBind.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/TagMonitorBind.java
@@ -44,20 +44,20 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Tag Bind Monitor | 标签与监控关联实体")
+@Schema(description = "Tag Bind Monitor")
@EntityListeners(AuditingEntityListener.class)
public class TagMonitorBind {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
- @Schema(title = "主键索引ID", example = "87584674384", accessMode = READ_ONLY)
+ @Schema(title = "The primary key index ID", example = "87584674384",
accessMode = READ_ONLY)
private Long id;
@Schema(title = "TAG ID", example = "87432674384", accessMode = READ_WRITE)
@Column(name = "tag_id")
private Long tagId;
- @Schema(title = "监控任务ID", example = "87432674336", accessMode = READ_WRITE)
+ @Schema(title = "Monitor task ID", example = "87432674336", accessMode =
READ_WRITE)
@Column(name = "monitor_id")
private Long monitorId;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/message/ClusterMsg.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/message/ClusterMsg.java
index 1221836b2..cdb047ad1 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/message/ClusterMsg.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/message/ClusterMsg.java
@@ -1644,8 +1644,8 @@ public final class ClusterMsg {
});
internal_static_org_dromara_hertzbeat_common_entity_message_Message_descriptor =
getDescriptor().getMessageTypes().get(0);
-
internal_static_org_dromara_hertzbeat_common_entity_message_Message_fieldAccessorTable
= new
-
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+
internal_static_org_dromara_hertzbeat_common_entity_message_Message_fieldAccessorTable
=
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_org_dromara_hertzbeat_common_entity_message_Message_descriptor,
new String[]{"Identity", "Direction", "Type", "Msg",});
}
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/entity/warehouse/History.java
b/common/src/main/java/org/apache/hertzbeat/common/entity/warehouse/History.java
index d9fdf2cdc..5bbb0b5c8 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/entity/warehouse/History.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/entity/warehouse/History.java
@@ -43,13 +43,13 @@ import static
io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@Builder
@AllArgsConstructor
@NoArgsConstructor
-@Schema(description = "Metrics History Data Entity | 指标数据历史实体")
+@Schema(description = "Metrics History Data Entity")
public class History {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "myid")
@GenericGenerator(name = "myid", strategy =
"org.apache.hertzbeat.common.util.SnowFlakeIdGenerator")
- @Schema(description = "指标数据历史实体主键索引ID", example = "87584674384",
accessMode = READ_ONLY)
+ @Schema(description = "Metric data history entity primary key index ID",
example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "Monitoring Id", example = "87432674336", accessMode =
READ_WRITE)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/queue/impl/KafkaCommonDataQueue.java
b/common/src/main/java/org/apache/hertzbeat/common/queue/impl/KafkaCommonDataQueue.java
index 9d38f9520..8eba3f338 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/queue/impl/KafkaCommonDataQueue.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/queue/impl/KafkaCommonDataQueue.java
@@ -111,12 +111,14 @@ public class KafkaCommonDataQueue implements
CommonDataQueue, DisposableBean {
Map<String, Object> metricsToPersistentConsumerConfig = new
HashMap<>(consumerConfig);
metricsToPersistentConsumerConfig.put("group.id",
"metrics-persistent-consumer");
- metricsDataToPersistentStorageConsumer = new
KafkaConsumer<>(metricsToPersistentConsumerConfig, new LongDeserializer(), new
KafkaMetricsDataDeserializer());
+ metricsDataToPersistentStorageConsumer = new
KafkaConsumer<>(metricsToPersistentConsumerConfig, new LongDeserializer(),
+ new KafkaMetricsDataDeserializer());
metricsDataToPersistentStorageConsumer.subscribe(Collections.singletonList(kafka.getMetricsDataTopic()));
Map<String, Object> metricsToRealTimeConsumerConfig = new
HashMap<>(consumerConfig);
metricsToRealTimeConsumerConfig.put("group.id",
"metrics-memory-consumer");
- metricsDataToRealTimeStorageConsumer = new
KafkaConsumer<>(metricsToRealTimeConsumerConfig, new LongDeserializer(), new
KafkaMetricsDataDeserializer());
+ metricsDataToRealTimeStorageConsumer = new
KafkaConsumer<>(metricsToRealTimeConsumerConfig, new LongDeserializer(),
+ new KafkaMetricsDataDeserializer());
metricsDataToRealTimeStorageConsumer.subscribe(Collections.singletonList(kafka.getMetricsDataTopic()));
} catch (Exception e) {
log.error("please config common.queue.kafka props correctly", e);
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/service/TencentSmsClient.java
b/common/src/main/java/org/apache/hertzbeat/common/service/TencentSmsClient.java
index 7a5628185..5f95f1266 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/service/TencentSmsClient.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/service/TencentSmsClient.java
@@ -61,7 +61,7 @@ public class TencentSmsClient {
}
/**
- * 发送短信
+ * send text message
* @param appId appId
* @param signName sign name
* @param templateId template id
@@ -89,7 +89,7 @@ public class TencentSmsClient {
}
/**
- * 发送短信
+ * send text message
* @param templateValues template values
* @param phones phones num
*/
diff --git a/common/src/main/java/org/apache/hertzbeat/common/util/AesUtil.java
b/common/src/main/java/org/apache/hertzbeat/common/util/AesUtil.java
index 5d87af68d..e23f3b674 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/util/AesUtil.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/util/AesUtil.java
@@ -35,7 +35,8 @@ import java.util.Base64;
public class AesUtil {
/**
- * Default encryption key The AES encryption key is 16 bits by default.
If the AES encryption key is larger than or smaller than 16 bits, an error
message is displayed
+ * Default encryption key The AES encryption key is 16 bits by default.
+ * If the AES encryption key is larger than or smaller than 16 bits, an
error message is displayed
*/
private static final String ENCODE_RULES = "tomSun28HaHaHaHa";
@@ -47,7 +48,8 @@ public class AesUtil {
private static final String AES = "AES";
/**
- * Encryption key The AES encryption key is 16 bits. If the AES encryption
key is larger than 16 bits, an error message is displayed
+ * Encryption key The AES encryption key is 16 bits.
+ * If the AES encryption key is larger than 16 bits, an error message is
displayed
*/
private static String secretKey = ENCODE_RULES;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/CommonUtil.java
b/common/src/main/java/org/apache/hertzbeat/common/util/CommonUtil.java
index afa1a0aff..6683d1a6d 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/util/CommonUtil.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/util/CommonUtil.java
@@ -44,7 +44,7 @@ public class CommonUtil {
* Converts the string str to the int numeric type
*
* @param str string
- * @return double 数字
+ * @return double number
*/
public static Integer parseStrInteger(final String str) {
if (StringUtils.isBlank(str)) {
@@ -63,7 +63,7 @@ public class CommonUtil {
* Converts the string str to the double number type
*
* @param str string
- * @return double 数字
+ * @return double number
*/
public static Double parseStrDouble(final String str) {
if (StringUtils.isBlank(str)) {
@@ -82,7 +82,7 @@ public class CommonUtil {
* Converts the time string str to seconds
*
* @param str string
- * @return double 数字
+ * @return double number
*/
public static int parseTimeStrToSecond(final String str) {
if (StringUtils.isEmpty(str)) {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java
b/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java
index be0c9b6d3..82a7bcadb 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java
@@ -21,7 +21,6 @@ import lombok.extern.slf4j.Slf4j;
/**
* expression calculate for number range
- * 数值区间表达式计算
* [a,b] = {a <= x <= b}
* [a,b) = {a <= x < b}
* [a,+∞) = {a <= x}
@@ -44,7 +43,7 @@ public class IntervalExpressionUtil {
* CHECK WHETHER THE VALUE IS IN AN INTERVAL RANGE
* @param numberValue NumericalValue
* @param expression INTERVAL EXPRESSION
- * @return true-是 false-否
+ * @return true-yes false-no
*/
public static boolean validNumberIntervalExpress(Double numberValue,
String expression) {
if (expression == null || "".equals(expression)) {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/LruHashMap.java
b/common/src/main/java/org/apache/hertzbeat/common/util/LruHashMap.java
index 44a71e21b..5232ee652 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/util/LruHashMap.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/util/LruHashMap.java
@@ -22,7 +22,7 @@ import java.util.Map;
/**
* lru hash map
- * 最近最少使用淘汰算法map
+ * The least recently used elimination algorithm map
*/
public class LruHashMap<K, V> extends LinkedHashMap<K, V> {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/SnowFlakeIdWorker.java
b/common/src/main/java/org/apache/hertzbeat/common/util/SnowFlakeIdWorker.java
index 08db6c7e4..55fcf7ca0 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/util/SnowFlakeIdWorker.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/util/SnowFlakeIdWorker.java
@@ -23,81 +23,68 @@ import java.util.Random;
/**
* SnowFlakeId Instance
- * 注意 由于前端JS TS 在json解析大数会造成精度丢失 UUID 不能超过 9007199254740991(10进制)16进制为
0x1FFFFFFFFFFFFF (小于53bit)
- * 1位符号位+41位时间戳+4位机器ID+8位序列号 = 53位
- * Note that because the front-end JS TS parses large numbers in json, the
precision will be lost.
- * UUID cannot exceed hexadecimal 0x1FFFFFFFFFFFFFF (less than 53bit)
+ * Note that due to the front-end JS TS in json parsing large numbers will
cause loss of precision
+ * UUID cannot exceed 9007199254740991 (10) Hexadecimal 0x1FFFFFFFFFFFFFFFFF
(less than 53bit)
+ * 1 bit symbol +41 bit timestamp +4 bit machine ID+8 bit sequence number = 53
bits
*/
@Slf4j
public class SnowFlakeIdWorker {
/**
* Start timestamp, in milliseconds; This is 2021-06-01
- * 开始时间戳,单位毫秒;这里是2021-06-01
*/
private static final long TW_EPOCH = 1622476800000L;
/**
* The number of bits occupied by the machine ID
- * 机器 ID 所占的位数
*/
private static final long WORKER_ID_BITS = 4L;
/**
* Maximum machine ID supported, 0-15
- * 支持的最大机器ID,0-15
* <p>
* The source code of PS.Twitter is -1L ^ (-1L << workerIdBits); Here the
final xor operation with -1,
* because of the particularity of -1's binary complement, it is
equivalent to taking the inverse.
- * PS. Twitter的源码是 -1L ^ (-1L <<
workerIdBits);这里最后和-1进行异或运算,由于-1的二进制补码的特殊性,就相当于进行取反。
*/
private static final long MAX_WORKER_ID = ~(-1L << WORKER_ID_BITS);
/**
* The number of bits the sequence occupies in the ID
- * 序列在 ID 中占的位数
*/
private static final long SEQUENCE_BITS = 8L;
/**
* Number of machine ID shifts left
- * 机器 ID 向左移位数
*/
private static final long WORKER_ID_SHIFT = SEQUENCE_BITS;
/**
* Time truncated left shift number
- * 时间截向左移位数
*/
private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS +
WORKER_ID_BITS;
/**
* The maximum mask of the generated sequence, 256
- * 生成序列的掩码最大值,256
*/
private static final long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
/**
* Working machine ID(0~15)
- * 工作机器 ID(0~15)
*/
private final long workerId;
/**
* Millisecond sequence (0~256)
- * 毫秒内序列(0~256)
*/
private long sequence = 0L;
/**
* Timestamp of the last ID generated
- * 上次生成 ID 的时间戳
*/
private long lastTimestamp = -1L;
/**
* How to create an ID generator: Use the serial number range of the
working machine [0, 15]
- * 创建 ID 生成器的方式: 使用工作机器的序号 范围是 [0, 15]
*
* @param workerId Working machine ID
*/
@@ -112,7 +99,6 @@ public class SnowFlakeIdWorker {
/**
* How to create an ID generator: Create the generator using the local IP
as the machine ID
- * 创建 ID 生成器的方式: 使用本地IP作为机器ID创建生成器
*/
public SnowFlakeIdWorker() {
int workerId = 0;
@@ -135,21 +121,21 @@ public class SnowFlakeIdWorker {
public synchronized long nextId() {
long timestamp = timeGen();
if (lastTimestamp == timestamp) {
- // 同一时间生成的,则序号+1
+ // Generated at the same time, then the sequence number +1
sequence = (sequence + 1) & SEQUENCE_MASK;
- // 毫秒内序列溢出:超过最大值
+ // Sequence overflow in milliseconds: The maximum value is exceeded
if (sequence == 0) {
- // 阻塞到下一个毫秒,获得新的时间戳
+ // Block to the next millisecond to get a new timestamp
timestamp = tilNextMillis(lastTimestamp);
}
} else {
- // 时间戳改变,毫秒内序列重置
+ // The timestamp changes and the sequence resets in milliseconds
sequence = 0L;
}
- // 上次生成 ID 的时间戳
+ // Timestamp of the last ID generated
lastTimestamp = timestamp;
- // 移位并通过或运算拼到一起
+ // Shift it and put it together with the OR operation
return ((timestamp - TW_EPOCH) << TIMESTAMP_LEFT_SHIFT)
| (workerId << WORKER_ID_SHIFT)
| sequence;
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/StrBuffer.java
b/common/src/main/java/org/apache/hertzbeat/common/util/StrBuffer.java
index ae8d9415b..21d06bfd1 100644
--- a/common/src/main/java/org/apache/hertzbeat/common/util/StrBuffer.java
+++ b/common/src/main/java/org/apache/hertzbeat/common/util/StrBuffer.java
@@ -18,8 +18,8 @@
package org.apache.hertzbeat.common.util;
/**
- * In order to avoid generating too many String objects in the way of
subString during ExporterParser parsing, use this class control
- * 为了避免ExporterParser解析过程中, 使用subString的方式生成过多的String对象, 使用该类控制
+ * In order to avoid generating too many String objects in the way of
subString during ExporterParser parsing,
+ * use this class control
*/
public class StrBuffer {
private static final String POSITIVE_INF = "+inf";
@@ -38,9 +38,9 @@ public class StrBuffer {
}
/**
- * 读取当前字符, left++
+ * Reading the current character, left++
*
- * @return 当前下标字符
+ * @return Current subscript character
*/
public char read() {
if (left > right) {
@@ -50,7 +50,7 @@ public class StrBuffer {
}
/**
- * 回滚一个字符
+ * Rollback one character
*/
public void rollback() {
if (left > 0) {
@@ -59,10 +59,10 @@ public class StrBuffer {
}
/**
- * 只查询left+i的下标字符, 不会进行left++的操作
+ * Only the index character of left+i is queried; there is no left++
operation
*
- * @param i 下标
- * @return left+i下标对应的字符
+ * @param i index
+ * @return left+iThe character corresponding to the index
*/
public char charAt(int i) {
if (left + i > right) {
@@ -72,9 +72,9 @@ public class StrBuffer {
}
/**
- * 转string对象
+ * Converting a string object
*
- * @return char数组对应的字符串
+ * @return charA string corresponding to an array
*/
public String toStr() {
StringBuilder builder = new StringBuilder();
@@ -85,9 +85,9 @@ public class StrBuffer {
}
/**
- * 转double
+ * transition double
*
- * @return char数组对应的浮点数
+ * @return char double integer corresponding to the array
*/
public double toDouble() {
String s = toStr();
@@ -95,9 +95,9 @@ public class StrBuffer {
}
/**
- * 转long
+ * transition long
*
- * @return char数组对应的长整数
+ * @return char the long integer corresponding to the array
*/
public long toLong() {
String s = toStr();
@@ -130,10 +130,10 @@ public class StrBuffer {
}
/**
- * string -> long, 需要判断是否为INF
+ * string -> long, We need to determine if it's INF
*
- * @param s 字符串
- * @return 长整数
+ * @param s string
+ * @return long
*/
public static long parseLong(String s) {
if (POSITIVE_INF.equalsIgnoreCase(s)) {
@@ -146,10 +146,10 @@ public class StrBuffer {
}
/**
- * string -> double, 需要判断是否为INF
+ * string -> double, We need to determine if it's INF
*
- * @param s 字符串
- * @return 浮点数
+ * @param s string
+ * @return double
*/
public static double parseDouble(String s) {
if (POSITIVE_INF.equalsIgnoreCase(s)) {
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/prometheus/PrometheusUtil.java
b/common/src/main/java/org/apache/hertzbeat/common/util/prometheus/PrometheusUtil.java
index 7b6b79b58..11f9eca08 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/util/prometheus/PrometheusUtil.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/util/prometheus/PrometheusUtil.java
@@ -30,9 +30,12 @@ import java.util.List;
*/
public class PrometheusUtil {
- private static final int ERROR_FORMAT = -1;
//解析过程中出现了未知格式数据,因为无法继续解析或已经到达输入流的末尾
+ //An unknown format occurred during parsing because parsing cannot continue
+ // or the end of the input stream has been reached
+ private static final int ERROR_FORMAT = -1;
- private static final int NORMAL_END = -2; //输入流正常结束
+ //The input stream ends normally
+ private static final int NORMAL_END = -2;
private static final int COMMENT_LINE = -3;
diff --git
a/common/src/test/java/org/apache/hertzbeat/common/util/SnowFlakeIdGeneratorTest.java
b/common/src/test/java/org/apache/hertzbeat/common/util/SnowFlakeIdGeneratorTest.java
index 24a9b694e..105c288e4 100644
---
a/common/src/test/java/org/apache/hertzbeat/common/util/SnowFlakeIdGeneratorTest.java
+++
b/common/src/test/java/org/apache/hertzbeat/common/util/SnowFlakeIdGeneratorTest.java
@@ -27,8 +27,8 @@ class SnowFlakeIdGeneratorTest {
@Test
void generateId() {
- // 注意 由于前端JS TS 在json解析大数会造成精度丢失 UUID 不能超过 16进制 0x1FFFFFFFFFFFFF
(小于53bit)
- // Note that because the front-end JS TS parses large numbers in json,
the precision will be lost. UUID cannot exceed hexadecimal 0x1FFFFFFFFFFFFFF
(less than 53bit)
+ // Note that because the front-end JS TS parses large numbers in json,
+ // the precision will be lost. UUID cannot exceed hexadecimal
0x1FFFFFFFFFFFFFF (less than 53bit)
for (int i = 0; i < 10000; i++) {
long id = SnowFlakeIdGenerator.generateId();
Assertions.assertTrue(id < 0x1FFFFFFFFFFFFFL);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]