use of org.apache.geode.management.internal.cli.functions.ListIndexFunction in project geode by apache.
the class IndexCommands method getIndexListing.
@SuppressWarnings("unchecked")
protected List<IndexDetails> getIndexListing() {
final Execution functionExecutor = getMembersFunctionExecutor(getMembers(getCache()));
if (functionExecutor instanceof AbstractExecution) {
((AbstractExecution) functionExecutor).setIgnoreDepartedMembers(true);
}
final ResultCollector<?, ?> resultsCollector = functionExecutor.execute(new ListIndexFunction());
final List<?> results = (List<?>) resultsCollector.getResult();
final List<IndexDetails> indexDetailsList = new ArrayList<IndexDetails>(results.size());
for (Object result : results) {
if (result instanceof Set) {
// ignore FunctionInvocationTargetExceptions and other Exceptions
indexDetailsList.addAll((Set<IndexDetails>) result);
}
}
Collections.sort(indexDetailsList);
return indexDetailsList;
}
Aggregations