use of org.apache.geode.cache.lucene.internal.cli.functions.LuceneListIndexFunction in project geode by apache.
the class LuceneIndexCommands method getIndexListing.
@SuppressWarnings("unchecked")
protected List<LuceneIndexDetails> getIndexListing() {
final Execution functionExecutor = getMembersFunctionExecutor(getMembers(getCache()));
if (functionExecutor instanceof AbstractExecution) {
((AbstractExecution) functionExecutor).setIgnoreDepartedMembers(true);
}
final ResultCollector resultsCollector = functionExecutor.execute(new LuceneListIndexFunction());
final List<Set<LuceneIndexDetails>> results = (List<Set<LuceneIndexDetails>>) resultsCollector.getResult();
List<LuceneIndexDetails> sortedResults = results.stream().flatMap(set -> set.stream()).sorted().collect(Collectors.toList());
LinkedHashSet<LuceneIndexDetails> uniqResults = new LinkedHashSet<>();
uniqResults.addAll(sortedResults);
sortedResults.clear();
sortedResults.addAll(uniqResults);
return sortedResults;
}
Aggregations