Search in sources :

Example 1 with StringUtils.f

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);
    }
}
Also used : ElasticsearchProbeException(org.graylog2.storage.versionprobe.ElasticsearchProbeException) SearchVersion(org.graylog2.storage.SearchVersion)

Aggregations

SearchVersion (org.graylog2.storage.SearchVersion)1 ElasticsearchProbeException (org.graylog2.storage.versionprobe.ElasticsearchProbeException)1