refactor(executor-task): 优化pulsar扫描任务

调整pulsar source并行度设置,优化pulsar时间分段长度
This commit is contained in:
2024-01-22 09:43:57 +08:00
parent 99e636d55d
commit ff72583d5d
8 changed files with 155 additions and 60 deletions

View File

@@ -15,6 +15,8 @@ import java.io.IOException;
import java.nio.charset.Charset;
import java.time.Duration;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.flink.client.cli.ClientOptions;
import org.apache.flink.configuration.*;
import org.apache.flink.yarn.configuration.YarnConfigOptions;
@@ -176,9 +178,17 @@ public class TaskService {
}
}
}
Pattern dateRegex = Pattern.compile("(\\w+) (\\d{17}) (.+)");
return results
.reject(StrUtil::isBlank)
.collect(StrUtil::trim)
.sortThisBy(line -> {
Matcher matcher = dateRegex.matcher(line);
if (matcher.matches()) {
return Long.valueOf(matcher.group(2));
}
return 0L;
})
.toImmutable();
}
}