Skip to content

Commit

Permalink
[doc] remove and translate chinese to english in warehous (#1773)
Browse files Browse the repository at this point in the history
Co-authored-by: Logic <zqr10159@dromara.org>
  • Loading branch information
xuziyang and zqr10159 authored Apr 18, 2024
1 parent 7ca110e commit 79017f3
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 77 deletions.
2 changes: 1 addition & 1 deletion warehouse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<artifactId>iotdb-session</artifactId>
<version>${iotdb-session.version}</version>
</dependency>
<!-- influxdb 这里支持1.7版本因此使用influxdb-java, 完全支持2.x版本需要使用influxdb-client-java -->
<!-- Influxdb supports version 1.7 so use influxdb-java, full support for 2.0. The X version requires influxdb-client-java -->
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.concurrent.TimeUnit;

/**
* warehouse 工作线程池
* warehouse worker thread pool
*/
@Component
Expand All @@ -42,7 +41,7 @@ public WarehouseWorkerPool() {
}

private void initWorkExecutor() {
// 线程工厂
// Thread factory
ThreadFactory threadFactory = new ThreadFactoryBuilder()
.setUncaughtExceptionHandler((thread, throwable) -> {
log.error("workerExecutor has uncaughtException.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@
import java.util.List;

/**
* 数据仓储配置属性
* Data warehousing configuration properties
* Data warehouse configuration properties
*/
@ConfigurationProperties(prefix = "warehouse")
public class WarehouseProperties {

/**
* 数据入口配置属性 Data entry configuration properties
* Data entry configuration properties
*/
private EntranceProperties entrance;

/**
* 数据存储配置属性
* Datastore configuration properties
*/
private StoreProperties store;
Expand All @@ -57,15 +55,12 @@ public void setStore(StoreProperties store) {
}

/**
* 数据入口配置属性
* 入口可以是从kafka rabbitmq rocketmq等消息中间件获取数据
* Data entry configuration properties
* The entrance can be to obtain data from message middleware such as kafka rabbitmq rocketmq
*/
public static class EntranceProperties {

/**
* kafka配置信息
* kafka configuration information
*/
private KafkaProperties kafka;
Expand All @@ -79,28 +74,23 @@ public void setKafka(KafkaProperties kafka) {
}

/**
* kafka配置信息
* kafka configuration information
*/
public static class KafkaProperties {
/**
* kafka数据入口是否启动
* Whether kafka data entry is started
*/
private boolean enabled = true;

/**
* kafka的连接服务器url
* kafka connection server url
*/
private String servers = "127.0.0.1:9092";
/**
* 接收数据的topic名称
* Topic name to receive data
*/
private String topic;
/**
* 消费者组ID
* Consumer group ID
*/
private String groupId;
Expand Down Expand Up @@ -141,7 +131,6 @@ public void setGroupId(String groupId) {
}

/**
* 调度数据出口配置属性
* Scheduling data export configuration properties
*/
public static class StoreProperties {
Expand All @@ -152,18 +141,15 @@ public static class StoreProperties {
private JpaProperties jpa;

/**
* 内存存储配置信息
* Memory storage configuration information
*/
private MemoryProperties memory;

/**
* influxdb配置信息
* influxdb configuration information
*/
private InfluxdbProperties influxdb;
/**
* redis配置信息
* redis configuration information
*/
private RedisProperties redis;
Expand All @@ -172,12 +158,10 @@ public static class StoreProperties {
*/
private VictoriaMetricsProperties victoriaMetrics;
/**
* TdEngine配置信息
* TdEngine configuration information
*/
private TdEngineProperties tdEngine;
/**
* IoTDB配置信息
* IoTDB configuration information
*/
private IotDbProperties iotDb;
Expand Down Expand Up @@ -251,17 +235,14 @@ public void setGreptime(GreptimeProperties greptime) {
}

/**
* 内存存储配置信息
* Memory storage configuration information
*/
public static class MemoryProperties {
/**
* 内存数据存储是否启动
* Whether memory data storage is enabled
*/
private boolean enabled = true;
/**
* 内存存储map初始化大小
* Memory storage map initialization size
*/
private Integer initSize = 1024;
Expand All @@ -284,7 +265,6 @@ public void setInitSize(Integer initSize) {
}

/**
* JPA配置信息
* JPA configuration information
*/
public static class JpaProperties {
Expand Down Expand Up @@ -329,37 +309,30 @@ public void setMaxHistoryRecordNum(Integer maxHistoryRecordNum) {
}

/**
* Influxdb配置信息
* Influxdb configuration information
*/
public static class InfluxdbProperties {
/**
* influxdb数据存储是否启动
* Is the influxdb data store started?
*/
private boolean enabled = false;
/**
* influxdb的连接服务器url
* Influxdb connection server url
*/
private String serverUrl;
/**
* 用户名
* username
*/
private String username;
/**
* 密码
* passowrd
* password
*/
private String password;
/**
* 过期时间
* Expiration
*/
private String expireTime = "30d";
/**
* 副本数
* Number of copies
*/
private int replication = 1;
Expand Down Expand Up @@ -414,7 +387,6 @@ public void setReplication(int replication) {
}

/**
* TdEngine配置信息
* TdEngine configuration information
*/
public static class TdEngineProperties {
Expand Down Expand Up @@ -552,27 +524,22 @@ public void setPassword(String password) {
*/
public static class RedisProperties {
/**
* redis数据存储是否启动
* Whether the redis data store is started
*/
private boolean enabled = false;
/**
* redis 主机host
* redis host
*/
private String host = "127.0.0.1";
/**
* redis 主机端口
* redis host port
*/
private Integer port = 6379;
/**
* redis 访问密码
* redis password
*/
private String password;
/**
* redis 使用数据库,默认为DB0
* redis uses the database, the default is DB0
*/
private Integer db = 0;
Expand Down Expand Up @@ -619,7 +586,6 @@ public void setPassword(String password) {
}

/**
* IoTDB配置信息
* IoTDB configuration information
*/
public static class IotDbProperties {
Expand Down Expand Up @@ -668,11 +634,8 @@ public static class IotDbProperties {
/**
* save data expire time(ms),-1 means it never expires
* Data storage time (unit: ms,-1 means never expire)
* 数据存储时间(单位:ms,-1代表永不过期)
* Note: Why is String used here instead of Long?
* 注:这里为什么使用String而不是Long?
* At present, the set ttl of IoTDB only supports milliseconds as a unit, and other units may be added later, so the String type is used for compatibility
* 目前IoTDB的set ttl只支持毫秒作为单位,后面可能会添加其他单位,为了兼容后面所以使用String类型
*
* Data storage time (unit: ms, -1 means never expires)
* Note: Why use String instead of Long here?
Expand Down Expand Up @@ -763,7 +726,6 @@ public void setExpireTime(String expireTime) {
}

/**
* GrepTimeDB配置信息
* GrepTimeDB configuration information
*/
public static class GreptimeProperties {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

/**
* 指标数据查询接口
* Indicator data query interface
*/
@RestController
@RequestMapping(produces = {APPLICATION_JSON_VALUE})
@Tag(name = "Metrics Data API | 监控指标数据API")
@Tag(name = "Metrics Data API | The API for monitoring metric data")
public class MetricsDataController {

private static final Integer METRIC_FULL_LENGTH = 3;
Expand All @@ -70,7 +69,7 @@ public MetricsDataController(List<AbstractRealTimeDataStorage> realTimeDataStora
}

@GetMapping("/api/warehouse/storage/status")
@Operation(summary = "Query Warehouse Storage Server Status", description = "查询仓储下存储服务的可用性状态")
@Operation(summary = "Query Warehouse Storage Server Status", description = "Query the availability status of the storage service under the warehouse")
public ResponseEntity<Message<Void>> getWarehouseStorageServerStatus() {
boolean available = false;
if (historyDataStorages != null) {
Expand All @@ -84,7 +83,7 @@ public ResponseEntity<Message<Void>> getWarehouseStorageServerStatus() {
}

@GetMapping("/api/monitor/{monitorId}/metrics/{metrics}")
@Operation(summary = "Query Real Time Metrics Data", description = "查询监控指标的实时指标数据")
@Operation(summary = "Query Real Time Metrics Data", description = "Query real-time metrics data of monitoring indicators")
public ResponseEntity<Message<MetricsData>> getMetricsData(
@Parameter(description = "Monitor Id", example = "343254354")
@PathVariable Long monitorId,
Expand Down Expand Up @@ -144,17 +143,17 @@ public ResponseEntity<Message<MetricsData>> getMetricsData(
}

@GetMapping("/api/monitor/{monitorId}/metric/{metricFull}")
@Operation(summary = "查询监控的指定指标的历史数据", description = "查询监控下的指定指标的历史数据")
@Operation(summary = "Queries historical data for a specified metric for monitoring", description = "Queries historical data for a specified metric under monitoring")
public ResponseEntity<Message<MetricsHistoryData>> getMetricHistoryData(
@Parameter(description = "监控任务ID", example = "343254354")
@Parameter(description = "monitor the task ID", example = "343254354")
@PathVariable Long monitorId,
@Parameter(description = "监控指标全路径", example = "linux.cpu.usage")
@Parameter(description = "monitor metric full path", example = "linux.cpu.usage")
@PathVariable() String metricFull,
@Parameter(description = "标签过滤,默认空", example = "disk2")
@Parameter(description = "label filter, empty by default", example = "disk2")
@RequestParam(required = false) String label,
@Parameter(description = "查询历史时间段,默认6h-6小时:s-秒、m-分, h-小时, d-, w-", example = "6h")
@Parameter(description = "query historical time period, default 6h-6 hours: s-seconds, M-minutes, h-hours, d-days, w-weeks", example = "6h")
@RequestParam(required = false) String history,
@Parameter(description = "是否计算聚合数据,需查询时间段大于1周以上,默认不开启,聚合降样时间窗口默认为4小时", example = "false")
@Parameter(description = "aggregate data calc. off by default; 4-hour window, query limit >1 week", example = "false")
@RequestParam(required = false) Boolean interval
) {
AbstractHistoryDataStorage historyDataStorage = historyDataStorages.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.List;

/**
* 实时数据存储抽象类
* Real-time data storage abstract class
*/
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ private boolean initDbSession(WarehouseProperties.StoreProperties.GreptimeProper

/**
* Checks if the database exists; if not, creates the Database.
* 检查数据库是否存在;如果不存在,则创建该数据库
*/
private boolean createDatabase() {
// 查询现有数据库
Expand All @@ -108,8 +107,7 @@ private boolean createDatabase() {
}

}
// Check if the database exists;
// 检查现有数据库是否包括“hertzbeat”
// Check if the existing database includes“Hertzbeat”
boolean isDatabaseExist = false;
if (result != null && result.isOk()) {
QueryOk queryOk = result.getOk();
Expand All @@ -126,7 +124,6 @@ private boolean createDatabase() {
}
}
// If it does not exist, create database
// 如果“hertzbeat”数据库不存在,则创建该数据库
if (!isDatabaseExist) {
QueryRequest createDatabase = QueryRequest.newBuilder()
.exprType(SelectExprType.Sql)
Expand Down Expand Up @@ -339,7 +336,7 @@ public Map<String, List<Value>> getHistoryIntervalMetricData(Long monitorId, Str
log.error(e.getMessage(), e);
}
}
// TODO greptime未找到合适的sql函数处理,暂时使用代码实现,将来greptime更新文档改用sql实现
// TODO 'greptime' did not find the proper SQL function processing, temporarily using code implementation, future 'greptime' update documents using SQL implementation
long endTime;
long startTime = getExpireTimeFromToken(history);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ private boolean createDatabase(WarehouseProperties.StoreProperties.InfluxdbPrope
}
}

// 创建数据库
// create the database
String createDatabaseSql = String.format(CREATE_DATABASE, DATABASE);
QueryResult createDatabaseResult = this.influxDb.query(new Query(createDatabaseSql));
if (createDatabaseResult.hasError()) {
log.error("create database {} in influxdb error, msg: {}", DATABASE, createDatabaseResult.getError());
return false;
}
// 设置过期时间
// set the expiration time
String createRetentionPolicySql = String.format(CREATE_RETENTION_POLICY, DATABASE, DATABASE,
influxdbProperties.getExpireTime(), influxdbProperties.getReplication());
QueryResult createRetentionPolicySqlResult = this.influxDb.query(new Query(createRetentionPolicySql));
Expand Down
Loading

0 comments on commit 79017f3

Please sign in to comment.