use of org.graylog.plugins.views.search.IndexRangeContainsOneOfStreams in project graylog2-server by Graylog2.
the class MoreSearch method getAffectedIndices.
private Set<String> getAffectedIndices(Set<String> streamIds, TimeRange timeRange) {
final SortedSet<IndexRange> indexRanges = indexRangeService.find(timeRange.getFrom(), timeRange.getTo());
// We support an empty streams list and return all affected indices in that case.
if (streamIds.isEmpty()) {
return indexRanges.stream().map(IndexRange::indexName).collect(Collectors.toSet());
} else {
final Set<Stream> streams = loadStreams(streamIds);
final IndexRangeContainsOneOfStreams indexRangeContainsOneOfStreams = new IndexRangeContainsOneOfStreams(streams);
return indexRanges.stream().filter(indexRangeContainsOneOfStreams).map(IndexRange::indexName).collect(Collectors.toSet());
}
}
Aggregations