Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
import org.elasticsearch.bootstrap.BootstrapInfo;
import org.elasticsearch.cli.Terminal;
import org.elasticsearch.cli.Terminal.Verbosity;
import org.elasticsearch.common.regex.Regex;

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.function.Predicate;

import static org.elasticsearch.bootstrap.BootstrapInfo.SERVER_READY_MARKER;
import static org.elasticsearch.server.cli.ProcessUtil.nonInterruptibleVoid;
Expand Down Expand Up @@ -84,8 +85,12 @@ void drain() {
nonInterruptibleVoid(this::join);
}

/** List of messages / lines to filter from the output. */
List<String> filter = List.of("WARNING: Using incubator modules: jdk.incubator.vector");
/** Messages / lines predicate to filter from the output. */
private static Predicate<String> filter = Regex.simpleMatcher(
"WARNING: Using incubator modules: jdk.incubator.vector",
// requires log4j2 upgrade, see https://github.com/elastic/elasticsearch/issues/132035
"WARNING: Use of the three-letter time zone ID * is deprecated and it will be removed in a future release"
);

@Override
public void run() {
Expand All @@ -95,7 +100,7 @@ public void run() {
if (line.isEmpty() == false && line.charAt(0) == SERVER_READY_MARKER) {
ready = true;
readyOrDead.countDown();
} else if (filter.contains(line) == false) {
} else if (filter.test(line) == false) {
terminal.errorPrintln(Verbosity.SILENT, line, false);
}
}
Expand Down