12
12
import org .elasticsearch .bootstrap .BootstrapInfo ;
13
13
import org .elasticsearch .cli .Terminal ;
14
14
import org .elasticsearch .cli .Terminal .Verbosity ;
15
+ import org .elasticsearch .common .regex .Regex ;
15
16
16
17
import java .io .BufferedReader ;
17
18
import java .io .Closeable ;
18
19
import java .io .IOException ;
19
20
import java .io .InputStream ;
20
21
import java .io .InputStreamReader ;
21
22
import java .nio .charset .StandardCharsets ;
22
- import java .util .List ;
23
23
import java .util .concurrent .CountDownLatch ;
24
+ import java .util .function .Predicate ;
24
25
25
26
import static org .elasticsearch .bootstrap .BootstrapInfo .SERVER_READY_MARKER ;
26
27
import static org .elasticsearch .server .cli .ProcessUtil .nonInterruptibleVoid ;
@@ -84,8 +85,12 @@ void drain() {
84
85
nonInterruptibleVoid (this ::join );
85
86
}
86
87
87
- /** List of messages / lines to filter from the output. */
88
- List <String > filter = List .of ("WARNING: Using incubator modules: jdk.incubator.vector" );
88
+ /** Messages / lines predicate to filter from the output. */
89
+ private static Predicate <String > filter = Regex .simpleMatcher (
90
+ "WARNING: Using incubator modules: jdk.incubator.vector" ,
91
+ // requires log4j2 upgrade, see https://github.com/elastic/elasticsearch/issues/132035
92
+ "WARNING: Use of the three-letter time zone ID * is deprecated and it will be removed in a future release"
93
+ );
89
94
90
95
@ Override
91
96
public void run () {
@@ -95,7 +100,7 @@ public void run() {
95
100
if (line .isEmpty () == false && line .charAt (0 ) == SERVER_READY_MARKER ) {
96
101
ready = true ;
97
102
readyOrDead .countDown ();
98
- } else if (filter .contains (line ) == false ) {
103
+ } else if (filter .test (line ) == false ) {
99
104
terminal .errorPrintln (Verbosity .SILENT , line , false );
100
105
}
101
106
}
0 commit comments