use of org.graylog2.shared.utilities.StringUtils.f in project graylog2-server by Graylog2.
the class SearchDbPreflightCheck method runCheck.
@Override
public void runCheck() throws PreflightCheckException {
try {
final SearchVersion searchVersion = elasticVersionProbe.probe(elasticsearchHosts).orElseThrow(() -> new PreflightCheckException("Could not get Elasticsearch version"));
if (SUPPORTED_ES_VERSIONS.stream().noneMatch(searchVersion::satisfies)) {
throw new PreflightCheckException(StringUtils.f("Unsupported (Elastic/Open)Search version <%s>. Supported versions: <%s>", searchVersion, SUPPORTED_ES_VERSIONS));
}
LOG.info("Connected to (Elastic/Open)Search version <{}>", searchVersion);
} catch (ElasticsearchProbeException e) {
throw new PreflightCheckException(e);
}
}
Aggregations