Chia-Ping Tsai created KAFKA-21042:
--------------------------------------
Summary: Improve LogCaptureAppender#getMessages and apply the
improved one to the codebase
Key: KAFKA-21042
URL: https://issues.apache.org/jira/browse/KAFKA-21042
Project: Kafka
Issue Type: Improvement
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
public List<String> getMessages(String level) {
return getEvents().stream()
.filter(e -> level.equals(e.getLevel()))
.map(Event::getMessage)
.collect(Collectors.toList());
} {code}
The following changes could make it more useful
# allow passing `Level` instead of String
# take events directly instead of `getEvents()`
Plus, the following tests can benefit from the above improvements:
* RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest
* LoggingResourceTest
* SourceTaskOffsetCommitterTest
* WorkerTest
* PluginsTest
* ConnectWorkerIntegrationTest
--
This message was sent by Atlassian Jira
(v8.20.10#820010)