Browse Source

[Improvement-14052][Log] Remove the useless filter in getAppIdsFromLogFile (#14053)

3.2.0-release
Rick Cheng 2 years ago committed by GitHub
parent
commit
84edea7593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/LogUtils.java

5
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/LogUtils.java

@ -164,10 +164,7 @@ public class LogUtils {
} }
Set<String> appIds = new HashSet<>(); Set<String> appIds = new HashSet<>();
try (Stream<String> stream = Files.lines(Paths.get(logPath))) { try (Stream<String> stream = Files.lines(Paths.get(logPath))) {
stream.filter(line -> { stream.forEach(line -> {
Matcher matcher = APPLICATION_REGEX.matcher(line);
return matcher.find();
}).forEach(line -> {
Matcher matcher = APPLICATION_REGEX.matcher(line); Matcher matcher = APPLICATION_REGEX.matcher(line);
if (matcher.find()) { if (matcher.find()) {
String appId = matcher.group(); String appId = matcher.group();

Loading…
Cancel
Save