Skip to content

Commit

Permalink
fix: figure out todo list
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyOVO committed Sep 10, 2024
1 parent 83180c1 commit 76068cc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public class TaskConstants extends CommonConstants {
public static final String TASK_SQLSERVER_UNIX_TIMESTAMP_FORMAT_ENABLE =
"task.sqlserverTask.unixTimestampFormatEnable";

//TODO: 补齐参数
// Redis task
public static final String TASK_REDIS_PORT = "task.redisTask.port";
public static final String TASK_REDIS_HOSTNAME = "task.redisTask.hostname";
Expand All @@ -190,6 +191,7 @@ public class TaskConstants extends CommonConstants {
public static final String TASK_REDIS_DB_NUMBER = "task.redisTask.dbNumber";
public static final String TASK_REDIS_COMMAND = "task.redisTask.command";
public static final String TASK_REDIS_KEYS = "task.redisTask.keys";
//fix:wrong name
public static final String TASK_REDIS_FIELD_OR_NUMBER = "task.redisTask.fieldOrMember";

public static final String TASK_STATE = "task.state";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.inlong.agent.pojo;

import lombok.Data;

//TODO: 补全所需参数配置
@Data
public class RedisTask {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ private static PostgreSQLTask getPostgresTask(DataConfig dataConfigs) {
return postgreSQLTask;
}

// TODO: 补全参数配置
private static RedisTask getRedisTask(DataConfig dataConfig) {
RedisTaskConfig config = GSON.fromJson(dataConfig.getExtParams(), RedisTaskConfig.class);
RedisTask redisTask = new RedisTask();
Expand Down Expand Up @@ -518,6 +519,7 @@ public static TaskProfile convertToTaskProfile(DataConfig dataConfig) {
task.setSource(MONGO_SOURCE);
profileDto.setTask(task);
break;
//TODO: 补全参数
case REDIS:
task.setTaskClass(DEFAULT_REDIS_TASK);
RedisTask redisTask = getRedisTask(dataConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
/**
* Redis source
*/
//TODO:
// 1. 提供两种模式,一个采用订阅一个使用命令,选择命令进行收集需要多配置一个参数
// --比如说 redis 中有一个 key 是 temperature,原始更新频率是每秒钟一次。
// --现在我们想采集这个 key,那么我们既可以通过订阅,来采集 temperature 每秒钟的变化情况,也可以是通过 get 命令,每个分钟采集一次
// 2. key 很多, 使用 mget 之类的批量查询的接口
// 3. 需要限制单条数据的上限
// --比如如果它超过了 500k,我们甚至要将数据扔掉或者做裁剪
public class RedisSource extends AbstractSource {

private static final Logger LOGGER = LoggerFactory.getLogger(RedisSource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected int getInstanceLimit() {
@Override
protected void initTask() {
LOGGER.info("Redis commonInit: {}", taskProfile.toJsonStr());
// TODO: 如果是命令模式则返回线程id
this.replid = taskProfile.get(TaskConstants.TASK_REDIS_REPLID);
}

Expand Down

0 comments on commit 76068cc

Please sign in to comment.